Rewriting the solver