first version with mnist reader