Existing binomail bounds

ClearAll[k,sum,coef];
sum[B_]:=Total[Select[allvals,#<B&]];
coef[B_]:=First[Extract[coefs,Position[vals,B]]];
k[B_]:=Min[coef[B]];

initCoefs[nn_,dd_]:=(
n=nn;d=dd;
coefs=IntegerPartitions[n,{d},Range[0,n]];
allcoefs=Permutations/@IntegerPartitions[n,{d},Range[0,n]]//Flatten[#,1]&;
vals=Multinomial@@@coefs;
allvals=Multinomial@@@allcoefs;
cc=Max[vals];

(* exclude 0 components, sort *)
nicevals=Select[vals,Min[coef[#]]>0&]//Sort;
(* focus on bottom 10% and exclude 0 coefficients *)
smallvals=Select[nicevals,sum[#]<d^n/10&]; 
);

(* checks  *)
initCoefs[8,4];
(* check that sums add up, only works for n that are multiples of d *)
Max[sum/@vals]+cc==d^n
(* check that coef does inverse mapping correctly *)
Total[Multinomial@@coef[#]&/@allvals]==d^n

lovasz1[B_]:=B 2^n/cc;
lovasz2[B_]:=Exp[n Log[2]-((((n/d-k[B]))^2)/(n-k[B]))];
lugo[B_]:=2B(((n-(k[B]-1))/(n-(2k[B]-1)))-1);
hterm[t_]:=If[t==0,0,t Log[t]];
flum[B_]:=2Exp[n Log[n]-Total[hterm/@coef[B]]]-2B;
boundFuncs={lovasz1,lovasz2,lugo,flum};
boundNames=ToString/@boundFuncs;

initCoefs[10,2];
bounds=Table[#[c]&/@boundFuncs,{c,vals}];
Needs["PlotLegends`"];
ListLinePlot[bounds//Transpose,Filling->Axis,PlotRange->All,PlotLegend->boundNames]

initCoefs[50,2];
boundError=Table[#[c]/sum[c]&/@boundFuncs,{c,smallvals}]//Transpose;
ListLinePlot[boundError//Log,PlotLegend->boundNames,PlotStyle->Thick,LegendPosition->{.28,.1},PlotLabel->"log errors for n=40,d=2"]

initCoefs[40,3];
boundError=Table[#[c]/sum[c]&/@boundFuncs,{c,smallvals}]//Transpose;
ListLinePlot[boundError//Log,PlotLegend->boundNames,PlotStyle->Thick,LegendPosition->{.4,.5},PlotLabel->"log errors for n=40,d=3"]

initCoefs[30,5];
boundError=Table[#[c]/sum[c]&/@boundFuncs,{c,smallvals}]//Transpose;
ListLinePlot[boundError//Log,PlotLegend->boundNames,PlotStyle->Thick,LegendPosition->{.4,.6},PlotLabel->"log errors for n=30,d=5"]