Solving equations with negative numbers