Added a repeat function