       else
         @selectedChoice = null
       @display()
-
-    # select the first choice with matching text
-    # I don't think we should use this...
-    # selectChoiceByText: (text) ->
-    #   if text? and text isnt ''
-    #     matches = @choices.filter (choice) -> `choice.text == text`
-    #     if matches[0]?
-    #       @selectedChoice = matches[0]
-    #       @display()
-    #     else
-    #       @selectedChoice = matches[0]
-    #       @display()
 
     # return array of choices
     getChoices: ->

          if query is ''
            @hideResults()
          else
            @showResults()
            filteredChoices = (@choices.filter @options.filterFn query)
            truncatedChoices = filteredChoices[0...@options.maxResults]
            difference = filteredChoices.length - truncatedChoices.length

      id = nextId()
      $('body').append "<div id=#{id} class='#{pluginName}_results'></div>"
      @queryResultArea = $ "##{id}"
      @hideResults()

      @_val = @element.val() # to keep track of what WAS in the text box

