modified kNN.py for handwriting