         if computedScore
           overall = 0
           for field of computedScore.value
-            if field != 'popularity'
-              team.scores[ field ] = computedScore.value[ field ]
+            team.scores[ field ] = computedScore.value[ field ]
+            if field != 'contestant_count' and field != 'judge_count' and field != 'popularity_count'
               overall += computedScore.value[ field ]
-          if maxPopularity == 0
+          if max_popularity_count == 0
             team.scores.popularity = 0
           else
-            team.scores.popularity = computedScore.value.popularity / maxPopularity * 10
+            team.scores.popularity = computedScore.value.popularity_count / max_popularity_count * 10
           overall += team.scores.popularity
           team.scores.overall = overall
         else

TeamSchema.static 'updateAllSavedScores', (next) ->
  map = ->
    ret =
      contestant_utility:
        sum: 0
        count: 0
      contestant_design:
        sum: 0
        count: 0
      contestant_innovation:
        sum: 0
        count: 0
      contestant_completeness:
        sum: 0
        count: 0
      judge_utility:
        sum: 0
        count: 0
      judge_design:
        sum: 0
        count: 0
      judge_innovation:
        sum: 0
        count: 0
      judge_completeness:
        sum: 0
        count: 0
      popularity: 0
    if this.type == 'contestant' or this.type == 'judge'
      ret[this.type + '_utility'] = { sum: this.utility, count: 1 }
      ret[this.type + '_design'] = { sum: this.design, count: 1 }
      ret[this.type + '_innovation'] = { sum: this.innovation, count: 1 }
      ret[this.type + '_completeness'] = { sum: this.completeness, count: 1 }
    else if this.type == 'voter'
      ret.popularity = 1
    emit this.teamId, ret

  reduce = (key,vals) ->
    ret = vals.shift()
    vals.forEach (val) ->
      for field of ret
        if field == 'popularity'
          ret[ field ] += val[ field ]
        else
          ret[ field ].sum += val[ field ].sum
          ret[ field ].count += val[ field ].count
    ret
    
  finalize = (key,val) ->
    ret = {}
    for field of val
      if field != 'popularity'
        if val[ field ].count == 0
          ret[ field ] = 0
        else
          ret[ field ] = val[ field ].sum / val[ field ].count
    ret[ 'popularity' ] = val.popularity
    ret
             
  mrCommand =

      console.log result
      return next [err,result]
    
    max_popularity_count = 0
    computedScores = result.documents[0].results
    computedScores.forEach (computedScore) ->
      max_popularity_count = Math.max max_popularity_count, computedScore.value.popularity_count
    Team.find {}, (err,teams) ->
      teams.forEach (team) ->
        id = team._id
