                     (* 2))]
     (if (= nil result) 0 result)))
 
+;public static int yatzy(int... dice)
+;{
+; int[] counts = new int[6];
+;    for (int die : dice)
+;    counts[die-1]++;
+; for (int i = 0; i != 6; i++)
+;    if (counts[i] == 5)
+;        return 50;
+; return 0;
+; }
+
+
+
 (defn get-first-tally [tallies value]
   (->> (range 0 6)
        (filter #(= value (nth tallies %)))
        (first)))
 
-(defn yatzy [dice]
-  (let [tallies (tally-die dice)]
-    (if (= nil (get-first-tally tallies 5))
-      0
-      50)))
-
-
-(defn three-of-a-kind [dice]
+(defn four-of-a-kind [dice]
   (let [tallies (tally-die dice)
-        result (first (remove nil?
-            (for [i (range 0 6)]
-              (if (>= (nth tallies i) 3)
-                (* (+ i 1) 3)
-                nil
-                )
-              )
-            ))]
+        result (first
+                 (remove nil?
+                         (for [i (range 0 6)]
+                           (if (>= (nth tallies i) 4)
+                             (* (+ i 1) 4)
+                             nil
+                             )
+                           )
+                         ))]
     (if (= nil result)
       0 result
       )
     )
   )
 
-
-
-
-(defn four-of-a-kind [dice]
-  (let [tallies (tally-die dice)
-        result (->> (range 0 6)
-                    (filter #(>= (nth tallies %) 4))
-                    (map (fn [i] (* (+ i 1) 4)))
-                    (first))]
-    (if (= nil result) 0 result)))
+(defn three-of-a-kind [dice]
+  (let [t (tally-die dice)
+        result (first
+                 (remove nil?
+                         (for [i (range 0 6)]
+                           (if (>= (nth t i) 3)
+                             (* (+ i 1) 3)
+                             nil
+                             )
+                           )
+                         ))]
+    (if (= nil result)
+      0 result
+      )
+    )
+  )
 
 
 (defn small-straight [dice]

  )

(defn fours [d1 d2 d3 d4 _5]
  (let [dice [d1 d2 d3 d4 _5]]
    (apply +
           (for [at (range 0 5)]
             (if (= 4 (nth dice at)) 4 0)
             )
           )
    )
  )

(defn fives_ [d1 d2 d3 d4 _5]
  (let [dice [d1 d2 d3 d4 _5]]
    (apply +
           (for [i (range 0 (count dice))]
             (if (= 5 (nth dice i)) 5 0)
             )
           )
    )
  )

(defn sixes [d1 d2 d3 d4 _5]
  (let [dice [d1 d2 d3 d4 _5]]

                    (first))]
    (if (= nil result) 0 result)))

(defn two-pair [dice]
  (let [tallies (tally-die dice)
        result (->> (range 0 6)
