Changed the if/else statements for the changeClass method