Uses a trie to efficiently keep track of lists of words