finish retrieve lattice function