implemented a timer