fix less-than, greater-than bug