R Code used for the MNIST Hand Writing Competition on Kaggle