add Top-down mergesort function