Oxygen_poor blood containing high amounts of carbon dioxide flows through the heart to the luags. Then, gas exchange occurs in alveoli inside the lungs. That is, oxygen is transferred from the alveoli to the blood. At the same time, carbon dioxde moves from the blood to the alveoli and is exhaled.