added indexing functionality