How is matter rearranged through photosynthesis?