                                        lessonLabel])]
     (if (and moduleName lessons)
         (let [lessonInfoSeq (doall
+                              ; remove lessonIdx
                               (map (fn [[lessonIdx lesson]]
                                      (add-module-lesson moduleCode
                                                         moduleName

(defn- create-empty-timetable-row
  "Creates an in-memory representation of an empty timetable row.

   Each row corresponds to a <tr> in the timetable. Each row is a map of the
   following format:

       {
         :nrLessons (integer representing the number of lesson groups
                     occupying the current row)
         :occupied  a vector of timeslots from 0800 to 2330 (inclusive)
                    in 30 min intervals. Each slot is one of:
                    - nil. The means that the slot is free
                    - a map of module information:
                      {
                        :moduleCode -> module code string
                        :lessonType -> lesson type string (long form),
                        :lessonGroup -> Lesson group string (lesson label)
                        :index       -> index to the list of lessons for
                                        that lesson group.
                      }
                      This information can be used to access the <div> in
                      the `ModulesSelected` global during module removal
                      or lesson shifting.
       }"
  []
  {
    :nrLessons 0,
    :occupied  (vec (map (fn [t] nil) (range 800 2400 50)))
  })

(defn- create-day-repr
  "Creates in-memory representation of a single day in the timetable.

      ; 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."
