Add and fix bug in ENERGY BALANCE