check in KNN codes