There is no way that the else (that turns all LEDs off) can ever execute because all possible cases are covered in the if-if else statements. You should turn off the LEDs that you want off as well as turn the one on in each if or if else. The way that it is, if an LED is turned on there is nothing to turn it off.