refactored countdown to use a duration instead of minutes and seconds