added function outputEnergy
added function outputTimes