Solving equations with multiple steps