     }
 }
 
-class Vertex {
-    enum VertextType {
-        case regular // ie, not a crossing
-        case crossing(entryExit: Bool, neighbor: UnsafePointer<Vertex>, alpha: CGFloat)
-    }
+internal class Vertex {
     let location: CGPoint
-    let vertexType: VertextType
+    let isIntersection: Bool
     // pointers must be set after initialization
+    
+    struct IntersectionInfo {
+        var entryExit: Bool = false
+        var neighbor: Vertex? = nil
+        var t: CGFloat = 0.0 // called alpha in the paper
+    }
+    var intersectionInfo: IntersectionInfo = IntersectionInfo()
     
     private(set) var next: Vertex! = nil
     private(set) weak var previous: Vertex! = nil

        self.previousTransition = transition
    }

    init(location: CGPoint, vertexType: VertextType) {
        self.location = location
        self.vertexType = vertexType
    }
}


        guard self.curves.count > 0 else {
            return []
        }
        assert(self.curves.first!.startingPoint == self.curves.last!.endingPoint, "this method assumes component is closed!")
        var elements: [Vertex] = [] // elements[i] is the first vertex of curves[i]
        let firstPoint: CGPoint = self.curves.first!.startingPoint
        let firstVertex = Vertex(location: firstPoint, isIntersection: false)
        elements.append(firstVertex)
        var lastVertex = firstVertex
        for i in 1..<self.curves.count {
            let v = Vertex(location: self.curves[i].startingPoint, isIntersection: false)
            elements[i] = v
            let curveForTransition = self.curves[i-1]
            // set the forwards reference for starting vertex of curve i-1
