The compilation problems about shadowed declarations should be trivial to fix. Just rename the "index" variables to "idx".
The compilation problems about shadowed declarations should be trivial to fix. Just rename the "index" variables to "idx".