adds a function which compares a string againsts a set of possible values