Updated example_lattice code