New version of index_generator