Modified setup indexing code