       @project = project
       mainFileName = @project.get("name")
       mainFileCode = @project.pfiles.get(mainFileName).get("content")
-      mainFileNode = new Node(mainFileName)
-      result  = @processIncludes(mainFileNode,mainFileName, mainFileCode)
-    
-      console.log "@resolvedIncludes"
-      console.log @resolvedIncludes
-      console.log "@unresolvedIncludes"
-      console.log @unresolvedIncludes
+      result  = @processIncludes(mainFileName, mainFileCode)
       
       if coffeeToJs
         result = CoffeeScript.compile(result, {bare: true})
       return result
-    
-    process_old:(source)->  
-      fullSource = libsSource + source
-      textblock = CoffeeScript.compile(fullSource, {bare: true})
       
-    processIncludes:(parentNode, filename, source)=>
+    processIncludes:(filename, source)=>
       #finds all matches of "include xxx", and fetches the corresponding text 
       console.log "processing #{filename}"
       console.log "@unresolvedIncludes : #{@unresolvedIncludes.join(' ')}"

          throw new Error("Circular dependency detected from #{filename} to #{includeeFileName}")
        if not (includeeFileName in @resolvedIncludes)
          result = @fetch_data(store,projectName,projectSubPath)
          newNode = new Node(includeeFileName)
          if parentNode?
            parentNode.addEdge(includeeFileName)
          result = @processIncludes(newNode, includeeFileName, result)
          
          @resolvedIncludes.push(includeeFileName)
        return result

  reqRes = require 'modules/core/reqRes'
  utils = require "modules/core/utils/utils"
  
  
  class PreProcessor
    #dependency resolving solved with the help of http://www.electricmonk.nl/docs/dependency_resolving_algorithm/dependency_resolving_algorithm.html
    constructor:()->
      @project = null
      @resolvedIncludes = []
