   (loop [left-spans spans]
     (when-let [span (first left-spans)]
       (let [[^Long begin ^Long finish] span]
-        (.seek ^BGZFInputStream (.reader rdr) begin)
         (or
-          (loop [left (read-to-finish rdr finish read-fn)]
+          (loop [left (read-to-finish rdr begin finish read-fn)]
             (when-let [one (first left)]
               (if (window one)
                 [one]

                        (<= start left)
                        (>= end left))))
        candidates (flatten (map (fn [[^Long begin ^Long finish]]
                                   (.seek ^BGZFInputStream (.reader rdr) begin)
                                   (read-to-finish rdr finish read-coordinate-alignment-block)) spans))]
    (filter window candidates)))

(defn load-headers


(defn- read-to-finish
  [^BAMReader rdr
   ^Long start
   ^Long finish
   ^clojure.lang.IFn read-fn]
  (let [r ^BGZFInputStream (.reader rdr)]
    (when (< start finish)
      (.seek r start)
      (when-not (zero? (.available r))
        (let [result (read-fn rdr (.refs rdr))
              curr (.getFilePointer r)]
          (cons result
                (lazy-seq (read-to-finish rdr curr finish read-fn))))))))

(defn- read-alignments-first-only
  "It should be equivalent to [(first (filter window @candidates))]"
