Added functio in pca.py for calculating smallest k needed for variance retained