implemented indexing