     (clojure.java.io/copy (clojure.java.io/input-stream rom-file) out)
     (.toByteArray out)))
 
-(defn- load-rom-into-memory
+(defn load-rom-into-memory
   [machine-state rom-file]
-  (let [memory (:memory machine-state)
-        rom-bytes (read-rom-into-byte-array rom-file)]
-    (doall (map-indexed 
-             (fn [index rom-byte]
-               (aset-short memory (+ program-load-addr index) rom-byte))
-             (vec rom-bytes)))
-    machine-state))
+  (let [rom-bytes (read-rom-into-byte-array rom-file)]
+    (-> (reduce-kv (fn [machine-state byte-index byte-data]
+                     (set-memory 
+                       machine-state 
+                       (+ program-load-addr byte-index) byte-data))
+                     machine-state (vec rom-bytes)))))
 
 (defn get-pc
   [machine-state]


(defn- initialise-memory
  [machine-state]
  (assoc machine-state :memory (short-array memory-size)))

(defn- initialise-stack
  [machine-state]

                   {:char "C" :addr 60 :bytes [0xF0 0x80 0x80 0x80 0xF0]}
                   {:char "D" :addr 65 :bytes [0xE0 0x90 0x90 0x90 0xE0]}
                   {:char "E" :addr 70 :bytes [0xF0 0x80 0xF0 0x80 0xF0]}
                   {:char "F" :addr 75 :bytes [0xF0 0x80 0xF0 0x80 0x80]}]]
    (reduce (fn [machine-state font]
              (reduce-kv (fn [machine-state byte-index byte-data]
                           (set-memory 
