Some functions to enhance gbm functionality