If you are using foreach, you can simply use [_foreachIndex](https://community.bistudio.com/wiki/forEach) instead of updating _pos.