updating TrieNode to work with Generics