                (fn [category-id]
                  (let [match (get-in matrix [category-id id])
                        score (:score match)
-                       normalized-score (/ score (:max-score video))]
+                       normalized-score (/ score max-score)
+                       video-normalized-score (/ score (:max-score video))]
                    (if match
                      {:tag :td
                       :attrs {:class "match"
                               :data-video-id id
                               :data-category-id category-id
-                              :style (str "background-color: rgba(234,30,106," normalized-score ")")}
+                              :style (str "background-color: rgba(234,30,106," video-normalized-score ")")}
                       :content [(link (str "categories/" category-id "/index.html?match=" id)
-                                 (format "%.1f%%" (* 100 score)))]}
+                                 (format "%.1f%%" (* 100 normalized-score)))]}
                      {:tag :td :content []})))
                category-ids)))})
 

                  (map render-match-matrix-head-cell categories)))})

(defn- render-match-matrix-row
  [matrix category-ids {:keys [id name] :as video}]
  {:tag :tr
   :content
   (vec (cons {:tag :th

         [(render-match-matrix-head-row categories)]}
        {:tag :tbody
         :content
         (vec (map (partial render-match-matrix-row matrix max-score category-ids) videos))}]}]}))

