change the iterations parameter to be adaptative on convergence