simple version of Mergesort