substituteVariables