changing `energy` to `total_energy` in `statistics`.