Added a timer that counts down to zero, refactored code as well