Experimenting with bags algorithm