Added a K-nearest neighbors check