Changed dictionary to utilize trie