Dirichlet sampling code added.