Adding math-fft for period detection