Added function for getting subregions.
Fixed wrong variable being used.
Application of PCA algorithm.