updated timer code