Script from Andrew, PCA update