Tried using patricia trie package. Not enough memory.