updated led state machine