added drawEnergy method