     (Thread/sleep 5))
   (let [md (Metadata.)
         pix (core popNextImageMD md)
-        tags (parse-core-metadata md)
-        t (compute-time-from-core tags)
-        tags (if (and t (pos? t))
-               (assoc tags "ElapsedTime-ms" t)
-               (dissoc tags "ElapsedTime-ms"))]
-    (log "compute-time t")
+        tags (parse-core-metadata md)]
     {:pix pix :tags (dissoc tags "StartTime-ms")}))
-
+    
 (defn collect-burst-images [event out-queue]
   (when (first-trigger-missing?) (pop-burst-image)) ; drop first image if first trigger doesn't happen
-  (doseq [event-data (event :burst-data) :while (not (@state :stop))]
-    (let [image (pop-burst-image)]
-      (.put out-queue (make-TaggedImage (annotate-image image event-data @state))))
-   (if (core isBufferOverflowed)
-      (do (swap! state assoc :stop true)
-          (ReportingUtils/showError "Circular buffer overflowed."))))
+  (swap! state assoc :burst-time-offset nil)
+  (dorun
+    (map-indexed
+      (fn [i evt]
+        (when-not (@state :stop)
+          (let [image (pop-burst-image)]
+            (when (zero? i)
+              (swap! state assoc
+                     :burst-time-offset (- (elapsed-time @state)
+                                           (core-time-from-tags (image :tags)))))
+            (.put out-queue (make-TaggedImage (annotate-image image evt @state))))
+          (when (core isBufferOverflowed)
+            (swap! state assoc :stop true)
+            (ReportingUtils/showError "Circular buffer overflowed."))))
+      (event :burst-data)))
   (while (and (not (@state :stop)) (. mmc isSequenceRunning))
     (Thread/sleep 5)))
 

    (start-property-sequences (:properties trigger-sequence))
    (when absolute-slices
      (start-slice-sequence))
    (swap! state assoc :burst-init-time (elapsed-time @state))
    (core startSequenceAcquisition (if (first-trigger-missing?) (inc length) length) 0 true)
    (swap! state assoc-in [:last-stage-positions (core getFocusDevice)]
           (last absolute-slices))))

(defn jvm-time-ms []
  (quot (System/nanoTime) 1000000))

(defn elapsed-time [state]
  (if (state :start-time) (- (jvm-time-ms) (state :start-time)) 0))

(defn core-time-from-tags [tags]
  (try (Double/parseDouble (tags "ElapsedTime-ms")) (catch Exception e nil)))

(defn burst-time [tags state]
  (when (and (:burst-time-offset state) (get tags "ElapsedTime-ms"))
    (+ (core-time-from-tags tags)
       (:burst-time-offset state))))

;; image metadata

