added prior as parameter to main ash function