very dirty code to process lists of weeks and courses