Lattice_fold_template