Modified PrefixTree contains