Updated indexing script