trie base implementation finished