generating an index