modified code for common anode LED