added variable substitution