     (or matrix [[]])))
 
 
+
+(defn named-matrix-gen-of
+  [gen]
+  (gen/bind
+    (gen/tuple
+      (gen/such-that not-empty (gen/vector-distinct (gen/such-that pos? (gen/int))))
+      (gen/such-that not-empty (gen/vector-distinct (gen/such-that pos? (gen/int)))))
+    (fn [[rownames colnames]]
+      (gen/fmap
+        (fn [matrix] (named-matrix rownames colnames matrix))
+        (gen/vector
+          (gen/vector gen (count colnames))
+          (count rownames))))))
+
+;(gen/sample (named-matrix-gen-of (s/gen #{-1 0 1 nil})))
+
+
 (s/def ::NamedMatrix
   (s/with-gen
     (s/and
       (partial satisfies? PNamedMatrix)
       ;(comp get-matrix matrix/matrix?)
-      (comp rownames matrix/vec?)
-      (comp colnames matrix/vec?)
-      (comp rownames distinct)
-      (comp colnames distinct))
+      (comp matrix/vec? rownames)
+      (comp matrix/vec? colnames)
+      (comp distinct rownames)
+      (comp distinct colnames))
     ;; Silly... need way smarter generators here; And maybe actually the generator shouldn't be on this entity, since a named
     ;(clojure.test.check.generators/elements)
-    #(gen/elements #{(named-matrix [1 2 3] [1 2 3] [[0 -1 -1] [0 1 -1] [1 -1 -1]])
-                     (named-matrix [3 1 2] [3 1 2] [[0 nil -1] [0 1 -1] [1 nil 1]])})))
-
-;; Not sure why I'm not able to excercise this?
-;(gen/generator (s/gen ::NamedMatrix))
-;(s/valid?
-;  ::NamedMatrix
-;  (gen/generate
-;    (gen/elements #{(named-matrix [1 2 3] [1 2 3] [[0 -1 -1] [0 1 -1] [1 -1 -1]])
-;                    (named-matrix [3 1 2] [3 1 2] [[0 nil -1] [0 1 -1] [1 nil 1]])})))
-;(gen/generate (s/gen ::NamedMatrix))
-;(s/exercise ::NamedMatrix)
+    #(named-matrix-gen-of (gen/double))))
+
+;(gen/sample (s/gen ::NamedMatrix))
+
+
+;(gen/frequency)
+;(gen/double*)
+;(gen/vector-of)
+;(gen/sample (gen/double* {:min 0 :max 1 :NaN? false :infinite? false}) 100)
 
 
 (defmethod print-method NamedMatrix

          columns)]
    (named-matrix rows cols m')))


(defn named-matrix-reader
  [{:keys [rownames colnames matrix]}]

      " :matrix " (get-matrix nm)
      "}")))

;(gen/sample (s/gen (s/cat :nm ::NamedMatrix :columns coll?)))

(s/fdef zero-out-columns
  :args (s/cat :nm ::NamedMatrix :columns coll?)
  :ret ::NamedMatrix)

(defn zero-out-columns
  "Creates a new rating matrix which has had the specied columns zeroed out"
