code for kNN training + red background fixed