implement subst operator