         front-queue (fn []
                       (if (empty-queue?)
                         (throw (IllegalArgumentException.
-                                "FRONT called with an empty queue"))
+                                (str "FRONT called with an empty queue"
+                                     @front-ptr)))
                         (car @front-ptr)))
         insert-queue! (fn [item]
                         (let [new-pair (kons item nil)]
                           (if (empty-queue?)
                             (do (reset! front-ptr new-pair)
-                                (reset! rear-ptr new-pair)
-                                @front-ptr)
+                                (reset! rear-ptr new-pair))
                             (do (set-cdr! @rear-ptr new-pair)
-                                (reset! rear-ptr new-pair)
-                                @front-ptr))))
+                                (reset! rear-ptr new-pair)))
+                          @front-ptr))
         delete-queue! (fn []
                         (if (empty-queue?)
                           (throw (IllegalArgumentException.
-                                  "DELETE called with an empty queue"))
+                                  (str "DELETE called with an empty queue"
+                                       @front-ptr)))
                           (do (reset! front-ptr (cdr @front-ptr))
                               @front-ptr)))
         dispatch (fn [m]

    :else (recur key (cdr records))))

(defn lookup [key table]
  (let [record (assok key (cdr table))]
    (if record
      (cdr record)
      false)))

(defn insert! [key value table]
  (let [record (assok key (cdr table))]
    (if record
      (set-cdr! record value)
      (set-cdr! table
                (kons (kons key value) (cdr table)))))
  :ok)

(defn make-table []
  (scheme-like-list '*table*))

(defn lookup' [key-1 key-2 table]
  (let [subtable (assok key-1 (cdr table))]
    (if subtable
      (let [record (assok key-2 (cdr subtable))]
        (if record
          (cdr record)
          false))
      false)))

(defn insert!' [key-1 key-2 value table]
  (let [subtable (assok key-1 (cdr table))]
    (if subtable
      (let [record (assok key-2 (cdr subtable))]
        (if record
          (set-cdr! record value)
          (set-cdr! subtable
                    (kons (kons key-2 value)
                          (cdr subtable)))))
      (set-cdr! table
                (kons (scheme-like-list key-1
                                        (kons key-2 value))
                      (cdr table)))))
  :ok)

(defn make-table' []
  (let [local-table (scheme-like-list '*table*)
        lookup (fn [key-1 key-2]
                 (let [subtable (assok key-1 (cdr local-table))]
                   (if subtable
                     (let [record (assok key-2 (cdr subtable))]
                       (if record
                         (cdr record)
                         false))
                     false)))
        insert! (fn [key-1 key-2 value]
                  (let [subtable (assok key-1 (cdr local-table))]
                    (if subtable
                      (let [record (assok key-2 (cdr subtable))]
                        (if record
                          (set-cdr! record value)
                          (set-cdr! subtable
                                    (kons (kons key-2 value)
                                          (cdr subtable)))))
                      (set-cdr! local-table
                                (kons (scheme-like-list key-1
                                                        (kons key-2 value))
                                      (cdr local-table)))))
                  :ok)
        dispatch (fn [m]
                   (case m

;; Exercise 3.24
(defn make-table'' [& {:keys [same-key?] :or {same-key? =}}]
  (let [local-table (scheme-like-list '*table*)
        assok (fn assok [key records]
                (cond
                  (nil? records) false
                  (same-key? key (car (car records))) (car records)
                  :else (recur key (cdr records))))
        lookup (fn [key-1 key-2]
                 (if-let [subtable (assok key-1 (cdr local-table))]
                   (if-let [record (assok key-2 (cdr subtable))]
                     (cdr record)
                     false)
                   false))
        insert! (fn [key-1 key-2 value]
                  (if-let [subtable (assok key-1 (cdr local-table))]
                    (if-let [record (assok key-2 (cdr subtable))]
                      (set-cdr! record value)
                      (set-cdr! subtable
                                (kons (kons key-2 value)
                                      (cdr subtable))))
                    (set-cdr! local-table
                              (kons (scheme-like-list key-1
                                                      (kons key-2 value))
                                    (cdr local-table))))
                  :ok)
        dispatch (fn [m]
                   (case m
