Trie seems to work