implement merge and merge_sort