Ah, okay. I'll keep a counter outside the function.