updated new functions for trie