add two function for periodicity