added more explanation for variable substitution