        (ko/where {:zid zid :created [<= final-vote-timestamp]})
        ; ordering by tid is important, since we rely on this ordering to determine the index within the comps, which needs to correspond to the tid
        (ko/order [:zid :tid :pid :created] :asc)))))
+
+(defn get-conversation-votes
+  [& args]
+  ;; Flip the signs on the votes XXX (remove when we switch)
+  (map  #(update-in % [:vote] (partial * -1))
+       (apply get-conversation-votes* args)))
 
 (defn get-conversation-data
   "Return a map with :topic and :description keys"

  (map
    (fn [{:keys [pid] :as comment-data}]
      (let [comment-votes (filter #(= pid (:pid %)) votes)
            aggrees (filter #(= -1 (:vote %)) comment-votes)
            disagrees (filter #(= 1 (:vote %)) comment-votes)]
        (assoc comment-data :aggrees (count aggrees) :disagrees (count disagrees))))
    comments))


(defn reconstruct-vote-matrix
  [votes]
  (let [new-nmat (nm/named-matrix)
        vote-tuples (map #(map % [:pid :tid :vote]) votes)]
    (nm/update-nmat new-nmat vote-tuples)))

