                   locations sorted-column]} settings]
       (def dc display-columns)
       (reset! current-data browser-model-data)
-      (doto model (.fireTableDataChanged) (.fireTableStructureChanged))
-      (-> @settings-window :locations :table .getModel
+      (.fireTableDataChanged model)
+      (doto (-> @settings-window :locations :table .getModel)
         (.setDataVector
           (Vector. (map #(Vector. (list %)) (seq locations)))
-          (Vector. (list "Locations"))))
-      (let [column-model (.. table getColumnModel)]
-        (println (-> table get-table-columns count))
-        (dorun (map #(.removeColumn column-model %)
-             (-> table get-table-columns reverse))))
-      (println display-columns)
+          (Vector. (list "Locations")))
+        .fireTableDataChanged)
+      (remove-all-columns table)
       (let [total-width (.getWidth table)]
         (doseq [col display-columns]
-          (println col)
           (doto (add-browser-column (:title col))
-            (.setPreferredWidth (* total-width (:width col)))))))
+            (.setPreferredWidth (* total-width (:width col))))))
       (-> @settings-window :columns :table
-                           .getModel .fireTableDataChanged)))
-
-(defn save-data-and-settings [collection-name]
-  (with-open [pr (PrintWriter. (get @collections collection-name))]
-    (write-json (get-current-data-and-settings) pr))
-  (println "saved data and settings: " (:display-columns (get-current-data-and-settings))))
-
-(defn fresh-data-and-settings [collection-name]
-  (reset! current-data nil)
-  (save-collection-map)
-  (save-data-and-settings collection-name)
-  (map add-browser-column ["Path" "Time" "Frames" "Comment"])
-  (awt-event
-    (update-collection-menu collection-name)
-      (let [m (-> @browser :table .getModel)]
-        (.fireTableDataChanged m))))  
-
-(defn load-data-and-settings [name]
-  (save-last-collection name)
-  (let [f (get @collections name)]
-    (if (.exists (File. f))
-      (apply-data-and-settings (read-json (slurp f))))
-      (fresh-data-and-settings name))
-  (update-collection-menu name))
-
-(defn user-creates-collection []
+                           .getModel .fireTableDataChanged))))
+
+;; creating a new collection
+
+(defn user-specifies-collection-name []
   (let [prompt-msg "Please enter a name for the new collection."]
     (loop [msg prompt-msg]
        (let [collection-name (JOptionPane/showInputDialog msg)]


(defn save-collection-map []
  (write-value-to-prefs prefs "collection-files" @collections))

(defn get-current-data-and-settings []
  (let [table (@browser :table)

      (.concat "}}") (read-json false) (get "Summary"))) 

(defn get-summary-map [data-set location]
  (merge (read-summary-map data-set)
    (if-let [frames (count-frames data-set)]
      {"Frames" frames})
