updated distribution functions, they are all in one function now