more efficient array indexing