adapted bnb example to current master