modify merge sort to pass OJ