added difference function.