Corrected energy.c