Added energy calculation and parallel force calculation.