variable substitution working