merge algorithm added.