split sample_latent_vars and update_pi again to reduce memory requirements (no more piUpdate)