The respiratory system functions to exchange gases, with oxygen coming in and carbon dioxide going out. It involves organs like the mouth, nose, trachea, bronchi, bronchioles and alveoli. The alveoli have an increased surface area that allows for more gas exchange between the circulatory and respiratory systems. The diaphragm and ribcage work together to inhale and exhale air by expanding and contracting the lungs.