initial import of psd.c