added debug info, changed 'leds' to global