private class Interval: improve, add documentation