fixed merge sort using O(n/2) extra space