Updated wordIndex creation