changed getNextWord() for new dictionary