Moved search_results function into the sun_functions file and cleaned up code to make it work (e.g. passing args and importing packages and files)