     
     typealias Edges = [Character: DawgNode]
     
-    internal lazy var edges = Edges()
+    private lazy var edges = Edges()
     internal var final: Bool = false
     internal var id: Int
-    private var descr: String = ""
     
     public init() {
         self.id = self.dynamicType.nextId
         self.dynamicType.nextId += 1
-        updateDescription()
     }
     
     private init(withId id: Int, final: Bool, edges: Edges?) {
+        self.dynamicType.nextId = max(self.dynamicType.nextId, id)
         self.id = id
         self.final = final
         if edges?.count > 0 { self.edges = edges! }
-        updateDescription()
     }
     
     public class func deserialize(serialized: NSArray, inout cached: [Int: DawgNode]) -> DawgNode {
         let id = serialized.firstObject! as! Int
         guard let cache = cached[id] else {
-            var edges: Edges?
+            var edges = Edges()
             if serialized.count == 3 {
                 edges = Edges()
                 if let serializedEdges = serialized.objectAtIndex(2) as? [String: NSArray] {
                     for (letter, array) in serializedEdges {
-                        edges?[Character(letter)] = DawgNode.deserialize(array, cached: &cached)
+                        edges[Character(letter)] = DawgNode.deserialize(array, cached: &cached)
                     }
                 }
             }

        
        // Add the suffix, starting from the correct node mid-way through the graph.
        var node = uncheckedNodes.last?.child ?? rootNode
        for letter in chars[commonPrefix..<chars.count] {
            let nextNode = DawgNode()
            node.setEdge(letter, node: nextNode)
            uncheckedNodes.append((node, letter, nextNode))
            node = nextNode
        }
        
        node.final = true
        previousWord = word
    }
    
    /// - parameter word: Word to check.

        return serialized
    }
    
    public var description: String {
        var arr = [final ? "1" : "0"]
        arr.appendContentsOf(edges.map({ "\($0.0)_\($0.1.hashValue)" }))
        return arr.joinWithSeparator("_")
    }
    
    public var hashValue: Int {
        return self.description.hashValue
    }
}

public class Dawg {
    private var rootNode: DawgNode
    private var previousWord: String = ""
    private var previousChars: [Character] = []
    
    private lazy var uncheckedNodes = [(parent: DawgNode, letter: Character, child: DawgNode)]()
    private lazy var minimizedNodes = [DawgNode: DawgNode]()
