Added matching periodic function code