Added indexing of file and pieces