Different algorithm for merging2