good enough compare algorithm