Slight improvement to trie