inefficient closest points algorithm