Rework of bag example, with real code.