renamed flip to bernoulli (as flip has a generative story flavour)