Added function to keep track of energy conservation (or lack thereof).