moved some probability functions to its own file