Modifications to get knn building