         )
 
         Meteor.users.update(
-            { _id: loser }, 
+            { _id: loser },
             { $inc: loserField }
         )

    updateTurns: (gameId, turns) ->
        Games.update gameId, { $set: { turns: turns } }

    # update player stats
    updateBoard: (gameId, board) ->
        Games.update gameId, { $set: { board: board } }

    # initialize a new game
    createGame: (opponentId) ->
        game = GameFactory.create [Meteor.userId(), opponentId]
        Games.insert game

    # update game document
    updateGame: (game) ->
        Games.update game._id, game

    updateFields: (gameId, field) ->
        Games.update gameId, { $set: field }

    log: (gameId, log) ->
        game = Games.findOne gameId


            }
        }

    # update user scores
    updateScores: (winner, loser, tie = no) ->
        if tie
            winnerField = loserField =
