Switched indexgray to main index