finish implementation of merge_sort