algorithm gbm.freq.hom2