modified thesaurus, input validation