When breathing in, the muscles of the diaphragm contract. This pulls the diaphragm downwards, and increases the volume of the thorax. At the same time, the external intercostal muscles contract. This pulls the ribcage upwards and outwards. This also increases the volume of the thorax. 