Added option for iteration count.