after changing how to compute total energy