Added a member variable storing totalLength in DisjointIntervals.