Finalized implementation of Energy class