Implemented mergesort