what do oxygen and sugars do in photosynthesis

http://science.howstuffworks.com/environmental/earth/geophysics/earth3.htm