      :log (conj log message)
      :peer-choices (conj peer-choices next-peer)}))
 
-(defn peer-gen [replica-state-gen]
+(defn peer-gen 
+  "Generator to look into all of the peer's write queues
+  and pick an entry to get fake written next"
+  [replica-state-gen]
   (gen/bind replica-state-gen 
             (fn [state]
               ; we only play back log messages from peers who have

  (checking
    "Checking joins"
    10000
    [{:keys [replica peer-choices]} 
     (apply-entries-gen 
       (gen/return
         {:replica {:job-scheduler (:onyx.peer/job-scheduler peer-config)
                    :messaging (:onyx.messaging/config peer-config)}
          :message-id 0
          :entries {:a [{:fn :prepare-join-cluster 
                         :immediate? true
                         :args {:peer-site (extensions/peer-site messaging)

                          peer-reactions)]
    (vector new-replica unapplied)))

(defn apply-peer-queue-entry 
  "Applies the next log message in the selected peer's queue.
  Effectively, the next peer that wrote its message to ZK"
  [{:keys [replica message-id entries peer-choices log]} next-peer] 
  (let [peer-queue (entries next-peer)
        next-entry (first peer-queue)
        new-peer-queue (vec (rest peer-queue))
