worked on indexFile()