sortedMerge() is working