RandomBag implementation