mergesort, inversions, point distance