added more conditions to classes