moved JavaScript to an external file
wrote functions: bernoulli and binomial