rewriting trie.cpp/h