add maxIterations to constructor