Final Update to psf creation code

Now it does everything it should and is sufficiently fast