add a version of the trie that keeps a reference count of inserts