 
       getSuggestions: ({editor, bufferPosition}) ->
         prefix = @getPrefix(editor, bufferPosition)
+
         new Promise (resolve) ->
           if prefix[0] == "@"
-            p = prefix.normalize().replace(/^@/, '')
+            normalizedPrefix = prefix.normalize().replace(/^@/, '')
             suggestions = []
-            hits = fuzzaldrin.filter allwords, p, { key: 'author' }
-            for h in hits
-              h.score = fuzzaldrin.score(p, h.author)
+            hits = fuzzaldrin.filter possibleWords, normalizedPrefix, { key: 'author' }
+
+            for hit in hits
+              hit.score = fuzzaldrin.score normalizedPrefix, hit.author
+
             hits.sort @compare
+
             resultTemplate = atom.config.get "autocomplete-bibtex.resultTemplate"
+
             for word in hits
-              suggestion = {
+              suggestions.push {
                 text: resultTemplate.replace("[key]", word.key)
                 displayText: word.label
                 replacementPrefix: prefix


  buildWordList: () =>
    possibleWords = []
    for citation in @bibtex
      if citation.entryTags and citation.entryTags.title and (citation.entryTags.authors or citation.entryTags.editors)
        citation.entryTags.title = citation.entryTags.title.replace(/(^\{|\}$)/g, "")

    atom.config.observe "autocomplete-bibtex.resultTemplate", (resultTemplate) =>
      @resultTemplate = resultTemplate

    possibleWords = @possibleWords

    @provider =
      selector: atom.config.get "autocomplete-bibtex.scope"
