code generator done with vmap