begin PCA functionality