   #currentMatchObject.randomSeed = parseInt(@clientResponseObject.randomSeed or 0, 10)  # Uncomment when actively debugging simulation mismatches
   sessionUpdateObject = @levelSessionUpdates[sessionID]
   sessionUpdateObject.$push.matches = {$each: [currentMatchObject], $slice: -200}
+  if currentMatchObject.metrics.rank is 0 and defeatedAI = ladderBenchmarkAIs[currentMatchObject.opponents[0].userID]
+    mySession = _.find @clientResponseObject.sessions, sessionID: sessionID
+    newLadderAchievementDifficulty = Math.max defeatedAI, mySession.ladderAchievementDifficulty || 0
+    if newLadderAchievementDifficulty isnt mySession.ladderAchievementDifficulty
+      sessionUpdateObject.ladderAchievementDifficulty = newLadderAchievementDifficulty
 
   myScoreObject = @newScoresObject[sessionID]
   opponentSession = _.find @clientResponseObject.sessions, (session) -> session.sessionID isnt sessionID


retrieveOldSessionData = (sessionID, callback) ->
  formatOldScoreObject = (session) =>
    oldScoreObject = 
      standardDeviation: session.standardDeviation ? 25/3
      meanStrength: session.meanStrength ? 25
      totalScore: session.totalScore ? (25 - 1.8*(25/3))
      id: sessionID
      submittedCodeLanguage: session.submittedCodeLanguage
    if session.leagues?.length
      _.find(@clientResponseObject.sessions, sessionID: sessionID).leagues = session.leagues
      oldScoreObject.leagues = []

  async.each sessionIDs, updateMatchesInSession.bind(@, matchObject), (err) ->
    callback err

ladderBenchmarkAIs =
  '564ba6cea33967be1312ae59': 0
  '564ba830a33967be1312ae61': 1
  '564ba91aa33967be1312ae65': 2
  '564ba95ca33967be1312ae69': 3
  '564ba9b7a33967be1312ae6d': 4

updateMatchesInSession = (matchObject, sessionID, callback) ->
  currentMatchObject = {}
  currentMatchObject.date = matchObject.date
