        (* 2)))
 
 (defn parse-processes [language programs]
-  (vec (map #(fire-process language
+  (mapv #(fire-process language
                              (:program %)
                              (:process-id %)
                              (:priority %))
-            programs)))
+            programs))
 
 (defn schedule-programs [language programs]
   (let [processes (parse-processes language programs)

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

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

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

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