The respiratory system functions to oxygenate tissues and remove carbon dioxide through gas exchange. It consists of the upper respiratory tract including the nose and pharynx, and the lower respiratory tract including the larynx, trachea, bronchi, bronchioles and alveoli in the lungs. Oxygen diffuses into the blood in the alveoli while carbon dioxide diffuses out. Breathing is controlled by respiratory centers in the brain and involves inspiration through contraction of the diaphragm and expiration through relaxation.