adding timer code