Add logging of number of iterations