     private let operation: BooleanPathOperation
     private let path1: Path
     private let path2: Path
-    private let graph1: [IntersectionNode]
-    private let graph2: [IntersectionNode]
+    private let graph1: [Node]
+    private let graph2: [Node]
+
+    public init(path1: Path, path2: Path, intersections: [PathIntersection], operation: BooleanPathOperation) {
+        self.operation = operation
+        self.path1 = path1
+        self.path2 = path2
+        // take the pairwise intersections and make two mutually linked lists of intersections, one for each path
+        var path1Intersections: [Node] = []
+        var path2Intersections: [Node] = []
+        intersections.forEach {
+            let node1 = Node(location: $0.indexedPathLocation1)
+            let node2 = Node(location: $0.indexedPathLocation2)
+            node1.addNeighbor(node2 /*, pathNumber: 1 */)
+            node2.addNeighbor(node1 /*, pathNumber: 0 */)
+            path1Intersections.append(node1)
+            if operation != .removeCrossings {
+                path2Intersections.append(node2)
+            } else {
+                path1Intersections.append(node2)
+            }
+        }
+        // sort each list of intersections and merge intersections that share the same location together
+        AugmentedGraph.sortAndMergeDuplicates(of: &path1Intersections)
+        if operation != .removeCrossings {
+            AugmentedGraph.sortAndMergeDuplicates(of: &path2Intersections)
+        }
+        // create graph representations of the two paths
+        self.graph1 = AugmentedGraph.createGraph(for: self.path1, using: path1Intersections)
+        self.graph2 = (operation != .removeCrossings) ? AugmentedGraph.createGraph(for: self.path2, using: path2Intersections) : graph1
+        // mark each edge as either included or excluded from the final result
+        self.classifyEdges(in: graph1)
+        if operation != .removeCrossings {
+            self.classifyEdges(in: graph2)
+        }
+    }
 
     public func draw(_ context: CGContext) {
-        func drawList(_ list: [IntersectionNode]) {
+        func drawList(_ list: [Node]) {
             for i in 0..<list.count {
                 self.forEachNode(in: list[i]) { node, _ in
 

                }
            }
        }

        if points.last != points.first {
            points.append(points.first!)
            orders.append(1)
        }

        return PathComponent(points: points, orders: orders)
    }

    internal func performOperation(for components: [IntersectionNode], appendingToComponents list: inout [PathComponent]) {
        for component in components {
            self.forEachNode(in: component) { node, _ in
                guard node.edge?.inSolution == true, node.edge?.visited == false else { return }
                list.append(self.createComponent(from: node))
            }
        }
    }

    internal func performOperation() -> Path {
        var components: [PathComponent] = []
        self.performOperation(for: self.graph1, appendingToComponents: &components)
        self.performOperation(for: self.graph2, appendingToComponents: &components)
        return Path(components: components)
    }
}

            points += component.points[1..<component.points.count]
            orders += component.orders
        }
        var nextNode: Node? = node
        while let currentNode = nextNode {
            nextNode = nil
            if let temp = visit(from: currentNode) {
