       (insert "|--|\n")
       (insert "| Category | Start | End | Duration | Task |\n")
       (let ((last-category nil))
-        (dolist (cluster timeline)
-          (when (not (equal last-category (timeline-tools-entry-category cluster)))
+        (dolist (line timeline)
+          (when (not (equal last-category (timeline-tools-entry-category line)))
             (insert "|--|\n")
-            (setq last-category (timeline-tools-entry-category cluster)))
-          (insert (format "| %s | %s | %s | %s min | "
-                           (timeline-tools-entry-category cluster)
-                           (timeline-tools-format-entry-time cluster 'start)
-                           (timeline-tools-format-entry-time cluster 'end)
-                           (timeline-tools-entry-duration cluster)))
-           ;; insert headline line by line
-          (dolist (headline (-interpose "|\n |||||"
-                                        (timeline-tools-entry-headlines cluster)))
-            (insert headline))
-          (insert "\n")))
+            (setq last-category (timeline-tools-entry-category line)))
+          (insert (format "| %s | %s | %s | %s min | %s | \n"
+                          (timeline-tools-entry-category line)
+                          (timeline-tools-format-entry-time line 'start)
+                          (timeline-tools-format-entry-time line 'end)
+                          (timeline-tools-entry-duration line)
+                          (timeline-tools-entry-headline line)))))
       (insert "|--|\n")
       (org-table-align)
       (goto-char (point-min)))))

(defalias 'timeline-tools-entry-end-time 'cadr
  "End time of ENTRY.")

(defalias 'timeline-tools-entry-markers 'caddr
  "Marker to org task of ENTRY.")

(defun timeline-tools-make-entry (start-time end-time markers)
  "Return a timeline entry made up of START-TIME, END-TIME, and MARKERS.
MARKER may be a list of markers, or a single marker.  Duplicate
markers will only be kept once."
  (list start-time end-time (if (listp markers) (-uniq markers) (list markers))))

(defun timeline-tools-entry-duration (entry)
  "Returns the duration of ENTRY, in minutes."

  :group 'applications)

(defcustom timeline-tools-filter-functions
  (list #'timeline-tools-remove-short-entries
        #'timeline-tools-cluster-same-entries)
  "List of functions to apply when formatting timelines.
Filter are applied in the order they are given in this list."
  :group 'timeline-tools
