Can now pass data to pca function instead of reading from file
new functions