started to create timer function