       (doseq [siblingTdElem (take (- slotsOcc 1) (.nextAll tdHTMLElem))]
         (.remove siblingTdElem))
 
-      ; Returns a map containing information to make it easier to remove the
-      ; lesson
-      {:day day, :rowNum rowNum, :startTime startTime, :endTime endTime,
-       :divElem $divElem})))
+      ; Returns a ModulesSelectedLessonInfo object
+      {:day day, :rowNum rowNum, :startTime startTime, :endTime endTime})))
 
 (defn- add-module-lesson-group
   "Adds a lesson group of a module to the timetable."
   [moduleCode lessonType lessonLabel bgColorCssClass
    & {:keys [ModulesMap]
       :or   {ModulesMap (aget js/window "ModulesMap")}}]
-  (let [moduleName (get-in ModulesMap [moduleCode "name"])
-        lessons    (get-in ModulesMap [moduleCode "lessons" lessonType
-                                       lessonLabel])]
-    (if (and moduleName lessons)
+  (let [moduleName          (get-in ModulesMap [moduleCode "name"])
+        modulesMapLessonSeq (get-in ModulesMap [moduleCode "lessons" lessonType
+                                                lessonLabel])]
+    (if (and moduleName modulesMapLessonSeq)
         (let [lessonInfoSeq (doall
-                              ; remove lessonIdx
-                              (map (fn [[lessonIdx lesson]]
+                              (map (fn [modulesMapLesson]
                                      (add-module-lesson moduleCode
                                                         moduleName
                                                         lessonType
                                                         lessonLabel
-                                                        lesson
-                                                        lessonIdx
+                                                        modulesMapLesson
                                                         bgColorCssClass))
-                                   (map vector
-                                        (range 0 (count lessons)) lessons)))]
+                                   modulesMapLessonSeq))]
           ; Update ModulesSelected with the lesson group
           (set! ModulesSelected
                 (assoc-in ModulesSelected [moduleCode lessonType]

(defn- add-missing-td-elements-replacing-lesson
  "Adds <td> elements that were removed by the `add-module-lesson` function
   to make way for the lesson."
  [$parentTd lessonInfo]
  (let [startTime (:startTime lessonInfo)
        endTime   (:endTime lessonInfo)]
    (loop [$currentTd $parentTd
           timeIdx    (inc startTime)]
      (if (>= timeIdx endTime)

;     :lessonGroup -> lesson group string of this lesson
;     :startTime   -> 0-indexed start time of the lesson
;     :endTime     -> 0-indexed end time of the lesson
;   }
;
;
; ModulesSelectedLessonInfo (abbrev: modSelLessonInfo)
; ----------------------------------------------------
; Describes a lesson in the `ModulesSelected` global.
; Each instance is a map in the following format:
;
;   {
;     :day       -> 0-indexed integer of the day of the lesson
;     :rowNum    -> 0-indexed integer of the row
;     :startTime -> 0-indexed start time of the lesson
;     :endTime   -> 0-indexed end time of the lesson
;   }

(def ^{:doc     "Width in pixels of a half hour timeslot"
