[The previous implementation had added the threshold value `max(thresholds) + 1` which I found awkward. Is there a problem with using `inf`?]