first version of mergesort