Change creation of cross variable to generate a sparse format