   "Test function to test for a board of size 6
   calls upd-pos untill all postions are done."
   [board]
-  (if-not (= 18 (:count @status))
+  (if-not (= 50 (:count @status-a))
     (do
-      (upd-pos)
+      (upd-pos status-a)
       (print board)
-      (recur (conj board (vector (get-in @status [:cur-pos :x])
-                           (get-in @status [:cur-pos :y])))))
+      (recur (conj board (vector (get-in @status-a [:cur-pos :x])
+                           (get-in @status-a [:cur-pos :y])))))
     board))

       (recur (- size 2) (conj arr (+ (last arr) size)) 1)
       (recur size (conj arr (+ (last arr) size)) 0)))))

(def change-on (atom (arr-maker-2 6)))

(defn change-direction
  "changes the direction to next-dir"
  [next-dir]
  (swap! status assoc :direction next-dir))



(defn upd-gen
  "updates the postion i.e. x or y co-ordinate depending upon current direction"
  [count pos next-dir f]
  (swap! status update-in [:cur-pos pos] f)
  (swap! status update :count inc)
  (if (some #(= % (get @status :count)) @change-on)
    (change-direction  next-dir)))


(defn upd-pos
  "Main function which will be called when button is clicked
  will update the current position in the status atom"
  []
  (let [direction (get @status :direction)
        count (get @status :count)]
    (cond
      (= direction :right) (upd-gen count :x :down inc)
      (= direction :down)  (upd-gen count :y :left inc)
      (= direction :left)  (upd-gen count :x :up dec)
      (= direction :up)    (upd-gen count :y :right dec))))





;;;;;; TRAVERSE A MATRIX SPIRALLY

(def status-a (atom {:direction :right
                   :cur-pos {:x -1
                             :y 0}
                   :count 0}))

(def status-b (atom {:direction :left
                     :cur-pos {:x 6
                               :y 5}
                     :count 0}))
(defn arr-maker
  "Returns an array with positions where the direction needs to be changed"
  ([size] (arr-maker (dec size) [size] 1))
