don't use Integer.compare for backward compatibility