Completed and tested max_energy block