kNN tool for digit recognition