Implements the repeat operator