minor improvment in psd calc