diff --git a/Inputs/DetectorConfiguration/sharc.detector b/Inputs/DetectorConfiguration/sharc.detector
index 74afb1bee67d19bf8f510b0f9b23ed39ecaff328..f06e6ea829d09397c773480e014ffa9c30462857 100644
--- a/Inputs/DetectorConfiguration/sharc.detector
+++ b/Inputs/DetectorConfiguration/sharc.detector
@@ -37,7 +37,7 @@ Sharc
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %Upstream Box
   SharcBOX
-    Z= -40
+    Z= 0
     ThicknessDector1= 100
     ThicknessDector2= 100
     ThicknessDector3= 100
diff --git a/NPLib/VDetector/DetectorManager.cxx b/NPLib/VDetector/DetectorManager.cxx
index aedf8cc7fff4d68cbec6c6590a8fa0d962057bb9..e96927f801d429bf48aebda5eb749e2cba5c4826 100644
--- a/NPLib/VDetector/DetectorManager.cxx
+++ b/NPLib/VDetector/DetectorManager.cxx
@@ -472,7 +472,7 @@ void DetectorManager::ReadConfigurationFile(string Path)
             ConfigFile >> DataBuffer;
 
             // Search for comment Symbol %
-            if (DataBuffer.compare(0, 1, "%") == 0) {ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );}
+            if (DataBuffer.compare(0, 1, "%") == 0) {ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );getline(ConfigFile, LineBuffer);}
 
             else if (DataBuffer.compare(0, 10, "THICKNESS=") == 0) {
                check_Thickness = true ;
diff --git a/NPSimulation/include/Sharc.hh b/NPSimulation/include/Sharc.hh
index 661de5ab58b28bf4ddcbf6c5b9c56d7480e3900f..17ce3a0bb838a8f92cb68052e9faad69ed900962 100644
--- a/NPSimulation/include/Sharc.hh
+++ b/NPSimulation/include/Sharc.hh
@@ -71,13 +71,14 @@ namespace SHARC
   const G4int    BOX_Wafer_Back_NumberOfStrip = 16 ;
   
   // Compute
+  const G4double BOX_Exposed_Length1 = BOX_Wafer_Length + BOX_PCB_Slot1_Border +0.5*BOX_PCB_Slot1_Width;
+  const G4double BOX_CenterOffset1 = 0.5* (BOX_PCB_Length-BOX_Exposed_Length1);
+  
   const G4double BOX_Wafer_Width_Offset =
-  BOX_PCB_Width/2. - BOX_PCB_Border_LongSide - BOX_Wafer_Width/2.;
-  const G4double BOX_Wafer_Length_Offset =
-  BOX_PCB_Length/2. - BOX_PCB_Border_ShortSide - BOX_Wafer_Length/2.;
+  BOX_PCB_Width*0.5 - BOX_PCB_Border_LongSide - BOX_Wafer_Width*0.5;
+  const G4double BOX_Wafer_Length_Offset = BOX_CenterOffset1;
   
-  const G4double BOX_PCB_Slot1_Position =-(BOX_Wafer_Length_Offset-BOX_Wafer_Length/2.-BOX_PCB_Slot1_Border - BOX_PCB_Slot1_Width/2.);
-  //const G4double BOX_PCB_Slot1_Position = BOX_PCB_Width*0.5-(BOX_PCB_Width - (BOX_Wafer_Length+BOX_PCB_Border_ShortSide+BOX_PCB_Slot1_Border+BOX_PCB_Slot1_Width*0.5))-BOX_PCB_Slot1_Width*0.5;
+  const G4double BOX_PCB_Slot1_Position = (BOX_PCB_Slot1_Border+0.5*BOX_PCB_Slot1_Width+0.5*BOX_Wafer_Length-BOX_CenterOffset1);
   
   // PAD //
   // PAD PCB
diff --git a/NPSimulation/src/Sharc.cc b/NPSimulation/src/Sharc.cc
index 2cb9396a5364620fe6377d690af8c7cb1ccfd3cc..a4851b4f9bea46bf4512d8bed8a75c41171508cc 100644
--- a/NPSimulation/src/Sharc.cc
+++ b/NPSimulation/src/Sharc.cc
@@ -464,15 +464,12 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){
       ///////////////////////////////////////////////////////////////////////////////////
       // Place the detector in the world
       // Position of the center of the PCB
-      //  G4double Exposed_Length= BOX_Wafer_Length + BOX_PCB_Slot_Border + BOX_PCB_Slot_Width;
-      //  G4double DetectorOffset= -0.5*(BOX_PCB_Length-Exposed_Length);
-      /*FIXME*///////////////////////////////////////////
       G4ThreeVector DetectorPosition =
-      G4ThreeVector(0,Box_Wafer_Offset.y(),0);
+      G4ThreeVector(-BOX_CenterOffset1,-Box_Wafer_Offset.y(),0);
 
       // Distance of the PCB to the target
       G4ThreeVector DetectorSpacing =
-      -G4ThreeVector(0, 0,Box_Wafer_Offset.y()+BOX_PCB_Slot_Position );
+        -G4ThreeVector(0, 0,BOX_Exposed_Length1*0.5);
 
       // If a PAD is present, DSSD is not in the center of the Slot:
       G4ThreeVector PAD_OFFSET=-G4ThreeVector(0.5*PAD_PCB_Thickness,0,0);