Changed energy conservation to integral of energy conservation.