   []
   ; game is won when count of matches is equal to half of gameboard, because
   ; cells contain duplicate numbers
-  (= (/ (count @gameboard) 2) (count @matched)))
+  (and (= (/ (count @gameboard) 2) (count @matched))
+       (not= (count @matched) 0)))
 
 (defn add-cell [n]
   ; add a numbered cell with a unique id
   (let [id (swap! counter inc)]
     (swap! gameboard assoc id {:id id :number n :color (colors n)})))
 
-(defn new-game
+(defn clicked 
+  []
+  (swap! counter inc))
+
+(defn new-game 
   []
   ; game starts out with an empty board, no cell selected, nothing hilighted,
   ; and no matches
+  (reset! counter 0)
   (reset! gameboard (sorted-map))
   (reset! selected nil)
   (reset! matched #{})

         (partition 4 cells))]
       ; text link to reset the game
       [:p [:a {:class "new-game" :on-click #(new-game)
                :href "#"} "New game"]]])))

(defn current-page []
  [:div [(session/get :current-page)]])

    (let [cells (vals @gameboard)]
      [:div#container
       ; game title
       [:h1 "The Memory Game"]
       ; win status
       [:h2 (if (won-game?) "You won!!!")]
       [:h2 (count @gameboard)]
       [:h2 (count @matched)]
       [:h2 @counter]
       ; the gameboard 
       [:table#gameboard
        ; taking 4 cells at a time for each row
        (map-indexed
