Running the Script to Generate Periods