use the sqlite database, create a table with 2 columns name and class and add your records
then use a select statement like this SELECT DISTINCT class FROM myTable
if you do not like to use the sqlite component (well, I recommend it, because it would reduce your blocks drastically), you also can take a look at @Abraham_Getzler’s method here