improve merge sort algorithm