Added filter and setup the logic for the LEDs