fixed bug where energy goes into the negatives