Solve the equations