Use solve only once on the system of equations.

Use solve only once on the system of equations, instead of calling
it for each equation.