Made changes to game.js for efficiency and neatness.