implements basic version of timer