changed return value of compare() to a string