added the difference function