             
 		}
         
+        var didSwap = false
+        
         // print(start)
 		
         func hierholzer_rec() -> [[Int]]? {
             var subtour = [Int]()
             var tours = [[Int]]()
             var remainingEdges : [Int: Set<Int>] = [:]
-            for v in vertices {
-                remainingEdges[v] = Set(self[v].map { $0.end })
-            }
+            for v in vertices { remainingEdges[v] = Set(self[v].map { $0.end }) }
             var visited : [Int: Set<Int>] = [:]
             var start = startv
 

                    subtour.append(next)
                    current = next
                    
                    // print("\tdid visit \(end)", remainingEdges, visited)
                    
                } while !remainingEdges.isEmpty && (current != end || current != start)
                tours.append(subtour)

                    // print(current, subtour, remainingEdges)
                    guard let next = remainingEdges[current]?.first(where: { self[$0, current] == nil }) ?? remainingEdges[current]?.first else {
                        if end != startv {
                            guard !didSwap else { return nil }
                            didSwap = true
                            swap(&startv, &end)
                            return hierholzer_rec()
                        }
