Fixed all energy level finding code. Still need to do the stats at the end.