CALCULATE ENERGY