   (load-mm)
   (reset! settings-window (create-settings-window))
   (reset! browser (create-browser))
-  (reset! headings default-headings)
-  (.setModel (:table @browser) (create-table-model default-headings))
+  (reset! headings tags)
+  (.setModel (:table @browser) (create-table-model tags))
+  (update-all-columns (.getModel (get-in @settings-window [:columns :table])))
   (add-location "/Users/arthur/qqqq")
   browser)
 

  (:import [javax.swing BorderFactory JButton JFrame JLabel
                        JList JPanel JScrollPane JSplitPane
                        JTable JTextField RowFilter SpringLayout SwingUtilities]
           [javax.swing.table AbstractTableModel DefaultTableModel TableRowSorter]
           [javax.swing.event DocumentListener]
           [java.io BufferedReader File FileReader]
           [java.util Vector]
           [java.awt Color Dimension Font Insets]

                     "Please add a location to scan for files")]
    (add-location (.getAbsolutePath loc))))

(defn get-display-index [table index]
  (let [column-model (.getColumnModel table)]
    (first
      (for [i (range (.getColumnCount column-model))
        :when (= index (.getModelIndex (.getColumn column-model i)))]
          i))))

(defn update-column [tags-model col]
  (when (:table @browser)
    (let [on (.getValueAt tags-model col 0)
          tag (.getValueAt tags-model col 1)
          table (:table @browser)
          column-model (.getColumnModel table)
          model-index (get-model-column-index table tag)
          display-index (get-display-index table model-index)]
      (when (<= 0 model-index)
        (when (and (not on) display-index)
          (.removeColumn column-model (.getColumn column-model display-index)))
        (when (and on (not display-index))
          (println model-index)
          (.addColumn column-model
            (doto (TableColumn. model-index)
              (.setHeaderValue tag))))))))

(defn update-all-columns [tags-model]
  (dorun (map #(update-column tags-model %) (range (.getRowCount tags-model)))))

(defn create-column-table []
  (let [table (proxy [JTable] []
                (isCellEditable [_ i] (get [true false] i)))
        model (proxy [DefaultTableModel] [0 2]
                (getColumnClass [i]
