Initial implementation of bernoulli