now writes LED in switch on when switch is closed, off when switch is open