use exhaustion to find nearest point