Implement closestVertex