fine tune the tryCompare method for <= and >=