Array index out of range

I’ll look …
Note that your code is not intended at all. That makes it very hard to read.