Merge with sort