function [junk,kk,cellphns]=make_phn_clusters2(phn_conf,phns,nc);

% jan modifies so that we get cell array of clusters at the out.

t=make_phn_clusters1(phn_conf,'cityblock','ward',nc);
disp('cityblock');

% pdist methods       linkage methods
% euclid		single
% seuclid		complete
% cityblock		average
% mahal			centroid
% minkowski		ward


for i=1:nc
  idx{i}=find(t==i);
end

for i=1:nc
  jj=idx{i};
  s=disp_phn_seq(phns,jj);
  cellphns(i) = cellstr(s);
end

junk=zeros(nc);

for i=1:nc
 ii=idx{i};
 for j=1:nc
   jj=idx{j};
   junk(i,j)=sum(sum(phn_conf(ii,jj)));
 end
end
kk=muinfo(junk)

function s=disp_phn_seq(phns,jj);
s='';
for i=1:length(jj)
  s=strcat([s '  ' phns{jj(i)}]);
end
disp(s);

function T=make_phn_clusters1(phn_conf,pdist_type,linkage_type,cutoff);

Y = pdist(phn_conf,pdist_type);
Z = linkage(Y, linkage_type);
T = cluster(Z, cutoff);