perl version now with working leds...