   taskLogObject.sessions = taskObject.sessions
   taskLogObject.save (err) -> callback err
 
-  winston.info "Game successfully simulated in #{taskObject.calculationTimeMS}, logging result"
 
 
 updateScores = (taskObject,callback) ->


      taskLogJSON = taskLog.toObject()

      return errors.badInput res, "That computational task has already been performed" if taskLogJSON.calculationTimeMS
      return handleTimedOutTask req, res, clientResponseObject if hasTaskTimedOut taskLogJSON.sentDate

      logTaskComputation clientResponseObject, taskLog, (loggingError) ->
        errors.serverError res, "There as a problem logging the task computation" if loggingError?
        updateScores clientResponseObject, (updatingScoresError, newScores) ->
          return errors.serverError res, "There was an error updating the scores.#{updatingScoresError}" if updatingScoresError?
          sendResponseObject req, res, newScores

  sessionIDs = _.pluck taskObject.sessions, 'sessionID'
  async.map sessionIDs, retrieveOldScoreMetrics, (err, oldScores) ->
    callback err, {"error": "There was an error retrieving the old scores"} if err?
    oldScoreArray = _.toArray putRankingFromMetricsIntoScoreObject taskObject, oldScores

    newScoreArray = bayes.updatePlayerSkills oldScoreArray
    
    #TODO: database persistence here
    callback err, newScoreArray

putRankingFromMetricsIntoScoreObject = (taskObject,scoreObject) ->
  scoreObject = _.indexBy scoreObject, 'id'
  for session in taskObject.sessions
    scoreObject[session.sessionID].gameRanking = session.metrics.rank

  return scoreObject

retrieveOldScoreMetrics = (sessionID, callback) ->
  LevelSession.findOne {"_id":sessionID}, (err, session) ->
