changed indexing script