implement repeat operator