 
 (def master-initial-behavior
   (behavior
-    [{:keys [n-workers n-reservations] :as options}]
+    [{:keys [n-workers n-secondary-workers n-reservations] :as options}]
     [_start]
     (let [{:keys [reservations cars flights rooms] :as data}
             (initialize-data options)
-          worker-actors
-            (map #(spawn worker-behavior % *actor* data options)
-              (range n-workers))]
+          ; It is important to wrap the two maps below in doall, so that they
+          ; are executed here, where *actor* refers to the master actor, and not
+          ; in another place. Stupid lazy Clojure.
+          secondary-workers
+            (doall (map #(spawn reserve-relation-behavior % *actor*)
+                        (range n-secondary-workers)))
+          reservation-workers
+            (doall (map #(spawn reservation-behavior
+                          % *actor* secondary-workers data options)
+                        (range n-workers)))]
       #_(log-data data)
-      (doseq [[worker reservation] (zip (cycle worker-actors) reservations)]
+      (doseq [[worker reservation] (zip (cycle reservation-workers) reservations)]
         (send worker reservation))
-      (become master-waiting-behavior n-reservations))))
+      (become master-waiting-behavior (* n-reservations 4)))))
 
 ; MAIN
 

    (when (:debug options)
      (def log log-debug))
    (if proceed?
      (let [options {:n-workers      (:workers options)
                     :n-reservations (:reservations options)
                     :n-relations    (:relations options)
                     :n-queries      (:queries options)}]
        (log "options: " options)
        (when (not= (rem (:n-reservations options) (:n-workers options)) 0)
          (println "WARNING: number of reservations is not divisible by number"

                              timestamp])]
    (base64/str->base64 data)))

(defn process-reservation-seq
  [reservation
   {:keys [cars flights rooms]}
   {:keys [n-queries]}]
