       (println "Database" db-name "already exist, its fine."))
     (println "Connection established!")))
 
+(defn create-line [id original-text male-text female-text translator]
+  {:db/id (d/tempid :db.part/user)
+   :project/name "default"
+   :line/id id
+   :line/original original-text
+   :line/male male-text
+   :line/female female-text
+   :line/translator translator})
+
+(defn get-n-words [n coll]
+  (let [sum (atom 0)
+        db (d/db conn)]
+    (reduce (fn [x y]
+              (if (< @sum n)
+                (do
+                  (swap! sum + (count (clojure.string/split (:line/original (d/touch (d/entity db y))) #"\s")))
+                  (conj x y))
+              x))
+          []
+          coll)))
+
 (defn get-dummy-info []
-  (define-attributes conn)
+  #_ 
   @(d/transact ; add entry
     conn
     [(create-line "wolololol" "" "" "noone")])
   (println ">")
-  (println (str (d/q '[:find (wat.database/get-2000 ?e) . ;; find all untranslated entries and collect till have 2000 symbols or shit
+  (println (str (d/q '[:find (wat.database/get-n-words 3 ?e) . ;; find all untranslated entries and collect till have n words 
                        :where [?e :line/translator "noone"]]
                      (d/db conn))))
   (println "<")
-  (str "messing with datomic"))
+  (str "Hello there, big brother greets you!"))
 
 (defn get-project-list []
   "Project list, duh.")

(defn define-attributes [c]
  (d/transact c
              [{:db/id (d/tempid :db.part/db)
                :db/ident :line/translator
                :db/valueType :db.type/string
                :db/cardinality :db.cardinality/one

                :db/doc "Female translated text line."
                :db.install/_attribute :db.part/db}]))

(defonce connect-to-db-server
  (let [db-name "test-db"
        uri (str "datomic:free://localhost:3131/" db-name)
