updated code for LEDs