rename arrayIndex to assignToArray
add test for accessing array elements