adding the time and ticking functionality