* added a mergesort which sorts and merges three parts