Adding comments to game.js and improving readability