implement a bit of the search