method to compare two strings and return boolean