allow setting maxiter