finshed with generic mergesort