autocomplete feature. Needs a bit more comments and possible documentation.