borrowing from the rpart package by Terry M. Therneau

borrowing from the rpart package by Terry M. Therneau