Multiple period detection now working.