Draft (read: broken) implementation of typeahead functionality