         [@grammar @grammarLearned (get @timeCourseVector 0) (get @timeCourseVector 1)]))
 
 
+(defn handle-request [sentences max_sentences]
+      (let [result (future (fn [] (doesChildLearnGrammar sentences max_sentences)))]
+        ; Do something else
+        (writeResults @result)))
+
+
+(defmacro enqueue
+   ([q concurrent-promise-name concurrent serialized]
+    `(let [~concurrent-promise-name (promise)]
+      (future (deliver ~concurrent-promise-name ~concurrent))
+       (deref ~q)
+      ~serialized
+      ~concurrent-promise-name))
+   ([concurrent-promise-name concurrent serialized]
+   `(enqueue (future) ~concurrent-promise-name ~concurrent ~serialized)))
+
+
 (defn runSimulation
   "max_eChildren number of eChildren will process 
   max_sentences number of sentences."
   [sentences max_eChildren max_sentences]
   (io/delete-file "out.csv" :silently true)
+  (loop [i 0 results []]
+    (if (< i max_eChildren)
+      (recur (inc i) (conj results (doesChildLearnGrammar sentences max_sentences)))
+      (writeResults results))))
 
-  (let [counter (atom 0)]
-    (while (< @counter max_eChildren)
-      (println "eChild #" (+ @counter 1))
-      (writeResults (doesChildLearnGrammar sentences max_sentences))
-      (swap! counter inc))))
-
+;(handle-request sentences max_sentences)
+;(-> (enqueue grammar (doesChildLearnGrammar sentences max_sentences) (writeResults @grammar)))

  (let [i (atom 0)
        countArr (atom [])]
    (while (< @i 13)
      (if (not= (get oldGrammar @i) (get currGrammar @i))
        (reset! countArr (conj @countArr sentenceCount))
        (reset! countArr (conj @countArr (get (get timeCourseVector 1) @i))))
      (swap! i inc))
    (assoc timeCourseVector 1 @countArr)))





(defn writeResults
  "Writes the results of each learner to an output file"
  [results]
  (println results)
  (spit "out.csv" results))


(defn updateTimeCourseVector
