- You are pulling the $('#game') div out of the DOM on several occasions throughout the programme which is expensive; 
- Refactor to only do this once in a place that is global to all functions;