enhanced version of autocomplete.