modified word_predict