Well, now you are double counting the end values of the ranges. In your example 1 is included in both 0-1 and 1-2.