Implement basic trie