         initial-clusters (into {}
                                (map (comp #(vector % #{}) first)
                                     (take k (sort-by second (map (juxt identity vj) paths)))))
-        ; Path is assigned to the medoid it is closest to. 
+        ; Path is assigned to the medoid it is closest to.
         assign-to-cluster (fn [clusters path]
                             (update clusters
                                     (reduce (partial min-key (partial distance-fn path)) (keys clusters))

                        (mapsum (fn [[medoid members]]
                                  (mapsum (partial distance-fn medoid) members))
                                clusters))
        ; Compute the total of distances between the members of a cluster. 
        total-distance (fn [cluster member]
                         (mapsum (partial distance-fn member) cluster))
        ; Find new medoid from members of a cluster.

  using the distance function `distance-fn`."
  [^PersistentHashSet paths
   distance-fn
   ^Number k
   & {:keys [max-iterations]
      :or {max-iterations 100}}]
  (let [; Function for selecting initial medoids
        vj (fn [path]
             (mapsum (fn [i]
