Working on the algebra for the posterior distributions