Added compact Trie representation, much faster.