incorporated Scott's set loop to replace the code found in the findIngredients and findCategories methods