added a mergesort algorithm