made a function for sorting majors, saved a lot of space by doing so.