write better (step-wise) function for beeping