     existingStreamsCount = localStreams.filter(startsWithName).length
     name + '_' + (existingStreamsCount + 1)
 
-  accumulateLocalName = (name) -> localNames.push(name) if name not in localNames
-  accumulateFunctionName = (name) -> functionNames.push name if (name not in functionNames and name not in localNames)
+  accumulateFunctionName = (name) -> functionNames.push name if name not in functionNames
   accumulateFunctionNames = (names) -> accumulateFunctionName(n) for n in names
   accumulateLocalStream = (name, code) -> localStreams.unshift {name, code}
   accumulateLocalStreams = (streams) -> localStreams.unshift s for s in streams
   accumulateCombineName = (name) ->
-    if (name.name not in localNames and !_.find(combineNames, (n) -> n.name == name.name))
+    if not _.find(combineNames, (n) -> n.name == name.name)
       combineNames.push name
   accumulateCombineNames = (names) -> accumulateCombineName(n) for n in names
 

  {code: bodyCode, functionNames}

exprCode = (expr, functionInfo, incomingLocalNames = []) ->
  localNames = [].concat incomingLocalNames
  functionNames = []
  localStreams = []
  combineNames = []

    when expr instanceof Aggregation
      items = []
      aggregationNames = (n for n in expr.childNames)

      for i in [0...expr.children.length]
        name = expr.childNames[i]
