Working trie. checks if string present in index