updated main-routine and interrupts