Nearest neighbor search implemented