updating the solver function