added code in testperiodic