Added trace checking.  Will use trace to calculate the energy if it is there

otherwise it defualts to the internal energy