   [fns]
   ;; This depends on the initial state we want
   (let [code [[:ldc 0 "; define main"]
-              [:ldf 'step]
+              (load-fn 0 fns 'step)
               [:cons]
               [:rtn]]
         main {:name 'main

              (repeat (count form) [:cons])))

    (seq? form)
    (let [[fn-name & args] form
          evaled-args (mapcat #(compile-form vars fns %) args)]
      (if (= fn-name 'quote)
        (concat (mapcat #(compile-form vars fns %) (first args))
                (repeat (dec (count form)) [:cons]))
        (if (builtins fn-name)
          (apply (builtins fn-name) evaled-args)
          (concat
            ;; Push the args onto the stack
            evaled-args
            [[:ldf fn-name]
             [:ap (count args)]]))))

    :else
    (throw (IllegalArgumentException. (format "Don't know how to compile %s which is %s" form (type form))))))

           [:add "; inc"]])
   'dec (fn [x]
          [x
           [:ldc 1 "; dec"]
           [:sub "; dec"]])})

(defn load-var
  [vars name]
  (let [index (.indexOf vars name)]
    (if-not (neg? index)
      [:ld 0 index (format "; load var %s" name)])))

(defn load-fn
  ([fns name]
   (load-fn 1 fns name))
  ([frame fns name]
   (if-let [func (first (filter #(= (:name %) name) fns))]
     [:ld frame (.indexOf fns func) (format "; load fn %s" name)])))

(defn load-symbol
  [fns vars name]
  (if-let [load-stmt (or (load-fn fns name) (load-var vars name))]
    load-stmt
    (throw (IllegalArgumentException. (format "Could not find symbol %s" name)))))

(defn compile-form
  [vars fns form]
