implemented one-vs-all digit recognition training