Oxygen and carbon dioxide enter and leave the cell via simple diffusion. Water enters and leaves via osmosis. During the day the leaf takes in carbon dioxide and releases oxygen and water vapour. Since it is also using energy, it will also give off small amounts of carbon dioxide. At night, it is not carrying on photosynthesis, so the oxygen and water vapour, are not being given off. The carbon dioxide that is being produced by respiration, is used in the dark reactions making sugar. Living cells need ATP to carry on active transport. Using energy, ions and small molecules may be pumped into or out of a cell, even against a concentration gradient.