Implemented indexing to a file