merge sort method