replace NaN with 0, and added flag option to pca
flag option added