first version of the timer (TO DEBUG! full of errors :D )