cleaned dsp functions