starting to integrate previous search functionality