       (let [lessonTypes
             (keys (get ModulesSelected moduleCode))
 
-            seqOfRemovedLessons
+            ttLessonInfoAugmentedSeq
             (flatten (map (fn [lessonType]
                             (remove-lesson-group-html moduleCode lessonType))
                           lessonTypes))]
-        (doseq [lessonInfo seqOfRemovedLessons]
-          (timetable-mark-lesson-slots-free lessonInfo))
+        (doseq [ttLessonInfoAug ttLessonInfoAugmentedSeq]
+          (let [day          (:day ttLessonInfoAug)
+                rowNum       (:rowNum ttLessonInfoAug)
+                ttLessonInfo (dissoc ttLessonInfoAug :day :rowNum)]
+          (timetable-remove-lesson day rowNum ttLessonInfo)))
         ; Remove from `ModulesSelected`
         (set! ModulesSelected (dissoc ModulesSelected moduleCode))
         ; Remove from `ModulesSelectedOrder`

      (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})))

(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 [lessonInfoSeq (doall
                              ; remove lessonIdx
                              (map (fn [[lessonIdx lesson]]
                                     (add-module-lesson moduleCode
                                                        moduleName
                                                        lessonType
                                                        lessonLabel
                                                        lesson
                                                        lessonIdx
                                                        bgColorCssClass))
                                   (map vector
                                        (range 0 (count lessons)) lessons)))]
          ; Update ModulesSelected with the lesson group
          (set! ModulesSelected
                (assoc-in ModulesSelected [moduleCode lessonType]

; Data type Definitions
; =====================
;
; TimetableLessonInfo (abbrev: ttLessonInfo)
; ------------------------------------------
; Describes a lesson in the `Timetable` global; this is the key used for each
; row in a day of the `Timetable`.
;
; Each instance of `TimetableLessonInfo` is a map in the following format:
;
;   {
;     :moduleCode  -> module code string of this lesson
