improved trie in assng 6