     }
     
     func childByID(childID: Int) -> Node? {
+        //the low hanging fruit first mkay?
         for c in self.children {
             if c.id == childID {
                 return c
             }
+        }
+        
+        //now the expensive stuff
+        for c in self.children {
             if let n = c.childByID(childID) {
                 return n
             }

//MARK: - public
extension Node {
    func openPorts() -> [Port] {
        return []
    }
    
    func isLeaf() -> Bool {


struct Port {
    var port: Int = 0
    
    enum State {
        case Unknown
        case Open
        case Closed
        //... Blocked, whatever
    }
    
    var state: State = .Unknown
}


