trie memory bookkeeping improved