   authors = []
   years = []
   journals = []
+  authors_short = []
+  titles_short = []
+
+  sep = /:|\.|\?/
+
+  # format author field (short)
+  format_author = (authors) ->
+    # split authors using ' and ' and get last name for 'last, first' format
+    authors = [a.split(", ")[0].trim() for a in authors.split(" and ")]
+    # get last name for 'first last' format (preserve {...} text)
+    # FIXME: I can't understand what this does!!!!
+    ## authors = [if a[-1] != '}' || a.find('{') == -1 then a.split(" ")[-1] else re.sub(r'{|}', '', a[len(a) - a[::-1].index('{'):-1]) for a in authors]
+    # truncate and add 'et al.'
+    if authors.length > 2
+      authors = authors[0] + " et al."
+    else
+      authors = authors.join(' & ')
+    # return formated string
+    # print(authors)
+    return authors
 
   entry = {   "keyword": "", "title": "", "author": "", "year": "", "editor": "", "journal": "", "eprint": "" }
+
   for line in bib
     line = line.trim()
     # Let's get rid of irrelevant lines first


  # at the end, we are left with one bib entry
  keywords.push(entry["keyword"])
  titles.push(entry["title"])
  years.push(entry["year"])
  authors.push(entry["author"] || entry["editor"] || "????")
  journals.push(entry["journal"] || entry["eprint"] || "????")

  # console.log( "Found #{keywords.length} total bib entries")

  # # Filter out }'s at the end. There should be no commas left

  # console.log(titles)
  titles = (t.replace('{\\textquoteright}', '').replace(/\{/g,'').replace(/\}/g,'') for t in titles)

  # format author field
  format_author = (authors) ->
    # split authors using ' and ' and get last name for 'last, first' format
    authors = [a.split(", ")[0].trim() for a in authors.split(" and ")]
    # get last name for 'first last' format (preserve {...} text)
    # FIXME: I can't understand what this does!!!!
    ## authors = [if a[-1] != '}' || a.find('{') == -1 then a.split(" ")[-1] else re.sub(r'{|}', '', a[len(a) - a[::-1].index('{'):-1]) for a in authors]
    # truncate and add 'et al.'
    if authors.length > 2
      authors = authors[0] + " et al."
    else
      authors = authors.join(' & ')
    # return formated string
    # print(authors)
    return authors

  # format list of authors
  authors_short = (format_author(author) for author in authors)

  # short title
  sep = /:|\.|\?/

  # console.log(titles)
  titles_short = (title.split(sep)[0] for title in titles)
  titles_short = (if title.length > 40 then title[0...40] + '...' else title for title in titles_short)

  return [keywords, titles, authors, years, authors_short, titles_short, journals]

      # First, see if we can add a record; the keyword must be non-empty, other fields not
      if entry["keyword"]
        keywords.push(entry["keyword"])
        t = entry["title"].replace('{\\textquoteright}', '').replace(/\{/g,'').replace(/\}/g,'')
        titles.push(t)
        t = t.split(sep)[0]
        titles_short.push (if t.length > 40 then t[0...40] + '...' else t)
        years.push(entry["year"])
        # For author, if there is an editor, that's good enough
        a = entry["author"] || entry["editor"] || "????"
        authors.push(a)
        authors_short.push(format_author(a))
        journals.push(entry["journal"] || entry["eprint"] || "????")
        # Now reset for the next iteration
        entry["keyword"] = ""
