Implemented principal component analysis