changed tabs to spaces
moved brackets around
moved braces around
removed unused void beep()
line breaks
corrected infinite loop