Code for determining digits from MNIST data