update trie.hpp to be more compatible