new sort_and_merge