adding many util functions used by trie