added basic indexing functionality