kNN cleanup