Adding state 'switching' to the led