Added broken trie implementation.
Messy trie, but should be correct now.