implemented magic __compare() method