added functions for setting up the interrupts
added interrupt handling