sa = size(cvha);
sb = size(cvhb);
sc = size(cvhc);

if(sa(1) < sb(1))
	if(sc(1) < sa(1))
		forhist = [cvha(1:sc(1)) cvhb(1:sc(1)) cvhc];
	else
		forhist = [cvha cvhb(1:sa(1)) cvhc(1:sc(1))];
	end
else
	if(sc(1) < sb(1))
		forhist = [cvha(1:sc(1)) cvhb(1:sc(1)) cvhc];
	else
		forhist = [cvha(1:sb(1)) cvhb cvhc(1:sb(1))];
	end
end

[dstrb quux] = hist(forhist, nclust)
%hist(forhist, nclust)
cverr = [];
right = 0;
wrong = 0;
for cn = 1:nclust
	if((dstrb(cn,1) > dstrb(cn,2)) & (dstrb(cn,1) > dstrb(cn,3)))
		right =right +dstrb(cn,1);
		wrong = wrong +dstrb(cn,2);
		wrong = wrong +dstrb(cn,3);
	elseif((dstrb(cn,2) > dstrb(cn,3)) & (dstrb(cn,2) > dstrb(cn,1)))
		right =right +dstrb(cn,2);
		wrong = wrong +dstrb(cn,1);
		wrong = wrong +dstrb(cn,3);
	else
		right =right +dstrb(cn,3);
		wrong = wrong +dstrb(cn,2);
		wrong = wrong +dstrb(cn,1);
	end
end

blah = wrong./(right+wrong)
cverr = [cverr;blah];