added iteration counter