corrected for use of pair function in gbm