final version of n-period