The loop depends on knowing which iteration we're in, I would need to add an extra counter to the foreach loop. Is that acceptable?