diff --git a/timetabling/timetable-ics.py b/timetabling/timetable-ics.py
index 64f8737a8ee58668ad31b00236485b8e90c0dc5d..224a5ff686f4dbc5e6d493994a155ba06798e5b8 100644
--- a/timetabling/timetable-ics.py
+++ b/timetabling/timetable-ics.py
@@ -8,7 +8,7 @@ import sys
 from icalendar import Calendar, Event
 from datetime import datetime, timedelta
 
-from typing import Dict, Generator
+from typing import Dict, Generator, Set
 
 TIMEZONE = "Europe/London"
 BASE_DATE = datetime(2024, 9, 23, 0, 0, 0, 0, pytz.timezone(TIMEZONE))
@@ -33,12 +33,13 @@ if sys.argv[1].lower() == "-expand":
 cals = { year: Calendar() for year in range(0, 6) }
 cals.update({ BEDFORD : Calendar() })
 
-def get_years(name : str) -> Generator[int, None, None]:
+def get_years(name : str) -> Set[int]:
     # remove CS2900 assessment weird names
     name = re.sub(r"<[^<]*>", "", name)
-    for sess in name.split(","):
-        year = int(sess.strip()[2])
-        yield year
+    return set(
+        int(sess.strip()[2])
+        for sess in name.split(",")
+    )
 
 def get_weeks(weeks : str) -> Generator[int, None, None]:
     for period in weeks.split(","):