The respiratory system performs several functions. Most importantly, it delivers oxygen to the cardiovascular system for distribution to the body and it removes carbon dioxide. Gas transfer occurs in the alveoli of the lungs, where the air-blood barrier is a thin, permeable membrane. Failure or major dysfunction of gas transfer due to disease processes that compromise this membrane or its air or blood supply have serious effects. In addition to gas exchange, the respiratory system performs numerous other functions, including maintaining acid-base balance, acting as a blood reservoir, filtering and probably destroying emboli, metabolizing some bioactive substances (eg, serotonin, prostaglandins, corticosteroids, and leukotrienes), and activating some substances (eg, angiotensin). The respiratory system also protects its own delicate airways by warming and humidifying inhaled air and by filtering out particulate material. The upper airways also provide for the sense of smell (olfaction) and play a role in temperature regulation in panting animals.