kNN routine added changed