implemented fft, needs to be adjusted