                (conj burst e2))
         [burst remaining-events]))))
       
-(defn make-bursts [events]  
+(defn make-bursts
+  "Lazily convert a sequence of events into bursts, when possible."
+  [events]
   (lazy-seq
     (let [[burst later] (accumulate-burst-event events)]
       (when burst

                 (or (different e1 e2 [:position-index])
                     (different e1 e2 [:frame-index]))))))))

(defn process-wait-time [events interval]
  (cons
    (assoc (first events) :wait-time-ms (if (vector? interval) (first interval) 0))    ;if supplied first custom time point is delay before acquisition start
    (for [[e1 e2] (pairs events) :when e2]
      (if-assoc (different e1 e2 [:frame-index])
                e2 :wait-time-ms (if (vector? interval)
                                   (nth interval (:frame-index e2))
                                   interval)))))
        
(defn event-triggerable [burst event]
  (let [n (count burst)
        e1 (peek burst)
        e2 event

                      (diff [:channel :properties ["Core" "Shutter"]]))
               true)))))

(defn process-channel-skip-frames
  "Remove events corresponding to a channel/frame that should be skipped."
  [events]
  (filter
    #(or
       (nil? (% :channel))
