use interrupts when pulse comes in