update get_words_list method using generators