function val = makePCs(Y)
% make the first Principle Components of yields

[W,d] = eig(cov(Y));
W = [W(:,end) W(:,end-1) W(:,end-2)];
mysign = sign(W(end,:)) ;
W = W *diag(mysign);   % make sure PC1 and PC2 are level and slope
PCs = Y*W;
val.PCs = PCs;
val.W = W;

end
 
