trying to implement substitutions