          lessonInfoSeq)))
 
 (defn- get-largest-consecutive-time-slot-freed-up-by-lesson
-  "Given a removed lessonInfo, find the largest interval which is freed up due
-   to the its removal.
+  "Given a removed lesson, find the largest interval on the same row which is
+   freed up due to the its removal.
 
    For instance, given this timetable row:
 

          (filter #(let [day   (:day %1)
                         row   (:rowNum %1)
                         ttRow (get-in Timetable [day row])]
                     (not= (:nrLessons ttRow) 0))
                  lessonInfoSeq))

        sort-lesson-info-seq (fn [lessonInfoSeq]
                               (sort #(let [dayA (:day %1)
                                            dayB (:day %2)]
                                        (if (= dayA dayB)
                                          (< (:rowNum %1) (:rowNum %2))
                                          (< dayA dayB)))
                                     lessonInfoSeq))]

    (loop [currentLessonInfoSeq
           (sort-lesson-info-seq (exclude-lessons-on-empty-rows
                                   removedLessonInfoSeq))

           nextLessonInfoVec    []]
      (cond (and (empty? currentLessonInfoSeq) (empty? nextLessonInfoVec))
            nil

            ; we're done for the current set of lessons. Move on to the
            ; set of lessons that were shifted upwards.
            (empty? currentLessonInfoSeq)
            (recur
              (sort-lesson-info-seq (exclude-lessons-on-empty-rows
                                      nextLessonInfoVec))
              [])

            ; find timeslot to shift up to replace gap
            :else
            (let [currentLessonInfo       (first currentLessonInfoSeq)
                  rowNum                  (:rowNum currentLessonInfo)
                  replacementTTRowLessons (find-replacement-lessons-within-time
                                            currentLessonInfo)]
              (doseq [ttRowLesson replacementTTRowLessons]
                (shift-lesson-to-row ttRowLesson rowNum))
              ; TODO: `replacementLessons` is not in the format we want. Make it so.
              (recur (rest currentLessonInfoSeq)
                     ; append newly shifted lessons to nextLessonInfoVec
                     (loop [newlyShiftedLessons    replacementLessons
                            nextLessonInfoVecPrime nextLessonInfoVec]

                rowNum       (:rowNum ttLessonInfoAug)
                ttLessonInfo (dissoc ttLessonInfoAug :day :rowNum)]
          (timetable-remove-lesson day rowNum ttLessonInfo)))
        (shift-lessons-upwards-to-replace-empty-slots ttLessonInfoAugmentedSeq)
        ; TODO: Modify `ModulesSelected` to update :rowNum

        ; Remove from `ModulesSelected`
