Added derivation of p(x)