Placed search line into function. Also added variable for total packages containing search string