added check to return false if getWords is passed a word that is not in the tree