added indexing to ArrayQuery class