Indexed arrays not working correct

Issue #1 resolved