diff --git a/hpvm/include/ExtractHPVMLeafNodes/ExtractHPVMLeafNodes.h b/hpvm/include/ExtractHPVMLeafNodes/ExtractHPVMLeafNodes.h
index dfbd09402d7006dd7e42968fef387908b1928afc..97e91f5e0734141627906e193562680c09c31a77 100644
--- a/hpvm/include/ExtractHPVMLeafNodes/ExtractHPVMLeafNodes.h
+++ b/hpvm/include/ExtractHPVMLeafNodes/ExtractHPVMLeafNodes.h
@@ -1,25 +1,26 @@
 #ifndef __EXTRACT_HPVM_LEAF_NODE_FUNCTIONS_H__
-	#define __EXTRACT_HPVM_LEAF_NODE_FUNCTIONS_H__
+#define __EXTRACT_HPVM_LEAF_NODE_FUNCTIONS_H__
 	
-	//===-------------------- ExtractHPVMLeafNodeFunctions.h ------------------===//
-	//
-	//                     The LLVM Compiler Infrastructure
-	//
-	// This file is distributed under the University of Illinois Open Source
-	// License. See LICENSE.TXT for details.
-	//
-	//===----------------------------------------------------------------------===//
+//===-------------------- ExtractHPVMLeafNodeFunctions.h ------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
 	
-	#include "llvm/IR/Module.h"
-	#include "llvm/BuildDFG/BuildDFG.h"
+#include "llvm/IR/Module.h"
+
+#include "BuildDFG/BuildDFG.h"
 	
-	namespace extracthpvmleaf {
+namespace extracthpvmleaf {
 	
-	class ExtractHPVMLeafNodeFunctions {
-	public:
-	  void run(Module &M, builddfg::BuildDFG &DFG);
-	};
+class ExtractHPVMLeafNodeFunctions {
+public:
+    void run(Module &M, builddfg::BuildDFG &DFG);
+};
 	
-	} // end namespace extracthpvmleaf
+} // end namespace extracthpvmleaf
 	
-	#endif
\ No newline at end of file
+#endif
diff --git a/hpvm/include/FuseHPVMTensorNodes/FuseHPVMTensorNodes.h b/hpvm/include/FuseHPVMTensorNodes/FuseHPVMTensorNodes.h
index 72812071a3ee3965d05b9c006fb304550d4eb3ff..ce6725b930cefb56d23cad2799bee27c97e44783 100644
--- a/hpvm/include/FuseHPVMTensorNodes/FuseHPVMTensorNodes.h
+++ b/hpvm/include/FuseHPVMTensorNodes/FuseHPVMTensorNodes.h
@@ -10,12 +10,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/IR/DFGraph.h"
+#include "SupportHPVM/DFGraph.h"
+
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
 
-#include "llvm/BuildDFG/BuildDFG.h"
-#include "llvm/SupportVISC/DFG2LLVM.h"
+#include "BuildDFG/BuildDFG.h"
+#include "SupportHPVM/DFG2LLVM.h"
 
 using namespace llvm;
 
