The expression you use to increment 'i' stands out to me:

i=$((( ${i} +1 )))

Bash has pre- and post-increment arithmetic expressions and there's a compound command which lets you use:

((i++))

Look for "compound commands" and "arithmetic evaluation" in the Bash documentation. I covered some of this in https://hackerpublicradio.org/eps.php?id=1951

For example, the following one-liner sets and increments 'i' as you do:

i=1; for name in A B C; do echo "$i: $name"; ((i++)); done
1: A
2: B
3: C