skel = skelo;

 for ii=2:length(skel.tree)
        skel.tree(ii).posInd = [];
 end
 clear M;

 
 counter = 1;
 for j=2:size(skel.tree,2) 
        if ~isempty(skel.tree(j).rotInd)
           skel.tree(j).rotInd = skel.tree(j).rotInd - 3*(counter);
           skel.tree(j).expmapInd = skel.tree(j).expmapInd - 3*(counter);
           skel.tree(j).channels = [{'Zrotation'},{'Yrotation'},{'Xrotation'}];
           skel.tree(j).order = 'zyx';
           counter = counter + 1;
        end
 end

 
 joints = counter -1;
 
 
 for jj=1:length(Motion)
 M{jj}(:,1:6) = Motion{jj}(:,1:6);
 counter = 1;
 for i=10:6:size(Motion{jj},2)
     i
     ch = Motion{jj}(:,i:i+2);
     M{jj}(:,counter+6:counter+8) = ch;
     counter=counter+3;
 end
 end