compare characters in string works