revising implementation of modified indexing