change mergesort function from void to return vector