working on in-place merge sort