initial trie implementation