added optimized FFT