Fixed More Bugs, Attempting to Refine Energy Determination Algorithm