make substitution function s