fixed acceleration and placed the HUD in a new function