Finished the energy equation