Simple merge sort implementation