diff --git a/docs/cloverage/the_great_game/merchants/merchant_utils.clj.html b/docs/cloverage/the_great_game/merchants/merchant_utils.clj.html
index 70cd0f3..8774b44 100644
--- a/docs/cloverage/the_great_game/merchants/merchant_utils.clj.html
+++ b/docs/cloverage/the_great_game/merchants/merchant_utils.clj.html
@@ -64,13 +64,13 @@
020 [merchant world]
-
+
021 (let [m (cond
022 (keyword? merchant)
-
+
023 (-> world :merchants merchant)
@@ -79,8 +79,8 @@
025 merchant)
-
- 026 cargo (:stock m)]
+
+ 026 cargo (or (:stock m) {})]
027 (reduce
@@ -94,7 +94,7 @@
030 (map
-
+
031 #(* (cargo %) (-> world :commodities % :weight))
@@ -124,7 +124,7 @@
040 (keyword? merchant)
-
+
041 (-> world :merchants merchant)
@@ -133,152 +133,194 @@
043 merchant)]
-
- 044 (quot
+
+ 044 (max
-
- 045 (- (:capacity m) (burden m world))
+
+ 045 0
+
+
+ 046 (quot
+
+
+ 047 (- (or (:capacity m) 0) (burden m world))
- 046 (-> world :commodities commodity :weight))))
+ 048 (-> world :commodities commodity :weight)))))
- 047
+ 049
- 048 (defn can-afford
+ 050 (defn can-afford
- 049 "Return the number of units of this `commodity` which this `merchant`
+ 051 "Return the number of units of this `commodity` which this `merchant`
- 050 can afford to buy in this `world`."
+ 052 can afford to buy in this `world`."
- 051 [merchant world commodity]
+ 053 [merchant world commodity]
- 052 (let [m (cond
+ 054 (let [m (cond
- 053 (keyword? merchant)
+ 055 (keyword? merchant)
-
- 054 (-> world :merchants merchant)
+
+ 056 (-> world :merchants merchant)
- 055 (map? merchant)
+ 057 (map? merchant)
- 056 merchant)
+ 058 merchant)
- 057 l (:location m)]
+ 059 l (:location m)]
+
+
+ 060 (cond
+
+
+ 061 (nil? m)
+
+
+ 062 (throw (Exception. "No merchant?"))
+
+
+ 063 (or (nil? l) (nil? (-> world :cities l)))
+
+
+ 064 (throw (Exception. (str "No known location for merchant " m)))
+
+
+ 065 :else
- 058 (quot
+ 066 (quot
- 059 (:cash m)
+ 067 (:cash m)
- 060 (-> world :cities l :prices commodity))))
+ 068 (-> world :cities l :prices commodity)))))
- 061
+ 069
- 062 (defn add-stock
+ 070 (defn add-stock
- 063 "Where `a` and `b` are both maps all of whose values are numbers, return
+ 071 "Where `a` and `b` are both maps all of whose values are numbers, return
- 064 a map whose keys are a union of the keys of `a` and `b` and whose values
+ 072 a map whose keys are a union of the keys of `a` and `b` and whose values
- 065 are the sums of their respective values."
+ 073 are the sums of their respective values."
- 066 [a b]
+ 074 [a b]
-
- 067 (reduce
+
+ 075 (reduce
-
- 068 merge
+
+ 076 merge
-
- 069 a
+
+ 077 a
-
- 070 (map
+
+ 078 (map
-
- 071 #(hash-map % (+ (or (a %) 0) (or (b %) 0)))
+
+ 079 #(hash-map % (+ (or (a %) 0) (or (b %) 0)))
-
- 072 (keys b))))
+
+ 080 (keys b))))
- 073
+ 081
- 074 (defn add-known-prices
+ 082 (defn add-known-prices
- 075 "Add the current prices at this `merchant`'s location in the `world`
+ 083 "Add the current prices at this `merchant`'s location in the `world`
- 076 to a new cacke of known prices, and return it."
+ 084 to a new cache of known prices, and return it."
- 077 [merchant world]
+ 085 [merchant world]
- 078 (let [m (cond
+ 086 (let [m (cond
- 079 (keyword? merchant)
+ 087 (keyword? merchant)
- 080 (-> world :merchants merchant)
+ 088 (-> world :merchants merchant)
- 081 (map? merchant)
+ 089 (map? merchant)
- 082 merchant)
+ 090 merchant)
+
+
+ 091 k (or (:known-prices m) {})
- 083 k (:known-prices m)
+ 092 l (:location m)
-
- 084 l (:location m)
-
-
- 085 d (:date world)
+
+ 093 d (or (:date world) 0)
- 086 p (-> world :cities l :prices)]
-
-
- 087 (reduce
-
-
- 088 merge
-
-
- 089 k
+ 094 p (-> world :cities l :prices)]
- 090 (map
+ 095 (cond
+
+
+ 096 (nil? m)
+
+
+ 097 (throw (Exception. "No merchant?"))
+
+
+ 098 (or (nil? l) (nil? (-> world :cities l)))
+
+
+ 099 (throw (Exception. (str "No known location for merchant " m)))
+
+
+ 100 :else
+
+
+ 101 (reduce
+
+
+ 102 merge
+
+
+ 103 k
+
+
+ 104 (map
- 091 #(hash-map % (apply vector cons {:price (p %) :date d} (k %)))
+ 105 #(hash-map % (apply vector cons {:price (p %) :date d} (k %)))
- 092 (-> world :commodities keys)))))
+ 106 (-> world :commodities keys))))))