Add mergesort implementation