update working codes for KNN homework