Compress methods modified, energy calculation fixed