Add logic to determine which LEDs have to be switched on