Completed the autocomplete mechanism