Implemented sumIntervals.js