Modified indexing file code.