Improved the solver