implemented lattice module, reading from pickle and MongoDB