Added function for computing PCA for use as covariates