finish nearest_point_index