modified project1 with interrupts