Hey everyone. As the title suggests, I am attempting to implement a manual version of the Cooley-Tukey Fast Fourier Algorithm in Mathematica but I cannot get it to work. Below is the code that I have written:
FFT[list_] := If[Length[list] <= 2, Fourier[list],
N2 := Length[list];
Wn := E^(2 \[Pi] I/N2);
W := 1;
Aeven := list[[2 ;; ;; 2]];
Aodd := list[[1 ;; ;; 2]];
Yeven := FFT[Aeven];
Yodd := FFT[Aodd];
For[j = 0, j < N/2, j++,
Y[j] := Yeven[j] + W*Yodd[j];
Y[j + N/2] := Yeven[j] - W*Yodd[j];
W := W*Wn];]]
I am unsure how to get the last For-loop to save the values in the new list Y, and how to then return it so that it can be accessed later. For reference, this is some pseudocode of what I am trying to do: 
Any help and/or comments would be greatly appreciated!