Identifying confounders and telling cause from effect using latent variable models