introduced generate_word()