Added repeat function and set function