almost working (interrupt driven version)
almost working (interrupt-driven version)