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

         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.

   For instance, given this timetable row:


          (filter #(let [day   (:day %1)
                         row   (:rowNum %1)
                         ttRow (get-in Timetable [day row])]
                     (not (empty? ttRow)))
                  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 [sortedAugTTLessonInfoSeq
           (sort-lesson-info-seq (exclude-lessons-on-empty-rows
                                   removedAugmentedTTLessonInfoSeq))

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

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

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