change variables to an array
change unscopedVariables to an array