Simplified bernoulli.jl