fixed deduct energy algo