almost finish PCA, need debug