With difference function