added rawdata as output and fixed some minor stuff in pPCA