init. code for lattice generation