moved repeated code from *PSD.m to Run.m