 
 
 (defn add-times [instructions]
-  (vec (map #(assoc % :times []) instructions)))
+  (mapv #(assoc % :times []) instructions))
 
 (defn prepare-scheduled [processes]
-  (vec (map #(update % :instructions add-times) processes)))
+  (mapv #(update % :instructions add-times) processes))
 
 (defn prepare-locks [processes]
   (->> (ps->is processes)

       (filter #(= (:inst-type %) :lock))
       (map #(hash-map :lock-id (% :inst-id) :lock-idx (.indexOf instructions %)))))

(defn the-locks-inst-depends-on
  [instructions instruction]
  (let [the-inst-idx (.indexOf instructions instruction)]
    (->> (all-lock-indices instructions)
         (filter #(> the-inst-idx (:lock-idx %) ))
         (map :lock-id)
         (into []))))

(defn lock [locks process-id lock-id]
  (assoc locks lock-id {:locker process-id :locked true}))

        processes-cycles  (gen-processes-cycles processes)]
    (loop [quantum 0
           remaining-processes processes-cycles]
      (if (and (more-incomplete-processes? @scheduled)
               (< quantum timeout))
        (do
          (progress-on-process! locks scheduled
