         console.error "Ran into error doing the save:", err
         return finalizePrompt userToSchool, suggestions, schoolName, users
       console.log "Updated users' schoolNames. Result:", result
+      # Take these users out of the pool to make suggestions about before going on to next suggestions.
       remainingUsers = _.without users, targets...
       nextPrompt remainingUsers
+
+findNumbers = (answer, max) ->
+  numbers = (parseInt(d, 10) for d in (' ' + answer + ' ').match(/ (\d+) /g) ? [])
+  ranges = answer.match(/(\d+-\d+)/g) or []
+  for range in ranges
+    bounds = (parseInt(d, 10) for d in range.split('-'))
+    for number in [bounds[0] .. bounds[1]]
+      numbers.push number
+  for number in numbers
+    if number > max
+      console.log "Incorrect number #{number} higher than max: #{max}"
+  numbers
 
 formatUser = (user) ->
   # TODO: replace date string with relative time since signup compared to target user

selection = 'name emailLower schoolName courseInstances clans ageRange dateCreated referrer points lastIP hourOfCode preferredLanguage lastLevel'
User.find(query).select(selection).lean().exec (err, users) ->
  usersWithSchools = _.filter users, 'schoolName'
  schoolNames = _.uniq (u.schoolName for u in usersWithSchools)
  log.info "Found #{usersWithSchools.length} users of #{users.length} users registered after #{startDate} with schools like:\n\t#{schoolNames.slice(0, 10).join('\n\t')}"

  # For each user, come up with a confidence that their school is correct.
  # For users with low confidence, look for similarities to other users with high confidence.
  # If we have enough data, prompt to update the school.
  # After each update, recalculate confidence to find the next user with low confidence.

  # How do we come up with confidence estimate?
  # If there are many students with the same school name, it's either correct or a rename must happen.
  # If the school name is unique but similar to a school name with many students, it's probably incorrect.
  #   But if we determine it is correct, how can we record this fact so it doesn't keep asking?

  # How can we infer the school name when we think it's not correct?
  # We look for users with confident schoolNames in shared courseInstances.
  # ... in shared clans.
  # ... with the same lastIP that doesn't cover the lastIP of students from multiple schools.
  # If we find a school-district-formatted email domain, we could try to match to other schoolNames in that domain, but I doubt that will be helpful until we have a lot of data and a lot of time to manually look things up.

  nextPrompt users

nextPrompt = (users, question) ->
  sortUsers users
  return console.log('Done.') or process.exit() unless [userToSchool, suggestions] = findUserToSchool users
  question ?= formatSuggestions userToSchool, suggestions

          existingSuggestion.reasons.push reason
        else
          suggestions.push schoolName: match, reasons: [reason], user: otherUser
  if domain = getDomain target
    for otherUser in userCategories.domain[domain] when otherUser isnt target
      reason = "Domain match"
      if existingSuggestion = _.find(suggestions, user: otherUser)
        existingSuggestion.reasons.push reason
      else
        suggestions.push schoolName: otherUser.schoolName, reasons: [reason], user: otherUser
  return _.uniq suggestions, 'user'

userCategories = {}
