completed extract_all_words