Updated with code to find best priors