Beep function demystified