implemented bionomial distribution