use Trie as data structure