fix bug where the game wasn't properly calculated
jshint cleanup