finishing trie.cpp/h
finish segment