     // method to run when table view cell is tapped
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         print("You tapped cell number \(indexPath.row).")
-        createAlert(title: "Booke dette rommet?", message: roomList[myIndex].name!)
+        
+        if indexPath.row == 0 {
+        createAlert(title: "Booke dette rommet?", message: roomList[myIndex].name!);           confirmtiElleve()
+        }
+        else if indexPath.row == 1 {
+            createAlert(title: "Booke dette rommet?", message: roomList[myIndex].name!);
+            confirmelleveTolv()
+        }
+        
+        
         
     }
       

    


    func confirm() {
        
        self.ref = FIRDatabase.database().reference()
        
        let prntRef  = FIRDatabase.database().reference().child("list").child(roomList[myIndex].name!)
        
        if roomList[myIndex].tielleve! == "Ledig" {
            

            
            prntRef.updateChildValues(["tielleve": "Ledig"])
        
        } else {
            print("test")
        }
    }
    
    
    func confirmelleveTolv() {
            
        if roomList[myIndex].ellevetolv! == "Ledig" {
            
