wrote the index files