fixed issue with key repeat for keyboard, refactored code, fixed and cleaned sound code.