bin search logic for multiclass