done with n-period