successfully finding nearest neighbor