Preliminary logic for timer and calculating remaining countdown.