Different Algorithm for merging