The lungs receive deoxygenated blood from the heart through blood vessels called the pulmonary arteries. Here, oxygen that has been funnelled through the bronchi and bronchioles can pass across the thin membranes found in the alveoli.The alveoli are the final branching of the lungs which are surrounded by capillaries containing blood. Gas exchange takes place between the alveoli and the capillaries through the walls of the alveolar wall. A chemical substance within red blood cells, called haemoglobin, has an affinity for oxygen. Haemoglobin binds oxygen tightly within red blood cells, allowing oxygen to be carried in the bloodstream. At the same time, as oxygen is used up from the bloodstream, CO2 is released. CO2 moves out of the blood and enters the alveoli. This allows the CO2 gas to be exhaled.