       console.log "Incorrect number #{number} higher than max: #{max}"
   numbers
 
-formatUser = (user, relativeToUser) ->
-  # TODO: replace date string with relative time since signup compared to target user, and actually make suggestions based on students that signed up at almost the same time
-  props = _.pick(user, ['name', 'emailLower', 'ageRange', 'dateCreated', 'lastLevel', 'points', 'referrer', 'hourOfCode'])
-  props.dateCreated = if relativeToUser then moment(props.dateCreated).from(relativeToUser.dateCreated) else moment(props.dateCreated).fromNow()
-  _.values(props).join('  ')
+formatUser = (user, relativeToUser, separator='  ') ->
+  values = []
+  for key in ['name', 'emailLower', 'ageRange', 'dateCreated', 'lastLevel', 'points', 'referrer', 'hourOfCode']
+    val = user[key]
+    if key is 'dateCreated'
+      val = if relativeToUser then moment(val).from(relativeToUser.dateCreated) else moment(val).fromNow()
+    values.push val
+  values.join separator
 
 formatSuggestions = (userToSchool, suggestions) ->
   suggestionPrompts = ("#{_.str.rpad(i + 1, 3)}  #{_.str.rpad(s.schoolName, 50)} #{s.reasons.length} #{if s.reasons.length > 1 then 'Matches' else 'Match'}: #{s.reasons.join(', ')}\tfrom user: #{formatUser(s.user, userToSchool)}" for s, i in suggestions).join('\n')

  unless userToSchool
    return console.log('Done.') or process.exit() unless [userToSchool, suggestions] = findUserToSchool users
  question ?= formatSuggestions userToSchool, suggestions
  prompt question, (answer) ->
    answer = answer.trim()
    return console.log('Bye.') or process.exit() if answer in ['q', 'quit']

  #{suggestionPrompts}
  Choose a number, type a name, enter to skip, or q to quit.
  > """

openTSV = (userToSchool, suggestions) ->
  header = ['#', 'School Name', 'Matches', 'Name', 'Email', 'Age', 'Signup', 'Last Level', 'Points', 'Referrer', 'HoC'].join '\t'
  rows = [[0, userToSchool.schoolName, '', formatUser(userToSchool, null, '\t')].join '\t']
  for s, i in suggestions
    matches = s.reasons.length + ' ' + if s.reasons.length > 1 then 'Matches' else 'Match' + ': ' + s.reasons.join(', ')
    rows.push [i + 1, s.schoolName, matches, formatUser(s.user, userToSchool, '\t')].join '\t'
  contents = [header].concat(rows).join('\n') + '\n'
  path = "#{process.env.HOME}/Downloads/#{userToSchool.emailLower}.tsv"
  fs.writeFile path, contents, {flags: 'w'}, (err) ->
    console.log 'Error writing school suggestions TSV:', err if err
    exec "open -a /Applications/Numbers.app #{path}"

checkedTopGroups = {}
findUserToSchool = (users) ->
