initial code with non-blocking beeper