Fixed PCA bug, still need to write shapes