updated to handle new words for the index correctly