Sorry, just found the answer so I am posting it for anyone who encounters this issue. This system will not let me post the link to where I found the answer so I will just post what it said in brief.
Enter the line,
unset($periods);
right before you define your periods and it will clear out the array and use what you have.
Thanks,
John