 (defrecord Node [id layer-id characters])
 (defrecord Edge [src dest characters])
 (defrecord Layer [id duration nodes])
-(defrecord SegmentContainer [segments])
+(defrecord SegmentContainer [edges])
 (defrecord AccumulatorNode [weight node-edges is-seg-c])
 
 

  next layer. ESK's description of the position algorithm is almost willfully circuitous
  and obtuse, so here's a simplified description: An item's position in an ordered layer
  is the sum of the size of all previous items, plus 1, where the size of a segment
  container is the number of segments it contains, and the size of a node is 1.

  Also, it doesn't really matter what seed you choose for the initial value of the sum. I
  chose -1, which is implied by the description in ESK."



(defn replace-ps
  "Step 1 of ESK - replace all p nodes with edges and merge segment containers"
  [graph layer]
  (->> (:ordered layer)
       (map #(if (contains? (:p graph) %)
