Added function for indexing multiple files