       (recur (perform-operation (instructions next) current-state))
       current-state)))
 
-;(def sample-input "cpy 2 a\ntgl a\ntgl a\ntgl a\ncpy 1 a\ndec a\ndec a")
-;(def sample-initial-state (get-initial-state (monorail/parse-instructions sample-input)))
 
-(def input "cpy a b\ndec b\ncpy a d\ncpy 0 a\ncpy b c\ninc a\ndec c\njnz c -2\ndec d\njnz d -5\ndec b\ncpy b c\ncpy c d\ndec d\ninc c\njnz d -2\ntgl c\ncpy -16 c\njnz 1 c\ncpy 73 c\njnz 82 d\ninc a\ninc d\njnz d -2\ninc c\njnz c -5")
-(def initial-state (get-initial-state (monorail/parse-instructions input)))
+; several instructions in the original input are replaced with new "mult" instruction followed
+; by setting a few registers to 0 and then jumping to the end of the multiplication (to keep the total number of instructions)
+; the same as in the original input
+(def input "cpy a b\ndec b\nmult a b\ncpy 0 c\ncpy 0 d\njnz 1 5\ndec c\njnz c -2\ndec d\njnz d -5\ndec b\ncpy b c\ncpy c d\ndec d\ninc c\njnz d -2\ntgl c\ncpy -16 c\njnz 1 c\ncpy 73 c\njnz 82 d\ninc a\ninc d\njnz d -2\ninc c\njnz c -5")
 
+; Part 1
+(->> input
+     (monorail/parse-instructions)
+     (get-initial-state)
+     (set-register {:name "a"} 7)
+     (execute-instructions)
+     (:registers)
+     (println "Part 1"))
 
-(->> initial-state
-     (set-register {:name "a"} 7)
-     (execute-instructions))
-
-
-(->> initial-state
+; Part 2
+(->> input
+     (monorail/parse-instructions)
+     (get-initial-state)
      (set-register {:name "a"} 12)
-     (execute-instructions))
-
-
-;(execute-instructions sample-initial-state)
-;(perform-tgl (get-in sample-initial-state [:instructions 1]) (move-next (set-register {:name "a"} 2 sample-initial-state)))+     (execute-instructions)
+     (:registers)
+     (println "Part 2"))

         move-next)
    (move-next state)))

(defn perform-jnz
  [{[op steps] :operands} state]
  (let [steps-value (resolve-value steps state)

    "dec" (perform-dec operation state)
    "jnz" (perform-jnz operation state)
    "tgl" (perform-tgl operation state)
    "mult" (perform-mult operation state)
    (throw (Exception. (str "Unknown operation" operation)))))

(defn execute-instructions
