 
 
 (defn get-item [machine item]
-  (print "get-item: Started")
 	(let [item-price (item item-prices)
 		tend (sum-coins (:tendered machine))
 		change (make-change item-price (:merk tend) (:plack tend) (:bawbee tend) (:bodle tend))]
-    (print (list "get-item:" item-price tend change))
-	(cond (<= 0 (item (:stock machine))) (coin-return machine)
-		(<= (coins-value (:tendered machine)) item-price) (coin-return machine)
-		(empty? change) (coin-return)
-		true (deliver-item machine item change))))
+	(cond (>= 0 (item (:stock machine))) (message-machine (coin-return machine) (str "Sorry, " item " not in stock"))
+		(<= (coins-value (:tendered machine)) item-price) (message-machine machine "Please insert more money")
+		(empty? change) (message-machine (coin-return machine) "Sorry, I don't have enough change.")
+		true (message-machine (deliver-item machine item change) (str "Enjoy your " item)))))
 
 (defn get-caramel-wafer [machine]
 	(get-item machine :caramel-wafer))
 
+;; (get-caramel-wafer (add-coin (add-coin (make-default-machine) :merk) :merk))
 
+

  "Sum the value of these coins."
	(apply + (map coin-value coins)))

(defn coin-return [machine]
  "Return all tendered coins in this machine."
	(assoc (dissoc machine :tendered) :change (:tendered machine)))

(defn add-coin [machine coin]
  "Add this coin to this machine."
	(assoc (dissoc machine :tendered) :tendered (cons coin (:tendered machine))))

(defn add-coins [machine coins]
  "Add these coins to this machine"

(defn make-default-machine [] { :stock {:caramel-wafer 5 :teacake 5 :snowball 5}
	:coins {:merk 1 :plack 4 :bawbee 4 :bodle 4}
	:tendered nil
	:message ""
	:change nil
	:output nil} )

