refactored countdown