a leaf is for generating energy for plants