fixed dimension counting in PCA.m