More code from culsp into LSPeriodogram.

Still not working.