added nperiod instead of period