Changed the structure of trie