changed to use genVars