KNN-extension functionality added.