Mergesort example - using pairs/tuples