merge sort implementation