override compare function