                          wu (take wu-n (shuffle warmup))
                          mob (take mob-n (shuffle mobility))
                          st (take st-n (shuffle strength))]
+                    (reset! template (sorted-map))
+                    (reset! c-counter 0)
                     (add-category! "Warmup" warmup)
-                    (add-category! "Mobility" mobility)
+                    (add-movement! "Push up" 1)
+                    #_(dotimes [n wu-n] (add-movement! (prep-name (nth wu n)) (ffirst @template)))
+                    (add-category! "Mobility" warmup)
+                    #_(dotimes [n mob-n] (add-movement! (prep-name (nth mob n)) (second @template)))
                     (add-category! "Strength" strength)
-                    (dotimes [n wu-n] (add-movement! (prep-name (nth wu n))))
-                    (dotimes [n mob-n] (add-movement! (prep-name (nth mob n))))
-                    (dotimes [n st-n] (add-movement! (prep-name (nth st n))))
+                    #_(dotimes [n st-n] (add-movement! (prep-name (nth st n)) (nth @template 2)))
 
                     #_(update! :strength)
                     #_(generate! "Warmup" warmup 1)

       "Maya"]]]]
   [:div {:class "section movements"}
    [:div.container
     ;----

     ;-----
     (let [categories [vals @template]]
       [:section
        (when (-> categories count pos?)
          [:div
           (for [c categories]
             ^{:key (:id c)} [category-item c])])])

     #_(let [items (vals @movements)]
       [:section#todoapp
        [:header#header
         [:h1 "Movements"]
        (when (-> items count pos?)
          [:div
           [:section#main
            [:ul#todo-list
             (for [todo items]
               ^{:key (:id todo)} [movement-item todo])]]])
         [movement-input {:id          "new-todo"
                          :placeholder "Add movement.."
                          :on-save     add-movement!}]]])
     ]]
   [:div.footer
    [:div.container

(defonce m-counter (atom 0))
(defonce c-counter (atom 0))

(defn add-movement! [text category-id]
  (let [category (get @template category-id)
        id (swap! (:m-counter category) inc)]
    (swap! (:movements category) assoc id {:id id :title text})))

(defn add-category! [title category]
  (let [id (swap! c-counter inc)]
    (swap! template assoc id {:id id :title title
                              :category category :m-counter (atom 0)
                              :movements (atom (sorted-map))})))

(defn add-mmovement! [text]
  (let [id (swap! m-counter inc)]
    (swap! movements assoc id {:id id :title text :done false})))

