 (defn dump-tape
   "Returns the genome recorded on the specified tape in the GTM of the provided Push state."
   [push-state tape-index]
-  (vec (vals (:contents (get (:tapes (:gtm push-state)) tape-index)))))
+  (vec (vals (get (:tapes (:gtm push-state)) tape-index))))
 
 (defn trace
   "Returns push-state with trace-info added to the trace recorded in its GTM."

                 (run-pgm)
                 (dump-tape 0))))



  (:use [clojush pushstate globals random util])
  (:require [clojure.math.numeric-tower :as math]))

;; Only read/write to one tape.

;; Single head position.

;; Secondary tape accessed only via gene/component swaps at current location.

;; Read/write by component or all components together.

;; Read (but not swap) no-ops over blanks, write creates an instruction-map 
;; (gene) under the head if none existed previously, with default instruction
;; exec_noop, silent false, and close 0.

;; All GTM instructions are no-ops on Push states that lack a GTM. 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; gtm (genetic turing machine) utilities

(defn init-gtm
  "Returns the provided Push state, but with a fresh GTM that has been initialized."
  [push-state]
  (assoc push-state 
    :gtm
    {:position 0
     :tapes (vec (repeat 2 (sorted-map)))
     :trace []
     :offset 0}))

(defn ensure-instruction-map
  "If instr-map is a hash map, returns it unchanged; otherwise returns a default 
