cleand the code and added a class for dirichlet dist
small changes