Add repeat function.