    [:text {:x 90 :y 30 :text-anchor "end"} (format-number (int (apply max (map :value data-points))))]
 
    (for [[index point] (map-indexed vector data-points)]
-       ^{:key (str "rect-" index (point :value))} [draw-bar point index (apply max (map :value data-points)) state])
-
-   (when (:selected-mortgage state)
-     (let [point (first (filter #(= (:mortgage %)
-                                    (:selected-mortgage state))
+     ^{:key (str "rect-" index (point :value))} [draw-bar
+                                                 point
+                                                 index
+                                                 (apply max (map :value data-points))
+                                                 (= (point :mortgage) selected-mortgage)
+                                                 ui-event-chan])
+
+   (when selected-mortgage
+     (let [point (first (filter #(= (:mortgage %) selected-mortgage)
                                 data-points))
            index (.indexOf (to-array data-points) point)
            x (+ 110 (* index 30))]

   (for [m mortgages]
     {:mortgage m
      :value    (-> m total-price-breakdown :interest)})
   state])

(sm/defn draw-monthly-payment [mortgages :- [Mortgage]
                               state :- UIState]

        [:th "% Down"]
        [:th "Duration"]]
       (when (:selected-mortgage state)
         [draw-mortgage (:selected-mortgage state) true (:ui-event-chan state)])
       (for [[index m] (map-indexed vector (:mortgages state))]
         ^{:key (str "mortgage-" index)} [draw-mortgage m (= m (:selected-mortgage state)) (:ui-event-chan state)])]]]))

(def some-mortgages
  (apply concat
