Updated assembly utilities for refactoring, and implemented energy calculation`