         new-uploads (:uploads new-state)
         old-upload (old-uploads upload-id)
         new-upload (new-uploads upload-id)]
+    ; confirm it is an upload, not a file hashing
     (when-not (= :hash (:type old-upload))
       (cond
         (and (not (:stopped? new-upload))

                                       (set old-uploads-order))
        removed-upload-ids (set/difference (set old-uploads-order)
                                           (set uploads-order))
        update-vals (fn [f m vals] (reduce #(update % %2 f)
                                           m
                                           vals))]
    (cond
      (< (count active-uploads) upload-slots)
      (assoc new-state 
             :uploads
              (update-vals start
                           uploads 
                           (take (- upload-slots
                                    (count active-uploads)) 
                                 uploads-order)))
      
      ;(> (count active-uploads) upload-slots)
      ;new-state

      :else new-state)))


       (not (:paused? upload))))

(defn active-uploads [uploads-order uploads]
  "Returns a list of active upload IDs"
  (remove #(not (active? (uploads %1))) uploads-order))

(defn inactive-uploads [uploads-order uploads]
  "Returns al list of inactive upload IDs"
  (remove #(active? (uploads %1)) uploads-order))

(defn get-action [old-state new-state upload-id]
