Playing with periodic functions