Naive Trie implementation