Added an iteration count and a restore feature