 
 extension PathComponent {
     func linkedListRepresentation() -> [Vertex] {
+        guard self.curves.count > 0 else {
+            return []
+        }
         var elements: [Vertex] = [] // elements[i] is the first vertex of curves[i]
         let firstPoint: CGPoint = self.curves.first!.startingPoint
         let firstVertex = Vertex(location: firstPoint, vertexType: .regular)
-        var currentVertex = firstVertex
-        for i in 0..<self.curves.count {
-            elements.append(currentVertex)
-            let curve = self.curves[i]
-            let nextVertex = (i == self.curves.count-1) ? firstVertex : Vertex(location: curve.endingPoint, vertexType: .regular)
-            switch curve {
-            case is LineSegment:
-                currentVertex.next = PathElementTransition(vertex: nextVertex, transition: .line)
-            case let quadCurve as QuadraticBezierCurve:
-                currentVertex.next = PathElementTransition(vertex: nextVertex, transition: .quadCurve(control: quadCurve.p1))
-            case let cubicCurve as CubicBezierCurve:
-                currentVertex.next = PathElementTransition(vertex: nextVertex, transition: .curve(control1: cubicCurve.p1, control2: cubicCurve.p2))
-            default:
-                fatalError("Vertex does not support curve type (\(type(of: curve))")
-            }
-            currentVertex = nextVertex
-        }
-        // for each vertex create the `previous` transition
-        currentVertex = firstVertex
-        repeat {
-            let backwardsTransition = PathElementTransition(vertex: currentVertex, transition: currentVertex.next.transition.reversed())
-            currentVertex.next.vertex.previous = backwardsTransition
-            currentVertex = currentVertex.next.vertex
-        } while currentVertex !== firstVertex /* !== because we care about pointer equality here */
+        elements.append(firstVertex)
+        var lastVertex = firstVertex
+        for i in 1..<self.curves.count {
+            let v = Vertex(location: self.curves[i].startingPoint, vertexType: .regular)
+            elements[i] = v
+            let curveForTransition = self.curves[i-1]
+            // set the forwards reference for starting vertex of curve i-1
+            lastVertex.setNextVertex(v, transition: VertexTransition(curve: curveForTransition))
+            // set the backwards reference for starting vertex of curve i
+            v.setPreviousVertex(lastVertex, transition: VertexTransition(curve: curveForTransition.reversed()))
+            // point previous at v for the next iteration
+            lastVertex = v
+        }
+        // connect the forward reference of the last vertex to the first vertex
+        let lastCurve = self.curves.last!
+        lastVertex.setNextVertex(firstVertex, transition: VertexTransition(curve: lastCurve))
+        // connect the backward reference of the first vertex to the last vertex
+        firstVertex.setPreviousVertex(lastVertex, transition: VertexTransition(curve: lastCurve.reversed()))
+   
+        // return list of vertexes that point to the start of each element
         return elements
     }
 }
 
 public class AugmentedGraph {
     
-    private let list1: Vertex
-    private let list2: Vertex
+    func insertIntersection(inList list: [Vertex], at location: IndexedPathComponentLocation) -> Vertex {
+        
+    }
+    
+    func connectNeighbors(_ vertex1: Vertex, _ vertex2: Vertex) {
+
+    }
+    
+    private let list1: [Vertex]
+    private let list2: [Vertex]
     
     init(component1: PathComponent, component2: PathComponent, intersections: [PathComponentIntersection]) {
         self.list1 = component1.linkedListRepresentation()
         self.list2 = component1.linkedListRepresentation()
         intersections.forEach {
-            let vertex1 = insertIntersection(inList: list1, at: $0.indexedComponentLocation1, otherPath: component2)
-            let vertex2 = insertIntersection(inList: list2, at: $0.indexedComponentLocation1, otherPath: component1)
+            let vertex1 = insertIntersection(inList: list1, at: $0.indexedComponentLocation1)
+            let vertex2 = insertIntersection(inList: list2, at: $0.indexedComponentLocation1)
             connectNeighbors(vertex1, vertex2) // sets the vertex crossing neighbor pointer
         }
     }

    let indexedComponentLocation1, indexedComponentLocation2: IndexedPathComponentLocation
}

class PathElementTransition {
    enum TransitionType {
        case line
        case quadCurve(control: CGPoint)
        case curve(control1: CGPoint, control2: CGPoint)
        func reversed() -> TransitionType {
            switch self {
                case let .curve(control1: c1, control2: c2):
                    return .curve(control1: c2, control2: c1)
                default:
                    return self
            }
        }
    }
    let vertex: Vertex
    let transition: TransitionType
    init(vertex: Vertex, transition: TransitionType) {
        self.vertex = vertex
        self.transition = transition
    }
}


    let location: CGPoint
    let vertexType: VertextType
    // pointers must be set after initialization
    
    private(set) var next: Vertex! = nil
    private(set) weak var previous: Vertex! = nil
    private(set) var nextTransition: VertexTransition! = nil
    private(set) var previousTransition: VertexTransition! = nil
    
    public func setNextVertex(_ vertex: Vertex, transition: VertexTransition) {
        self.next = vertex
        self.nextTransition = transition
    }
    
    public func setPreviousVertex(_ vertex: Vertex, transition: VertexTransition) {
        self.previous = vertex
        self.previousTransition = transition
    }

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