MergeSort implementation