Updated indexing to allow for merging multiple files