The diaphragm works by expanding and contracting the thoracic cavity to aid in breathing. When inhaling, the diaphragm moves in the inferior direction, increasing the size of the thoracic cavity and therefore reducing air pressure. Since the air pressure in the cavity is lower than the air surrounding the body, air is drawn in. When the diaphragm relaxes, the elastic recoil of the thoracic cavity and the lungs expel the air. These two functions form the basic components of breathing.