Changed from list of words to list of indices