   }
   fftBuffer[0] = val;
   float fs = 16000/ACC_SIZE; // 250 Hz
-  uint32_t mag[FFT_SIZE];
-  float phase[FFT_SIZE];
+  float mag[20];
+  float phase[20];
   uint16_t startIndex, endIndex;
   // KickFFT<int32_t>::fft(fs, 0, 4, FFT_SIZE, fftBuffer, mag, startIndex, endIndex);
   fft_phase(fs, .5, 4, FFT_SIZE, fftBuffer, mag, phase, startIndex, endIndex);

		//dividing each number by 1000 to prevent each number from getting too large
		//Also adjusts for the fact that the trigonometric values were multiplied
		//by 1000 as well to make them integers instead of decimal values
		real = real/1000;
		imag = imag/1000;
		
                float phaseRad = atan2(imag, real) + PI;
		
		//calculating magnitude of the data by taking the square root of the
		//sum of the squares of the real and imaginary component of each signal
		mag[i] = KickMath<signed long int>::calcMagnitude(real, imag);
		phase[i] = phaseRad;
	}
}

	
	for (uint16_t i = startIndex; i < endIndex; i++)
	{
		float real = 0;
		float imag = 0;
		
		
		//Euler's Identity
