Building the bagging class