What substances are produced during photosynthesis?