added merge difference function