improve for merge sort