Implemented timer with on and off