cleaned up version of latent classes