improve the tryCompare() for <= and >=