def bracket_block(text):
  """
  finds start and end of the first bracketed block
  """

  istart=text.find('(')

  cursor=istart

  if cursor != -1:

    counter=1
    while (cursor<len(text)) and counter>0:
      cursor+=1
      if text[cursor]=='(':
         counter += 1
      elif text[cursor]==')':
         counter -= 1  

  return istart, cursor