Getting rid of energy matrix to reduce memory usage further. Attempting to meet reference memory usage.