     printPoses(variables)
   }
   
+  /// Switching system example from Figure 2.b in that same paper
   func createSwitchingFactorGraph() -> (FactorGraph, VariableAssignments) {
     var variables = VariableAssignments()
     let x1 = variables.store(origin)
     let x2 = variables.store(origin)
     let x3 = variables.store(origin)
+    
+    // We now have discrete labels, as well
     let q1 = variables.store(0)
     let q2 = variables.store(0)
     
-    // Model parameters.
+    // Model parameters include a 3x3 transition matrix and 3 motion models.
     let labelCount = 3
     let transitionMatrix: [Double] = [
       0.8, 0.1, 0.1,

      Pose2(1, 0, -.pi / 4) // turn right
    ]
    
    var graph = FactorGraph()
    graph.store(PriorFactor(x1, z1)) // prior
    graph.store(PriorFactor(x1, z1))

    /// Proposal to change one label, and re-optimize
    let flipAndOptimize = {(x:VariableAssignments) -> VariableAssignments in
      let labelVars = x.storage[ObjectIdentifier(Int.self)]
      //  let positionVars = x.storage[ObjectIdentifier(Pose2.self)]
      
      // Randomly change one label.
      let i = Int.random(in: 0..<labelVars!.count)
