clean up mnist example code