write data structures and mergesort for points