external respiration function