added align_pca function