Implemented sequential pca.
Removed bugs and compile errors.