Photosynthesis requires sunlight, carbon dioxide and water as starting reactants. It releases oxygen and produces sugar, most commonly glucose, whose molecules hold the energy living things need. Plants, algae and some bacteria are autotrophs, self feeders; humans and all other animals are heterotrophs that get energy and carbon by eating other organisms. The carbon in a plant's sugar comes from carbon dioxide in the air, so matter cycles between the air and living things while energy flows in from the Sun. Photosynthesis happens in chloroplasts, mostly in the middle layer of leaves, where the green pigment chlorophyll absorbs light.