Entirely rewrote energy system