handles sorting ranked sets with -inf and +inf