ATP (energy storage molecule) is a compound that is synthesized when: