fixed the index for classes

a little more complicated than i though this would be...