Improved the merge sort.