implemented updating priors