modified the gpio code in order to imporove interrupts