 // MARK: UISearchResultsUpdating
 extension ViewController: UISearchResultsUpdating {
   func filterContentForSearch (searchText: String, scope: Int) {
-    self.filteredSuggestedSearchFoods = self.suggestedSearchFoods.filter({ (food: String) -> Bool in
-      var foodMatch = food.rangeOfString(searchText)
-      return foodMatch != nil
-    })
+    if scope == 0 {
+      self.filteredSuggestedSearchFoods = self.suggestedSearchFoods.filter({ (food: String) -> Bool in
+        var foodMatch = food.lowercaseString.rangeOfString(searchText.lowercaseString)
+        return foodMatch != nil
+      })
+    } else if scope == 2 {
+      self.filteredFavoritedUSDAItems = self.favoritedUSDAItems.filter({ (item: USDAItem) -> Bool in
+        var stringMatch = item.name.lowercaseString.rangeOfString(searchText.lowercaseString)
+        return stringMatch != nil
+      })
+    }
   }
   
   func updateSearchResultsForSearchController(searchController: UISearchController) {

    } else if selectedScopeButtonIndex == 1 {
      return self.apiSearchForFoods.count
    } else {
      return self.favoritedUSDAItems.count
    }
  }
  

    else if selectedScopeButtonIndex == 1 {
      foodName = apiSearchForFoods[indexPath.row].name
    } else {
      if self.searchController.active && self.searchString! != "" {
        foodName = self.filteredFavoritedUSDAItems[indexPath.row].name
      } else {
        foodName = self.favoritedUSDAItems[indexPath.row].name
      }
    }
    
    cell.textLabel?.text = foodName
