Generalized cross_lattice subroutine