updated code for common cathode as previous code was for a common anode