added mergesort method