                   value
                   (- value))))))
 
-(defn- create-indicies
-  "Creates an indicies list modified by crisis tags and normalised
-  Requries crisies to be initialised"
-  [scenRec]
-
 (defn- get-crisis-id-list
   "Taking a full crisis record, returns a collection of the crisis ids"
   [{crisises :crisises :as crisRec}]
-  (map (partial :c_id)
-       crisises))
+  (map :c_id crisises))
+
+(defn- select-crisis-tags
+  "Selects all the crisis tags for a single crisis"
+  [crisisNum]
+  (map :ct_tag (sql/query "SELECT * FROM crisis_tag WHERE c_id = ?;" crisisNum)))
+
+(defn- normalise-all-indicies
+  "Normalises the sector indicies, and the service group indicies"
+  [indicies]
+  (->> indicies
+      (normalise-specific-indicies sectorIndicies)
+      (normalise-specific-indicies (map key (remove (partial some (into #{} sectorIndicies)) indicies)))))
+
+(defn- load-crisis-indicies
+  "Updates the indicies list modified by crisis tags and normalised
+  Requries crisies and base indicies to be initialised"
+  [scenRec]
+  (update-in scenRec [:indicies]
+              (apply comp (map partial
+                               (repeat adjust-index)
+                               (apply concat (map select-crisis-tags (get-crisis-id-list scenRec)))))
+              ))
 
 (defn- add-crisis-desc
   "Given a crisis map, adds an :extraDesc field with a vector of string descriptors"

  ([adj indicies]
   (adjust-index adj indicies 4))
  ([adj indicies value]
   (assert (string? adj) "Index adjustment is not a string!")
   (if (or (not (= (count adj) 3))
           (not (or (= (nth adj 2) \D)
                    (= (nth adj 2) \U)))
           ) ;; TODO Test to see if keyword exists
     (do ; Invalid index, log and return
         (log/debug "Adjustment " adj " incorrect, skipping")
         indicies)
     (update-in indicies

       (select-secret-society-missions)
       (select-secret-society-missions-unused)
       (select-minion-lists)
       (assoc-in [:indicies] (create-base-indicies-list))
       (load-crisis-indicies)
       (update-in [:indicies] fuzzify-indicies)
       (update-in [:indicies] fuzzify-indicies)
       (update-in [:indicies] normalise-all-indicies)
       )))

(:indicies (create-scenario))
