minor rearrangement of Dirichlet estimation code