added lattice stuff