Working merge sort