added periodic trie pruning