tweaked constructor
moved debug interrupt handler code