Making the string comparison function