How does solving by substitution work?