         
     }
     
+    func getImage (imageID: String, item: Item) {
+//        self.itemImageRef!.child("images/itemImages/\(imageID)/imageOne").downloadURL(completion: { (url, error) -> Void in
+        self.itemImageRef!.child("images/itemImages/\(imageID)/imageOne").data(withMaxSize: 1 * 200 * 1024) { (data, error) in
+            DispatchQueue.main.async(execute: {
+                if (error != nil) {
+                    print("Image download failed: \(error?.localizedDescription)")
+                    return
+                }
+                print("HERE?")
+//                let imageURL = url
+//                let imageData = NSData(contentsOf: imageURL! as URL)
+//                item.image = UIImage(data: imageData! as Data)
+                item.image = UIImage(data: data!)
+                self.tableView.reloadData()
+                return
+            })
+//        })
+        }
+    }
+
     override func viewDidAppear(_ animated: Bool) {
         self.tableView.contentOffset = CGPoint (x: 0, y: self.searchController.searchBar.frame.size.height)
         self.tableView.reloadData()

                    item.username = snapshot.value as! String?
                })
                
                self.imageRef.child(dictionary["id"] as! String)
                             .observe(.value, with: { (snapshot) in
                                print("SOMETHING \(snapshot.value)")
//                    item.imagePath = snapshot.value as! String?
                 })
                
                self.itemList.append(item)
            }
            self.tableView.reloadData()

    var userRef:        FIRDatabaseReference!
    var usernameRef:    FIRDatabaseReference!
    var hubsRef:        FIRDatabaseReference!
    var itemImageRef:   FIRStorageReference!
    var itemList      = [Item]()
    

    
//  These are for searching the list of items
    let searchController = UISearchController(searchResultsController: nil)
