Wrote PCA method and associated test.