@@ -113,7 +114,7 @@ public:
 class FindFusionTargetsTraversal : public dfg2llvm::CodeGenTraversal {
 
 private:
-  typedef std::map< visc::Target, std::vector< std::vector<Intrinsic::ID> > >
+  typedef std::map< hpvm::Target, std::vector< std::vector<Intrinsic::ID> > >
           FusePatterns;
   //Member variables
 
@@ -137,14 +138,14 @@ public:
 
   FindFusionTargetsTraversal(Module &_M, builddfg::BuildDFG &_DFG) :
     CodeGenTraversal(_M, _DFG) {
-/*    FPs[visc::PROMISE_TARGET] = { {Intrinsic::visc_tensor_conv,
-                                   Intrinsic::visc_tensor_add,
-                                   Intrinsic::visc_tensor_relu,
-                                   Intrinsic::visc_tensor_pooling
+/*    FPs[hpvm::PROMISE_TARGET] = { {Intrinsic::visc_tensor_conv,
+                                   Intrinsic::hpvm_tensor_add,
+                                   Intrinsic::hpvm_tensor_relu,
+                                   Intrinsic::hpvm_tensor_pooling
                                   },
-                                  {Intrinsic::visc_tensor_mul,
-                                   Intrinsic::visc_tensor_add,
-                                   Intrinsic::visc_tensor_relu
+                                  {Intrinsic::hpvm_tensor_mul,
+                                   Intrinsic::hpvm_tensor_add,
+                                   Intrinsic::hpvm_tensor_relu
                                   }
                                 }
 */
@@ -176,3 +177,4 @@ public:
 } // End of namespace
 
 #endif
+
diff --git a/hpvm/include/InPlaceDFG/InPlaceDFGAnalysis.h b/hpvm/include/InPlaceDFG/InPlaceDFGAnalysis.h
index fc4c7f3ee9f0d0bb14b81ca08b88d94799705788..820b274eb6bf17261df1e482680b7f8e1d1aae9e 100644
--- a/hpvm/include/InPlaceDFG/InPlaceDFGAnalysis.h
+++ b/hpvm/include/InPlaceDFG/InPlaceDFGAnalysis.h
@@ -12,8 +12,8 @@
 
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/IR/DFGraph.h"
-#include "llvm/BuildDFG/BuildDFG.h"
+#include "SupportHPVM/DFGraph.h"
+#include "BuildDFG/BuildDFG.h"
 
 using namespace llvm;
 
diff --git a/hpvm/include/SupportHPVM/DFGTreeTraversal.h b/hpvm/include/SupportHPVM/DFGTreeTraversal.h
index 67c317a2e9857b9000e4d77f6858494eb81c1ec1..e357bb3dd98527fd773570593beac7ce0386c6cf 100644
--- a/hpvm/include/SupportHPVM/DFGTreeTraversal.h
+++ b/hpvm/include/SupportHPVM/DFGTreeTraversal.h
@@ -10,7 +10,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/BuildDFG/BuildDFG.h"
+#include "BuildDFG/BuildDFG.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
diff --git a/hpvm/include/SupportHPVM/DFGraph.h b/hpvm/include/SupportHPVM/DFGraph.h
index 2deb2ca8f5c17620da0ddf60e1ef269acde52235..e7f3c5bc78fff430f389c2e76cc168c8d3381ddf 100644
--- a/hpvm/include/SupportHPVM/DFGraph.h
+++ b/hpvm/include/SupportHPVM/DFGraph.h
@@ -761,12 +761,14 @@ DFEdge *DFNode::getOutDFEdgeAt(unsigned outPort) {
 
   // Cannot perform check for the number of outputs here,
   // it depends on the node's return type
-
+  
+  unsigned index = 0;
   for (outdfedge_iterator i = outdfedge_begin(), e = outdfedge_end(); i != e;
        ++i) {
     DFEdge *E = *i;
-    if (outPort == E->getSourcePosition())
+    if (outPort == index)//E->getSourcePosition())
       return E;
+    index++;
   }
   return NULL;
 }
@@ -855,8 +857,11 @@ bool DFNode::hasSideEffects() {
 
 //===--------------------- DFInternalNode Outlined Functions --------------===//
 void DFInternalNode::addEdgeToDFGraph(DFEdge *E) {
+  errs() << "----- ADD EDGE TO DFGRAPH\n";
   DFNode *S = E->getSourceDF();
   DFNode *D = E->getDestDF();
+  errs() << "INIT SOURCE NODE: " << S << "\n";
+  errs() << "INIT DEST NODE: " << D << "\n";
 
   assert(std::find(childGraph->begin(), childGraph->end(), S) !=
              childGraph->end() &&
@@ -874,6 +879,9 @@ void DFInternalNode::addEdgeToDFGraph(DFEdge *E) {
   S->addOutDFEdge(E);
   D->addInDFEdge(E);
 
+  errs() << "SET SOURCE NODE: " << E->getSourceDF() << "\n";
+  errs() << "SET DEST NODE: " << E->getDestDF() << "\n";
+
   // Update Rank
   if (D->getRank() <= S->getRank())
     D->setRank(S->getRank() + 1);