How does substitution work?