Got bagging working to an extent