implemented sorting of Subjects