more FFT stuff, but went back to rectangle detection