added min and max calculations to fft