off-by-one error in the range output example