process PCA for data(need to confirm)
fixes #1, fixes #2