The respiratory system has both primary and secondary functions. Its primary functions are to provide oxygen for metabolism and remove carbon dioxide. Its secondary functions include facilitating smell, producing speech, and maintaining acid-base balance and body water levels. The upper respiratory system includes the nose, which filters and humidifies air, and the pharynx, which serves as a passageway. The lower respiratory system includes the trachea, bronchi, and lungs, where gas exchange occurs in tiny sacs called alveoli.