added search term generation code"