Added PCA function
Comments added.
Performance changes in projection