mergesort inplace