now all the solvers call optimize