added addDuration; bug fixes and tests