you should pass the intervals as parameters to calculateDuration() to make the function testable