mergesort implemented