code to handle IRQs - external interrupts