Write function skeletons for closestPoints