modified to disallow psd lengths of 1