adding bagging and samme functions and samme tests