updated merge sort