Added 'repeat' function.