updated pca_lib to glue with the main program