Version 1, using a global variable to keep track of time
Using setInterval with global variables to count down time