diff --git a/IO/IODispatcher.cpp b/IO/IODispatcher.cpp
index 1e6b8187486860bb1a2c9854a4d83bfc1a85616a..9d46815777d467d933df9456c6dca909e248c4a6 100644
--- a/IO/IODispatcher.cpp
+++ b/IO/IODispatcher.cpp
@@ -315,9 +315,9 @@ void TrajectoriesJPSV04::WriteFrame(int frameNr, Building* building)
           string caption = r->GetCaption();
 
           if ((rooms_to_plot.empty() == false)
-                              && (IsElementInVector(rooms_to_plot, caption) == false)) {
-                         continue;
-                    }
+                    && (IsElementInVector(rooms_to_plot, caption) == false)) {
+               continue;
+          }
           data.append(WritePed(ped));
      }
 
@@ -341,6 +341,7 @@ TrajectoriesFLAT::TrajectoriesFLAT() : Trajectories()
 
 void TrajectoriesFLAT::WriteHeader(int nPeds, double fps, Building* building, int seed)
 {
+     (void) seed; (void) nPeds;
      char tmp[CLENGTH] = "";
      Write("#description: my super simulation");
      sprintf(tmp, "#framerate: %0.2f",fps);
@@ -356,7 +357,7 @@ void TrajectoriesFLAT::WriteHeader(int nPeds, double fps, Building* building, in
 
 void TrajectoriesFLAT::WriteGeometry(Building* building)
 {
-
+     (void) building;
 }
 
 void TrajectoriesFLAT::WriteFrame(int frameNr, Building* building)
@@ -392,6 +393,8 @@ TrajectoriesVTK::TrajectoriesVTK()
 
 void TrajectoriesVTK::WriteHeader(int nPeds, double fps, Building* building, int seed)
 {
+     //suppress unused warnings
+     (void) nPeds; (void) fps ; (void) seed;
      Write("# vtk DataFile Version 4.0");
      Write(building->GetCaption());
      Write("ASCII");
@@ -447,6 +450,7 @@ void TrajectoriesVTK::WriteGeometry(Building* building)
 
 void TrajectoriesVTK::WriteFrame(int frameNr, Building* building)
 {
+     (void) frameNr; (void)building;
 }
 
 void TrajectoriesVTK::WriteFooter()
@@ -481,24 +485,24 @@ void TrajectoriesJPSV06::WriteHeader(int nPeds, double fps, Building* building,
 void TrajectoriesJPSV06::WriteGeometry(Building* building)
 {
      // just put a link to the geometry file
-//     string embed_geometry;
-//     embed_geometry.append("\t<geometry>\n");
-//     char file_location[CLENGTH] = "";
-//     sprintf(file_location, "\t<file location= \"%s\"/>\n", building->GetGeometryFilename().c_str());
-//     embed_geometry.append(file_location);
-//     //embed_geometry.append("\t</geometry>\n");
-//
-//     const map<int, Hline*>& hlines=building->GetAllHlines();
-//     if(hlines.size()>0){
-//          //embed_geometry.append("\t<geometry>\n");
-//          for (std::map<int, Hline*>::const_iterator it=hlines.begin(); it!=hlines.end(); ++it)
-//          {
-//               embed_geometry.append(it->second->WriteElement());
-//          }
-//          //embed_geometry.append("\t</geometry>\n");
-//     }
-//     embed_geometry.append("\t</geometry>\n");
-//     Write(embed_geometry);
+     //     string embed_geometry;
+     //     embed_geometry.append("\t<geometry>\n");
+     //     char file_location[CLENGTH] = "";
+     //     sprintf(file_location, "\t<file location= \"%s\"/>\n", building->GetGeometryFilename().c_str());
+     //     embed_geometry.append(file_location);
+     //     //embed_geometry.append("\t</geometry>\n");
+     //
+     //     const map<int, Hline*>& hlines=building->GetAllHlines();
+     //     if(hlines.size()>0){
+     //          //embed_geometry.append("\t<geometry>\n");
+     //          for (std::map<int, Hline*>::const_iterator it=hlines.begin(); it!=hlines.end(); ++it)
+     //          {
+     //               embed_geometry.append(it->second->WriteElement());
+     //          }
+     //          //embed_geometry.append("\t</geometry>\n");
+     //     }
+     //     embed_geometry.append("\t</geometry>\n");
+     //     Write(embed_geometry);
 
      //set the content of the file
      string fileName=building->GetProjectRootDir()+"/"+building->GetGeometryFilename().c_str();
@@ -510,51 +514,51 @@ void TrajectoriesJPSV06::WriteGeometry(Building* building)
      buffer << t.rdbuf();
      embed_geometry=buffer.str();
      Write(embed_geometry);
-//
-//
-//     //collecting the hlines
-//     std::stringstream hlines_buffer;
-//     // add the header
-//     hlines_buffer<<" <routing version=\"0.5\" "
-//               <<"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
-//               <<"xsi:noNamespaceSchemaLocation=\"http://134.94.2.137/jps_routing.xsd\" >"<<endl
-//               <<"<Hlines> "<<endl;
-//
-//     const map<int, Hline*>& hlines=building->GetAllHlines();
-//     for (std::map<int, Hline*>::const_iterator it=hlines.begin(); it!=hlines.end(); ++it)
-//     {
-//          Hline* hl=it->second;
-//          hlines_buffer <<"\t<Hline id=\""<< hl->GetID()<<"\" room_id=\""<<hl->GetRoom1()->GetID()
-//                                        <<"\" subroom_id=\""<< hl->GetSubRoom1()->GetSubRoomID()<<"\">"<<endl;
-//          hlines_buffer <<"\t\t<vertex px=\""<< hl->GetPoint1()._x<<"\" py=\""<< hl->GetPoint1()._y<<"\" />"<<endl;
-//          hlines_buffer <<"\t\t<vertex px=\""<< hl->GetPoint2()._x<<"\" py=\""<< hl->GetPoint2()._y<<"\" />"<<endl;
-//          hlines_buffer <<"\t</Hline>"<<endl;
-//     }
-//     hlines_buffer<<"</Hlines> "<<endl;
-//     hlines_buffer<<"</routing> "<<endl;
-//
-//     string hline_string=hlines_buffer.str();
-//     string to_replace="</geometry>";
-//     hline_string.append(to_replace);
-//
-//     size_t start_pos = embed_geometry.find(to_replace);
-//     if(start_pos == std::string::npos)
-//     {
-//          Log->Write("WARNING:\t missing %s tag while writing the geometry in the trajectory file.",to_replace.c_str());
-//     }
-//
-//     embed_geometry.replace(start_pos, to_replace.length(), hline_string);
-//     Write(embed_geometry);
-
-//     Write("\t<AttributeDescription>");
-//     Write("\t\t<property tag=\"x\" description=\"xPosition\"/>");
-//     Write("\t\t<property tag=\"y\" description=\"yPosition\"/>");
-//     Write("\t\t<property tag=\"z\" description=\"zPosition\"/>");
-//     Write("\t\t<property tag=\"rA\" description=\"radiusA\"/>");
-//     Write("\t\t<property tag=\"rB\" description=\"radiusB\"/>");
-//     Write("\t\t<property tag=\"eC\" description=\"ellipseColor\"/>");
-//     Write("\t\t<property tag=\"eO\" description=\"ellipseOrientation\"/>");
-//     Write("\t</AttributeDescription>\n");
+     //
+     //
+     //     //collecting the hlines
+     //     std::stringstream hlines_buffer;
+     //     // add the header
+     //     hlines_buffer<<" <routing version=\"0.5\" "
+     //               <<"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+     //               <<"xsi:noNamespaceSchemaLocation=\"http://134.94.2.137/jps_routing.xsd\" >"<<endl
+     //               <<"<Hlines> "<<endl;
+     //
+     //     const map<int, Hline*>& hlines=building->GetAllHlines();
+     //     for (std::map<int, Hline*>::const_iterator it=hlines.begin(); it!=hlines.end(); ++it)
+     //     {
+     //          Hline* hl=it->second;
+     //          hlines_buffer <<"\t<Hline id=\""<< hl->GetID()<<"\" room_id=\""<<hl->GetRoom1()->GetID()
+     //                                        <<"\" subroom_id=\""<< hl->GetSubRoom1()->GetSubRoomID()<<"\">"<<endl;
+     //          hlines_buffer <<"\t\t<vertex px=\""<< hl->GetPoint1()._x<<"\" py=\""<< hl->GetPoint1()._y<<"\" />"<<endl;
+     //          hlines_buffer <<"\t\t<vertex px=\""<< hl->GetPoint2()._x<<"\" py=\""<< hl->GetPoint2()._y<<"\" />"<<endl;
+     //          hlines_buffer <<"\t</Hline>"<<endl;
+     //     }
+     //     hlines_buffer<<"</Hlines> "<<endl;
+     //     hlines_buffer<<"</routing> "<<endl;
+     //
+     //     string hline_string=hlines_buffer.str();
+     //     string to_replace="</geometry>";
+     //     hline_string.append(to_replace);
+     //
+     //     size_t start_pos = embed_geometry.find(to_replace);
+     //     if(start_pos == std::string::npos)
+     //     {
+     //          Log->Write("WARNING:\t missing %s tag while writing the geometry in the trajectory file.",to_replace.c_str());
+     //     }
+     //
+     //     embed_geometry.replace(start_pos, to_replace.length(), hline_string);
+     //     Write(embed_geometry);
+
+     //     Write("\t<AttributeDescription>");
+     //     Write("\t\t<property tag=\"x\" description=\"xPosition\"/>");
+     //     Write("\t\t<property tag=\"y\" description=\"yPosition\"/>");
+     //     Write("\t\t<property tag=\"z\" description=\"zPosition\"/>");
+     //     Write("\t\t<property tag=\"rA\" description=\"radiusA\"/>");
+     //     Write("\t\t<property tag=\"rB\" description=\"radiusB\"/>");
+     //     Write("\t\t<property tag=\"eC\" description=\"ellipseColor\"/>");
+     //     Write("\t\t<property tag=\"eO\" description=\"ellipseOrientation\"/>");
+     //     Write("\t</AttributeDescription>\n");
 }
 
 void TrajectoriesJPSV06::WriteFrame(int frameNr, Building* building)
diff --git a/Simulation.cpp b/Simulation.cpp
index 110fa144f47244421d0436ca731eb8eb04a033c4..72f2c95238563dc8a1de1964b809931e5561b402 100644
--- a/Simulation.cpp
+++ b/Simulation.cpp
@@ -28,7 +28,6 @@
  *
  **/
 
-
 #include "Simulation.h"
 
 #include "math/GCFMModel.h"
@@ -42,7 +41,6 @@
 #define omp_get_max_threads()  1
 #endif
 
-
 using namespace std;
 
 OutputHandler* Log;
@@ -51,7 +49,7 @@ Simulation::Simulation()
 {
      _nPeds = 0;
      _tmax = 0;
-     _seed=8091983;
+     _seed = 8091983;
      _deltaT = 0;
      _building = NULL;
      _distribution = NULL;
@@ -59,11 +57,11 @@ Simulation::Simulation()
      _operationalModel = NULL;
      _solver = NULL;
      _iod = new IODispatcher();
-     _fps=1;
-     _em=NULL;
-     _argsParser=NULL;
-     _hpc=-1;
-     _profiling=false;
+     _fps = 1;
+     _em = NULL;
+     _argsParser = NULL;
+     _hpc = -1;
+     _profiling = false;
 }
 
 Simulation::~Simulation()
@@ -82,57 +80,64 @@ int Simulation::GetPedsNumber() const
      return _nPeds;
 }
 
-void Simulation::InitArgs(ArgumentParser* args)
+bool Simulation::InitArgs(ArgumentParser* args)
 {
      char tmp[CLENGTH];
      string s = "Parameter:\n";
 
-     _argsParser=args;
-     switch (args->GetLog()) {
+     _argsParser = args;
+     switch (args->GetLog())
+     {
      case 0:
           // no log file
           //Log = new OutputHandler();
           break;
      case 1:
-          if(Log) delete Log;
+          if (Log)
+               delete Log;
           Log = new STDIOHandler();
           break;
      case 2: {
-          char name[CLENGTH]="";
-          sprintf(name,"%s.P0.dat",args->GetErrorLogFile().c_str());
-          if(Log) delete Log;
+          char name[CLENGTH] = "";
+          sprintf(name, "%s.P0.dat", args->GetErrorLogFile().c_str());
+          if (Log)
+               delete Log;
           Log = new FileHandler(name);
      }
-     break;
+          break;
      default:
           printf("Wrong option for Logfile!\n\n");
-          exit(0);
+          return false;
      }
 
-
-     if(args->GetPort()!=-1) {
-          switch(args->GetFileFormat()) {
+     if (args->GetPort() != -1) {
+          switch (args->GetFileFormat())
+          {
           case FORMAT_XML_PLAIN_WITH_MESH:
           case FORMAT_XML_PLAIN: {
-               OutputHandler* travisto = new SocketHandler(args->GetHostname(), args->GetPort());
-               Trajectories* output= new TrajectoriesJPSV06();
+               OutputHandler* travisto = new SocketHandler(args->GetHostname(),
+                         args->GetPort());
+               Trajectories* output = new TrajectoriesJPSV06();
                output->SetOutputHandler(travisto);
                _iod->AddIO(output);
                break;
           }
           case FORMAT_XML_BIN: {
-               Log->Write("INFO: \tFormat xml-bin not yet supported in streaming\n");
+               Log->Write(
+                         "INFO: \tFormat xml-bin not yet supported in streaming\n");
                //exit(0);
                break;
           }
           case FORMAT_PLAIN: {
-               Log->Write("INFO: \tFormat plain not yet supported in streaming\n");
-               exit(0);
+               Log->Write(
+                         "INFO: \tFormat plain not yet supported in streaming\n");
+               return false;
                break;
           }
           case FORMAT_VTK: {
-               Log->Write("INFO: \tFormat vtk not yet supported in streaming\n");
-               exit(0);
+               Log->Write(
+                         "INFO: \tFormat vtk not yet supported in streaming\n");
+               return false;
                break;
           }
           }
@@ -140,26 +145,30 @@ void Simulation::InitArgs(ArgumentParser* args)
           s.append("\tonline streaming enabled \n");
      }
 
-     if(args->GetTrajectoriesFile().empty()==false) {
-          switch (args->GetFileFormat()) {
+     if (args->GetTrajectoriesFile().empty() == false) {
+          switch (args->GetFileFormat())
+          {
           case FORMAT_XML_PLAIN: {
-               OutputHandler* tofile = new FileHandler(args->GetTrajectoriesFile().c_str());
-               Trajectories* output= new TrajectoriesJPSV05();
+               OutputHandler* tofile = new FileHandler(
+                         args->GetTrajectoriesFile().c_str());
+               Trajectories* output = new TrajectoriesJPSV05();
                output->SetOutputHandler(tofile);
                _iod->AddIO(output);
                break;
           }
           case FORMAT_PLAIN: {
-               OutputHandler* file = new FileHandler(args->GetTrajectoriesFile().c_str());
-               Trajectories* output= new  TrajectoriesFLAT();
+               OutputHandler* file = new FileHandler(
+                         args->GetTrajectoriesFile().c_str());
+               Trajectories* output = new TrajectoriesFLAT();
                output->SetOutputHandler(file);
                _iod->AddIO(output);
                break;
           }
           case FORMAT_VTK: {
                Log->Write("INFO: \tFormat vtk not yet supported\n");
-               OutputHandler* file = new FileHandler((args->GetTrajectoriesFile() +".vtk").c_str());
-               Trajectories* output= new  TrajectoriesVTK();
+               OutputHandler* file = new FileHandler(
+                         (args->GetTrajectoriesFile() + ".vtk").c_str());
+               Trajectories* output = new TrajectoriesVTK();
                output->SetOutputHandler(file);
                _iod->AddIO(output);
                break;
@@ -190,7 +199,8 @@ void Simulation::InitArgs(ArgumentParser* args)
      int direction = args->GetExitStrategy();
      sprintf(tmp, "\tDirection to the exit: %d\n", direction);
      s.append(tmp);
-     switch (direction) {
+     switch (direction)
+     {
      case 1:
           _direction = new DirectionMiddlePoint();
           break;
@@ -205,17 +215,20 @@ void Simulation::InitArgs(ArgumentParser* args)
           break;
      default:
           _direction = new DirectionMinSeperationShorterLine();
-          sprintf(tmp, "\t Warning Direction %d is not in [1,4]. Fall back to 2\n", direction);
+          sprintf(tmp,
+                    "\t Warning Direction %d is not in [1,4]. Fall back to 2\n",
+                    direction);
           s.append(tmp);
           break;
      }
-     int model =  args->GetModel();
-     if(model == MODEL_GFCM)
-     { //GCFM
-          //if(args->GetHPCFlag()==0){
-          _operationalModel = new GCFMModel(_direction, args->GetNuPed(), args->GetNuWall(), args->GetDistEffMaxPed(),
-                    args->GetDistEffMaxWall(), args->GetIntPWidthPed(), args->GetIntPWidthWall(),
-                    args->GetMaxFPed(), args->GetMaxFWall());
+     int model = args->GetModel();
+     if (model == MODEL_GFCM) { //GCFM
+                                //if(args->GetHPCFlag()==0){
+          _operationalModel = new GCFMModel(_direction, args->GetNuPed(),
+                    args->GetNuWall(), args->GetDistEffMaxPed(),
+                    args->GetDistEffMaxWall(), args->GetIntPWidthPed(),
+                    args->GetIntPWidthWall(), args->GetMaxFPed(),
+                    args->GetMaxFWall());
           s.append("\tModel: GCFMModel\n");
           s.append(_operationalModel->GetDescription());
           //}
@@ -233,11 +246,11 @@ void Simulation::InitArgs(ArgumentParser* args)
           //s.append("\tModel: GCFMModel\n");
           //s.append(_model->writeParameter());
           //}
-     }
-     else if (model == MODEL_GOMPERTZ)
-     { //Gompertz
-          _operationalModel = new GompertzModel(_direction, args->GetNuPed(), args->GetaPed(), args->GetbPed(), args->GetcPed(),
-                    args->GetNuWall(), args->GetaWall(), args->GetbWall(), args->GetcWall() );
+     } else if (model == MODEL_GOMPERTZ) { //Gompertz
+          _operationalModel = new GompertzModel(_direction, args->GetNuPed(),
+                    args->GetaPed(), args->GetbPed(), args->GetcPed(),
+                    args->GetNuWall(), args->GetaWall(), args->GetbWall(),
+                    args->GetcWall());
           s.append("\tModel: GompertzModel\n");
           s.append(_operationalModel->GetDescription());
      }
@@ -248,14 +261,14 @@ void Simulation::InitArgs(ArgumentParser* args)
      s.append(tmp);
      //switch (solver) {
      //case 1:
-          //_solver = new EulerSolver(_model);
-          //break;
-          //case 2:
-          //     _solver = new VelocityVerletSolver(_model);
-          //     break;
-          //case 3:
-          //     _solver = new LeapfrogSolver(_model);
-          //     break;
+     //_solver = new EulerSolver(_model);
+     //break;
+     //case 2:
+     //     _solver = new VelocityVerletSolver(_model);
+     //     break;
+     //case 3:
+     //     _solver = new LeapfrogSolver(_model);
+     //     break;
      //}
      sprintf(tmp, "\tnCPU: %d\n", args->GetMaxOpenMPThreads());
      s.append(tmp);
@@ -266,23 +279,24 @@ void Simulation::InitArgs(ArgumentParser* args)
      sprintf(tmp, "\tdt: %f\n", _deltaT);
      s.append(tmp);
 
-     _fps=args->Getfps();
+     _fps = args->Getfps();
      sprintf(tmp, "\tfps: %f\n", _fps);
      s.append(tmp);
 
      // Route choice
-     vector< pair<int, RoutingStrategy> >  routers=  args->GetRoutingStrategy();
-     RoutingEngine* routingEngine= new RoutingEngine();
+     vector<pair<int, RoutingStrategy> > routers = args->GetRoutingStrategy();
+     RoutingEngine* routingEngine = new RoutingEngine();
 
-     for (unsigned int r= 0; r<routers.size(); r++) {
+     for (unsigned int r = 0; r < routers.size(); r++) {
 
-          RoutingStrategy strategy=routers[r].second;
+          RoutingStrategy strategy = routers[r].second;
 
-          int routerID=routers[r].first;
+          int routerID = routers[r].first;
 
-          switch (strategy) {
+          switch (strategy)
+          {
           case ROUTING_LOCAL_SHORTEST: {
-               Router* router=new GlobalRouter();
+               Router* router = new GlobalRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -290,7 +304,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_GLOBAL_SHORTEST: {
-               Router* router=new GlobalRouter();
+               Router* router = new GlobalRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -298,7 +312,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_QUICKEST: {
-               Router* router=new QuickestPathRouter();
+               Router* router = new QuickestPathRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -306,7 +320,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_DYNAMIC: {
-               Router* router=new GraphRouter();
+               Router* router = new GraphRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -314,7 +328,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_NAV_MESH: {
-               Router* router=new MeshRouter();
+               Router* router = new MeshRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -322,7 +336,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_DUMMY: {
-               Router* router=new DummyRouter();
+               Router* router = new DummyRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -330,7 +344,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_SAFEST: {
-               Router * router=new SafestPathRouter();
+               Router * router = new SafestPathRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -338,7 +352,7 @@ void Simulation::InitArgs(ArgumentParser* args)
                break;
           }
           case ROUTING_COGNITIVEMAP: {
-               Router* router=new CognitiveMapRouter();
+               Router* router = new CognitiveMapRouter();
                router->SetID(routerID);
                router->SetStrategy(strategy);
                routingEngine->AddRouter(router);
@@ -347,8 +361,8 @@ void Simulation::InitArgs(ArgumentParser* args)
           }
           case ROUTING_UNDEFINED:
           default:
-               cout<<"router not available"<<endl;
-               exit(EXIT_FAILURE);
+               cout << "router not available" << endl;
+               return false;
                break;
           }
      }
@@ -360,14 +374,20 @@ void Simulation::InitArgs(ArgumentParser* args)
      _building->SetProjectFilename(args->GetProjectFile());
      _building->SetProjectRootDir(args->GetProjectRootDir());
 
-     _building->LoadGeometry();
-     _building->LoadRoutingInfo(args->GetProjectFile());
+     if (!_building->LoadGeometry())
+          return false;
+
+     if (!_building->LoadRoutingInfo(args->GetProjectFile()))
+          return false;
      //_building->AddSurroundingRoom();
-     _building->InitGeometry(); // create the polygons
-     _building->LoadTrafficInfo();
 
+     if(!_building->InitGeometry())
+          return false; // create the polygons
+
+     if(!_building->LoadTrafficInfo())
+          return false;
 
-     _nPeds=_distribution->Distribute(_building);
+     _nPeds = _distribution->Distribute(_building);
 
      //using linkedcells
      if (args->GetLinkedCells()) {
@@ -378,31 +398,35 @@ void Simulation::InitArgs(ArgumentParser* args)
      }
 
      // initialize the routing engine before doing any other things
-     routingEngine->Init(_building);
+     if(routingEngine->Init(_building)==false)
+          return false;
 
      //perform customs initialisation, like computing the phi for the gcfm
      //this should be called after the routing engine has been initialised
      // because a direction is needed for this initialisation.
-     _operationalModel->Init(_building);
+     if(_operationalModel->Init(_building)==false)
+          return false;
 
      //other initializations
-     const vector< Pedestrian* >& allPeds = _building->GetAllPedestrians();
-     for(Pedestrian *ped: allPeds)
-        {
-         ped->Setdt(_deltaT);
-        }
+     const vector<Pedestrian*>& allPeds = _building->GetAllPedestrians();
+     for (Pedestrian *ped : allPeds) {
+          ped->Setdt(_deltaT);
+     }
      //pBuilding->WriteToErrorLog();
 
      //get the seed
-     _seed=args->GetSeed();
+     _seed = args->GetSeed();
 
      // perform a general check to the .
-     _building->SanityCheck();
+     if(_building->SanityCheck()==false)
+          return false;
+
      //size of the cells/GCFM/Gompertz
-     if(args->GetDistEffMaxPed()>args->GetLinkedCellSize()){
-          Log->Write("ERROR: the linked-cell size [%f] should be bigger than the force range [%f]",
-                  args->GetLinkedCellSize(),args->GetDistEffMaxPed());
-          exit(EXIT_FAILURE);
+     if (args->GetDistEffMaxPed() > args->GetLinkedCellSize()) {
+          Log->Write(
+                    "ERROR: the linked-cell size [%f] should be bigger than the force range [%f]",
+                    args->GetLinkedCellSize(), args->GetDistEffMaxPed());
+          return false;
      }
 
      //read the events
@@ -420,20 +444,22 @@ void Simulation::InitArgs(ArgumentParser* args)
      //((GPU_ocl_GCFMModel*) _model)->initCL(_building->GetNumberOfPedestrians());
      //}
      //_building->SaveGeometry("test.sav.xml");
-}
 
+     //everything went fine
+     return true;
+}
 
 int Simulation::RunSimulation()
 {
      int frameNr = 1; // Frame Number
      int writeInterval = (int) ((1. / _fps) / _deltaT + 0.5);
      writeInterval = (writeInterval <= 0) ? 1 : writeInterval; // mustn't be <= 0
-     double t=0.0;
+     double t = 0.0;
 
      // writing the header
-     _iod->WriteHeader(_nPeds, _fps, _building,_seed);
+     _iod->WriteHeader(_nPeds, _fps, _building, _seed);
      _iod->WriteGeometry(_building);
-     _iod->WriteFrame(0,_building);
+     _iod->WriteFrame(0, _building);
 
      //first initialisation needed by the linked-cells
      UpdateRoutesAndLocations();
@@ -444,29 +470,28 @@ int Simulation::RunSimulation()
      //time(&starttime);
 
      // main program loop
-     for (t = 0; t < _tmax && _nPeds > 0; ++frameNr)
-     {
+     for (t = 0; t < _tmax && _nPeds > 0; ++frameNr) {
           t = 0 + (frameNr - 1) * _deltaT;
 
           // update the positions
-          _operationalModel->ComputeNextTimeStep(t,_deltaT,_building);
+          _operationalModel->ComputeNextTimeStep(t, _deltaT, _building);
 
           // update the routes and locations
           //Update();
           UpdateRoutesAndLocations();
 
           //update the events
-          _em->Update_Events(t,_deltaT);
+          _em->Update_Events(t, _deltaT);
 
           //other updates
           //someone might have leave the building
-          _nPeds=_building->GetAllPedestrians().size();
+          _nPeds = _building->GetAllPedestrians().size();
 
           //update the linked cells
           _building->UpdateGrid();
 
           // update the global time
-           Pedestrian::SetGlobalTime(t);
+          Pedestrian::SetGlobalTime(t);
 
           // write the trajectories
           if (frameNr % writeInterval == 0) {
@@ -484,12 +509,13 @@ int Simulation::RunSimulation()
      _iod->WriteFooter();
 
      //if(_hpc==1)
-       //  ((GPU_GCFMModel*) _model)->DeleteBuffers();
+     //  ((GPU_GCFMModel*) _model)->DeleteBuffers();
 
      //temporary work around since the total number of frame is only available at the end of the simulation.
-     if(_argsParser->GetFileFormat()==FORMAT_XML_BIN) {
+     if (_argsParser->GetFileFormat() == FORMAT_XML_BIN) {
 
-          delete _iod;   _iod=NULL;
+          delete _iod;
+          _iod = NULL;
 
           // char tmp[CLENGTH];
           // int f= frameNr / writeInterval ;
@@ -498,16 +524,17 @@ int Simulation::RunSimulation()
 
           char replace[CLENGTH];
           // open the file and replace the 8th line
-          sprintf(replace,"sed -i '9s/.*/ %d /' %s", frameNr/ writeInterval, _argsParser->GetTrajectoriesFile().c_str());
-          int result=system(replace);
-          Log->Write("INFO:\t Updating the framenumber exits with code [%d]",result);
+          sprintf(replace, "sed -i '9s/.*/ %d /' %s", frameNr / writeInterval,
+                    _argsParser->GetTrajectoriesFile().c_str());
+          int result = system(replace);
+          Log->Write("INFO:\t Updating the framenumber exits with code [%d]",
+                    result);
      }
 
      //return the evacuation time
      return (int) t;
 }
 
-
 void Simulation::UpdateRoutesAndLocations()
 {
      //pedestrians to be deleted
@@ -516,8 +543,8 @@ void Simulation::UpdateRoutesAndLocations()
      pedsToRemove.reserve(100); //just reserve some space
 
      // collect all pedestrians in the simulation.
-     const vector< Pedestrian* >& allPeds = _building->GetAllPedestrians();
-     const map<int, Goal*>& goals=_building->GetAllGoals();
+     const vector<Pedestrian*>& allPeds = _building->GetAllPedestrians();
+     const map<int, Goal*>& goals = _building->GetAllGoals();
 
      unsigned int nSize = allPeds.size();
      int nThreads = omp_get_max_threads();
@@ -531,22 +558,19 @@ void Simulation::UpdateRoutesAndLocations()
           if ((threadID == nThreads - 1))
                end = nSize - 1;
 
-          for (int p = start; p <= end; ++p)
-          {
+          for (int p = start; p <= end; ++p) {
                Pedestrian* ped = allPeds[p];
                Room* room = _building->GetRoom(ped->GetRoomID());
                SubRoom* sub = room->GetSubRoom(ped->GetSubRoomID());
 
                //set the new room if needed
                if ((ped->GetFinalDestination() == FINAL_DEST_OUT)
-                         && (room->GetCaption() == "outside"))
-               {
+                         && (room->GetCaption() == "outside")) {
 #pragma omp critical
                     pedsToRemove.push_back(ped);
-               }
-               else if ((ped->GetFinalDestination() != FINAL_DEST_OUT)
-                         && (goals.at(ped->GetFinalDestination())->Contains(ped->GetPos())))
-               {
+               } else if ((ped->GetFinalDestination() != FINAL_DEST_OUT)
+                         && (goals.at(ped->GetFinalDestination())->Contains(
+                                   ped->GetPos()))) {
 #pragma omp critical
                     pedsToRemove.push_back(ped);
                }
@@ -554,18 +578,22 @@ void Simulation::UpdateRoutesAndLocations()
                // reposition in the case the pedestrians "accidently left the room" not via the intended exit.
                // That may happen if the forces are too high for instance
                // the ped is removed from the simulation, if it could not be reassigned
-               else if (!sub->IsInSubRoom(ped))
-               {
+               else if (!sub->IsInSubRoom(ped)) {
                     bool assigned = false;
-                    const std::vector<Room*>& allRooms=_building->GetAllRooms();
-                    for (Room* room : allRooms)
-                    {
-                         const vector<SubRoom*>& allSubs=room->GetAllSubRooms();
-                         for(SubRoom* sub : allSubs)
-                         {
-                              SubRoom* old_sub= allRooms[ped->GetRoomID()]->GetSubRoom(ped->GetSubRoomID());
-                              if ((sub->IsInSubRoom(ped->GetPos())) && (sub->IsDirectlyConnectedWith(old_sub))) {
-                                   ped->SetRoomID(room->GetID(), room->GetCaption());
+                    const std::vector<Room*>& allRooms =
+                              _building->GetAllRooms();
+                    for (Room* room : allRooms) {
+                         const vector<SubRoom*>& allSubs =
+                                   room->GetAllSubRooms();
+                         for (SubRoom* sub : allSubs) {
+                              SubRoom* old_sub =
+                                        allRooms[ped->GetRoomID()]->GetSubRoom(
+                                                  ped->GetSubRoomID());
+                              if ((sub->IsInSubRoom(ped->GetPos()))
+                                        && (sub->IsDirectlyConnectedWith(
+                                                  old_sub))) {
+                                   ped->SetRoomID(room->GetID(),
+                                             room->GetCaption());
                                    ped->SetSubRoomID(sub->GetSubRoomID());
                                    ped->ClearMentalMap(); // reset the destination
                                    //ped->FindRoute();
@@ -577,8 +605,7 @@ void Simulation::UpdateRoutesAndLocations()
                               break; // stop the loop
                     }
 
-                    if (assigned == false)
-                    {
+                    if (assigned == false) {
 #pragma omp critical
                          pedsToRemove.push_back(ped);
                     }
@@ -587,21 +614,21 @@ void Simulation::UpdateRoutesAndLocations()
                //finally actualize the route
                if (ped->FindRoute() == -1) {
                     //a destination could not be found for that pedestrian
-                    Log->Write("\tINFO: \tCould not found a route for pedestrian %d",ped->GetID());
+                    Log->Write(
+                              "\tINFO: \tCould not found a route for pedestrian %d",
+                              ped->GetID());
+                    //exit(EXIT_FAILURE);
 #pragma omp critical
                     pedsToRemove.push_back(ped);
                }
           }
      }
 
-
      // remove the pedestrians that have left the building
-     for (unsigned int p = 0; p < pedsToRemove.size(); p++)
-     {
+     for (unsigned int p = 0; p < pedsToRemove.size(); p++) {
           _building->DeletePedestrian(pedsToRemove[p]);
      }
 
-
      //    temporary fix for the safest path router
      //    if (dynamic_cast<SafestPathRouter*>(_routingEngine->GetRouter(1)))
      //    {
@@ -615,10 +642,13 @@ void Simulation::PrintStatistics()
      Log->Write("\nEXIT USAGE:");
      const map<int, Transition*>& transitions = _building->GetAllTransitions();
      map<int, Transition*>::const_iterator itr;
-     for(itr = transitions.begin(); itr != transitions.end(); ++itr) {
-          Transition* goal =  itr->second;
-          if(goal->IsExit()) {
-               Log->Write("Exit ID [%d] used by [%d] pedestrians. Last passing time [%0.2f] s",goal->GetID(),goal->GetDoorUsage(),goal->GetLastPassingTime());
+     for (itr = transitions.begin(); itr != transitions.end(); ++itr) {
+          Transition* goal = itr->second;
+          if (goal->IsExit()) {
+               Log->Write(
+                         "Exit ID [%d] used by [%d] pedestrians. Last passing time [%0.2f] s",
+                         goal->GetID(), goal->GetDoorUsage(),
+                         goal->GetLastPassingTime());
           }
      }
 }
diff --git a/Simulation.h b/Simulation.h
index 70baf07438acdf11fb1307b71a7dcf8c71493378..f7ecc01d7424e0f81368a47064e6d70e87c7b829 100644
--- a/Simulation.h
+++ b/Simulation.h
@@ -100,7 +100,7 @@ public:
     /**
      * Read parameters from the argument parser class.
      */
-    void InitArgs(ArgumentParser *args);
+    bool InitArgs(ArgumentParser *args);
 
     /**
      * @return the total simulated/evacuation time
diff --git a/events/EventManager.cpp b/events/EventManager.cpp
index e50425fab0d63b8e09c25095e4d27ca4006a435a..da3cadcb32396adc2611e31d19b45c3a5203e08b 100644
--- a/events/EventManager.cpp
+++ b/events/EventManager.cpp
@@ -22,10 +22,10 @@ EventManager::EventManager(Building *_b){
     _lastUpdateTime=0;
     _deltaT=0;
     if(!_file){
-        Log->Write("INFO:\tDatei events.txt nicht gefunden. Dynamisches Eventhandling nicht moeglich.");
+        Log->Write("INFO:\tFiles 'events.txt' missing. Realtime interaction with the simulation not possible.");
     }
     else{
-        Log->Write("INFO:\tDatei events.txt gefunden. Dynamisches Eventhandling moeglich.");
+        Log->Write("INFO:\tFile 'events.txt' will be monitored for new events.");
         _dynamic=true;
     }
 }
@@ -42,7 +42,7 @@ void EventManager::SetProjectRootDir(const std::string &filename){
 }
 
 void EventManager::readEventsXml(){
-     Log->Write("INFO: \tLooking for events");
+     Log->Write("INFO: \tLooking for pre-defined events in other files");
      //get the geometry filename from the project file
      TiXmlDocument doc(_projectFilename);
      if (!doc.LoadFile()){
@@ -97,16 +97,19 @@ void EventManager::readEventsXml(){
      Log->Write("INFO: \tEvents were read\n");
 }
 
-void EventManager::listEvents(){
-    if(_event_times.size()==0){
-        Log->Write("INFO: \tNo events in the events.xml");
-    }
-    else{
-        char buf[10],buf2[10];
-        for(unsigned int i=0;i<_event_times.size();i++){
-            sprintf(buf,"%f",_event_times[i]);
-            sprintf(buf2,"%d",_event_ids[i]);
-            Log->Write("INFO: \tAfter "+string(buf)+" sec: "+_event_types[i]+" "+string(buf2)+" "+_event_states[i]);
+void EventManager::listEvents()
+{
+    if (_event_times.size() == 0) {
+        //this notification was already printed ealier
+        //Log->Write("INFO: \tNo events in the events.xml");
+    } else {
+        char buf[10], buf2[10];
+        for (unsigned int i = 0; i < _event_times.size(); i++) {
+            sprintf(buf, "%f", _event_times[i]);
+            sprintf(buf2, "%d", _event_ids[i]);
+            Log->Write(
+                    "INFO: \tAfter " + string(buf) + " sec: " + _event_types[i]
+                            + " " + string(buf2) + " " + _event_states[i]);
         }
     }
 
diff --git a/general/Macros.h b/general/Macros.h
index 7049a89231005de0b6d2be318327004e476111c3..be6d113eb055c5eb2ce7d496d137b2e6042d00b3 100644
--- a/general/Macros.h
+++ b/general/Macros.h
@@ -162,4 +162,7 @@ template<typename A>
                return true;
           }
      }
+
+//another useful macro
+//#define UNUSED(expr) (void)(expr)
 #endif  /* _MACROS_H */
diff --git a/geometry/Building.cpp b/geometry/Building.cpp
index 39179b923b1b99ed4fc788bebd37864383027112..66a908685dd2057bba06711688ccb301bc7f57cf 100644
--- a/geometry/Building.cpp
+++ b/geometry/Building.cpp
@@ -259,7 +259,7 @@ void Building::AddSurroundingRoom()
 }
 
 
-void Building::InitGeometry()
+bool Building::InitGeometry()
 {
      Log->Write("INFO: \tInit Geometry");
      for (int i = 0; i < GetNumberOfRooms(); i++) {
@@ -284,7 +284,8 @@ void Building::InitGeometry()
                }
 
                // initialize the poly
-               s->ConvertLineToPoly(goals);
+               if(! s->ConvertLineToPoly(goals))
+                   return false;
                s->CalculateArea();
                goals.clear();
 
@@ -292,11 +293,14 @@ void Building::InitGeometry()
                const vector<Obstacle*>& obstacles = s->GetAllObstacles();
                for (unsigned int obs = 0; obs < obstacles.size(); ++obs) {
                     if (obstacles[obs]->GetClosed() == 1)
-                         obstacles[obs]->ConvertLineToPoly();
+                         if(!obstacles[obs]->ConvertLineToPoly())
+                             return false;
                }
           }
      }
      Log->Write("INFO: \tInit Geometry successful!!!\n");
+
+     return true;
 }
 
 
@@ -324,7 +328,7 @@ const std::string& Building::GetGeometryFilename() const
      return _geometryFilename;
 }
 
-void Building::LoadGeometry(const std::string &geometryfile)
+bool Building::LoadGeometry(const std::string &geometryfile)
 {
      //get the geometry filename from the project file
      string geoFilenameWithPath= _projectRootDir + geometryfile;
@@ -335,7 +339,7 @@ void Building::LoadGeometry(const std::string &geometryfile)
           if (!doc.LoadFile()) {
                Log->Write("ERROR: \t%s", doc.ErrorDesc());
                Log->Write("\t could not parse the project file");
-               exit(EXIT_FAILURE);
+               return false;
           }
 
           Log->Write("INFO: \tParsing the geometry file");
@@ -352,23 +356,23 @@ void Building::LoadGeometry(const std::string &geometryfile)
      if (!docGeo.LoadFile()) {
           Log->Write("ERROR: \t%s", docGeo.ErrorDesc());
           Log->Write("\t could not parse the geometry file");
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      TiXmlElement* xRootNode = docGeo.RootElement();
      if( ! xRootNode ) {
           Log->Write("ERROR:\tRoot element does not exist");
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      if( xRootNode->ValueStr () != "geometry" ) {
           Log->Write("ERROR:\tRoot element value is not 'geometry'.");
-          exit(EXIT_FAILURE);
+          return false;
      }
      if(xRootNode->Attribute("unit"))
           if(string(xRootNode->Attribute("unit")) != "m") {
                Log->Write("ERROR:\tOnly the unit m (meters) is supported. \n\tYou supplied [%s]",xRootNode->Attribute("unit"));
-               exit(EXIT_FAILURE);
+               return false;
           }
 
      double version = xmltof(xRootNode->Attribute("version"), -1);
@@ -377,7 +381,7 @@ void Building::LoadGeometry(const std::string &geometryfile)
           Log->Write(" \tWrong geometry version!");
           Log->Write(" \tOnly version >= %s supported",JPS_VERSION);
           Log->Write(" \tPlease update the version of your geometry file to %s",JPS_VERSION);
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      _caption = xmltoa(xRootNode->Attribute("caption"), "virtual building");
@@ -388,7 +392,7 @@ void Building::LoadGeometry(const std::string &geometryfile)
      TiXmlNode*  xRoomsNode = xRootNode->FirstChild("rooms");
      if (!xRoomsNode) {
           Log->Write("ERROR: \tThe geometry should have at least one room and one subroom");
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      for(TiXmlElement* xRoom = xRoomsNode->FirstChildElement("room"); xRoom;
@@ -431,7 +435,7 @@ void Building::LoadGeometry(const std::string &geometryfile)
                     if(xSubRoom->FirstChildElement("up")==NULL) {
                          Log->Write("ERROR:\t the attribute <up> and <down> are missing for the stair");
                          Log->Write("ERROR:\t check your geometry file");
-                         exit(EXIT_FAILURE);
+                         return false;
                     }
                     double up_x = xmltof( xSubRoom->FirstChildElement("up")->Attribute("px"), 0.0);
                     double up_y = xmltof( xSubRoom->FirstChildElement("up")->Attribute("py"), 0.0);
@@ -601,8 +605,10 @@ void Building::LoadGeometry(const std::string &geometryfile)
                AddTransition(t);
           }
 
-
      Log->Write("INFO: \tLoading building file successful!!!\n");
+
+     //everything went fine
+     return true;
 }
 
 
@@ -851,18 +857,21 @@ bool Building::IsVisible(const Point& p1, const Point& p2, bool considerHlines)
      return true;
 }
 
-void Building::SanityCheck()
+bool Building::SanityCheck()
 {
      Log->Write("INFO: \tChecking the geometry for artifacts");
+     bool status = true;
      for (unsigned int i = 0; i < _rooms.size(); i++) {
           Room* room = _rooms[i];
 
           for (int j = 0; j < room->GetNumberOfSubRooms(); j++) {
                SubRoom* sub = room->GetSubRoom(j);
-               sub->SanityCheck();
+               if (!sub->SanityCheck())
+                    status = false;
           }
      }
      Log->Write("INFO: \t...Done!!!\n");
+     return status;
 }
 
 
@@ -938,25 +947,25 @@ void Building::InitGrid(double cellSize)
      Log->Write("INFO: \tDone with Initializing the grid ");
 }
 
-void Building::LoadRoutingInfo(const string &filename)
+bool Building::LoadRoutingInfo(const string &filename)
 {
      Log->Write("INFO:\tLoading extra routing information");
      if (filename == "") {
           Log->Write("INFO:\t No file supplied !");
           Log->Write("INFO:\t done with loading extra routing information");
-          return;
+          return true;
      }
      TiXmlDocument docRouting(filename);
      if (!docRouting.LoadFile()) {
           Log->Write("ERROR: \t%s", docRouting.ErrorDesc());
           Log->Write("ERROR: \t could not parse the routing file");
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      TiXmlElement* xRootNode = docRouting.RootElement();
      if( ! xRootNode ) {
           Log->Write("ERROR:\tRoot element does not exist");
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      //load goals and routes
@@ -993,7 +1002,9 @@ void Building::LoadRoutingInfo(const string &filename)
                     }
                }
 
-               goal->ConvertLineToPoly();
+               if(!goal->ConvertLineToPoly())
+                   return false;
+
                AddGoal(goal);
                _routingEngine->AddFinalDestinationID(goal->GetId());
           }
@@ -1008,7 +1019,7 @@ void Building::LoadRoutingInfo(const string &filename)
                double id = xmltof(trip->Attribute("id"), -1);
                if (id == -1) {
                     Log->Write("ERROR:\t id missing for trip");
-                    exit(EXIT_FAILURE);
+                    return false;
                }
                string sTrip = trip->FirstChild()->ValueStr();
                vector<string> vTrip;
@@ -1023,9 +1034,10 @@ void Building::LoadRoutingInfo(const string &filename)
                _routingEngine->AddTrip(vTrip);
           }
      Log->Write("INFO:\tdone with loading extra routing information");
+     return true;
 }
 
-void Building::LoadTrafficInfo()
+bool Building::LoadTrafficInfo()
 {
 
      Log->Write("INFO:\tLoading  the traffic info file");
@@ -1035,14 +1047,13 @@ void Building::LoadTrafficInfo()
      if (!doc.LoadFile()) {
           Log->Write("ERROR: \t%s", doc.ErrorDesc());
           Log->Write("ERROR: \t could not parse the project file");
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      TiXmlNode* xRootNode = doc.RootElement()->FirstChild("traffic_constraints");
      if( ! xRootNode ) {
           Log->Write("WARNING:\tcould not find any traffic information");
-          return;
-          //exit(EXIT_FAILURE);
+          return true;
      }
 
      //processing the rooms node
@@ -1076,6 +1087,7 @@ void Building::LoadTrafficInfo()
                }
           }
      Log->Write("INFO:\tDone with loading traffic info file");
+     return true;
 }
 
 
diff --git a/geometry/Building.h b/geometry/Building.h
index d24f3614f90ef4b6463bc3b2b7a86af9daf7ebeb..006ae966b2d6c7aea56a18efc62f774ad002138e 100644
--- a/geometry/Building.h
+++ b/geometry/Building.h
@@ -163,7 +163,7 @@ public:
      LCGrid* GetGrid() const;
 
      // convenience methods
-     void InitGeometry();
+     bool InitGeometry();
      void InitGrid(double cellSize);
      //void InitRoomsAndSubroomsMap();
      void InitSavePedPathway(const std::string &filename);
@@ -193,7 +193,7 @@ public:
       *
       * @param filename, the geometry file
       */
-     void LoadGeometry(const std::string &geometryfile="");
+     bool LoadGeometry(const std::string &geometryfile="");
 
      /**
       * Write the geometry to the given file.
@@ -203,15 +203,15 @@ public:
       */
      bool SaveGeometry(const std::string &filename);
 
-     void LoadTrafficInfo();
-     void LoadRoutingInfo(const std::string &filename);
+     bool LoadTrafficInfo();
+     bool LoadRoutingInfo(const std::string &filename);
      void WriteToErrorLog() const;
 
      /**
       * Check the scenario for possible errors and
       * output user specific informations.
       */
-     void SanityCheck();
+     bool SanityCheck();
 
 
 private:
diff --git a/geometry/Goal.cpp b/geometry/Goal.cpp
index d352c255c9d05df363cc2529e8741632e5fad959..a2157819a0986f834920bb0c822049feac9bb44d 100644
--- a/geometry/Goal.cpp
+++ b/geometry/Goal.cpp
@@ -182,9 +182,8 @@ bool Goal::Contains(const Point& ped) const
           return false;
 }
 
-void Goal::ConvertLineToPoly()
+bool Goal::ConvertLineToPoly()
 {
-
      vector<Line*> copy;
      vector<Point> tmpPoly;
      Point point;
@@ -219,11 +218,11 @@ void Goal::ConvertLineToPoly()
           char tmp[CLENGTH];
           sprintf(tmp, "ERROR: \tGoal::ConvertLineToPoly(): ID %d !!!\n", _id);
           Log->Write(tmp);
-          exit(0);
+          return false;
      }
      _poly = tmpPoly;
-
      ComputeControid();
+     return true;
 }
 
 const Point& Goal::GetCentroid() const
diff --git a/geometry/Goal.h b/geometry/Goal.h
index 3f239a570368db0b277b29009e9e734bbb4ffa82..3fe6596f0883d589b238b74e97d6c5acbf7e9d42 100644
--- a/geometry/Goal.h
+++ b/geometry/Goal.h
@@ -90,7 +90,7 @@ public:
      /**
       * Create the obstacles polygonal structure from the walls
       */
-     void ConvertLineToPoly();
+     bool ConvertLineToPoly();
 
      /**
       * @return the Goal as a polygon
diff --git a/geometry/Obstacle.cpp b/geometry/Obstacle.cpp
index 59b6ecf8010dda17315b6bf5ff8ad2ddea96442a..93cd9a1b60f0df3a39732f37580c30d8b161bf9d 100644
--- a/geometry/Obstacle.cpp
+++ b/geometry/Obstacle.cpp
@@ -209,15 +209,16 @@ bool Obstacle::Contains(const Point& ped) const
           return false;
 }
 
-void Obstacle::ConvertLineToPoly()
+bool Obstacle::ConvertLineToPoly()
 {
-
-     if(_isClosed==0.0) {
+     if(_isClosed==0.0)
+     {
           char tmp[CLENGTH];
           sprintf(tmp, "INFO: \tObstacle [%d] is not closed. Not converting to polyline.\n", _id);
           Log->Write(tmp);
-          return;
+          return true;
      }
+
      vector<Line*> copy;
      vector<Point> tmpPoly;
      Point point;
@@ -252,9 +253,10 @@ void Obstacle::ConvertLineToPoly()
           char tmp[CLENGTH];
           sprintf(tmp, "ERROR: \tObstacle::ConvertLineToPoly(): ID %d !!!\n", _id);
           Log->Write(tmp);
-          exit(0);
+          return false;
      }
      _poly = tmpPoly;
+     return true;
 }
 
 const Point Obstacle::GetCentroid() const
diff --git a/geometry/Obstacle.h b/geometry/Obstacle.h
index 9dcbb3cda876386d0d49f8cc118d601c3c8e37c2..9302a9563d1c98ec1f5127487c2da81492cf1c31 100644
--- a/geometry/Obstacle.h
+++ b/geometry/Obstacle.h
@@ -112,7 +112,7 @@ public:
      /**
       * Create the obstacles polygonal structure from the walls
       */
-     void ConvertLineToPoly();
+     bool ConvertLineToPoly();
 
      /**
       * @return the obstacle as a polygon
diff --git a/geometry/SubRoom.cpp b/geometry/SubRoom.cpp
index 143d7e6f8da8f6549b7a876070dc826580d03ba7..557301e8f74228f429c7496090ebcf98a7270a8a 100644
--- a/geometry/SubRoom.cpp
+++ b/geometry/SubRoom.cpp
@@ -465,7 +465,7 @@ void SubRoom::CheckObstacles()
      }
 }
 
-void SubRoom::SanityCheck()
+bool SubRoom::SanityCheck()
 {
      if(_obstacles.size()==0) {
           if((IsConvex()==false) && (_hlines.size()==0)) {
@@ -482,7 +482,7 @@ void SubRoom::SanityCheck()
                // everything is fine
           }
      }
-
+     return true;
 }
 
 ///http://stackoverflow.com/questions/471962/how-do-determine-if-a-polygon-is-complex-convex-nonconvex
@@ -622,7 +622,7 @@ void NormalSubRoom::WriteToErrorLog() const
      }
 }
 
-void NormalSubRoom::ConvertLineToPoly(vector<Line*> goals)
+bool NormalSubRoom::ConvertLineToPoly(vector<Line*> goals)
 {
      vector<Line*> copy;
      vector<Point> tmpPoly;
@@ -664,9 +664,10 @@ void NormalSubRoom::ConvertLineToPoly(vector<Line*> goals)
           Log->Write(tmp);
           sprintf(tmp, "ERROR: \tDistance between the points: %lf !!!\n", (tmpPoly[0] - point).Norm());
           Log->Write(tmp);
-          exit(EXIT_FAILURE);
+          return false;
      }
      _poly = tmpPoly;
+     return true;
 }
 
 
@@ -866,11 +867,10 @@ const Point* Stair::CheckCorner(const Point** otherPoint, const Point** aktPoint
      return rueck;
 }
 
-void Stair::ConvertLineToPoly(vector<Line*> goals)
+bool Stair::ConvertLineToPoly(vector<Line*> goals)
 {
 
      //return NormalSubRoom::ConvertLineToPoly(goals);
-
      vector<Line*> copy;
      vector<Point> orgPoly = vector<Point > ();
      const Point* aktPoint;
@@ -924,7 +924,7 @@ void Stair::ConvertLineToPoly(vector<Line*> goals)
           sprintf(tmp, "ERROR: \tStair::ConvertLineToPoly(): SubRoom %d Room %d Anfangspunkt ungleich Endpunkt!!!\n"
                   "\t(%f, %f) != (%f, %f)\n", GetSubRoomID(), GetRoomID(), x1, y1, x2, y2);
           Log->Write(tmp);
-          exit(EXIT_FAILURE);
+          return false;
      }
 
      if (orgPoly.size() != 4) {
@@ -932,7 +932,7 @@ void Stair::ConvertLineToPoly(vector<Line*> goals)
           sprintf(tmp, "ERROR: \tStair::ConvertLineToPoly(): Stair %d Room %d ist kein Viereck!!!\n"
                   "Anzahl Ecken: %d\n", GetSubRoomID(), (int)GetRoomID(), (int)orgPoly.size());
           Log->Write(tmp);
-          exit(EXIT_FAILURE);
+          return false;
      }
      vector<Point> neuPoly = (orgPoly);
      // ganz kleine Treppen (nur eine Stufe) nicht
@@ -957,6 +957,8 @@ void Stair::ConvertLineToPoly(vector<Line*> goals)
           }
      }
      _poly = neuPoly;
+
+     return true;
 }
 
 bool Stair::IsInSubRoom(const Point& ped) const
diff --git a/geometry/SubRoom.h b/geometry/SubRoom.h
index 1087164160d37243005984bfe332794e32ecca9c..72e640e070e4f0e570d90863192ec659a27acdb4 100644
--- a/geometry/SubRoom.h
+++ b/geometry/SubRoom.h
@@ -237,7 +237,7 @@ public:
       * Check the subroom for possible errors and
       * output user specific informations.
       */
-     void SanityCheck();
+     bool SanityCheck();
 
      //navigation
      void AddCrossing(Crossing* line);
@@ -291,7 +291,7 @@ public:
      virtual std::string WritePolyLine() const=0;
 
      /// convert all walls and transitions(doors) into a polygon representing the subroom
-     virtual void ConvertLineToPoly(std::vector<Line*> goals) = 0;
+     virtual bool ConvertLineToPoly(std::vector<Line*> goals) = 0;
 
      ///check whether the pedestrians is still in the subroom
      virtual bool IsInSubRoom(const Point& ped) const = 0;
@@ -327,7 +327,7 @@ public:
      std::string WritePolyLine() const;
 
      void WriteToErrorLog() const;
-     void ConvertLineToPoly(std::vector<Line*> goals);
+     bool ConvertLineToPoly(std::vector<Line*> goals);
      bool IsInSubRoom(const Point& ped) const;
 };
 
@@ -362,7 +362,7 @@ public:
      std::string WriteSubRoom() const;
      std::string WritePolyLine() const;
      virtual void WriteToErrorLog() const;
-     virtual void ConvertLineToPoly(std::vector<Line*> goals);
+     virtual bool ConvertLineToPoly(std::vector<Line*> goals);
      bool IsInSubRoom(const Point& ped) const;
 };
 
diff --git a/main.cpp b/main.cpp
index ab63210d60b2063476df332519e16538d37e2af4..13380cb03a154d34cc330ab9b4b3b274f33f93cc 100644
--- a/main.cpp
+++ b/main.cpp
@@ -48,36 +48,38 @@ int main(int argc, char **argv)
      time(&starttime);
 
      Simulation sim = Simulation();
-     sim.InitArgs(args);
-     Log->Write("INFO: \tStart runSimulation()");
-     int evacTime = sim.RunSimulation();
-     Log->Write("\nINFO: \tEnd runSimulation()");
-     time(&endtime);
+     if(sim.InitArgs(args))
+     {
+          Log->Write("INFO: \tStart runSimulation()");
+          int evacTime = sim.RunSimulation();
+          Log->Write("\nINFO: \tEnd runSimulation()");
+          time(&endtime);
 
-     // some output
-     double execTime = difftime(endtime, starttime);
+          // some output
+          double execTime = difftime(endtime, starttime);
 
-     if (sim.GetPedsNumber())
-          Log->Write("\nPedestrians not evacuated [%d] using [%d] threads",
-                     sim.GetPedsNumber(),
-                     args->GetMaxOpenMPThreads());
+          if (sim.GetPedsNumber()) {
+               Log->Write("\nPedestrians not evacuated [%d] using [%d] threads",
+                         sim.GetPedsNumber(), args->GetMaxOpenMPThreads());
+          }
 
-     Log->Write("\nExec Time [s]   : %.2f", execTime);
-     Log->Write("Evac Time [s]     : %d", evacTime);
-     Log->Write("Realtime Factor   : %.2f X", evacTime / execTime);
-     Log->Write("Number of Threads : %d", args->GetMaxOpenMPThreads());
-     Log->Write("Warnings          : %d", Log->GetWarnings() );
-     Log->Write("Errors            : %d", Log->GetErrors() );
-     // sim.PrintStatistics();
-     if (NULL == dynamic_cast<STDIOHandler*>(Log)) {
-          printf("\nExec Time [s]     : %4.2f\n", execTime);
-          printf("Evac Time [s]       : %d\n", evacTime);
-          printf("Realtime Factor     : %.2f (X)\n", evacTime / execTime);
-          printf("Number of Threads   : %d\n", args->GetMaxOpenMPThreads());
-          printf("Warnings            : %d\n", Log->GetWarnings() );
-          printf("Errors              : %d\n", Log->GetErrors() );
-     }
+          Log->Write("\nExec Time [s]   : %.2f", execTime);
+          Log->Write("Evac Time [s]     : %d", evacTime);
+          Log->Write("Realtime Factor   : %.2f X", evacTime / execTime);
+          Log->Write("Number of Threads : %d", args->GetMaxOpenMPThreads());
+          Log->Write("Warnings          : %d", Log->GetWarnings());
+          Log->Write("Errors            : %d", Log->GetErrors());
 
+          // sim.PrintStatistics();
+          if (NULL == dynamic_cast<STDIOHandler*>(Log)) {
+               printf("\nExec Time [s]     : %4.2f\n", execTime);
+               printf("Evac Time [s]       : %d\n", evacTime);
+               printf("Realtime Factor     : %.2f (X)\n", evacTime / execTime);
+               printf("Number of Threads   : %d\n", args->GetMaxOpenMPThreads());
+               printf("Warnings            : %d\n", Log->GetWarnings());
+               printf("Errors              : %d\n", Log->GetErrors());
+          }
+     }
      // do the last cleaning
      delete args;
      delete Log;
diff --git a/math/GCFMModel.cpp b/math/GCFMModel.cpp
index 0e50dbdd9b1b748dc2a5f544adcf0d138554faeb..f90a201592b1602e94925f6c67ca3af0358c1d39 100644
--- a/math/GCFMModel.cpp
+++ b/math/GCFMModel.cpp
@@ -69,7 +69,7 @@ GCFMModel::~GCFMModel(void)
 }
 
 
-void GCFMModel::Init (Building* building) const
+bool GCFMModel::Init (Building* building) const
 {
     const vector< Pedestrian* >& allPeds = building->GetAllPedestrians();
     for(unsigned int p=0;p<allPeds.size();p++)
@@ -95,7 +95,7 @@ void GCFMModel::Init (Building* building) const
               Log->Write(
                    "ERROR: \allPeds::Init() cannot initialise phi! "
                    "dist to target is 0\n");
-              exit(EXIT_FAILURE);
+              return false;
          }
 
          JEllipse E = ped->GetEllipse();
@@ -103,6 +103,7 @@ void GCFMModel::Init (Building* building) const
          E.SetSinPhi(sinPhi);
          ped->SetEllipse(E);
     }
+    return true;
 }
 
 void GCFMModel::ComputeNextTimeStep(double current, double deltaT, Building* building) const
@@ -628,14 +629,3 @@ string GCFMModel::GetDescription() const
 
      return rueck;
 }
-
-
-
-/**
- * implementation of Linked-cell combined with openMP
- */
-
-void GCFMModel::CalculateForce(double time, double tip1, Building* building) const
-{
-     
-}
diff --git a/math/GCFMModel.h b/math/GCFMModel.h
index f162d16ab179cc0923dda3d583e3076fc520060e..414f8c8448a2320a69334d24c65cd8dac90b496f 100644
--- a/math/GCFMModel.h
+++ b/math/GCFMModel.h
@@ -64,10 +64,16 @@ public:
     double GetDistEffMaxPed() const;
     double GetDistEffMaxWall() const;
 
-    // virtual function
+    /**
+     * Compute the next simulation step
+     * Solve the differential equations and update the positions and velocities
+     * @param current the actual time
+     * @param deltaT the next timestep
+     * @param building the geometry object
+     */
     virtual void ComputeNextTimeStep(double current, double deltaT, Building* building) const;
     virtual std::string GetDescription() const;
-    virtual void Init (Building* building) const;
+    virtual bool Init (Building* building) const;
 
 private:
     /// define the strategy for crossing a door (used for calculating the driving force)
@@ -116,15 +122,6 @@ private:
     Point ForceRepStatPoint(Pedestrian* ped, const Point& p, double l, double vn) const;
     Point ForceInterpolation(double v0, double K_ij, const Point& e, double v, double d, double r, double l) const;
 
-    /**
-     * Calculate the forces and update the pedestrians position and velocities
-     * @param t
-     * @param tp
-     * @param building
-     */
-    void CalculateForce(double t, double tp, Building* building) const;
-
-
 };
 
 
diff --git a/math/GompertzModel.cpp b/math/GompertzModel.cpp
index f0936f73fb5f9b699259c0b0685b88948931447c..499da26fc129c7de5d1b772cdd43a3fe27c81c3a 100644
--- a/math/GompertzModel.cpp
+++ b/math/GompertzModel.cpp
@@ -72,7 +72,7 @@ GompertzModel::~GompertzModel()
 
 }
 
-void GompertzModel::Init (Building* building) const
+bool GompertzModel::Init (Building* building) const
 {
     const vector< Pedestrian* >& allPeds = building->GetAllPedestrians();
 
@@ -99,7 +99,7 @@ void GompertzModel::Init (Building* building) const
               Log->Write(
                    "ERROR: \allPeds::Init() cannot initialise phi! "
                    "dist to target is 0\n");
-              exit(EXIT_FAILURE);
+              return false;
          }
 
          JEllipse E = ped->GetEllipse();
@@ -107,6 +107,7 @@ void GompertzModel::Init (Building* building) const
          E.SetSinPhi(sinPhi);
          ped->SetEllipse(E);
     }
+    return true;
 }
 
 void GompertzModel::ComputeNextTimeStep(double current, double deltaT, Building* building) const
@@ -123,7 +124,7 @@ void GompertzModel::ComputeNextTimeStep(double current, double deltaT, Building*
      int partSize;
      partSize = (int) (nSize / nThreads);
 
-      int debugPed = -69;//10;
+      //int debugPed = -69;//10;
       //building->GetGrid()->HighlightNeighborhood(debugPed, building);
 
 
@@ -482,10 +483,6 @@ Point GompertzModel::ForceRepWall(Pedestrian* ped, const Wall& w) const
      return F_wrep;
 }
 
-void GompertzModel::CalculateForce(double time, double tip1, Building* building) const
-{
-
-}
 string GompertzModel::GetDescription() const
 {
      string rueck;
@@ -500,6 +497,7 @@ string GompertzModel::GetDescription() const
      rueck.append(tmp);
      return rueck;
 }
+
 DirectionStrategy* GompertzModel::GetDirection() const
 {
      return _direction;
diff --git a/math/GompertzModel.h b/math/GompertzModel.h
index 5b3d867b3969aa1d07c9566f19fecfc37a4e98c0..f2a1df18309531724785d830d669bae10487ea1e 100644
--- a/math/GompertzModel.h
+++ b/math/GompertzModel.h
@@ -163,14 +163,6 @@ public:
       */
      double GetcWall() const;
 
-     /**
-      * Solve the differential equations and update the positions and velocities
-      * @param t the actual time
-      * @param tp the next timestep
-      * @param building the geometry object
-      */
-     virtual void CalculateForce(double t, double tp, Building* building) const;
-
      /**
       * @return all model parameters in a nicely formatted string
       */
@@ -180,10 +172,14 @@ public:
       * initialize the phi angle
       * @param building
       */
-     virtual void Init (Building* building) const;
+     virtual bool Init (Building* building) const;
 
      /**
       * Compute the next simulation step
+      * Solve the differential equations and update the positions and velocities
+      * @param current the actual time
+      * @param deltaT the next timestep
+      * @param building the geometry object
       */
      virtual void ComputeNextTimeStep(double current, double deltaT, Building* building) const;
 };
diff --git a/math/OperationalModel.h b/math/OperationalModel.h
index 91a0a34812b4316e92edda3253fd340e2ea756e7..c862cc51a9442d9b56b154dcc4827184c4c7324e 100644
--- a/math/OperationalModel.h
+++ b/math/OperationalModel.h
@@ -52,8 +52,9 @@ public:
       * Performs whatever initialization is needed/required.
       * This function is called at the beginning the simulation once.
       * @param building, the building object
+      * return the status of the initialisation
       */
-     virtual void Init (Building* building) const = 0;
+     virtual bool Init (Building* building) const = 0;
 
      /**
       * @return a description of the model possibly with all model parameters in a nicely formatted string
diff --git a/pedestrian/Pedestrian.cpp b/pedestrian/Pedestrian.cpp
index eef897c4b4d0a060bc195fe8df13308827031200..936dfc85af8ed4977db4193e351b418da8f20324 100644
--- a/pedestrian/Pedestrian.cpp
+++ b/pedestrian/Pedestrian.cpp
@@ -439,7 +439,7 @@ double Pedestrian::GetTimeInJam() const
 
 void Pedestrian::SetSmoothTurning(bool smt)
 {
-     _newOrientationDelay = 0;
+    _newOrientationDelay = 0;
 }
 
 
diff --git a/routing/CognitiveMapRouter.cpp b/routing/CognitiveMapRouter.cpp
index 7b2ef03d4b7b2e50c62731c5f489131b1dd2ada9..18e62ac6d980f8af0e15b46afb29fd1afb4f662d 100644
--- a/routing/CognitiveMapRouter.cpp
+++ b/routing/CognitiveMapRouter.cpp
@@ -107,7 +107,7 @@ void CognitiveMapRouter::CheckAndInitPedestrian(Pedestrian * p)
 }
 
 
-void CognitiveMapRouter::Init(Building * b)
+bool CognitiveMapRouter::Init(Building * b)
 {
      Log->Write("INFO:\tInit the Cognitive Map  Router Engine");
      building = b;
@@ -118,4 +118,5 @@ void CognitiveMapRouter::Init(Building * b)
      //Init Sensor Manager
      sensor_manager = SensorManager::InitWithAllSensors(b, cm_storage);
      Log->Write("INFO:\tInitialized SensorManager");
+     return true;
 }
diff --git a/routing/CognitiveMapRouter.h b/routing/CognitiveMapRouter.h
index 75b98805faa9bf086d524a0a8d305482bdc0d552..922d8d9623e5a58bd26e9db203a89c6ad87cd6bc 100644
--- a/routing/CognitiveMapRouter.h
+++ b/routing/CognitiveMapRouter.h
@@ -51,7 +51,7 @@ public:
      virtual ~CognitiveMapRouter();
 
      virtual int FindExit(Pedestrian* p);
-     virtual void Init(Building* b);
+     virtual bool Init(Building* b);
 
 protected:
      void CheckAndInitPedestrian(Pedestrian *);
diff --git a/routing/DirectionStrategy.cpp b/routing/DirectionStrategy.cpp
index 6e5c55a8229445510fb0e40ac1a04a8feb00dfae..a9138362be77e91c3c97ed4c86e1ecc3fba27422 100644
--- a/routing/DirectionStrategy.cpp
+++ b/routing/DirectionStrategy.cpp
@@ -46,11 +46,13 @@ DirectionStrategy::~DirectionStrategy()
 /// 1
 Point DirectionMiddlePoint::GetTarget(Room* room, Pedestrian* ped) const
 {
-     return (ped->GetExitLine()->GetPoint1() + ped->GetExitLine()->GetPoint2())*0.5;
+    (void)room; // suppress the unused warning
+    return (ped->GetExitLine()->GetPoint1() + ped->GetExitLine()->GetPoint2())*0.5;
 }
 /// 2
 Point DirectionMinSeperationShorterLine::GetTarget(Room* room, Pedestrian* ped) const
 {
+    (void)room; // suppress the unused warning
 
      double d = ped->GetEllipse().GetBmin() + 0.1 ; // shoulder//0.5;
      const Point& p1 = ped->GetExitLine()->GetPoint1();
@@ -81,35 +83,37 @@ Point DirectionMinSeperationShorterLine::GetTarget(Room* room, Pedestrian* ped)
 /// 3
 Point DirectionInRangeBottleneck::GetTarget(Room* room, Pedestrian* ped) const
 {
-     const Point& p1 = ped->GetExitLine()->GetPoint1();
-     const Point& p2 = ped->GetExitLine()->GetPoint2();
-     Line ExitLine = Line(p1, p2);
-     Point Lot = ExitLine.LotPoint( ped->GetPos() );
-     Point ExitMiddle = (p1+p2)*0.5;
-     double d = 0.2;
-     Point diff = (p1 - p2).Normalized() * d;
-     Line e_neu = Line(p1 - diff, p2 + diff);
-
-     if(ped->GetID() == -10)
-     {
-      printf("=======\nX=[%.2f], Y=[%.2f]\n", ped->GetPos().GetX(), ped->GetPos().GetY());
-          printf("p1=[%.2f, %.2f], p2=[%.2f, %.2f]\n", p1.GetX(), p1.GetY(), p2.GetX(), p2.GetY());
-          printf("e_neu=[%.2f, %.2f]===[%.2f, %.2f]\n", e_neu.GetPoint1().GetX(), e_neu.GetPoint1().GetY(), e_neu.GetPoint2().GetX(), e_neu.GetPoint2().GetY() );
-     }
-
-     if ( e_neu.IsInLineSegment(Lot) ) {
-          if(ped->GetID() == -10){
-          printf("Return Lot=[%.2f, %.2f]\n", Lot.GetX(), Lot.GetY() );
-          if(0 && ped->GetPos().GetX() > 56)
-               getc(stdin);}
-          return Lot;
-     } else {
-          if(ped->GetID() == -10){
-          printf("Return Middle=[%.2f, %.2f]\n", ExitMiddle.GetX(), ExitMiddle.GetY() );
-          if(0 && ped->GetPos().GetX() > 56)
-               getc(stdin);}
-          return ExitMiddle;
-     }
+   (void)room; // suppress the unused warning
+
+    const Point& p1 = ped->GetExitLine()->GetPoint1();
+    const Point& p2 = ped->GetExitLine()->GetPoint2();
+    Line ExitLine = Line(p1, p2);
+    Point Lot = ExitLine.LotPoint( ped->GetPos() );
+    Point ExitMiddle = (p1+p2)*0.5;
+    double d = 0.2;
+    Point diff = (p1 - p2).Normalized() * d;
+    Line e_neu = Line(p1 - diff, p2 + diff);
+
+    if(ped->GetID() == -10)
+    {
+        printf("=======\nX=[%.2f], Y=[%.2f]\n", ped->GetPos().GetX(), ped->GetPos().GetY());
+        printf("p1=[%.2f, %.2f], p2=[%.2f, %.2f]\n", p1.GetX(), p1.GetY(), p2.GetX(), p2.GetY());
+        printf("e_neu=[%.2f, %.2f]===[%.2f, %.2f]\n", e_neu.GetPoint1().GetX(), e_neu.GetPoint1().GetY(), e_neu.GetPoint2().GetX(), e_neu.GetPoint2().GetY() );
+    }
+
+    if ( e_neu.IsInLineSegment(Lot) ) {
+        if(ped->GetID() == -10){
+            printf("Return Lot=[%.2f, %.2f]\n", Lot.GetX(), Lot.GetY() );
+            if(0 && ped->GetPos().GetX() > 56)
+                getc(stdin);}
+        return Lot;
+    } else {
+        if(ped->GetID() == -10){
+            printf("Return Middle=[%.2f, %.2f]\n", ExitMiddle.GetX(), ExitMiddle.GetY() );
+            if(0 && ped->GetPos().GetX() > 56)
+                getc(stdin);}
+        return ExitMiddle;
+    }
 
 }
 
diff --git a/routing/DummyRouter.cpp b/routing/DummyRouter.cpp
index 155d42a421e23bd686f4e9658b8fd1e509668793..2b168d9d2711ca55c226597f9d5a9f143ca42642 100644
--- a/routing/DummyRouter.cpp
+++ b/routing/DummyRouter.cpp
@@ -47,7 +47,7 @@ int DummyRouter::FindExit(Pedestrian* p)
      return 1;
 }
 
-void DummyRouter::Init(Building* b)
+bool DummyRouter::Init(Building* b)
 {
      _building=b;
      Log->Write("ERROR: \tdo not use this  <<Dummy>> router !!");
@@ -68,6 +68,7 @@ void DummyRouter::Init(Building* b)
 //              iter->second->WriteToErrorLog();
 //      }
 //      exit(EXIT_FAILURE);
+     return true;
 }
 
 
diff --git a/routing/DummyRouter.h b/routing/DummyRouter.h
index ea2664ef54727496a633a1f65aa03a04456a319c..cfc2554db2d2269f1bb630979145acb4bea8d10b 100644
--- a/routing/DummyRouter.h
+++ b/routing/DummyRouter.h
@@ -42,7 +42,7 @@ public:
      virtual ~DummyRouter();
 
      virtual int FindExit(Pedestrian* p);
-     virtual void Init(Building* b);
+     virtual bool Init(Building* b);
 
 };
 
diff --git a/routing/GlobalRouter.cpp b/routing/GlobalRouter.cpp
index 4379718602396d73cb88e27c973c1c7420c85e01..787acd083b0f5694515a59bb76acb805e6066f4d 100644
--- a/routing/GlobalRouter.cpp
+++ b/routing/GlobalRouter.cpp
@@ -82,7 +82,7 @@ GlobalRouter::~GlobalRouter()
      _accessPoints.clear();
 }
 
-void GlobalRouter::Init(Building* building)
+bool GlobalRouter::Init(Building* building)
 {
 
     //necessary if the init is called several times during the simulation
@@ -471,6 +471,8 @@ void GlobalRouter::Init(Building* building)
      //WriteGraphGV("routing_graph.gv",1,rooms);
      Log->Write("INFO:\tDone with the Global Router Engine!");
      //exit(0);
+
+     return true;
 }
 
 void GlobalRouter::Reset(){
diff --git a/routing/GlobalRouter.h b/routing/GlobalRouter.h
index a3d9dd673859885a8348ad9c0334cc6bab8f39a3..d39c8b3744d8fae63f3c6c19ded6fb52ba994f63 100644
--- a/routing/GlobalRouter.h
+++ b/routing/GlobalRouter.h
@@ -2,7 +2,7 @@
  * \file        GlobalRouter.h
  * \date        Dec 15, 2010
  * \version     v0.5
- * \copyright   <2009-2014> Forschungszentrum J�lich GmbH. All rights reserved.
+ * \copyright   <2009-2014> Forschungszentrum J�lich GmbH. All rights reserved.
  *
  * \section License
  * This file is part of JuPedSim.
@@ -62,7 +62,7 @@ public:
       */
      virtual ~GlobalRouter();
 
-     virtual void Init(Building* building);
+     virtual bool Init(Building* building);
 
 
      virtual int FindExit(Pedestrian* p);
diff --git a/routing/GraphRouter.cpp b/routing/GraphRouter.cpp
index 0862429f2d4b2119607c0d7b3137ac44b4ceed5b..2845ec8298fe0fab6cfe756534992a9fc3699b49 100644
--- a/routing/GraphRouter.cpp
+++ b/routing/GraphRouter.cpp
@@ -142,9 +142,10 @@ int GraphRouter::FindExit(Pedestrian* p)
      }
 }
 
-void GraphRouter::Init(Building* b)
+bool GraphRouter::Init(Building* b)
 {
-     GlobalRouter::Init(b);
+     if(GlobalRouter::Init(b)==false)
+          return false;
 
      Log->Write("ERROR: GRAPHROUTER  is not ready to use yet.");
      _building = b;
@@ -154,4 +155,5 @@ void GraphRouter::Init(Building* b)
      //        b->GetTransition("200E Normal Exit E3")->Close();
 
      //std::cout <<  b->GetTransition("200E Normal Exit E3")->IsOpen() << std::endl;
+     return true;
 }
diff --git a/routing/GraphRouter.h b/routing/GraphRouter.h
index 710f04e2a1140b83a8d6319e713b1154a13e41a9..249de23f89d13fff61d8f1e5fbc1289e1510546e 100644
--- a/routing/GraphRouter.h
+++ b/routing/GraphRouter.h
@@ -40,7 +40,7 @@ public:
      virtual ~GraphRouter();
 
      virtual int FindExit(Pedestrian* p);
-     virtual void Init(Building* b);
+     virtual bool Init(Building* b);
 
 private:
      RoutingGraphStorage g;
diff --git a/routing/MeshRouter.cpp b/routing/MeshRouter.cpp
index 726e1cc681dd9d84b86c8a84e687e208403b9248..b2f8d43408fca52a5a36a47eb809670c992f7699 100644
--- a/routing/MeshRouter.cpp
+++ b/routing/MeshRouter.cpp
@@ -845,7 +845,7 @@ void MeshRouter::FixMeshEdges()
      }
 }
 
-void MeshRouter::Init(Building* b)
+bool MeshRouter::Init(Building* b)
 {
      _building=b;
      //Log->Write("WARNING: \tdo not use this  <<Mesh>>  router !!");
@@ -955,6 +955,7 @@ void MeshRouter::Init(Building* b)
      }
      _meshdata=new MeshData(nodes,edges,outedges,mCellGroups);
      FixMeshEdges();
+     return true;
 }
 
 void MeshRouter::WriteMeshToFile(const string& filename)
diff --git a/routing/MeshRouter.h b/routing/MeshRouter.h
index 6e10b5ed0e9809304f6b8dc184a94d537af2cf65..e8f80a4274c96a4b53454c855042dc8860020eaf 100644
--- a/routing/MeshRouter.h
+++ b/routing/MeshRouter.h
@@ -51,7 +51,7 @@ public:
      virtual ~MeshRouter();
 
      virtual int FindExit(Pedestrian* p);
-     virtual void Init(Building* b);
+     virtual bool Init(Building* b);
 
 };
 
diff --git a/routing/QuickestPathRouter.cpp b/routing/QuickestPathRouter.cpp
index 3f7fb6184909bb5e0c6da365e99754e0b4441635..535e254d65c5ca0a3c780d2d2a3f33ad57c77104 100644
--- a/routing/QuickestPathRouter.cpp
+++ b/routing/QuickestPathRouter.cpp
@@ -294,13 +294,14 @@ double QuickestPathRouter::gain(double time)
 }
 
 
-void QuickestPathRouter::Init(Building* building)
+bool QuickestPathRouter::Init(Building* building)
 {
      Log->Write("INFO:\tInit Quickest Path Router Engine");
 
      // prefer path through corridors to path through rooms
      SetEdgeCost(10.0);
-     GlobalRouter::Init(building);
+     if (GlobalRouter::Init(building) == false)
+          return false;
 
      // activate the spotlight for tracking some pedestrians
      //Pedestrian::ActivateSpotlightSystem(true);
@@ -313,6 +314,7 @@ void QuickestPathRouter::Init(Building* building)
      //DumpAccessPoints(1185);
      //exit(0);
      Log->Write("INFO:\tDone with Quickest Path Router Engine!");
+     return true;
 }
 
 void QuickestPathRouter::SelectReferencePedestrian(Pedestrian* myself, Pedestrian** myref, double jamThreshold, int exitID, int* flag)
diff --git a/routing/QuickestPathRouter.h b/routing/QuickestPathRouter.h
index c9367dad604b399fd789b7ff467134fa4fb5be05..84eeef8b5bae1c88c5facec580253af56c2fb681 100644
--- a/routing/QuickestPathRouter.h
+++ b/routing/QuickestPathRouter.h
@@ -54,7 +54,7 @@ public:
 
      virtual int FindExit(Pedestrian* ped);
 
-     virtual void Init(Building* building);
+     virtual bool Init(Building* building);
 
 private:
 
diff --git a/routing/Router.h b/routing/Router.h
index 944352c5b167729bc364b0e62a1b2f163b4a2019..533e9cbb2665f432ecf35df6f50d8f9ea45fb5d1 100644
--- a/routing/Router.h
+++ b/routing/Router.h
@@ -129,7 +129,7 @@ public:
       * its Routing engine using the supplied building object.
       * @param b the building object
       */
-     virtual void Init(Building* b) = 0;
+     virtual bool Init(Building* b) = 0;
 
 
 };
diff --git a/routing/RoutingEngine.cpp b/routing/RoutingEngine.cpp
index 3b7d6ee78b455a394e7058ac38fea3b29add4b18..d89ded400ed505d7996b791457f2c2e71ca92628 100644
--- a/routing/RoutingEngine.cpp
+++ b/routing/RoutingEngine.cpp
@@ -107,9 +107,12 @@ void RoutingEngine::AddTrip(vector<string> trip)
      _tripsCollection.push_back(trip);
 }
 
-void RoutingEngine::Init(Building* building)
+bool RoutingEngine::Init(Building* building)
 {
+     bool status=true;
      for(unsigned int r=0; r<_routersCollection.size(); r++) {
-          _routersCollection[r]->Init(building);
+          if(_routersCollection[r]->Init(building)==false)
+               status=false;
      }
+     return status;
 }
diff --git a/routing/RoutingEngine.h b/routing/RoutingEngine.h
index 5ff08286ede2149c3826f95014a89d5fe5e671d0..4602d6ff58a83948d6023a890c398ecf783f06bc 100644
--- a/routing/RoutingEngine.h
+++ b/routing/RoutingEngine.h
@@ -95,8 +95,9 @@ public:
      /**
       * Initialize all routers with the current building object
       * @param building
+      * @return the status of the initialisation
       */
-     void Init(Building* building);
+     bool Init(Building* building);
 
 private:
      /// collections of all routers used
diff --git a/routing/SafestPathRouter.cpp b/routing/SafestPathRouter.cpp
index 75820fe21132ee61e9d1c8a4884aa0e576388f9d..2d674f5bd3de840b34fe40ed954eb62b1d90da9d 100644
--- a/routing/SafestPathRouter.cpp
+++ b/routing/SafestPathRouter.cpp
@@ -87,11 +87,12 @@ SafestPathRouter::~SafestPathRouter()
      delete dFinalLineEvac;
 }
 
-void SafestPathRouter::Init(Building* building)
+bool SafestPathRouter::Init(Building* building)
 {
      //Load the FDS file info
      //handle over to the global router engine
-     GlobalRouter::Init(building);
+     if(GlobalRouter::Init(building)==false)
+          return false;
 
 
      for (int i = 0; i < _building->GetNumberOfRooms(); i++) {
@@ -150,6 +151,8 @@ void SafestPathRouter::Init(Building* building)
      //cout << rR[i] << " ";
 
      //}
+
+     return true;
 }
 
 
@@ -493,7 +496,8 @@ void SafestPathRouter::ReadMatrixFromFDS()
 
 void SafestPathRouter::GetHline(Building* building)
 {
-
+    //suppress the unused warning
+(void)building;
      /*
 
      //              cout << dFinalLineEvac[j]<< " ";
diff --git a/routing/SafestPathRouter.h b/routing/SafestPathRouter.h
index 9a1210aac87368812d4cc5f719850be5087ee69e..d41afe7a98f0397f04b19828f62065906ea5599a 100644
--- a/routing/SafestPathRouter.h
+++ b/routing/SafestPathRouter.h
@@ -46,8 +46,7 @@ public:
       * Load the fds simulation file and preprocess the input,
       * before calling the Init from the Global RouterEngine
       */
-     virtual void Init(Building* building);
-
+     virtual bool Init(Building* building);
 
      /**
       * Bypass using
diff --git a/routing/graph/RoutingGraph.cpp b/routing/graph/RoutingGraph.cpp
index 6dbdd65a86f97297406255d328df1c2619faadaa..c0d097704537719c70deaa5308f4cb204d8e0187 100644
--- a/routing/graph/RoutingGraph.cpp
+++ b/routing/graph/RoutingGraph.cpp
@@ -199,7 +199,7 @@ RoutingGraph * RoutingGraph::BuildGraph()
      }
      //print();
      return this;
-};
+}
 
 /**
  * RoutingGraph::addVertex(NavLine * nav_line)
@@ -316,7 +316,7 @@ void RoutingGraph::addEdge(Vertex * v1, Vertex * v2, SubRoom* sub)
           v1->edges[v2->id] = new_edge;
      }
 
-};
+}
 
 bool RoutingGraph::checkVisibility(Line* l1, Line* l2, SubRoom* sub)
 {
@@ -479,7 +479,7 @@ void RoutingGraph::print()
 map <int, Vertex> * RoutingGraph::GetAllVertexes()
 {
      return  &vertexes;
-};
+}
 
 
 Vertex * RoutingGraph::GetVertex(int id)
@@ -491,7 +491,7 @@ Vertex * RoutingGraph::GetVertex(int id)
      } else {
           return NULL;
      }
-};
+}
 
 /****************************************
  * Class Vertex