3rd set of changes for the substitution