One factor is the contraction of the diaphragm, during the inhalation the diaphragm contracts, flattening, pushing down the liver and stomach. Another factor is the contraction of the intercostal muscles, during inhalation the external intercostal muscles contract, moving the ribs up and out. The contraction of the intercostal muscles and the diaphragm, creates the third factor, increasing the volume of the thoracic cavity, decreasing the pressure. This pulls air into the lungs, inflating them. During exhalation the diaphragm and the external intercostal muscles relax. This increases the pressure of the thoracic cavity forcing air out of the lungs. During forced exhalation the internal intercostal muscles may also contract, pulling the ribs dow and inwards, increasing the pressure of the thoracic cavity more rapidly.