Updated mergeSort function.