refactored binomial distribution