Re-writing the solver