build (Star r1) sigma = do
  lbfa1 <- build r1 sigma
  s <- fetchState
  let transUnion  = remove (initial lbfa1) (trans lbfa1)
      transLoop   = let t = transitionList lbfa1 (initial lbfa1)
                    in (s,t) : [ (f,t) | f <- finals lbfa1 ]
  return $ LBFA {
    trans  = merge transLoop transUnion,
    finalS = s:(delete (initial lbfa1) (finals lbfa1)),
    alpha  = sigma,
    initS  = s,
    lastS  = s
    }
build (Star r1) sigma = do
  lbfa1 <- build r1 sigma
  s <- fetchState
  let transUnion  = remove (initial lbfa1) (trans lbfa1)
      transLoop   = let t = transitionList lbfa1 (initial lbfa1)
                    in (s,t) : [ (f,t) | f <- finals lbfa1 ]
  return $ LBFA {
    trans  = merge transLoop transUnion,
    finalS = s:(delete (initial lbfa1) (finals lbfa1)),
    alpha  = sigma,
    initS  = s,
    lastS  = s
    }
build (Star r1) sigma = do
  lbfa1 <- build r1 sigma
  s <- fetchState
  let transUnion  = remove (initial lbfa1) (trans lbfa1)
      transLoop   = let t = transitionList lbfa1 (initial lbfa1)
                    in (s,t) : [ (f,t) | f <- finals lbfa1 ]
  return $ LBFA {
    trans  = merge transLoop transUnion,
    finalS = s:(delete (initial lbfa1) (finals lbfa1)),
    alpha  = sigma,
    initS  = s,
    lastS  = s
    }