added bagging for internal nodes