     
     // MARK: - Table View Delegate
     public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        if isFiltering() {
+            return searchedEvents?.count ?? 0
+        }
         return events?.count ?? 0
         
     }
     
     public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         let cell = tableView.dequeueReusableCell(withIdentifier: "FeedCell") as! FeedCell
-        cell.event = (events?[indexPath.row])!
+        var event: Event?
+        if isFiltering() {
+            event = (searchedEvents?[indexPath.row])!
+        } else {
+            event = (events?[indexPath.row])!
+        }
+        cell.event = event!
         return cell
     }
     

        Event.getNearbyEvents(radiusInMiles: 10000, searchString: nil, tags: nil, limit: 20) { (eventsReturned: [Event]) in
            print("I am in here")
            self.events = eventsReturned
            for event in self.events! {
                event.printHumanReadableTestString()
            }
            self.tableView.reloadData()
        }
    }
}

    
    public func updateSearchResults(for searchController: UISearchController) {
        if let searchText = searchController.searchBar.text {
            self.searchText = searchText
            getEventsForSearch(searchText: searchText)
        }
        
    }
