Changed method of comparing classes so that it works.