 					if nodes[new!].isSelected {
 						selections.append(indexPath)
 					}
-					tableView.insertRows(at: [indexPath], with: animation)
+					tableView?.insertRows(at: [indexPath], with: animation)
 				case .delete:
-					tableView.deleteRows(at: [IndexPath(row: start + old!, section: 0)], with: animation)
+					tableView?.deleteRows(at: [IndexPath(row: start + old!, section: 0)], with: animation)
 				case .move:
-					//				tableView.moveRow(at: IndexPath(row: start + old!, section: 0), to: IndexPath(row: start + new!, section: 0))
+					//				tableView?.moveRow(at: IndexPath(row: start + old!, section: 0), to: IndexPath(row: start + new!, section: 0))
 					let indexPath = IndexPath(row: start + new!, section: 0)
 					if nodes[new!].isSelected {
 						selections.append(indexPath)
 					}
 					
-					tableView.deleteRows(at: [IndexPath(row: start + old!, section: 0)], with: animation)
-					tableView.insertRows(at: [indexPath], with: animation)
+					tableView?.deleteRows(at: [IndexPath(row: start + old!, section: 0)], with: animation)
+					tableView?.insertRows(at: [indexPath], with: animation)
 				case .update:
 					let indexPath = IndexPath(row: start + old!, section: 0)
 					let a = from[old!]

			}
		}
		else {
			tableView.reloadData()
		}
		
		updateIndexes()
		endUpdates()
		for indexPath in selections {
			tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none)
		}
	}
	

	public func reloadCells(for nodes: [TreeNode], with animation: UITableViewRowAnimation = .fade) {
		let indexPaths = nodes.flatMap({$0.flatIndex == nil ? nil : IndexPath(row: $0.flatIndex!, section:0)})
		if (indexPaths.count > 0) {
			tableView?.reloadRows(at: indexPaths, with: animation)
		}
	}

