pull from bertrand
more realistic case
different implementation