 
 A slot is short if it is not longer than THRESHOLD seconds.
 Resulting gaps are distributed evenly among adjacent slots."
-  (let ((start (first (first timeline)))
-        (end (second (car (last timeline))))
+  (let ((start (caar timeline))
+        (end (cadar (last timeline)))
         new-timeline)
     ;; remove all slots that are too short
     (setq new-timeline
           (cl-remove-if (lambda (entry)
-                          (<= (- (second entry) (first entry))
+                          (<= (- (cadr entry) (car entry))
                               timeline-tools-short-task-threshold))
                         timeline))
 
     ;; reset start and end times
-    (setf (first (first new-timeline)) start)
-    (setf (second (car (last new-timeline))) end)
+    (setf (caar new-timeline) start)
+    (setf (cadar (last new-timeline)) end)
 
     ;; distribute gaps evenly among adjacent slots
-    (do ((sub-timeline new-timeline (cdr sub-timeline)))
+    (cl-do
+        ((sub-timeline new-timeline (cdr sub-timeline)))
         ((null (cdr sub-timeline)))
-      (let* ((entry-1 (first sub-timeline))
-             (entry-2 (second sub-timeline))
-             (end-1 (second entry-1))
-             (start-2 (first entry-2)))
+      (let* ((entry-1 (car sub-timeline))
+             (entry-2 (cadr sub-timeline))
+             (end-1 (cadr entry-1))
+             (start-2 (car entry-2)))
         (when (not (= end-1 start-2))
           (let ((middle (/ (+ end-1 start-2) 2)))
-            (setf (second entry-1) middle)
-            (setf (first entry-2) middle)))))
+            (setf (cadr entry-1) middle)
+            (setf (car entry-2) middle)))))
     new-timeline))
 
 ;;;###autoload


;;; Code:

(eval-when-compile
  (require 'cl))
(require 'dash)
(require 'org)
(require 'org-clock)

        (dolist (cluster timeline)
          (cl-destructuring-bind (start end markers) cluster
            (insert (format "| %s | %s | %s | %s min | "
                            (org-entry-get (car markers) "CATEGORY")
                            (format-time-string "%Y-%m-%d %H:%M" start)
                            (format-time-string "%Y-%m-%d %H:%M" end)
                            (floor (/ (- end start) 60))))
