First version of principle component analysis code.