updated firmware. Extracted some things out to header files and gave the beep function a type