[pgrouting] 01/11: Imported Upstream version 2.2.0

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Fri Apr 8 01:18:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pgrouting.

commit b0220e9e66e75229b2d844bb8cc6eb2f9509c8fb
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu Apr 7 16:20:40 2016 +0200

    Imported Upstream version 2.2.0
---
 .github/ISSUE_TEMPLATE.md                          |    15 +
 .github/PULL_REQUEST_TEMPLATE.md                   |     8 +
 .gitignore                                         |     1 +
 .travis.yml                                        |    85 +-
 CMakeLists.txt                                     |   187 +-
 NEWS                                               |    31 +
 README.md                                          |    41 +-
 VERSION                                            |     2 +-
 appveyor.yml                                       |    76 +
 cmake/CMakeParseArguments.cmake.back               |   138 +
 cmake/FindPackageHandleStandardArgs.cmake.back     |   325 +
 cmake/FindPackageMessage.cmake.back                |    49 +
 cmake/FindPostGIS.cmake                            |    52 +
 cmake/MacroLibrary.cmake.back                      |    22 +
 doc/conf.py.in                                     |    17 +-
 doc/deprecated.rst                                 |    69 +
 doc/index.rst                                      |   187 +-
 doc/index_man.rst                                  |    89 -
 doc/src/changelog/2_2_0.rst                        |    59 +
 doc/src/changelog/index.rst                        |     8 +-
 doc/src/developer/developer_guide.rst              |   176 +
 doc/src/developer/discontinued.rst                 |     6 +-
 doc/src/developer/images/Fig1-originalData.png     |   Bin 0 -> 88031 bytes
 .../src/developer}/images/Fig2-cost.png            |   Bin
 .../src/developer}/images/Fig4-costUndirected.png  |   Bin
 .../src/developer}/images/Fig6-undirected.png      |   Bin
 doc/src/developer/index.rst                        |   189 -
 doc/src/developer/sampledata.rst                   |   118 +-
 doc/src/installation/build.rst                     |     9 +-
 doc/src/installation/index.rst                     |   136 -
 doc/src/installation/install-dependencies.rst      |   157 +
 doc/src/installation/installation.rst              |   165 +
 doc/src/introduction/index.rst                     |    26 -
 doc/src/introduction/introduction.rst              |    26 +-
 doc/src/introduction/support.rst                   |     5 +-
 doc/src/recipes/test/example_recipe.test.sql       |     3 +-
 doc/src/recipes/test/parallel_handling.result      |     9 -
 doc/src/recipes/test/parallel_handling.test.sql    |     3 +
 doc/src/recipes/test/test.conf                     |     1 -
 .../recipes/test/zzz-remove_sampledata.test.sql    |     3 +-
 doc/src/tutorial/custom_wrapper.rst                |    27 -
 doc/src/tutorial/tutorial.rst                      |    58 +-
 doc/static/images/favicon.ico                      |   Bin 0 -> 1406 bytes
 doc/test/alphashape-any.test.sql                   |    24 -
 doc/test/analyzeGraph-any.result                   |   378 -
 doc/test/analyzeGraph-any.test.sql                 |    51 -
 doc/test/analyzeOneway-any.test.sql                |    11 -
 doc/test/apspJohnson-any.result                    |    10 -
 doc/test/apspJohnson-any.test.sql                  |     9 -
 doc/test/apspWarshall-any.result                   |    10 -
 doc/test/apspWarshall-any.test.sql                 |    11 -
 doc/test/astar-any.result                          |    10 -
 doc/test/astar-any.test.sql                        |    14 -
 doc/test/bdDijkstra-any.result                     |    12 -
 doc/test/bdDijkstra-any.test.sql                   |    14 -
 doc/test/bdstar-any.result                         |    10 -
 doc/test/bdstar-any.test.sql                       |    13 -
 doc/test/createTopology-any.result                 |   173 -
 doc/test/createTopology-any.test.sql               |    45 -
 doc/test/createVertTab-any.test.sql                |    41 -
 doc/test/dijkstra-v2.result                        |    12 -
 doc/test/dijkstra-v2.test.sql                      |    30 -
 doc/test/issue-353.test.sql                        |     8 -
 doc/test/kdijkstra-any.result                      |    12 -
 doc/test/kdijkstra-any.test.sql                    |    22 -
 doc/test/ksp-any.result                            |    24 -
 doc/test/ksp-any.test.sql                          |    15 -
 doc/test/makeTests.sh                              |    64 -
 doc/test/nodeNetwork-any.result                    |   136 -
 doc/test/nodeNetwork-any.test.sql                  |    23 -
 doc/test/pointsAsPolygon-any.result                |     2 -
 doc/test/pointsAsPolygon-any.test.sql              |    16 -
 doc/test/sampledata.data                           |    59 -
 doc/test/sampledata.result                         |     9 -
 doc/test/sampledata.test.sql                       |    57 -
 doc/test/test.conf                                 |    29 +-
 doc/test/trsp-any.result                           |    37 -
 doc/test/trsp-any.test.sql                         |    56 -
 doc/test/tsp-any.test.sql                          |    10 -
 doc/test/utilities-any.result                      |     2 +-
 doc/test/utilities-any.test.sql                    |     5 +-
 src/CMakeLists.txt                                 |     3 +
 .../test => allpairs/doc}/CMakeLists.txt           |     0
 src/allpairs/doc/allpairs.rst                      |   182 +
 src/allpairs/doc/doc-floydWarshall.queries         |    26 +
 src/allpairs/doc/doc-johnson.queries               |    28 +
 src/allpairs/doc/pgr_floydWarshall.rst             |   161 +
 src/allpairs/doc/pgr_johnson.rst                   |   157 +
 src/allpairs/sql/CMakeLists.txt                    |     8 +
 src/allpairs/sql/floydWarshall.sql                 |    36 +
 src/allpairs/sql/johnson.sql                       |    36 +
 src/allpairs/src/CMakeLists.txt                    |     6 +
 src/allpairs/src/floydWarshall.c                   |   192 +
 src/allpairs/src/floydWarshall_driver.cpp          |    99 +
 src/allpairs/src/floydWarshall_driver.h            |    54 +
 src/allpairs/src/johnson.c                         |   196 +
 src/allpairs/src/johnson_driver.cpp                |   101 +
 src/allpairs/src/johnson_driver.h                  |    51 +
 src/allpairs/src/pgr_allpairs.hpp                  |   316 +
 src/allpairs/test/doc-floydWarshall.result         |    11 +
 src/allpairs/test/doc-floydWarshall.test.sql       |     9 +
 src/allpairs/test/doc-johnson.result               |    11 +
 src/allpairs/test/doc-johnson.test.sql             |    11 +
 src/allpairs/test/pgtap/compare-directed.test.sql  |   142 +
 .../test/pgtap/compare-undirected.test.sql         |   102 +
 src/allpairs/test/pgtap/fw-types-check.sql         |    85 +
 src/allpairs/test/pgtap/j-types-check.sql          |    85 +
 src/allpairs/test/test.conf                        |    25 +
 src/alpha_shape/doc/doc-pgr_alphashape.queries     |    20 +
 .../doc/doc-pgr_pointsAsPolygon.queries            |    13 +
 src/alpha_shape/doc/pgr_alphaShape.rst             |   125 +
 src/alpha_shape/doc/pgr_pointsAsPolygon.rst        |    76 +
 src/alpha_shape/sql/CMakeLists.txt                 |     7 +
 src/alpha_shape/sql/alpha_shape.sql                |    97 +
 src/alpha_shape/src/CMakeLists.txt                 |     5 +
 src/alpha_shape/src/alpha.c                        |   414 +
 src/alpha_shape/src/alpha.h                        |    52 +
 src/alpha_shape/src/alpha_drivedist.cpp            |   280 +
 .../alpha_shape/test/doc-pgr_alphashape.result     |     0
 src/alpha_shape/test/doc-pgr_alphashape.test.sql   |    26 +
 .../test/doc-pgr_pointsAsPolygon.result            |     3 +
 .../test/doc-pgr_pointsAsPolygon.test.sql          |    10 +
 src/alpha_shape/test/test.conf                     |    21 +
 src/apsp_johnson/CMakeLists.txt                    |     5 -
 src/apsp_johnson/doc/doc-apspJohnson.queries       |    13 +
 src/apsp_johnson/doc/index.rst                     |    86 -
 src/apsp_johnson/doc/pgr_apspJohnson.rst           |    77 +
 src/apsp_johnson/sql/CMakeLists.txt                |     4 +-
 src/apsp_johnson/sql/apsp_johnson.sql              |     5 -
 src/apsp_johnson/sql/apsp_johnson_v2.2.sql         |    56 +
 src/apsp_johnson/src/CMakeLists.txt                |     9 -
 src/apsp_johnson/src/apsp_johnson.c                |   376 -
 src/apsp_johnson/src/apsp_johnson.h                |    41 -
 .../src/apsp_johnson_boost_wrapper.cpp             |   144 -
 src/apsp_johnson/test/apsp_johnson-any-00.data     |    14 -
 src/apsp_johnson/test/apsp_johnson-any-00.result   |     9 -
 src/apsp_johnson/test/apsp_johnson-any-00.test.sql |     1 -
 src/apsp_johnson/test/doc-apspJohnson.result       |     6 +
 src/apsp_johnson/test/doc-apspJohnson.test.sql     |    10 +
 .../test/pgtap/apsp_johnson-any-00.test.sql        |    21 +
 src/apsp_johnson/test/pgtap/types-check.sql        |   114 +
 .../test/pgtap/v2-v3-equivalence.test.sql          |   143 +
 src/apsp_johnson/test/test.conf                    |    11 +-
 src/apsp_warshall/CMakeLists.txt                   |     5 -
 src/apsp_warshall/doc/doc-apspWarshall.queries     |    17 +
 src/apsp_warshall/doc/index.rst                    |    92 -
 src/apsp_warshall/doc/pgr_apspWarshall.rst         |    85 +
 src/apsp_warshall/sql/CMakeLists.txt               |     4 +-
 src/apsp_warshall/sql/apsp_warshall.sql            |     6 -
 src/apsp_warshall/sql/apsp_warshall_v2.2.sql       |    56 +
 src/apsp_warshall/src/CMakeLists.txt               |     6 -
 src/apsp_warshall/src/apsp.c                       |   435 -
 src/apsp_warshall/src/apsp.h                       |    53 -
 src/apsp_warshall/src/apsp_boost_wrapper.cpp       |   312 -
 src/apsp_warshall/test/apsp_warshall-any-00.data   |    14 -
 src/apsp_warshall/test/apsp_warshall-any-00.result |     9 -
 .../test/apsp_warshall-any-00.test.sql             |     1 -
 src/apsp_warshall/test/doc-apspWarshall.result     |     9 +
 src/apsp_warshall/test/doc-apspWarshall.test.sql   |    12 +
 .../test/pgtap/apsp_warshall-any-00.test.sql       |    28 +
 src/apsp_warshall/test/pgtap/types-check.sql       |   164 +
 .../test/pgtap/v2-v3-equivalence-directed.test.sql |   153 +
 .../pgtap/v2-v3-equivalence-undirected.test.sql    |   120 +
 src/apsp_warshall/test/test.conf                   |     9 +-
 src/astar/doc/doc-astar.queries                    |    31 +
 src/astar/doc/index.rst                            |   123 -
 src/astar/doc/pgr_astar.rst                        |    96 +
 src/astar/sql/CMakeLists.txt                       |     1 -
 src/astar/sql/astar.sql                            |    39 +-
 src/astar/src/CMakeLists.txt                       |    16 +-
 src/astar/src/astar.c                              |   171 +-
 src/astar/src/astar.h                              |    61 +-
 src/astar/src/astar_boost_wrapper.cpp              |    76 +-
 src/astar/test/doc-astar.result                    |    13 +
 src/astar/test/doc-astar.test.sql                  |    16 +
 src/astar/test/pgtap/astar-types-check.sql         |   198 +
 src/astar/test/spas-any-00.data                    |   212 -
 src/astar/test/spas-any-00.result                  |     6 +-
 src/astar/test/spas-any-00.test.sql                |    27 +-
 src/astar/test/spas-any-01.test.sql                |    22 +
 src/astar/test/test.conf                           |    11 +-
 src/bd_astar/doc/doc-bdAstar.queries               |    33 +
 src/bd_astar/doc/index.rst                         |   129 -
 src/bd_astar/doc/pgr_bdAstar.rst                   |   102 +
 src/bd_astar/sql/routing_bd_astar.sql              |    26 +-
 src/bd_astar/src/BiDirAStar.cpp                    |  1082 +-
 src/bd_astar/src/BiDirAStar.h                      |   283 +-
 src/bd_astar/src/CMakeLists.txt                    |     6 +-
 src/bd_astar/src/MinHeap.cpp                       |    47 +-
 src/bd_astar/src/MinHeap.h                         |    47 +-
 src/bd_astar/src/bdastar.c                         |   181 +-
 src/bd_astar/src/bdastar.h                         |    65 +-
 src/bd_astar/src/bdastar_core.cpp                  |    53 +-
 src/bd_astar/src/utils.h                           |   134 -
 src/bd_astar/test/bd_astar-any-01.test.sql         |    22 +
 src/bd_astar/test/bd_astar-any-02.test.sql         |    22 +
 src/bd_astar/test/bd_astar-any-03.test.sql         |    22 +
 src/bd_astar/test/bd_astar-any-04.test.sql         |    22 +
 src/bd_astar/test/bd_astar-any-05.test.sql         |    22 +
 src/bd_astar/test/bd_astar-any-06.test.sql         |    22 +
 src/bd_astar/test/doc-bdAstar.result               |    13 +
 src/bd_astar/test/doc-bdAstar.test.sql             |    18 +
 src/bd_astar/test/pgtap/bdAstar-types-check.sql    |   198 +
 src/bd_astar/test/test.conf                        |    12 +-
 src/bd_astar/tester/BDATester.cpp                  |   619 +-
 src/bd_astar/tester/BiDirAStar.cpp                 |  1017 +-
 src/bd_astar/tester/BiDirAStar.h                   |   313 +-
 src/bd_astar/tester/MinHeap.cpp                    |    47 +-
 src/bd_astar/tester/MinHeap.h                      |    47 +-
 src/bd_astar/tester/utils.h                        |   234 +-
 src/bd_dijkstra/doc/doc-bdDijkstra.queries         |    31 +
 src/bd_dijkstra/doc/index.rst                      |   123 -
 src/bd_dijkstra/doc/pgr_bdDijkstra.rst             |    96 +
 src/bd_dijkstra/sql/routing_bd_dijkstra.sql        |    24 +-
 src/bd_dijkstra/src/BiDirDijkstra.cpp              |  1025 +-
 src/bd_dijkstra/src/BiDirDijkstra.h                |   264 +-
 src/bd_dijkstra/src/CMakeLists.txt                 |     5 +-
 src/bd_dijkstra/src/bdsp.c                         |   164 +-
 src/bd_dijkstra/src/bdsp.h                         |    57 +-
 src/bd_dijkstra/src/bdsp_core.cpp                  |   175 +-
 src/bd_dijkstra/src/utils.h                        |   134 -
 src/bd_dijkstra/test/bd_dijkstra-any-01.test.sql   |    22 +
 src/bd_dijkstra/test/bd_dijkstra-any-02.test.sql   |    22 +
 src/bd_dijkstra/test/bd_dijkstra-any-03.test.sql   |    22 +
 src/bd_dijkstra/test/bd_dijkstra-any-04.test.sql   |    22 +
 src/bd_dijkstra/test/bd_dijkstra-any-05.test.sql   |    22 +
 src/bd_dijkstra/test/bd_dijkstra-any-06.test.sql   |    22 +
 src/bd_dijkstra/test/doc-bdDijkstra.result         |    13 +
 src/bd_dijkstra/test/doc-bdDijkstra.test.sql       |    17 +
 .../test/pgtap/bdDijkstra-types-check.sql          |   110 +
 src/bd_dijkstra/test/test.conf                     |    11 +-
 src/bd_dijkstra/tester/BDDTester.cpp               |   317 -
 src/bd_dijkstra/tester/BiDirDijkstra.cpp           |   377 -
 src/bd_dijkstra/tester/BiDirDijkstra.h             |   142 -
 src/bd_dijkstra/tester/Makefile                    |     7 -
 src/bd_dijkstra/tester/ans1.txt                    |   101 -
 src/bd_dijkstra/tester/ans2.txt                    |    60 -
 src/bd_dijkstra/tester/ans3.txt                    |     2 -
 src/bd_dijkstra/tester/ans4.txt                    |     2 -
 src/bd_dijkstra/tester/ans5.txt                    |   101 -
 src/bd_dijkstra/tester/ans6.txt                    |    60 -
 src/bd_dijkstra/tester/input.txt                   |     7 -
 src/bd_dijkstra/tester/utils.h                     |   134 -
 src/bd_dijkstra/tester/ways.txt                    | 17268 -------------------
 src/bd_dijkstra/tester/ways2data                   |    33 -
 src/common/doc/convenience/flip_edges.rst          |    91 -
 src/common/doc/convenience/index.rst               |    44 -
 src/common/doc/convenience/point_to_edgenode.rst   |    83 -
 src/common/doc/convenience/points_to_dmatrix.rst   |    94 -
 src/common/doc/convenience/points_to_vids.rst      |    81 -
 src/common/doc/convenience/text_to_points.rst      |    81 -
 src/common/doc/convenience/vids_to_dmatrix.rst     |   102 -
 src/common/doc/convenience/vids_to_dmatrix2.rst    |   101 -
 src/common/doc/functions/analyze_graph.rst         |   376 -
 src/common/doc/functions/analyze_oneway.rst        |   139 -
 src/common/doc/functions/create_topology.rst       |   291 -
 src/common/doc/functions/create_vert_table.rst     |   267 -
 .../doc/functions/images/Fig1-originalData.png     |   Bin 49125 -> 0 bytes
 src/common/doc/functions/index.rst                 |    33 -
 src/common/doc/functions/node_network.rst          |   395 -
 src/common/doc/index.rst                           |    21 -
 src/common/doc/legacy.rst                          |    65 -
 src/common/doc/pgr_version.rst                     |    82 +
 src/common/doc/types/cost_result.rst               |     2 +-
 src/common/doc/types/geom_result.rst               |     2 +-
 src/common/doc/types/index.rst                     |     2 +-
 src/common/doc/utilities/end_point.rst             |     2 +-
 src/common/doc/utilities/get_column_name.rst       |     2 +-
 src/common/doc/utilities/get_table_name.rst        |     2 +-
 src/common/doc/utilities/index.rst                 |    47 +-
 src/common/doc/utilities/is_column_in_table.rst    |     2 +-
 src/common/doc/utilities/is_column_indexed.rst     |     4 +-
 src/common/doc/utilities/point_to_id.rst           |     2 +-
 src/common/doc/utilities/quote_ident.rst           |     2 +-
 src/common/doc/utilities/start_point.rst           |     2 +-
 src/common/doc/utilities/version.rst               |    81 -
 src/common/doc/utilities/versionless.rst           |     2 +-
 src/common/sql/CMakeLists.txt                      |    11 +-
 .../sql/OBSOLETE/pgrouting_network_check.sql       |    87 -
 src/common/sql/OBSOLETE/routing_tsp_wrappers.sql   |    52 -
 src/common/sql/_point_toId.sql                     |    81 +
 src/common/sql/createIndex.sql                     |    34 +-
 src/common/sql/create_vertices_table.sql           |   232 -
 src/common/sql/findClosestEdge.sql                 |   100 +
 src/common/sql/noUnderUtilities.sql                |    30 +-
 src/common/sql/pgr_parameter_check.sql             |    95 +-
 src/common/sql/pgrouting-types.sql                 |    23 +-
 src/common/sql/pgrouting_analytics.sql             |   586 -
 src/common/sql/pgrouting_conversion_tools.sql      |   161 -
 src/common/sql/pgrouting_dmatrix_tools.sql         |   120 -
 src/common/sql/pgrouting_legacy.sql                |  1429 --
 src/common/sql/pgrouting_node_network.sql          |   267 -
 src/common/sql/pgrouting_topology.sql              |   306 -
 src/common/sql/pgrouting_utilities.sql             |   125 +-
 src/common/sql/pgrouting_version.sql               |     6 +-
 src/common/sql/utilities_pgr.sql                   |    66 +-
 src/common/src/CMakeLists.txt                      |    13 +-
 src/common/src/arrays_input.c                      |   115 +
 src/common/src/arrays_input.h                      |    29 +
 src/common/src/baseGraph.hpp                       |   871 +-
 src/common/src/basePath_SSEC.cpp                   |   274 +-
 src/common/src/basePath_SSEC.hpp                   |   261 +-
 src/common/src/debug_macro.h                       |    35 +
 src/common/src/edges_input.c                       |   179 +
 src/common/src/edges_input.h                       |    52 +
 src/common/src/get_check_data.c                    |   231 +
 src/common/src/get_check_data.h                    |    60 +
 src/common/src/memory_func.hpp                     |    47 +
 src/common/src/pgr_assert.cpp                      |    10 +-
 src/common/src/pgr_assert.h                        |    16 +-
 src/common/src/pgr_logger.h                        |    15 +-
 src/common/src/pgr_types.h                         |   201 +-
 src/common/src/points_input.c                      |   150 +
 src/common/src/points_input.h                      |    32 +
 src/common/src/postgres_connection.c               |   435 +-
 src/common/src/postgres_connection.h               |    72 +-
 src/common/src/restrictions_input.c                |   151 +
 src/common/src/restrictions_input.h                |    32 +
 src/common/src/signalhandler.cpp                   |    31 +-
 src/common/src/signalhandler.h                     |    31 +-
 src/common/src/time_msg.c                          |    12 +
 src/common/src/time_msg.h                          |     5 +
 src/common/test/common-any-00.data                 |    92 -
 src/common/test/common-any-01.data                 |    13 -
 src/common/test/common-any-01.result               |    53 -
 src/common/test/common-any-01.test.sql             |     4 -
 src/common/test/common-any-02.data                 |   132 -
 src/common/test/common-any-02.result               |    51 -
 src/common/test/common-any-02.test.sql             |     7 -
 src/common/test/common-any-03.result               |    21 -
 src/common/test/common-any-03.test.sql             |     9 -
 src/common/test/common-any-04.result               |   216 -
 src/common/test/common-any-04.test.sql             |    49 -
 src/common/test/common-any-05.result               |    44 -
 src/common/test/common-any-05.test.sql             |    29 -
 src/common/test/createTopology-any-01.result       |    66 -
 src/common/test/createTopology-any-01.test.sql     |   133 -
 src/common/test/createVerticesTable-any-01.result  |   475 -
 .../test/createVerticesTable-any-01.test.sql       |   146 -
 src/common/test/gettablename-any-01.result         |    35 -
 src/common/test/gettablename-any-01.test.sql       |    83 -
 .../test/incrementalCreateTopology_any_01.result   |   146 -
 .../test/incrementalCreateTopology_any_01.test.sql |    75 -
 src/common/test/isColumnInTable-any.result         |    56 -
 src/common/test/isColumnInTable-any.test.sql       |   103 -
 src/common/test/isColumnIndexed-any.result         |    56 -
 src/common/test/isColumnIndexed-any.test.sql       |   103 -
 src/common/test/makeTests.sh                       |    49 -
 src/common/test/no_underscored-2x.result           |    36 -
 src/common/test/no_underscored-2x.test.sql         |    28 -
 src/common/test/pgr_checkVertTab_any_01.result     |    13 -
 src/common/test/pgr_checkVertTab_any_01.test.sql   |    96 -
 src/common/test/pgr_getColumnName_any_01.result    |    32 -
 src/common/test/pgr_getColumnName_any_01.test.sql  |    87 -
 src/common/test/pgr_getColumnType_any_01.result    |    21 -
 src/common/test/pgr_getColumnType_any_01.test.sql  |    76 -
 .../test/pgrouting_conversion_tools-any-01.result  |    25 -
 .../pgrouting_conversion_tools-any-01.test.sql     |    23 -
 .../test/pgrouting_dmatrix_tools-any-01.result     |    11 -
 .../test/pgrouting_dmatrix_tools-any-01.test.sql   |    16 -
 src/common/test/pgtap/checkVertTab.test.sql        |    30 +
 src/common/test/pgtap/getColumnName.test.sql       |    62 +
 src/common/test/pgtap/getColumnType.test.sql       |    51 +
 src/common/test/pgtap/getTableName.test.sql        |    79 +
 src/common/test/pgtap/isColumnInTable.test.sql     |    87 +
 src/common/test/pgtap/isColumnIndexed.test.sql     |    97 +
 src/common/test/pgtap/no_underscored-2x.test.sql   |    60 +
 src/common/test/test.conf                          |    28 +-
 src/common/test/versionless-any-01.test.sql        |    22 +
 src/common/tester/test1.c                          |    22 +
 src/common/tester/test2.cpp                        |    22 +
 src/contraction/doc/contraction.rst                |   414 +
 .../doc/images/threeNodestwoEdges_a.png            |   Bin 0 -> 2600 bytes
 .../doc/images/threeNodestwoEdges_b.png            |   Bin 0 -> 2527 bytes
 .../doc/images/threeNodestwoEdges_c.png            |   Bin 0 -> 1861 bytes
 src/contraction/doc/images/twoNodesoneEdge_a.png   |   Bin 0 -> 2003 bytes
 src/contraction/doc/images/twoNodesoneEdge_b.png   |   Bin 0 -> 1724 bytes
 .../doc/images/undirected_sampledata_a.png         |   Bin 0 -> 25062 bytes
 .../doc/images/undirected_sampledata_b.png         |   Bin 0 -> 17165 bytes
 .../doc/images/undirected_sampledata_c.png         |   Bin 0 -> 20395 bytes
 src/convinience/doc/convenience.rst                |    61 +
 src/convinience/doc/doc-conversion.queries         |    87 +
 src/convinience/doc/doc-matrix.queries             |   100 +
 src/convinience/doc/pgr_flipEdges.rst              |    78 +
 src/convinience/doc/pgr_pointToEdgeNode.rst        |    92 +
 src/convinience/doc/pgr_pointsToDMatrix.rst        |    90 +
 src/convinience/doc/pgr_pointsToVids.rst           |    85 +
 src/convinience/doc/pgr_textToPoints.rst           |    77 +
 src/convinience/doc/pgr_vidsToDMatrix.rst          |   107 +
 src/convinience/doc/pgr_vidsToDMatrix2.rst         |    98 +
 src/convinience/sql/CMakeLists.txt                 |     9 +
 src/convinience/sql/pgr_vidsToDMatrix_dir.sql      |    29 +
 src/convinience/sql/pgrouting_conversion_tools.sql |   183 +
 src/convinience/sql/pgrouting_dmatrix_tools.sql    |   142 +
 src/convinience/test/doc-conversion.result         |    22 +
 src/convinience/test/doc-conversion.test.sql       |    50 +
 src/convinience/test/doc-matrix.result             |    25 +
 src/convinience/test/doc-matrix.test.sql           |    57 +
 .../test/pgtap/flipEdges-types-check.sql           |    13 +
 .../test/pgtap/pointToEdgeNode-types-check.sql     |    14 +
 .../test/pgtap/pointsToDMatrix-types-check.sql     |    14 +
 .../test/pgtap/pointsToVids-types-check.sql        |    13 +
 .../test/pgtap/textToPoints-types-check.sql        |    15 +
 .../test/pgtap/vidsToDMatrix-types-check.sql       |    17 +
 src/convinience/test/test.conf                     |    28 +
 src/convinience/test/vidstodmatrix-any-01.result   |     2 +
 src/convinience/test/vidstodmatrix-any-01.test.sql |    34 +
 src/dijkstra/CMakeLists.txt                        |     5 -
 src/dijkstra/demo/boost_demo.sql                   |    80 +
 src/dijkstra/demo/hanoslav_demo.sql                |    97 +
 src/dijkstra/demo/wiki_demo.sql                    |    49 +
 src/dijkstra/doc/dijkstra-v2.queries               |    51 +
 src/dijkstra/doc/dijkstra.rst                      |   114 +
 src/dijkstra/doc/dijkstra_v2.rst                   |   159 -
 src/dijkstra/doc/dijkstra_v3.rst                   |   811 -
 src/dijkstra/doc/doc-pgr_dijkstra.queries          |   614 +
 src/dijkstra/doc/doc-pgr_dijkstraCost.queries      |    83 +
 src/dijkstra/doc/doc-pgr_dijkstraVia.queries       |   128 +
 src/dijkstra/doc/index.rst                         |   120 -
 src/dijkstra/doc/pgr_dijkstra.rst                  |   357 +
 src/dijkstra/doc/pgr_dijkstraCost.rst              |   301 +
 src/dijkstra/doc/pgr_dijkstraVia.rst               |   206 +
 src/dijkstra/doc/pgr_dijkstra_v2.rst               |   116 +
 src/dijkstra/sql/CMakeLists.txt                    |     3 +-
 src/dijkstra/sql/dijkstra.sql                      |   276 +-
 src/dijkstra/sql/dijkstraCost.sql                  |   103 +
 src/dijkstra/sql/dijkstraVia.sql                   |    51 +
 src/dijkstra/src/1_to_many_dijkstra.c              |   198 -
 src/dijkstra/src/CMakeLists.txt                    |    19 +-
 src/dijkstra/src/dijkstra.c                        |   205 -
 src/dijkstra/src/dijkstraVia.c                     |   233 +
 src/dijkstra/src/dijkstraVia_driver.cpp            |   243 +
 src/dijkstra/src/dijkstraVia_driver.h              |    53 +
 src/dijkstra/src/dijkstra_driver.cpp               |   367 -
 src/dijkstra/src/dijkstra_driver.h                 |    61 -
 src/dijkstra/src/many_to_1_dijkstra.c              |   188 -
 src/dijkstra/src/many_to_many_dijkstra.c           |   382 +-
 src/dijkstra/src/many_to_many_dijkstra_driver.cpp  |   131 +
 src/dijkstra/src/many_to_many_dijkstra_driver.h    |    64 +
 src/dijkstra/src/many_to_one_dijkstra.c            |   238 +
 src/dijkstra/src/many_to_one_dijkstra_driver.cpp   |   126 +
 src/dijkstra/src/many_to_one_dijkstra_driver.h     |    62 +
 src/dijkstra/src/one_to_many_dijkstra.c            |   238 +
 src/dijkstra/src/one_to_many_dijkstra_driver.cpp   |   118 +
 src/dijkstra/src/one_to_many_dijkstra_driver.h     |    62 +
 src/dijkstra/src/one_to_one_dijkstra.c             |   231 +
 src/dijkstra/src/one_to_one_dijkstra_driver.cpp    |   120 +
 src/dijkstra/src/one_to_one_dijkstra_driver.h      |    62 +
 src/dijkstra/src/pgr_dijkstra.hpp                  |   933 +-
 src/dijkstra/test/1_to_many.result                 |    32 -
 src/dijkstra/test/1_to_many.test.sql               |    53 -
 src/dijkstra/test/dijkstra-dir-00.result           |    35 -
 src/dijkstra/test/dijkstra-dir-00.test.sql         |    43 -
 src/dijkstra/test/dijkstra-dir-01.result           |    20 -
 src/dijkstra/test/dijkstra-dir-01.test.sql         |    35 -
 src/dijkstra/test/dijkstra-undi-00.result          |    25 -
 src/dijkstra/test/dijkstra-undi-00.test.sql        |    43 -
 src/dijkstra/test/dijkstra-undi-01.result          |    20 -
 src/dijkstra/test/dijkstra-undi-01.test.sql        |    33 -
 src/dijkstra/test/dijkstra-v2.result               |     9 +
 src/dijkstra/test/dijkstra-v2.test.sql             |    38 +-
 src/dijkstra/test/dijkstra-v3.result               |   175 -
 src/dijkstra/test/dijkstra-v3.test.sql             |   276 -
 src/dijkstra/test/dijkstra.data                    |    84 -
 src/dijkstra/test/doc-pgr_dijkstra.result          |   226 +
 src/dijkstra/test/doc-pgr_dijkstra.test.sql        |   267 +
 src/dijkstra/test/doc-pgr_dijkstraCost.result      |    30 +
 src/dijkstra/test/doc-pgr_dijkstraCost.test.sql    |    38 +
 src/dijkstra/test/doc-pgr_dijkstraVia.result       |    55 +
 src/dijkstra/test/doc-pgr_dijkstraVia.test.sql     |    61 +
 src/dijkstra/test/issue-353.result                 |    28 +-
 src/dijkstra/test/issue-353.test.sql               |     8 -
 src/dijkstra/test/many_to_1.test.sql               |     1 -
 src/dijkstra/test/many_to_many.result              |    54 -
 src/dijkstra/test/many_to_many.test.sql            |    50 -
 src/dijkstra/test/pgtap/dijkstra-types-check.sql   |   322 +
 .../test/pgtap/dijkstraCost-types-check.sql        |   302 +
 src/dijkstra/test/pgtap/dijkstraV2-types-check.sql |   279 +
 .../pgtap/dijkstraVia-equivalenceDijkstra.test.sql |   207 +
 .../test/pgtap/dijkstraVia-types-check.sql         |   249 +
 src/dijkstra/test/pgtap/issue-353.test.sql         |    31 +
 .../test/pgtap/oneToOne_equiv_manyToMany.test.sql  |    55 +
 .../test/pgtap/oneToOne_equiv_manyToOne.test.sql   |    54 +
 .../test/pgtap/oneToOne_equiv_oneToMany.test.sql   |    55 +
 .../pgtap/v2-equi-v3-directed-N-reverse.test.sql   |   111 +
 .../pgtap/v2-equi-v3-directed-W-reverse.test.sql   |   118 +
 .../pgtap/v2-equi-v3-undirected-N-reverse.test.sql |   111 +
 .../pgtap/v2-equi-v3-undirected-W-reverse.test.sql |   109 +
 .../test/pgtap/zero_one_edge_-1_rev.test.sql       |   233 +
 .../test/pgtap/zero_one_edge_has_rev.test.sql      |   233 +
 .../test/pgtap/zero_one_edge_no_rev.test.sql       |   233 +
 src/dijkstra/test/sampledata.data                  |    59 -
 src/dijkstra/test/test.conf                        |    32 +-
 src/dijkstra/test/zero_one_edge_-1_rev.result      |    20 -
 src/dijkstra/test/zero_one_edge_-1_rev.test.sql    |    80 -
 src/dijkstra/test/zero_one_edge_has_rev.result     |    44 -
 src/dijkstra/test/zero_one_edge_has_rev.test.sql   |    80 -
 src/dijkstra/test/zero_one_edge_no_rev.result      |    20 -
 src/dijkstra/test/zero_one_edge_no_rev.test.sql    |    80 -
 src/dijkstra/tester/boost_wrapper.cpp              |    22 +
 src/dijkstra/tester/dijkstra.h                     |    22 +
 src/dijkstra/tester/testit.c                       |    22 +
 src/driving_distance/doc/dd_alphashape.rst         |   125 -
 .../doc/dd_driving_distance_v2.rst                 |   125 -
 .../doc/dd_driving_distance_v3.rst                 |   475 -
 src/driving_distance/doc/dd_points_as_polygon.rst  |   103 -
 .../doc/doc-pgr_drivingDistance.queries            |   337 +
 .../doc/doc-pgr_drivingdistance-v2.queries         |    28 +
 src/driving_distance/doc/drivingDistance.rst       |    36 +
 src/driving_distance/doc/index.rst                 |    44 -
 src/driving_distance/doc/pgr_drivingDistance.rst   |   170 +
 .../doc/pgr_drivingDistance_v2.rst                 |    99 +
 src/driving_distance/sql/CMakeLists.txt            |     1 +
 src/driving_distance/sql/routing_dd.sql            |   140 +-
 src/driving_distance/sql/routing_dd_legacy.sql     |   116 -
 src/driving_distance/sql/withPoints_dd.sql         |    64 +
 src/driving_distance/src/CMakeLists.txt            |    10 +-
 src/driving_distance/src/alpha.c                   |   417 -
 src/driving_distance/src/alpha.h                   |    49 -
 src/driving_distance/src/alpha_drivedist.cpp       |   275 -
 .../src/boost_interface_drivedist.cpp              |   201 +-
 .../src/boost_interface_drivedist.h                |    37 +-
 src/driving_distance/src/drivedist.c               |   159 +-
 .../src/many_to_dist_driving_distance.c            |   294 +-
 .../src/many_to_dist_withPointsDD.c                |   270 +
 src/driving_distance/src/withPoints_dd.c           |   271 +
 src/driving_distance/src/withPoints_dd_driver.cpp  |   323 +
 src/driving_distance/src/withPoints_dd_driver.h    |    80 +
 .../test/doc-pgr_drivingDistance.result            |   178 +
 .../test/doc-pgr_drivingDistance.test.sql          |   118 +
 .../test/doc-pgr_drivingdistance-v2.result         |     8 +
 .../test/doc-pgr_drivingdistance-v2.test.sql       |    18 +
 .../test/drivingdistance-any-00.data               |    34 -
 .../test/drivingdistance-any-00.result             |   619 +-
 .../test/drivingdistance-any-00.test.sql           |    73 +-
 .../test/drivingdistance-doc-v2.result             |     4 -
 .../test/drivingdistance-doc-v2.test.sql           |    16 -
 .../test/drivingdistance-doc-v3.result             |   173 -
 .../test/drivingdistance-doc-v3.test.sql           |    91 -
 src/driving_distance/test/pgtap/issue-519.sql      |    30 +
 src/driving_distance/test/sampledata.data          |    59 -
 src/driving_distance/test/test.conf                |    16 +-
 src/index.rst                                      |    42 -
 src/kdijkstra/doc/doc-kdijkstra.queries            |    50 +
 src/kdijkstra/doc/index.rst                        |   155 -
 src/kdijkstra/doc/pgr_kDijkstra.rst                |   127 +
 src/kdijkstra/sql/CMakeLists.txt                   |     2 +-
 src/kdijkstra/sql/kdijkstra-V2.2.sql               |   195 +
 src/kdijkstra/sql/kdijkstra.sql                    |    55 -
 src/kdijkstra/src/CMakeLists.txt                   |     4 +-
 src/kdijkstra/src/k_targets_boost_wrapper.cpp      |   362 +-
 src/kdijkstra/src/k_targets_boost_wrapper.h        |    98 +
 src/kdijkstra/src/k_targets_sp.c                   |   860 +-
 src/kdijkstra/src/k_targets_sp.h                   |   121 -
 src/kdijkstra/test/doc-kdijkstra.result            |    19 +
 src/kdijkstra/test/doc-kdijkstra.test.sql          |    26 +
 src/kdijkstra/test/kdijkstra-any-00.data           |    24 -
 src/kdijkstra/test/kdijkstra-any-01.data           |    73 -
 src/kdijkstra/test/kdijkstra-any-01.result         |     4 -
 src/kdijkstra/test/kdijkstra-any-01.test.sql       |     1 -
 src/kdijkstra/test/kdijkstra-any-02.result         |   100 -
 src/kdijkstra/test/kdijkstra-any-02.test.sql       |     1 -
 src/kdijkstra/test/kdijkstra-any-03.result         |   100 -
 src/kdijkstra/test/kdijkstra-any-03.test.sql       |     6 -
 .../compare-kdijstraCost-dijkstraCost.test.sql     |    77 +
 .../pgtap/compare-kdijstraPath-dijkstra.test.sql   |    78 +
 .../test/pgtap/errors-exceptions-cost.test.sql     |   299 +
 .../test/pgtap/errors-exceptions-path.test.sql     |   305 +
 src/kdijkstra/test/pgtap/issue229.test.sql         |    22 +
 src/kdijkstra/test/pgtap/issue333.test.sql         |    42 +
 src/kdijkstra/test/pgtap/kdijkstra-any-01.test.sql |    74 +
 src/kdijkstra/test/test.conf                       |    14 +-
 src/kdijkstra/test/vidstodmatrix-any-01.result     |     1 -
 src/kdijkstra/test/vidstodmatrix-any-01.test.sql   |     1 -
 src/kdijkstra/test/vidstodmatrix-any-02.result     |     1 -
 src/kdijkstra/test/vidstodmatrix-any-02.test.sql   |     1 -
 src/ksp/doc/doc-ksp-v2.queries                     |    45 +
 src/ksp/doc/doc-ksp.queries                        |   288 +
 src/ksp/doc/index.rst                              |    31 -
 src/ksp/doc/ksp.rst.back                           |    24 +
 src/ksp/doc/ksp_v2.rst                             |   146 -
 src/ksp/doc/ksp_v3.rst                             |   431 -
 src/ksp/doc/pgr_ksp.rst                            |   178 +
 src/ksp/doc/pgr_ksp_v2.rst                         |   107 +
 src/ksp/sql/CMakeLists.txt                         |     1 +
 src/ksp/sql/routing_ksp.sql                        |    56 +-
 src/ksp/sql/withPoints_ksp.sql                     |    44 +
 src/ksp/src/CMakeLists.txt                         |     8 +-
 src/ksp/src/ksp.c                                  |   300 +-
 src/ksp/src/ksp.h                                  |    23 +-
 src/ksp/src/ksp_driver.cpp                         |   113 +-
 src/ksp/src/ksp_driver.h                           |    30 +-
 src/ksp/src/pgr_ksp.cpp                            |   271 +-
 src/ksp/src/pgr_ksp.hpp                            |   197 +-
 src/ksp/src/withPoints_ksp.c                       |   282 +
 src/ksp/src/withPoints_ksp_driver.cpp              |   173 +
 src/ksp/src/withPoints_ksp_driver.h                |    62 +
 src/ksp/test/CMakeLists.txt                        |     0
 src/ksp/test/doc-ksp-v2.result                     |    29 +
 src/ksp/test/doc-ksp-v2.test.sql                   |    14 +
 src/ksp/test/doc-ksp.result                        |   174 +
 src/ksp/test/doc-ksp.test.sql                      |    94 +
 src/ksp/test/ksp-any-00.data                       |   160 -
 src/ksp/test/ksp-any-01.result                     |   214 -
 src/ksp/test/ksp-any-01.test.sql                   |    20 -
 src/ksp/test/ksp-any-02.result                     |   214 -
 src/ksp/test/ksp-any-02.test.sql                   |    22 -
 src/ksp/test/ksp-network.result                    |   184 +
 src/ksp/test/ksp-network.test.sql                  |   142 +
 src/ksp/test/ksp-parallel-any-03.result            |    26 -
 src/ksp/test/ksp-parallel-any-03.test.sql          |    59 -
 src/ksp/test/ksp-v2.result                         |    24 -
 src/ksp/test/ksp-v2.test.sql                       |    15 -
 src/ksp/test/ksp-v3-1route.result                  |    93 -
 src/ksp/test/ksp-v3-1route.test.sql                |   116 -
 src/ksp/test/ksp-v3.result                         |   154 -
 src/ksp/test/ksp-v3.test.sql                       |   117 -
 src/ksp/test/makeTests.sh                          |    12 -
 src/ksp/test/pgtap/ksp-v3-1route.test.sql          |   109 +
 src/ksp/test/pgtap/parallel-v2.test.sql            |   106 +
 src/ksp/test/pgtap/parallel.test.sql               |   106 +
 src/ksp/test/show_data.result                      |   104 -
 src/ksp/test/show_data.test.sql                    |    18 -
 src/ksp/test/test.conf                             |    25 +-
 src/label_graph/doc/analyze_brokengraph.rst        |   176 -
 src/label_graph/doc/doc-pgr_labelGraph.queries     |    24 +
 src/label_graph/doc/pgr_labelGraph.rst             |    85 +
 src/label_graph/sql/label_graph.sql                |    22 +
 src/label_graph/test/doc-pgr_labelGraph.result     |     6 +
 src/label_graph/test/doc-pgr_labelGraph.test.sql   |     8 +
 src/label_graph/test/pgrouting_brokengraph.data    |  4214 -----
 src/label_graph/test/pgrouting_brokengraph.result  |     0
 .../test/pgrouting_brokengraph.test.sql            |    52 -
 src/label_graph/test/pgrouting_labelgraph.data     |   134 +
 .../test/pgrouting_labelgraph.result}              |     0
 src/label_graph/test/pgrouting_labelgraph.test.sql |    74 +
 src/label_graph/test/test.conf                     |     4 +
 src/linecommand/src/Makefile                       |    18 +-
 src/linecommand/src/dijkstra.cpp                   |    91 -
 src/linecommand/src/dijkstra.hpp                   |   113 +
 src/linecommand/src/driving.cpp                    |    18 +-
 src/linecommand/src/ksp.cpp                        |    99 +
 src/linecommand/src/performance/dijkstra/Makefile  |    31 +
 .../src/performance/dijkstra/dijkstra.hpp          |   139 +
 .../src/performance/dijkstra/pgRouting.cpp         |   374 +
 src/linecommand/src/pgRouting.cpp                  |    97 +-
 src/linecommand/src/warshall.hpp                   |    56 +
 src/mainpage.dox                                   |   272 +
 src/pickDeliver/CMakeLists.txt                     |     5 +
 src/{astar/test => pickDeliver/doc}/CMakeLists.txt |     0
 src/pickDeliver/doc/index.rst                      |    85 +
 src/pickDeliver/sql/CMakeLists.txt                 |     8 +
 src/pickDeliver/sql/routing_vrppdtw.sql            |    43 +
 src/pickDeliver/src/CMakeLists.txt                 |     7 +
 src/pickDeliver/src/Route.h                        |   257 +
 src/pickDeliver/src/Solution.h                     |   140 +
 src/pickDeliver/src/customers_input.c              |   155 +
 src/pickDeliver/src/customers_input.h              |    46 +
 src/pickDeliver/src/pdp.c                          |   170 +
 src/pickDeliver/src/pdp.h                          |    69 +
 src/pickDeliver/src/pdp.hpp                        |    69 +
 src/pickDeliver/src/pdp_solver.cpp                 |   355 +
 src/{common => pickDeliver}/test/CMakeLists.txt    |     0
 src/pickDeliver/test/pdp-any-00.data               |   120 +
 src/pickDeliver/test/pdp-any-01.result             |     3 +
 src/pickDeliver/test/pdp-any-01.test.sql           |    44 +
 src/proposed.rst                                   |   100 +
 src/proposedNext.rst                               |    52 +
 src/routingFunctions.rst                           |    63 +
 src/shooting_star/doc/index.rst                    |    22 +
 src/shooting_star/sql/shooting_star.sql            |    22 +
 src/shooting_star/src/edge_visitors.hpp            |    22 +
 src/shooting_star/src/shooting_star.c              |    22 +
 src/shooting_star/src/shooting_star.h              |    22 +
 .../src/shooting_star_boost_wrapper.cpp            |    22 +
 src/shooting_star/src/shooting_star_relax.hpp      |    22 +
 src/shooting_star/src/shooting_star_search.hpp     |    22 +
 src/shooting_star/test/spss-any-00.test.sql        |    22 +
 src/shooting_star/test/spss-any-01.test.sql        |    22 +
 src/topology/doc/doc-pgr_analyzeGraph.queries      |   534 +
 src/topology/doc/doc-pgr_createTopology.queries    |   260 +
 .../doc}/images/Fig3-reverseCost.png               |   Bin
 .../doc}/images/Fig5-reverseCostUndirected.png     |   Bin
 .../doc}/images/after_node_net.png                 |   Bin
 .../doc}/images/before_node_net.png                |   Bin
 src/topology/doc/pgr_analyzeGraph.rst              |   376 +
 src/topology/doc/pgr_analyzeOneWay.rst             |   139 +
 src/topology/doc/pgr_createTopology.rst            |   257 +
 src/topology/doc/pgr_createVerticesTable.rst       |   267 +
 src/topology/doc/pgr_nodeNetwork.rst               |   396 +
 src/topology/doc/topology.rst                      |    33 +
 src/topology/sql/CMakeLists.txt                    |    10 +
 src/topology/sql/create_vertices_table.sql         |   254 +
 src/topology/sql/nodeNetwork.sql                   |   289 +
 src/topology/sql/pgrouting_analytics.sql           |   610 +
 src/topology/sql/pgrouting_topology.sql            |   289 +
 .../topology}/test/analyzeOneway-any.result        |     0
 src/topology/test/analyzeOneway-any.test.sql       |    11 +
 .../topology}/test/createVertTab-any.result        |     0
 src/topology/test/createVertTab-any.test.sql       |    40 +
 src/topology/test/doc-pgr_analyzeGraph.result      |   378 +
 src/topology/test/doc-pgr_analyzeGraph.test.sql    |    51 +
 src/topology/test/doc-pgr_createTopology.result    |    97 +
 src/topology/test/doc-pgr_createTopology.test.sql  |   117 +
 src/topology/test/nodeNetwork-any.result           |   136 +
 src/topology/test/nodeNetwork-any.test.sql         |    25 +
 src/topology/test/pgtap/analyzeGraph.test.sql      |    38 +
 src/topology/test/pgtap/analyzeOneWay.test.sql     |    29 +
 src/topology/test/pgtap/createTopology.test.sql    |   288 +
 .../test/pgtap/createVerticesTable.test.sql        |   254 +
 .../test/pgtap/incrementalCreateTopology.test.sql  |    80 +
 src/topology/test/pgtap/nodeNetwork.test.sql       |   126 +
 src/topology/test/test.conf                        |    29 +
 src/trsp/doc/doc-trsp.queries                      |   113 +
 src/trsp/doc/index.rst                             |   302 -
 src/trsp/doc/pgr_trsp.rst                          |   205 +
 src/trsp/sql/CMakeLists.txt                        |     6 +-
 src/trsp/sql/routing_trsp.sql                      |    26 +-
 src/trsp/sql/routing_trsp_vias.sql                 |    26 +-
 src/trsp/sql/trsp_V2.2.sql                         |   162 +
 src/trsp/sql/vias_trsp_V2.2.sql                    |   217 +
 src/trsp/src/CMakeLists.txt                        |     6 +-
 src/trsp/src/GraphDefinition.cpp                   |   669 +-
 src/trsp/src/GraphDefinition.h                     |   317 +-
 src/trsp/src/trsp.c                                |  1085 +-
 src/trsp/src/trsp.h                                |    87 +-
 src/trsp/src/trsp_core.cpp                         |    96 +-
 src/trsp/src/utils.h                               |   106 -
 src/trsp/test/CMakeLists.txt                       |     0
 src/trsp/test/doc-trsp.result                      |    56 +
 src/trsp/test/doc-trsp.test.sql                    |    56 +
 .../blank-restrictions-compare-dijkstra.test.sql   |    52 +
 src/trsp/test/pgtap/emptyset-from-i-to-i.test.sql  |    84 +
 src/trsp/test/pgtap/from1to3.test.sql              |    96 +
 src/trsp/test/pgtap/from3to4-directed.test.sql     |    50 +
 ...restrictions-compare-dijkstra-directed.test.sql |   100 +
 ...strictions-compare-dijkstra-undirected.test.sql |    98 +
 src/trsp/test/pgtap/trsp-any-00.test.sql           |    28 +
 src/trsp/test/pgtap/trsp-any-01.test.sql           |    24 +
 src/trsp/test/pgtap/trsp-issue244.test.sql         |    66 +
 ...restrictions-compare-dijkstra-directed.test.sql |    98 +
 ...strictions-compare-dijkstra-undirected.test.sql |   100 +
 src/trsp/test/test.conf                            |    14 +-
 src/trsp/test/trsp-any-00.data                     |   212 -
 src/trsp/test/trsp-any-00.result                   |     4 -
 src/trsp/test/trsp-any-00.test.sql                 |     9 -
 src/trsp/test/trsp-any-01.result                   |     5 -
 src/trsp/test/trsp-any-01.test.sql                 |     8 -
 src/trsp/test/trsp-any-02.result                   |    20 +-
 src/trsp/test/trsp-any-02.test.sql                 |    26 +-
 src/trsp/test/trsp-any-03.result                   |    11 -
 src/trsp/test/trsp-any-03.test.sql                 |     9 -
 src/trsp/test/trsp-issue244.data                   |    42 -
 src/trsp/test/trsp-issue244.result                 |     6 -
 src/trsp/test/trsp-issue244.test.sql               |     2 -
 src/trsp/test/trsp_vias-any-04.result              |    95 +-
 src/trsp/test/trsp_vias-any-04.test.sql            |   103 +-
 src/trsp/tester/issue191-bad-m1.h                  |    22 +
 src/trsp/tester/issue191-bad.h                     |    22 +
 src/trsp/tester/issue191-good.h                    |    22 +
 src/trsp/tester/postgres.h                         |    22 +
 src/trsp/tester/testit.cpp                         |    22 +
 src/tsp/doc/index.rst                              |   234 -
 src/tsp/doc/pgr_tsp.rst                            |   246 +
 src/tsp/sql/routing_tsp.sql                        |    30 +-
 src/tsp/sql/routing_tsp_wrappers.sql               |    34 +-
 src/tsp/sql/xyd_tsp.sql                            |    11 +
 src/tsp/src/CMakeLists.txt                         |    38 +-
 src/tsp/src/Dmatrix.cpp                            |   181 +
 src/tsp/src/Dmatrix.hpp                            |    39 +
 src/tsp/src/OBSOLETE/tsp.c                         |    22 +
 src/tsp/src/distances_input.c                      |   130 +
 src/tsp/src/distances_input.h                      |    37 +
 src/tsp/src/pgr_tsp.cpp                            |   381 +
 src/tsp/src/pgr_tsp.hpp                            |    93 +
 src/tsp/src/tsp.h                                  |    37 +-
 src/tsp/src/tsp2.c                                 |    86 +-
 src/tsp/src/tsp_driver.cpp                         |   234 +
 src/tsp/src/tsp_driver.h                           |    51 +
 src/tsp/src/tsplib.c                               |   107 +-
 src/tsp/src/xyd_tsp.c                              |   208 +
 src/tsp/test/test.conf                             |    10 +-
 src/tsp/test/tsp-any-00.test.sql                   |    22 +
 src/tsp/test/tsp-any-01.test.sql                   |    22 +
 src/tsp/test/tsp-any-03.test.sql                   |    22 +
 src/tsp/test/tsp-any-04.test.sql                   |    22 +
 src/tsp/test/tsp-any-05.test.sql                   |    22 +
 {doc => src/tsp}/test/tsp-any.result               |     0
 src/tsp/test/tsp-any.test.sql                      |    14 +
 src/tsp/test/tsp.data                              |    12 +
 src/vrp_basic/CMakeLists.txt                       |     1 -
 src/vrp_basic/doc/index.rst                        |    20 -
 src/vrp_basic/doc/pgr_vrpOneDepot.rst              |    20 +
 src/vrp_basic/sql/CMakeLists.txt                   |     2 +-
 src/vrp_basic/sql/routing_vrp.sql                  |    24 +-
 src/vrp_basic/src/Tester.cpp                       |   534 +-
 src/vrp_basic/src/Utils.h                          |   238 +-
 src/vrp_basic/src/VRP.c                            |  1838 +-
 src/vrp_basic/src/VRP.h                            |   170 +-
 src/vrp_basic/src/VRP_Solver.cpp                   |  2071 +--
 src/vrp_basic/src/VRP_Solver.h                     |   854 +-
 src/vrp_basic/src/VRP_core.cpp                     |   481 +-
 src/vrp_basic/test/VRP-any-01.test.sql             |    22 +
 src/vrp_basic/test/VRP-any-02.test.sql             |    22 +
 src/vrpdptw/test/README.vrpdptw-testdata           |    33 -
 src/vrpdptw/test/vrpdptw-testdata.sql.gz           |   Bin 1996513 -> 0 bytes
 src/vrppdtw/doc/index.rst                          |     5 +-
 src/vrppdtw/sql/routing_vrppdtw.sql                |     2 +-
 src/vrppdtw/src/CMakeLists.txt                     |     9 +-
 .../doc/CMakeLists.txt                             |     0
 src/withPoints/doc/doc-pgr_withPoints.queries      |   206 +
 src/withPoints/doc/doc-pgr_withPointsCost.queries  |   103 +
 src/withPoints/doc/doc-pgr_withPointsDD.queries    |    94 +
 src/withPoints/doc/doc-pgr_withPointsKSP.queries   |   133 +
 src/withPoints/doc/doc-pgr_withPointsVia.queries   |    37 +
 src/withPoints/doc/doc-withPointsVia.queries       |   100 +
 src/withPoints/doc/images/leftDrivingSide.png      |   Bin 0 -> 97902 bytes
 src/withPoints/doc/images/noMatterDrivingSide.png  |   Bin 0 -> 63207 bytes
 src/withPoints/doc/images/rightDrivingSide.png     |   Bin 0 -> 97704 bytes
 src/withPoints/doc/pgr_withPoints.rst              |   292 +
 src/withPoints/doc/pgr_withPointsCost.rst          |   287 +
 src/withPoints/doc/pgr_withPointsDD.rst            |   213 +
 src/withPoints/doc/pgr_withPointsKSP.rst           |   186 +
 src/withPoints/doc/pgr_withPointsVia.rst           |   190 +
 src/withPoints/doc/withPoints.rst                  |   175 +
 src/withPoints/doc/withPoints_queries.txt          |    51 +
 src/withPoints/sql/CMakeLists.txt                  |     9 +
 src/withPoints/sql/withPoints.sql                  |   264 +
 src/withPoints/sql/withPointsCost.sql              |   132 +
 src/withPoints/sql/withPointsVia.sql               |   165 +
 src/withPoints/src/CMakeLists.txt                  |    15 +
 src/withPoints/src/get_new_queries.cpp             |    59 +
 src/withPoints/src/get_new_queries.h               |    45 +
 src/withPoints/src/many_to_many_withPoints.c       |   282 +
 .../src/many_to_many_withPoints_driver.cpp         |   210 +
 .../src/many_to_many_withPoints_driver.h           |    71 +
 src/withPoints/src/many_to_one_withPoints.c        |   269 +
 .../src/many_to_one_withPoints_driver.cpp          |   173 +
 src/withPoints/src/many_to_one_withPoints_driver.h |    62 +
 src/withPoints/src/msg_logger.hpp                  |    45 +
 src/withPoints/src/one_to_many_withPoints.c        |   324 +
 .../src/one_to_many_withPoints_driver.cpp          |   198 +
 src/withPoints/src/one_to_many_withPoints_driver.h |    69 +
 src/withPoints/src/one_to_one_withPoints.c         |   307 +
 .../src/one_to_one_withPoints_driver.cpp           |   175 +
 src/withPoints/src/one_to_one_withPoints_driver.h  |    63 +
 src/withPoints/src/pgr_withPoints.cpp              |   428 +
 src/withPoints/src/pgr_withPoints.hpp              |    66 +
 src/withPoints/test/doc-pgr_withPoints.result      |   113 +
 src/withPoints/test/doc-pgr_withPoints.test.sql    |    76 +
 src/withPoints/test/doc-pgr_withPointsCost.result  |    31 +
 .../test/doc-pgr_withPointsCost.test.sql           |    55 +
 src/withPoints/test/doc-pgr_withPointsDD.result    |    52 +
 src/withPoints/test/doc-pgr_withPointsDD.test.sql  |    36 +
 src/withPoints/test/doc-pgr_withPointsKSP.result   |    95 +
 src/withPoints/test/doc-pgr_withPointsKSP.test.sql |    32 +
 .../test/doc-pgr_withPointsVia.result}             |     0
 src/withPoints/test/doc-pgr_withPointsVia.test.sql |    36 +
 .../many_to_many_eq_one_to_one_withPoint.test.sql  |   126 +
 .../many_to_one_eq_one_to_one_withPoint.test.sql   |    86 +
 .../one_to_many_eq_one_to_one_withPoint.test.sql   |    86 +
 .../test/pgtap/one_to_many_withPoint.test.sql      |   188 +
 .../test/pgtap/one_to_one_withPoint.test.sql       |    99 +
 src/withPoints/test/test.conf                      |    30 +
 tools/build-extension-update-files                 |     1 +
 tools/doxygen/Doxyfile                             |    46 +-
 tools/licences/CCM_license.txt                     |     8 +
 tools/licences/GNU_license.txt                     |    22 +
 tools/licences/MIT_license.txt                     |    29 +
 tools/licences/add-licenses                        |   217 +
 tools/mapserver/arialbd.ttf                        |   Bin 288496 -> 0 bytes
 tools/mapserver/fonts.txt                          |     1 -
 tools/mapserver/trsp-test-image.map                |   130 -
 tools/mapserver/trsp-test-image.png                |   Bin 6689 -> 0 bytes
 tools/mk-signature-file                            |    38 +-
 tools/performanceQueries/allPairs-performance.sql  |   244 +
 tools/sigs/pgrouting--2.0.1.sig                    |    36 +
 tools/sigs/pgrouting--2.1.0.sig                    |    76 +-
 tools/template/create.sh                           |   124 +
 .../test => tools/template/doc}/CMakeLists.txt     |     0
 tools/template/doc/pgr_function1.rst               |   284 +
 tools/template/sql/CMakeLists.txt                  |     7 +
 tools/template/sql/function1.sql                   |    37 +
 tools/template/src/CMakeLists.txt                  |     3 +
 tools/template/src/function1.c                     |   224 +
 tools/template/src/function1_driver.cpp            |   134 +
 tools/template/src/function1_driver.h              |    58 +
 tools/template/test/doc-function1.result           |    19 +
 tools/template/test/doc-function1.test.sql         |    13 +
 tools/template/test/pgtap/types-check.sql          |   126 +
 tools/template/test/test.conf                      |    25 +
 tools/test-runner.pl                               |   444 -
 tools/testers/algorithm-tester.pl                  |   537 +
 tools/testers/pg_prove_tests.sh                    |    56 +
 tools/testers/sampledata.sql                       |    97 +
 tools/testers/setup.sql                            |    17 +
 tools/testers/setup_db.sql                         |    24 +
 tools/{test-update.sh => testers/update-tester.pl} |     0
 tools/travis/before_script.sh                      |    14 +
 tools/travis/check-extensions.sh                   |    41 +
 tools/travis/install-postgres9.5.sh                |    58 +
 tools/travis/install_pgtap.sh                      |    26 +
 tools/travis/pgrouting_build.sh                    |     5 +-
 tools/travis/pgrouting_prepare.sh                  |    42 -
 tools/travis/pgrouting_test.sh                     |    63 +-
 tools/travis/postGIS_install.sh                    |    93 +
 tools/winnie/build_pgrouting.sh                    |     5 +-
 tools/winnie/package_pgrouting.sh                  |     4 +
 908 files changed, 58074 insertions(+), 58294 deletions(-)

diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..75d447e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,15 @@
+### Expected behavior and actual behavior
+
+
+### Steps to reproduce the problem
+
+
+### Specifications like the version of pgRouting/PostGIS and PostgreSQL as well as Operating System
+
+Use the commands:
+```
+SELECT version();
+SELECT postgis_full_version();
+SELECT pgr_version();
+```
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..eebfe2b
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,8 @@
+Fixes # .
+
+Changes proposed in this pull request:
+-
+-
+-
+
+ at pgRouting/admins
diff --git a/.gitignore b/.gitignore
index 5ea4f44..f685e80 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 # default build directory
 build
+src/turnRestricted
 .DS_Store
 .vagrant
 issues
diff --git a/.travis.yml b/.travis.yml
index ad11004..c6e4ef8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,12 +5,19 @@
 # Main configuration
 # ------------------------------------------------------------------------------
 
-language: c
+#choose precise or trusty
+
+group: edge
+3dist: trusty    
+
+#dist: precise
 
 sudo: required
 
+language: c
+
 compiler:
-  - gcc
+    - gcc
 
 notifications:
   email:
@@ -21,46 +28,62 @@ branches:
     - master
     - develop
 
-addons:
-  postgresql: "9.2"
-  postgresql: "9.3"
-  postgresql: "9.4"
+env:
+  - POSTGRESQL_VERSION=9.1
+  - POSTGRESQL_VERSION=9.2
+  - POSTGRESQL_VERSION=9.3
+  - POSTGRESQL_VERSION=9.4
+  - POSTGRESQL_VERSION=9.5
 
-services:
-  #- postgresql: 9.1
-  #- postgresql: 9.2
-  #- postgresql: 9.3
 
-env:
-  matrix:
-    - POSTGRESQL_VERSION=9.4 POSTGIS_VERSION=2.1
-    - POSTGRESQL_VERSION=9.3 POSTGIS_VERSION=2.1
-    - POSTGRESQL_VERSION=9.2 POSTGIS_VERSION=2.1
-    - POSTGRESQL_VERSION=9.1 POSTGIS_VERSION=2.1
-
-    - POSTGRESQL_VERSION=9.4 POSTGIS_VERSION=2.0
-    - POSTGRESQL_VERSION=9.3 POSTGIS_VERSION=2.0
-    - POSTGRESQL_VERSION=9.2 POSTGIS_VERSION=2.0
-    - POSTGRESQL_VERSION=9.1 POSTGIS_VERSION=2.0
-
-    ## We are NOT supporting these for pgrouting 2.1.0
-    #- POSTGRESQL_VERSION=8.4 POSTGIS_VERSION=1.5
-    #- POSTGRESQL_VERSION=9.0 POSTGIS_VERSION=1.5
-    #- POSTGRESQL_VERSION=9.1 POSTGIS_VERSION=1.5
+# excecuted. So things have to be tested oe by one.
+addons:
+  apt:
+    sources:
+      # For gcc >= 4.8
+      - ubuntu-toolchain-r-test
+      # For cmake >= 2.8.8 (for CMakePackageConfigHelpers)
+      - kubuntu-backports
+      - boost-latest
+    packages:
+      - g++-4.8
+      - cmake
+      - libboost-thread-dev
+      - libboost-graph-dev
+      - libcgal-dev
+      - postgresql-server-dev-all
+      - postgresql-common
+
 
 install:
-  - ./tools/travis/pgrouting_install.sh $POSTGRESQL_VERSION $POSTGIS_VERSION
+  - sudo /etc/init.d/postgresql stop
+  - sudo /etc/init.d/postgresql stop
+  - sudo ./tools/travis/install-postgres9.5.sh $POSTGRESQL_VERSION postgres
 
 before_script:
-  #-
+  # Add our chosen PG version to the path
+  - export PATH=/usr/lib/postgresql/$POSTGRESQL_VERSION/bin:$PATH
+  # Stop whichever version of PG that travis started
+  - sudo /etc/init.d/postgresql stop
+  # Start the version of PG that we want to test
+  - sudo /etc/init.d/postgresql start $POSTGRESQL_VERSION
+  # Install pgtap and pg_prove
+  # pgtap has to be installed after postgres has started
+  - ./tools/travis/install_pgtap.sh $POSTGRESQL_VERSION
+  - sudo apt-get install -y libtap-parser-sourcehandler-pgtap-perl
+  # initialize databases
+  - createdb  -U postgres ___pgr___test___
+  - createdb  -U postgres pgr_test__db__test
+  - ./tools/travis/check-extensions.sh $POSTGRESQL_VERSION ___pgr___test___
 
 script: 
   - ./tools/travis/pgrouting_build.sh $POSTGRESQL_VERSION $POSTGIS_VERSION
 
 after_script: 
-  - ./tools/travis/pgrouting_prepare.sh $POSTGRESQL_VERSION $POSTGIS_VERSION
-  - ./tools/travis/pgrouting_test.sh $POSTGRESQL_VERSION $POSTGIS_VERSION
+  # note: right takes the travis default
+  - ./tools/travis/pgrouting_test.sh $POSTGRESQL_VERSION postgres
+  - ./tools/testers/pg_prove_tests.sh postgres
 
-after_success:
+#after_success:
   #- ./tools/travis/pgrouting_deploy.sh $POSTGRESQL_VERSION $POSTGIS_VERSION
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57cccac..a80c25c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,14 +5,13 @@
 # (http://www.cmake.org/cmake/help/v2.8.10/cmake.html)
 #
 
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8./ FATAL_ERROR)
 project(PGROUTING)
 
 #set(CMAKE_VERBOSE_MAKEFILE 1)
 
 # Configure options
 
-
 option(WITH_DOC
     "Set ON|OFF (default=OFF) to build Documentation library tree" OFF)
 
@@ -31,18 +30,20 @@ SET(POSTGRESQL_BIN "" CACHE STRING "Define optional path to PostgreSQL binaries
 #-----------------------------------------------------------------------------
 # PGROUTING version number.
 set(PGROUTING_VERSION_MAJOR "2")
-set(PGROUTING_VERSION_MINOR "1")
+set(PGROUTING_VERSION_MINOR "2")
 set(PGROUTING_VERSION_PATCH "0")
 
 set(PGROUTING_VERSION_STRING "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}.${PGROUTING_VERSION_PATCH}")
+set(PGROUTING_VERSION "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}")
 
 set(POSTGRESQL_MINIMUM_VERSION "9.1.0")
 set(POSTGIS_MINIMUM_VERSION "2.0.0")
 
 file(STRINGS "${PGROUTING_SOURCE_DIR}/VERSION" PGROUTING_BUILD_STRING)
 
-string(REGEX REPLACE "^(.+)-([0-9]+)-g([0-9a-f]+) (.*)$" "\\1" PGROUTING_GIT_TAG ${PGROUTING_BUILD_STRING})
-string(REGEX REPLACE "^(.+)-([0-9]+)-g([0-9a-f]+) (.*)$" "\\2" PGROUTING_GIT_BUILD ${PGROUTING_BUILD_STRING})
+set(PGROUTING_GIT_TAG "pgrouting-2.2.0")
+#string(REGEX REPLACE "^(.+)-([0-9]+)-g([0-9a-f]+) (.*)$" "\\1" PGROUTING_GIT_TAG ${PGROUTING_BUILD_STRING})
+string(REGEX REPLACE "^(.+)-([^-]+)-[0-9]+-g([0-9a-f]+) (.*)$" "\\2" PGROUTING_GIT_BUILD ${PGROUTING_BUILD_STRING})
 string(REGEX REPLACE "^(.+)-([0-9]+)-g([0-9a-f]+) (.*)$" "\\3" PGROUTING_GIT_HASH ${PGROUTING_BUILD_STRING})
 string(REGEX REPLACE "^(.+)-([0-9]+)-g([0-9a-f]+) (.*)$" "\\4" PGROUTING_GIT_BRANCH ${PGROUTING_BUILD_STRING})
 
@@ -174,6 +175,7 @@ add_subdirectory(doc)
 set(PGROUTING_INCLUDE_DIRECTORIES
     ${PGROUTING_SOURCE_DIR}/src/apsp_johnson/src
     ${PGROUTING_SOURCE_DIR}/src/apsp_warshall/src
+    ${PGROUTING_SOURCE_DIR}/src/allpairs/src
     ${PGROUTING_SOURCE_DIR}/src/astar/src
     ${PGROUTING_SOURCE_DIR}/src/bd_astar/src
     ${PGROUTING_SOURCE_DIR}/src/bd_dijkstra/src
@@ -193,7 +195,6 @@ set(PGROUTING_INCLUDE_DIRECTORIES
 
 #not suported but directory exists
 #    ${PGROUTING_SOURCE_DIR}/src/shooting_star/src
-#    ${PGROUTING_SOURCE_DIR}/src/vrpdptw/src
     )
 
 include_directories(${PGROUTING_INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
@@ -210,6 +211,7 @@ if(WIN32)
   link_libraries(postgres)
 endif(WIN32)
 
+# TODO default compilation with -dNDEBUG 
 
 #compiler directives
 if(APPLE)
@@ -226,22 +228,90 @@ if(APPLE)
   endif()
 
 elseif(UNIX) # UNIX system variable include UNIX like system(i.e. APPLE and CYGWIN)
-  set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -O2 -g -Wall -frounding-math")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O2 -g -Wall -std=c++0x -frounding-math -Wno-deprecated")
+    #set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -std=gnu99 -fPIC -O2 -g -Wall -Wconversion -pedantic -fmax-errors=10  -Wmissing-prototypes -frounding-math")
+    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC -O2 -g -Wall -Wconversion -pedantic -fmax-errors=10 -Wextra  -frounding-math -Wno-deprecated")
+
+    set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -fPIC -O2 -g  -frounding-math")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O2 -g -std=c++0x -frounding-math -Wno-deprecated")
 
 elseif(WIN32)
-  # currently, support MinGW only
-  set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O2 -g -Wall -frounding-math")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g  -std=c++0x -frounding-math -Wno-deprecated")
+    # currently, support MinGW only
+    set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O2  -frounding-math")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2  -std=c++0x -frounding-math -Wno-deprecated")
 endif()
 
 # List variable to collect module SQL file names
 set(PACKAGE_SQL_FILES "")
 set(L_PACKAGE_SQL_FILES "")
 
-# Recurse into the subdirectories.
-add_subdirectory(src)
-list(APPEND L_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
+#==========================
+#  PgRouting_SOURCE_NAMES
+#==========================
+
+set(PgRouting_SOURCE_NAMES
+    "common"
+
+    #to be deprecated
+    "kdijkstra"
+
+    "dijkstra"
+    "driving_distance"
+    "ksp"
+    "allpairs"
+    "withPoints"
+
+    #"funnyDijkstra"
+
+    "alpha_shape"
+
+    "astar" "bd_astar"
+    "bd_dijkstra"
+    "trsp" #2.0
+    "tsp"
+
+    "vrp_basic"
+    "vrppdtw"
+
+    )
+
+#-------------------
+# add the subdirectories that have the C/C++ code 
+#-------------------
+
+foreach (subdir ${PgRouting_SOURCE_NAMES})
+    add_subdirectory("${PGROUTING_SOURCE_DIR}/src/${subdir}/src")
+endforeach()
+
+#-----------------------------------------------------------------------------
+# List variable to collect module SQL file names
+#-----------------------------------------------------------------------------
+set(PgRouting_SQL_DIRECTORIES ${PgRouting_SOURCE_NAMES}
+    "apsp_johnson"  #V2.0
+    "apsp_warshall" #V2.0
+    "convinience"
+    "topology"
+    "label_graph")
+
+
+set(PACKAGE_SQL_FILES "")
+set(LIST_PACKAGE_SQL_FILES "")
+
+foreach (subdir ${PgRouting_SQL_DIRECTORIES})
+    add_subdirectory("${PGROUTING_SOURCE_DIR}/src/${subdir}/sql")
+endforeach()
+
+list(APPEND LIST_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
+
+#if (CDEBUG)
+    foreach (files ${LIST_PACKAGE_SQL_FILES})
+        message("${files}")
+    endforeach()
+#endif()
+
+
+#add_subdirectory(src)
+#list(APPEND L_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
+
 
 # assemble the object files from the src functions into
 # a single library librouting.so
@@ -256,58 +326,58 @@ endif(APPLE)
 
 LINK_LIBRARIES(${CGAL_LIBRARIES} ${GMP_LIBRARIES} ${BOOST_THREAD_LIBRARIES})
 
-# libraries listed in alphabetical order.
-add_library(routing-2.1
+#-------------------
+# pgRouting objects to be linked
+#-------------------
+foreach (subdir ${PgRouting_SOURCE_NAMES} )
+    set(PGROUTING_OBJECTS ${PGROUTING_OBJECTS} "$<TARGET_OBJECTS:${subdir}>")
+endforeach()
+
+
+#-----------------------------------------------------------------------------
+# PGROUTING Library names
+#-----------------------------------------------------------------------------
+
+message("Building the library names")
+
+#----------------------
+# PGROUTING installation files names have the following name
+#----------------------
+set(PGROUTING_LIB_NAME "pgrouting-${PGROUTING_VERSION}")
+
+
+#----------------------
+# PGROUTING library name used in the pgr_functions
+#  '$libdir/${PGROUTING_LIBRARY_NAME}'
+#----------------------
+set(PGROUTING_LIBRARY_NAME "libpgrouting-${PGROUTING_VERSION}")
+
+add_library(${PGROUTING_LIB_NAME}
     ${LIBRARY_MODE_TARGET}
-    $<TARGET_OBJECTS:apsp_johnson>
-    $<TARGET_OBJECTS:apsp_warshall>
-    $<TARGET_OBJECTS:astar>
-    $<TARGET_OBJECTS:bd_astar>
-    $<TARGET_OBJECTS:bd_dijkstra>
-    $<TARGET_OBJECTS:common>
-    $<TARGET_OBJECTS:dijkstra>
-    $<TARGET_OBJECTS:driving_distance>
-    $<TARGET_OBJECTS:kdijkstra>
-    $<TARGET_OBJECTS:ksp>
-    $<TARGET_OBJECTS:trsp>
-    $<TARGET_OBJECTS:tsp>
-    $<TARGET_OBJECTS:vrp_basic>
-    $<TARGET_OBJECTS:vrppdtw>
-
-#not supported but directory exists
-#    $<TARGET_OBJECTS:shooting_star>
-    )
+    ${PGROUTING_OBJECTS})
 
-install(TARGETS routing-2.1 DESTINATION ${LIBRARY_INSTALL_PATH})
+install(TARGETS ${PGROUTING_LIB_NAME} DESTINATION ${LIBRARY_INSTALL_PATH})
 
-#add_library(routing_vrp
-#add_library(routing_bd
-#add_library(routing_dd
-#add_library(routing
 
 
 if(APPLE)
-    set_target_properties(routing-2.1
+    set_target_properties(${PGROUTING_LIB_NAME}
         PROPERTIES
         LINK_FLAGS "-bundle_loader ${POSTGRESQL_EXECUTABLE} -bundle")
 endif(APPLE)
 
 
 file(WRITE "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql.in"
-"-- pgRouting version '${PGROUTING_VERSION_STRING}' extension for postgresql\n")
+    "-- pgRouting version '${PGROUTING_VERSION_STRING}' extension for postgresql\n")
 
 file(APPEND "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql.in"
-  "-- Complain if script is sourced in pgsql, rather than CREATE EXTENSION\n")
+    "-- Complain if script is sourced in pgsql, rather than CREATE EXTENSION\n")
 #file(APPEND "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql.in"
 #    "\\echo Use \"CREATE EXTENSION pgrouting\" to load this file. \\quit")
 
 
-cat("${PGROUTING_SOURCE_DIR}/src/common/sql/pgrouting-types.sql"
-    "${PGROUTING_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql.in")
-#cat("${PGROUTING_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql.in")
-
 
-foreach(PACKAGE_SQL_FILE ${L_PACKAGE_SQL_FILES})
+foreach(PACKAGE_SQL_FILE ${LIST_PACKAGE_SQL_FILES})
     cat(${PACKAGE_SQL_FILE} "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql.in")
 endforeach()
 
@@ -323,20 +393,20 @@ configure_file("${PGROUTING_SOURCE_DIR}/src/common/sql/pgrouting.control.in"
 # create the signature file for this release
 message(STATUS "Creating lib/pgrouting--${PGROUTING_VERSION_STRING}.sig")
 execute_process(
-  COMMAND ${PERL_EXECUTABLE} ${PGROUTING_SOURCE_DIR}/tools/mk-signature-file ${PGROUTING_VERSION_STRING}
-  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-  RESULT_VARIABLE SIG_RESULT
-)
+    COMMAND ${PERL_EXECUTABLE} ${PGROUTING_SOURCE_DIR}/tools/mk-signature-file ${PGROUTING_VERSION_STRING}
+    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+    RESULT_VARIABLE SIG_RESULT
+    )
 if(SIG_RESULT)
     message(FATAL_ERROR "    SIG_RESULT: ${SIG_RESULT}")
 endif(SIG_RESULT)
 
 # create the extension update scripts
 execute_process(
-  COMMAND ${PERL_EXECUTABLE} ${PGROUTING_SOURCE_DIR}/tools/build-extension-update-files ${PGROUTING_VERSION_STRING} ${PGROUTING_SOURCE_DIR}
-  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-  RESULT_VARIABLE UPDATE_RESULT
-)
+    COMMAND ${PERL_EXECUTABLE} ${PGROUTING_SOURCE_DIR}/tools/build-extension-update-files ${PGROUTING_VERSION_STRING} ${PGROUTING_SOURCE_DIR}
+    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+    RESULT_VARIABLE UPDATE_RESULT
+    )
 if(UPDATE_RESULT)
     message(FATAL_ERROR "   UPDATE_RESULT: ${UPDATE_RESULT}")
 endif(UPDATE_RESULT)
@@ -344,12 +414,6 @@ endif(UPDATE_RESULT)
 # make a list of the files we need to install for version updates
 file(GLOB VERSION_UPDATE_FILES "${CMAKE_BINARY_DIR}/lib/pgrouting--*--*.sql")
 
-# We will copy the pgrouting_legacy.sql, but not install it as part of 
-# the extension. TODO: we might want to also include a 
-# pgrouting_legacy_uninstall.sql file or add it to the extension
-#configure_file("${PGROUTING_SOURCE_DIR}/src/common/sql/pgrouting_legacy.sql"
-#    "${CMAKE_BINARY_DIR}/lib/pgrouting_legacy.sql" COPYONLY)
-
 # this will create the commands in the makefile under the install target
 if(UNIX)
     file(GLOB_RECURSE LIBS_TO_INSTALL "${CMAKE_BINARY_DIR}/lib/*.so")
@@ -365,6 +429,5 @@ install(FILES
     "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql"
     "${CMAKE_BINARY_DIR}/lib/pgrouting.control"
     ${VERSION_UPDATE_FILES}
-#    "${CMAKE_BINARY_DIR}/lib/pgrouting_legacy.sql"
     DESTINATION "${SHARE_DIR}")
 
diff --git a/NEWS b/NEWS
index e5b33f7..d9e912d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,35 @@
 
+Changes for 2.2.0
+-------------------------------------------------------------------------------
+
+  - Improved:
+    - pgr_nodeNetwork
+      - Adding a row_where and outall optional parameters
+
+  - Signature fix
+    - pgr_dijkstra  -- to match what was documented (the pgr_dijkstra from V2.0)
+
+  - New functions
+    - pgr_floydWarshall
+    - pgr_Johnson
+    - pgr_DijkstraCost
+
+  - New Proposed functions
+    - pgr_withPoints
+    - pgr_withPointsCost
+    - pgr_withPointsDD
+    - pgr_withPointsKSP
+    - pgr_dijkstraVia
+
+
+  - Deprecated functions:
+    - pgr_apspWarshall  use pgr_floydWarshall instead
+    - pgr_apspJohnson   use pgr_Johnson instead
+    - pgr_kDijkstraCost use pgr_dijkstraCost instead
+    - pgr_kDijkstraPath use pgr_dijkstra instead
+
+
+
 Changes for 2.1.0
 -------------------------------------------------------------------------------
 
diff --git a/README.md b/README.md
index fc189c3..55833ea 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,8 @@
 
 ### Current Development is in the *develop* branch
 
-The *master* branch reflects our current 2.1.0 release.
-Post 2.1.0 development will happen in the *develop* branch.
+The *master* branch reflects the current 2.2.0 release.
+
 
 
 ## LINKS
@@ -25,18 +25,13 @@ Post 2.1.0 development will happen in the *develop* branch.
 	<tr>
 		<td>master</td>
 		<td><img src="https://travis-ci.org/pgRouting/pgrouting.png?branch=master" alt="Build Status"/></td>
-		<td>not enabled</td>
 	</tr>
 	<tr>
 		<td>develop</td>
 		<td><img src="https://travis-ci.org/pgRouting/pgrouting.png?branch=develop" alt="Build Status"/></td>
 		<td></td>
 	</tr>
-        <tr>
-                <td>develop_2_1_0</td>
-                <td><img src="https://travis-ci.org/pgRouting/pgrouting.png?branch=develop_2_1_0" alt="Build Status"/></td>
-                <td></td>
-        </tr>
+
 	<tr>
 		<td>gh-pages</td>
 		<td><img src="https://travis-ci.org/pgRouting/pgrouting.png?branch=gh-pages" alt="Build Status"/></td>
@@ -55,13 +50,28 @@ This library contains following features:
 * Shortest Path A*
 * Bi-directional Dijkstra Shortest Path
 * Bi-directional A* Shortest Path
-* Shortest Path Dijkstra
+* Shortest Path Dijkstra Family of functions
+* Shortest Path Dijkstra Cost Family of functions
 * Driving Distance
-* K-Shortest Path, Multiple Alternative Paths
-* K-Dijkstra, One to Many Shortest Path
+* K-Shortest Path, Multiple Alternative Paths (Yen's algorithm)
 * Traveling Sales Person
 * Turn Restriction Shortest Path (TRSP)
 
+Additionaly, ready for testing and to be part of 2.3 official version:
+
+* Shortest Path Dijkstra With Points Family of functions
+* Shortest Path Dijkstra Cost With Points Family of functions
+* Driving Distance With Points
+* K-Shortest Path With Points, Multiple Alternative Paths (Yen's algorithm)
+* Dijkstra Via vertices
+
+Family of functions include:
+
+* one to one
+* one to many
+* many to one
+* many to many
+
 
 ## REQUIREMENTS
 
@@ -69,8 +79,7 @@ This library contains following features:
 * Postgresql version >= 9.1
 * PostGIS version >= 2.0
 * The Boost Graph Library (BGL).
-  * Version >= 1.55 for linux
-  * Version >= 1.58 for MAC
+  * Version >= 1.46
 * CMake >= 2.8.8
 * CGAL >= 4.4
 * Sphinx >= 1.2
@@ -106,12 +115,12 @@ Build with documentation (requires [Sphinx](http://sphinx-doc.org/))
 Postgresql 9.1+
 
 	createdb mydatabase
-	psql mydatabase -c "create extension postgis"
-	psql mydatabase -c "create extension pgrouting"
+	psql mydatabase -c "CREATE EXTENSION postgis"
+	psql mydatabase -c "CREATE EXTENSION pgrouting"
 
 ## USAGE
 
-See online documentation: http://docs.pgrouting.org/dev/doc/index.html
+See online documentation: http://docs.pgrouting.org/en/2.2/doc/index.html
 
 
 ## LICENSE
diff --git a/VERSION b/VERSION
index 72e643e..4a204e8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-pgrouting-2.1.0-1-gb38118a master
+pgrouting-2.2.0-RC1-13-gafc622e master
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..b4b1534
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,76 @@
+# ------------------------------------------------------------------------------
+# appVeyor script
+# Copyright(c) pgRouting Contributors
+#
+# Main configuration
+# ------------------------------------------------------------------------------
+
+
+
+
+
+notifications:
+  email:
+    on_failure: vicky_vergara at hotmail.com
+
+branches:
+  only:
+    - master
+    - develop
+    - dev-2.2
+
+    
+
+services:
+  - postgresql
+
+environment:
+  POSTGRESQL_VERSION: 9.4
+
+# excecuted. So things have to be tested oe by one.
+#addons:
+#  apt:
+#    sources:
+# For gcc >= 4.8
+# - ubuntu-toolchain-r-test
+# For cmake >= 2.8.8 (for CMakePackageConfigHelpers)
+#- kubuntu-backports
+#      - boost-latest
+#    packages:
+#- cmake
+#      - libboost-thread-dev
+#- libboost-graph-dev
+#- libcgal-dev
+#- postgresql-server-dev-all
+#- postgresql-common
+
+
+#- export PATH=/usr/lib/postgresql/$POSTGRESQL_VERSION/bin:$PATH # Add our chosen PG version to the path
+#- sudo /etc/init.d/postgresql stop                      # Stop whichever version of PG that travis started
+#- sudo apt-get install -y postgresql-9.5
+#- sudo apt-get install -y postgresql-9.5-postgis
+#- sudo /etc/init.d/postgresql stop                      # Stop whichever version of PG that travis started
+#- sudo /etc/init.d/postgresql start $POSTGRESQL_VERSION # Start the version of PG that we want to test
+#before_script:
+    
+# - ./tools/travis/install_pgtap.sh $POSTGRESQL_VERSION   # pgtap has to be installed after postgres has started
+#- sudo apt-get install -y libtap-parser-sourcehandler-pgtap-perl
+#- createdb  ___pgr___test___
+#- createdb  pgr_test__db__test
+#- ./tools/travis/check-extensions.sh $POSTGRESQL_VERSION ___pgr___test___
+
+
+#before_install:
+
+#before_script:
+
+#script: 
+
+#- ./tools/travis/pgrouting_build.sh $POSTGRESQL_VERSION $POSTGIS_VERSION
+#- ./tools/travis/pgrouting_test.sh $POSTGRESQL_VERSION
+
+#after_script: 
+
+#- ./tools/travis/pg_prove_tests.sh postgres
+
+#after_success:
diff --git a/cmake/CMakeParseArguments.cmake.back b/cmake/CMakeParseArguments.cmake.back
new file mode 100644
index 0000000..016da0c
--- /dev/null
+++ b/cmake/CMakeParseArguments.cmake.back
@@ -0,0 +1,138 @@
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+#
+# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
+# parsing the arguments given to that macro or function.
+# It processes the arguments and defines a set of variables which hold the
+# values of the respective options.
+#
+# The <options> argument contains all options for the respective macro,
+# i.e. keywords which can be used when calling the macro without any value
+# following, like e.g. the OPTIONAL keyword of the install() command.
+#
+# The <one_value_keywords> argument contains all keywords for this macro
+# which are followed by one value, like e.g. DESTINATION keyword of the
+# install() command.
+#
+# The <multi_value_keywords> argument contains all keywords for this macro
+# which can be followed by more than one value, like e.g. the TARGETS or
+# FILES keywords of the install() command.
+#
+# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# keywords listed in <options>, <one_value_keywords> and
+# <multi_value_keywords> a variable composed of the given <prefix>
+# followed by "_" and the name of the respective keyword.
+# These variables will then hold the respective value from the argument list.
+# For the <options> keywords this will be TRUE or FALSE.
+#
+# All remaining arguments are collected in a variable
+# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
+# your macro was called with unrecognized parameters.
+#
+# As an example here a my_install() macro, which takes similar arguments as the
+# real install() command:
+#
+#   function(MY_INSTALL)
+#     set(options OPTIONAL FAST)
+#     set(oneValueArgs DESTINATION RENAME)
+#     set(multiValueArgs TARGETS CONFIGURATIONS)
+#     cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+#     ...
+#
+# Assume my_install() has been called like this:
+#   my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
+#
+# After the cmake_parse_arguments() call the macro will have set the following
+# variables:
+#   MY_INSTALL_OPTIONAL = TRUE
+#   MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
+#   MY_INSTALL_DESTINATION = "bin"
+#   MY_INSTALL_RENAME = "" (was not used)
+#   MY_INSTALL_TARGETS = "foo;bar"
+#   MY_INSTALL_CONFIGURATIONS = "" (was not used)
+#   MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
+#
+# You can then continue and process these variables.
+#
+# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
+# another recognized keyword follows, this is interpreted as the beginning of
+# the new option.
+# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
+# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
+# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf at kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+
+if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
+  return()
+endif()
+set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
+
+
+function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
+  # first set all result variables to empty/FALSE
+  foreach(arg_name ${_singleArgNames} ${_multiArgNames})
+    set(${prefix}_${arg_name})
+  endforeach()
+
+  foreach(option ${_optionNames})
+    set(${prefix}_${option} FALSE)
+  endforeach()
+
+  set(${prefix}_UNPARSED_ARGUMENTS)
+
+  set(insideValues FALSE)
+  set(currentArgName)
+
+  # now iterate over all arguments and fill the result variables
+  foreach(currentArg ${ARGN})
+    list(FIND _optionNames "${currentArg}" optionIndex)  # ... then this marks the end of the arguments belonging to this keyword
+    list(FIND _singleArgNames "${currentArg}" singleArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
+    list(FIND _multiArgNames "${currentArg}" multiArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
+
+    if(${optionIndex} EQUAL -1  AND  ${singleArgIndex} EQUAL -1  AND  ${multiArgIndex} EQUAL -1)
+      if(insideValues)
+        if("${insideValues}" STREQUAL "SINGLE")
+          set(${prefix}_${currentArgName} ${currentArg})
+          set(insideValues FALSE)
+        elseif("${insideValues}" STREQUAL "MULTI")
+          list(APPEND ${prefix}_${currentArgName} ${currentArg})
+        endif()
+      else()
+        list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
+      endif()
+    else()
+      if(NOT ${optionIndex} EQUAL -1)
+        set(${prefix}_${currentArg} TRUE)
+        set(insideValues FALSE)
+      elseif(NOT ${singleArgIndex} EQUAL -1)
+        set(currentArgName ${currentArg})
+        set(${prefix}_${currentArgName})
+        set(insideValues "SINGLE")
+      elseif(NOT ${multiArgIndex} EQUAL -1)
+        set(currentArgName ${currentArg})
+        set(${prefix}_${currentArgName})
+        set(insideValues "MULTI")
+      endif()
+    endif()
+
+  endforeach()
+
+  # propagate the result variables to the caller:
+  foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
+    set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE)
+  endforeach()
+  set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
+
+endfunction()
diff --git a/cmake/FindPackageHandleStandardArgs.cmake.back b/cmake/FindPackageHandleStandardArgs.cmake.back
new file mode 100644
index 0000000..ef3909c
--- /dev/null
+++ b/cmake/FindPackageHandleStandardArgs.cmake.back
@@ -0,0 +1,325 @@
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
+#
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to find_package().
+# It also sets the <packagename>_FOUND variable.
+# The package is considered found if all variables <var1>... listed contain
+# valid results, e.g. valid filepaths.
+#
+# There are two modes of this function. The first argument in both modes is
+# the name of the Find-module where it is called (in original casing).
+#
+# The first simple mode looks like this:
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# If DEFAULT_MSG is given as second argument, then the function will generate
+# itself useful success and error messages. You can also supply a custom error message
+# for the failure case. This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>]
+#                                           [REQUIRED_VARS <var1>...<varN>]
+#                                           [VERSION_VAR   <versionvar>]
+#                                           [HANDLE_COMPONENTS]
+#                                           [CONFIG_MODE]
+#                                           [FAIL_MESSAGE "Custom failure message"] )
+#
+# In this mode, the name of the result-variable can be set either to either
+# <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the FOUND_VAR option.
+# Other names for the result-variable are not allowed.
+# So for a Find-module named FindFooBar.cmake, the two possible names are
+# FooBar_FOUND and FOOBAR_FOUND. It is recommended to use the original case version.
+# If the FOUND_VAR option is not used, the default is <UPPERCASED_NAME>_FOUND.
+#
+# As in the simple mode, if <var1> through <varN> are all valid,
+# <packagename>_FOUND will be set to TRUE.
+# After REQUIRED_VARS the variables which are required for this package are listed.
+# Following VERSION_VAR the name of the variable can be specified which holds
+# the version of the package which has been found. If this is done, this version
+# will be checked against the (potentially) specified required version used
+# in the find_package() call. The EXACT keyword is also handled. The default
+# messages include information about the required version and the version
+# which has been actually found, both if the version is ok or not.
+# If the package supports components, use the HANDLE_COMPONENTS option to enable
+# handling them. In this case, find_package_handle_standard_args() will report
+# which components have been found and which are missing, and the <packagename>_FOUND
+# variable will be set to FALSE if any of the required components (i.e. not the
+# ones listed after OPTIONAL_COMPONENTS) are missing.
+# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
+# a find_package(... NO_MODULE) call.  In this case VERSION_VAR will be set
+# to <NAME>_VERSION and the macro will automatically check whether the
+# Config module was found.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
+#
+# Example for mode 1:
+#
+#    find_package_handle_standard_args(LibXml2  DEFAULT_MSG  LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
+# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
+# independent whether QUIET was used or not.
+# If it is found, success will be reported, including the content of <var1>.
+# On repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+#    find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND
+#                                             REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
+#                                             VERSION_VAR LibXslt_VERSION_STRING)
+# In this case, LibXslt is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. LibXslt_LIBRARIES and LibXslt_INCLUDE_DIRS
+# in this case. The result will then be stored in LibXslt_FOUND .
+# Also the version of LibXslt will be checked by using the version contained
+# in LibXslt_VERSION_STRING.
+# Since no FAIL_MESSAGE is given, the default messages will be printed.
+#
+# Another example for mode 2:
+#
+#    find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+#    find_package_handle_standard_args(Automoc4  CONFIG_MODE)
+# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4 NO_MODULE)
+# and adds an additional search directory for automoc4.
+# Here the result will be stored in AUTOMOC4_FOUND.
+# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
+# success/error message.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+message(STATUS "CMAKE_CURRENT_LIST_DIR= ${CMAKE_CURRENT_LIST_DIR}")
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
+
+# internal helper macro
+macro(_FPHSA_FAILURE_MESSAGE _msg)
+  if (${_NAME}_FIND_REQUIRED)
+    message(FATAL_ERROR "${_msg}")
+  else ()
+    if (NOT ${_NAME}_FIND_QUIETLY)
+      message(STATUS "${_msg}")
+    endif ()
+  endif ()
+endmacro()
+
+
+# internal helper macro to generate the failure message when used in CONFIG_MODE:
+macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+  # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
+  if(${_NAME}_CONFIG)
+    _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
+  else()
+    # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
+    # List them all in the error message:
+    if(${_NAME}_CONSIDERED_CONFIGS)
+      set(configsText "")
+      list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+      math(EXPR configsCount "${configsCount} - 1")
+      foreach(currentConfigIndex RANGE ${configsCount})
+        list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+        list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+        set(configsText "${configsText}    ${filename} (version ${version})\n")
+      endforeach()
+      if (${_NAME}_NOT_FOUND_MESSAGE)
+        set(configsText "${configsText}    Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
+      endif()
+      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
+
+    else()
+      # Simple case: No Config-file was found at all:
+      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
+    endif()
+  endif()
+endmacro()
+
+
+function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+  set(options  CONFIG_MODE  HANDLE_COMPONENTS)
+  set(oneValueArgs  FAIL_MESSAGE  VERSION_VAR  FOUND_VAR)
+  set(multiValueArgs REQUIRED_VARS)
+  set(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
+  list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+  if(${INDEX} EQUAL -1)
+    set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+    set(FPHSA_REQUIRED_VARS ${ARGN})
+    set(FPHSA_VERSION_VAR)
+  else()
+
+    CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
+
+    if(FPHSA_UNPARSED_ARGUMENTS)
+      message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+    endif()
+
+    if(NOT FPHSA_FAIL_MESSAGE)
+      set(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
+    endif()
+  endif()
+
+# now that we collected all arguments, process them
+
+  if("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+    set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+  endif()
+
+  # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
+  # when it successfully found the config-file, including version checking:
+  if(FPHSA_CONFIG_MODE)
+    list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+    list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+    set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+  endif()
+
+  if(NOT FPHSA_REQUIRED_VARS)
+    message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+  endif()
+
+  list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+
+  string(TOUPPER ${_NAME} _NAME_UPPER)
+  string(TOLOWER ${_NAME} _NAME_LOWER)
+
+  if(FPHSA_FOUND_VAR)
+    if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$"  OR  FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
+      set(_FOUND_VAR ${FPHSA_FOUND_VAR})
+    else()
+      message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
+    endif()
+  else()
+    set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
+  endif()
+
+  # collect all variables which were not found, so they can be printed, so the
+  # user knows better what went wrong (#6375)
+  set(MISSING_VARS "")
+  set(DETAILS "")
+  # check if all passed variables are valid
+  unset(${_FOUND_VAR})
+  foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+    if(NOT ${_CURRENT_VAR})
+      set(${_FOUND_VAR} FALSE)
+      set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+    else()
+      set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+    endif()
+  endforeach()
+  if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE")
+    set(${_FOUND_VAR} TRUE)
+  endif()
+
+  # component handling
+  unset(FOUND_COMPONENTS_MSG)
+  unset(MISSING_COMPONENTS_MSG)
+
+  if(FPHSA_HANDLE_COMPONENTS)
+    foreach(comp ${${_NAME}_FIND_COMPONENTS})
+      if(${_NAME}_${comp}_FOUND)
+
+        if(NOT DEFINED FOUND_COMPONENTS_MSG)
+          set(FOUND_COMPONENTS_MSG "found components: ")
+        endif()
+        set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
+
+      else()
+
+        if(NOT DEFINED MISSING_COMPONENTS_MSG)
+          set(MISSING_COMPONENTS_MSG "missing components: ")
+        endif()
+        set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
+
+        if(${_NAME}_FIND_REQUIRED_${comp})
+          set(${_FOUND_VAR} FALSE)
+          set(MISSING_VARS "${MISSING_VARS} ${comp}")
+        endif()
+
+      endif()
+    endforeach()
+    set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
+    set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
+  endif()
+
+  # version handling:
+  set(VERSION_MSG "")
+  set(VERSION_OK TRUE)
+  set(VERSION ${${FPHSA_VERSION_VAR}} )
+  if (${_NAME}_FIND_VERSION)
+
+    if(VERSION)
+
+      if(${_NAME}_FIND_VERSION_EXACT)       # exact version required
+        if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+          set(VERSION_OK FALSE)
+        else ()
+          set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+        endif ()
+
+      else()     # minimum version specified:
+        if ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+          set(VERSION_OK FALSE)
+        else ()
+          set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
+        endif ()
+      endif()
+
+    else()
+
+      # if the package was not found, but a version was given, add that to the output:
+      if(${_NAME}_FIND_VERSION_EXACT)
+         set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+      else()
+         set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+      endif()
+
+    endif()
+  else ()
+    if(VERSION)
+      set(VERSION_MSG "(found version \"${VERSION}\")")
+    endif()
+  endif ()
+
+  if(VERSION_OK)
+    set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+  else()
+    set(${_FOUND_VAR} FALSE)
+  endif()
+
+
+  # print the result:
+  if (${_FOUND_VAR})
+    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
+  else ()
+
+    if(FPHSA_CONFIG_MODE)
+      _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
+    else()
+      if(NOT VERSION_OK)
+        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+      else()
+        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+      endif()
+    endif()
+
+  endif ()
+
+  set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE)
+
+endfunction()
diff --git a/cmake/FindPackageMessage.cmake.back b/cmake/FindPackageMessage.cmake.back
new file mode 100644
index 0000000..5cea43e
--- /dev/null
+++ b/cmake/FindPackageMessage.cmake.back
@@ -0,0 +1,49 @@
+# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
+#
+# This macro is intended to be used in FindXXX.cmake modules files.
+# It will print a message once for each unique find result.
+# This is useful for telling the user where a package was found.
+# The first argument specifies the name (XXX) of the package.
+# The second argument specifies the message to display.
+# The third argument lists details about the find result so that
+# if they change the message will be displayed again.
+# The macro also obeys the QUIET argument to the find_package command.
+#
+# Example:
+#
+#  if(X11_FOUND)
+#    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+#      "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
+#  else()
+#   ...
+#  endif()
+
+#=============================================================================
+# Copyright 2008-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+function(FIND_PACKAGE_MESSAGE pkg msg details)
+  # Avoid printing a message repeatedly for the same find result.
+  if(NOT ${pkg}_FIND_QUIETLY)
+    string(REGEX REPLACE "[\n]" "" details "${details}")
+    set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
+    if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
+      # The message has not yet been printed.
+      message(STATUS "${msg}")
+
+      # Save the find details in the cache to avoid printing the same
+      # message again.
+      set("${DETAILS_VAR}" "${details}"
+        CACHE INTERNAL "Details about finding ${pkg}")
+    endif()
+  endif()
+endfunction()
diff --git a/cmake/FindPostGIS.cmake b/cmake/FindPostGIS.cmake
new file mode 100644
index 0000000..c5ab85c
--- /dev/null
+++ b/cmake/FindPostGIS.cmake
@@ -0,0 +1,52 @@
+# (c) 2015  pgRouting colaborators
+# 
+# Finds the most recent postGIS for a particular postgreSQL
+# We need this for the tests
+#
+# Usage:
+# find_package(PostGIS <version>)
+#
+
+# The following variables are set if PostGIS is found:
+#  PostGIS_FOUND            - Set to true when PostGIS is found.
+#  PostGIS_LIBRARY          - if we ever need to link it
+#  PostGIS_EXTENSION_DIR    - usless for the moment
+#  PostGIS_LIBRARY_DIR      - useless for the moment
+
+
+FIND_PATH(PostGIS_EXTENSION_DIR postgis.control
+    PATHS "${PostgreSQL_EXTENSION_INSTALLATION}")
+
+find_library(PostGIS_LIBRARY_DIR NAMES postgis-2.2.so
+    PATHS "${PostgreSQL_LIBRARY_INSTALLATION}")
+
+if (NOT PostGIS_LIBRARY)
+    find_library(PostGIS_LIBRARY_DIR NAMES postgis-2.1.so
+        PATHS "${PostgreSQL_LIBRARY_INSTALLATION}")
+endif()
+
+if (NOT PostGIS_LIBRARY)
+    find_library(PostGIS_LIBRARY_DIR NAMES postgis-2.0.so
+        PATHS "${PostgreSQL_LIBRARY_INSTALLATION}")
+endif()
+
+if (NOT (PostGIS_EXTENSION_DIR STREQUAL PostgreSQL_EXTENSION_INSTALLATION))
+    #message(STATUS "PostGIS not found for the given postgreSQL version")
+    set(PostGIS_FOUND FALSE)
+else()
+
+    if (PostGIS_EXTENSION_DIR  AND PostGIS_LIBRARY_DIR)
+        SET(PostGIS_FOUND TRUE)
+        set(PostGIS_LIBRARY_DIR ${PostgreSQL_LIBRARY_INSTALLATION})
+    else ()
+        SET(PostGIS_FOUND FALSE)
+    endif ()
+endif ()
+
+#message(STATUS PostGIS_LIBRARY ${PostGIS_LIBRARY})
+#message(STATUS PostGIS_EXTENSION_DIR ${PostGIS_EXTENSION_DIR})
+#message(STATUS PostgreSQL_EXTENSION_INSTALLATION ${PostgreSQL_EXTENSION_INSTALLATION})
+#message(STATUS PostGIS_LIBRARY_DIR ${PostGIS_LIBRARY_DIR})
+
+MARK_AS_ADVANCED(PostGIS_EXTENSION_DIR PostGIS_LIBRARY_DIR PostGIS_LIBRARY)
+
diff --git a/cmake/MacroLibrary.cmake.back b/cmake/MacroLibrary.cmake.back
new file mode 100644
index 0000000..31a16fb
--- /dev/null
+++ b/cmake/MacroLibrary.cmake.back
@@ -0,0 +1,22 @@
+# - include MacroLibrary offers a collection of macros which extend the built-in cmake commands
+# OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+INCLUDE(Cat)
+INCLUDE(MacroOptionalFindPackage)
+#INCLUDE(MacroAdditionalCleanFiles)
+#INCLUDE(MacroAddFileDependencies)
+INCLUDE(MacroAddCompileFlags)
+INCLUDE(MacroAddLinkFlags)
+#INCLUDE(MacroEnsureOutOfSourceBuild)
+#INCLUDE(MacroBoolTo01)
+#INCLUDE(MacroPushRequiredVars)
+#INCLUDE(MacroLogFeature)
+
+#INCLUDE(MacroCreateLibtoolFile)
+
+INCLUDE(CheckCCompilerFlag)
diff --git a/doc/conf.py.in b/doc/conf.py.in
index 9400007..48e1e5a 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -42,7 +42,7 @@ master_doc = 'doc/index'
 
 # General information about the project.
 project = u'pgRouting'
-copyright = u'pgRouting Contributors - Version @PGROUTING_VERSION_STRING@ (@PGROUTING_VERSION_REVISION_NAME@)'
+copyright = u'pgRouting Contributors - Version @PGROUTING_VERSION_STRING@ (@PGROUTING_GIT_TAG@)'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -51,7 +51,8 @@ copyright = u'pgRouting Contributors - Version @PGROUTING_VERSION_STRING@ (@PGRO
 # The short X.Y version.
 version = '@PGROUTING_VERSION_STRING@'
 # The full version, including alpha/beta/rc tags.
-release = '@PGROUTING_VERSION_STRING@ (@PGROUTING_VERSION_REVISION_NAME@)'
+#release = '@PGROUTING_VERSION_STRING@ (@PGROUTING_GIT_BRANCH@)'
+release = '@PGROUTING_VERSION_STRING@ (@PGROUTING_GIT_TAG@)'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -67,7 +68,15 @@ gettext_compact = False
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['doc/build','src/shooting_star/doc/index.rst']
+exclude_patterns = [
+    'doc/build',
+    'src/shooting_star/doc/index.rst',
+    'src/withPoints/doc/pgr_withPointsVia.rst',
+    'src/pickDeliver/*',
+    'src/travelingSalesPerson',
+    '*/notUsed',
+    'tools/template'
+    ]
 
 # The reST default role (used for this markup: `text`) to use for all documents.
 #default_role = None
@@ -144,7 +153,7 @@ html_sidebars = {
 #html_additional_pages = {}
 
 # If false, no module index is generated.
-html_domain_indices = True
+html_domain_indices = False
 
 # If false, no index is generated.
 html_use_index = True
diff --git a/doc/deprecated.rst b/doc/deprecated.rst
new file mode 100644
index 0000000..56c1511
--- /dev/null
+++ b/doc/deprecated.rst
@@ -0,0 +1,69 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _deprecated:
+
+Deprecated Functions
+====================
+
+.. warning:: This functions have being deprecated
+
+
+
+Deprecated Routing Functions
+----------------------------
+
+Deprecated on version 2.2
+
+  - :ref:`pgr_apspJohnson<pgr_apsp_johnson>` - Replaced with :ref:`pgr_johnson` 
+  - :ref:`pgr_apspWarshall<pgr_apsp_warshall>` - Replaced with :ref:`pgr_floydWarshall`
+  - :ref:`pgr_kDijkstra<pgr_kdijkstra>` - Replaced with :ref:`pgr_dijkstraCost`
+  - :ref:`pgr_drivingDistance<pgr_driving_distance_v2>` - Driving Distance (V2.0 signature). See new signature :ref:`pgr_drivingDistance`
+
+.. toctree::
+   :hidden: 
+
+   ../src/apsp_johnson/doc/pgr_apspJohnson
+   ../src/apsp_warshall/doc/pgr_apspWarshall
+   ../src/kdijkstra/doc/pgr_kDijkstra
+   ../src/driving_distance/doc/pgr_drivingDistance_v2
+
+Deprecated on version 2.1
+
+ - :ref:`pgr_dijkstra<pgr_dijkstra_v2>` - Mutliple destination Shortest Path Dijkstra (V2.0 signature)
+ - :ref:`pgr_ksp<pgr_ksp_v2>` - K shortest paths (V2.0 signature)
+
+.. toctree::
+   :hidden: 
+
+   ../src/dijkstra/doc/pgr_dijkstra_v2
+   ../src/ksp/doc/pgr_ksp_v2
+
+Deprecated Developer's Auxiliary Functions
+------------------------------------------
+
+
+Deprecated on version 2.1
+
+  -  :ref:`pgr_get_column_name` - to get the name of the column as is stored in the postgres administration tables.
+  -  :ref:`pgr_get_table_name` - to retrieve the name of the table as is stored in the postgres administration tables.
+  -  :ref:`pgr_is_column_indexed` - to check if the column is indexed.
+  -  :ref:`pgr_is_column_in_table` - to check only for the existance of the column.
+  -  :ref:`pgr_quote_ident` - to quotes the input text to be used as an identifier in an SQL statement string.
+  -  :ref:`pgr_versionless` - to compare two version numbers.
+  -  :ref:`pgr_start_point` - to get the start point of a (multi)linestring.
+  -  :ref:`pgr_end_point` - to get the end point of a (multi)linestring.
+
+
+
+.. toctree::
+   :hidden: 
+
+   ../src/common/doc/utilities/index
+
diff --git a/doc/index.rst b/doc/index.rst
index b39938d..41e67e4 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -9,16 +9,17 @@
 
 .. _index:
 
+*******************************************************************************
 Table of Contents
-===============================================================================
+*******************************************************************************
 
 pgRouting extends the `PostGIS <http://postgis.net>`_/`PostgreSQL <http://postgresql.org>`_ geospatial database to provide geospatial routing and other network analysis functionality.
 
 This is the manual for pgRouting |release|.
 
 .. image:: static/images/ccbysa.png
-	:align: left
-	:alt: Creative Commons Attribution-Share Alike 3.0 License
+    :align: left
+    :alt: Creative Commons Attribution-Share Alike 3.0 License
 
 The pgRouting Manual is licensed under a `Creative Commons Attribution-Share Alike 3.0 License <http://creativecommons.org/licenses/by-sa/3.0/>`_. Feel free to use this material any way you like, but we ask that you attribute credit to the pgRouting Project and wherever possible, a link back to http://pgrouting.org. For other licenses used in pgRouting see the :ref:`license` page.
 
@@ -30,7 +31,7 @@ General
     :maxdepth: 2
 
     src/introduction/introduction
-    src/installation/index
+    src/installation/installation
     src/installation/build
     src/introduction/support
 
@@ -46,36 +47,51 @@ Tutorial
   - :ref:`analytics` for an overview of the analysis of a graph.
   - :ref:`custom_query` that is used in the routing algorithms.
   - :ref:`performance` to improve your performance.
-  - :ref:`sampledata` that is used in the examples of this manual.
   - :ref:`recipes`
+  - :ref:`developer`
 
+For a more complete introduction how to build a routing application read the `pgRouting Workshop <http://workshop.pgrouting.org>`_.
 
 
 .. toctree::
    :hidden:
 
    src/tutorial/index
-   src/developer/sampledata
    src/recipes/index
+   src/developer/developer_guide
+   
+*******************************************************************************
+Sample Data
+*******************************************************************************
+
+  - :ref:`sampledata` that is used in the examples of this manual.
+
+.. toctree::
+   :hidden:
+
+   src/developer/sampledata
+
 
-For a more complete introduction how to build a routing application read the `pgRouting Workshop <http://workshop.pgrouting.org>`_.
 
 *******************************************************************************
-Version
+Functions
 *******************************************************************************
 
+Version
+===============================================================================
+
 :ref:`pgr_version` - to get pgRouting's version information.
 
 .. toctree::
    :hidden:
 
-   ../src/common/doc/utilities/version
+   ../src/common/doc/pgr_version
+
 
 
 
-*******************************************************************************
 Data Types
-*******************************************************************************
+===============================================================================
 
 :ref:`data_types`
 
@@ -88,9 +104,9 @@ Data Types
 
    ../src/common/doc/types/index
 
-*******************************************************************************
+
 Topology functions
-*******************************************************************************
+===============================================================================
 
 :ref:`topology_functions`
 
@@ -101,160 +117,67 @@ Topology functions
   -  :ref:`pgr_node_network`  -to create nodes to a not noded edge table.
 
 .. toctree::
-	:hidden:
-
-	../src/common/doc/functions/index
-
-*******************************************************************************
-Routing functions
-*******************************************************************************
+   :hidden:
 
-:ref:`routing_functions`
+   ../src/topology/doc/topology
 
-  -  :ref:`pgr_apspJohnson <pgr_apsp_johnson>`- All Pairs Shortest Path, Johnson’s Algorithm
-  -  :ref:`pgr_apspWarshall<pgr_apsp_warshall>` - All Pairs Shortest Path, Floyd-Warshall Algorithm
-  -  :ref:`pgr_astar<pgr_astar>` - Shortest Path A*
-  -  :ref:`pgr_bdAstar<bd_astar>` - Bi-directional A* Shortest Path
-  -  :ref:`pgr_bdDijkstra<bd_dijkstra>` - Bi-directional Dijkstra Shortest Path
-  -  :ref:`pgr_dijkstra<pgr_dijkstra>` - Shortest Path Dijkstra
-  -  :ref:`pgr_driving_distance<pgr_driving_distance>` - Driving Distance
-  -  :ref:`pgr_kDijkstra<pgr_kdijkstra>` - Mutliple destination Shortest Path Dijkstra
-  -  :ref:`pgr_ksp<pgr_ksp>` - K-Shortest Path
-  -  :ref:`pgr_trsp<trsp>` - Turn Restriction Shortest Path (TRSP)
-  -  :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
+..
+    ROUTING FUNCTIONS SECTION
 
 .. toctree::
-	:hidden:
-
-	../src/index
-
-*******************************************************************************
-Pre processing or post processing helping functions
-*******************************************************************************
-
-:ref:`pgr_driving_distance_post`
-
-  -  :ref:`pgr_alphaShape` - Alpha shape computation
-  -  :ref:`pgr_points_as_polygon` - Polygon around set of points
-
-*******************************************************************************
-Experimental and Proposed functions
-*******************************************************************************
+   :hidden:
+   :maxdepth: 0
 
-This section contains new experimental or proposed signatures for any of the following sections:
-  - topology functions
-  - routing functions
-  - vehicle routing functions
-  - pre / post procesing helper functions
+   ../src/routingFunctions
 
+Routing Functions
+=================
 
-We are including them so that the pgRouting community can evaluate them before
-including them as an official function of pgRouting.
+.. include:: ../src/routingFunctions.rst
+   :start-after: from-here
+   :end-before: to-here
 
-Some of them are unsupported like the GSoC functions.
 
 
 *******************************************************************************
-Experimental functions: Proposed by Steve Woodbridge
+Available Functions but not official pgRouting functions
 *******************************************************************************
 
-:ref:`convenience_functions`
-  -  :ref:`pgr_point_to_edgenode` - convert a point geometry to a ``vertex_id`` based on closest edge.
-  -  :ref:`pgr_flip_edges` - flip the edges in an array of geometries so the connect end to end.
-  -  :ref:`pgr_text_to_points` - convert a string of ``x,y;x,y;...`` locations into point geometries.
-  -  :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
-  -  :ref:`pgr_points_to_dmatrix` - Create a distance matrix from an array of points.
-  -  :ref:`pgr_vids_to_dmatrix` - Create a distance matrix from an array of ``vertix_id``.
-  -  :ref:`pgr_vids_to_dmatrix2` - Create a distance matrix from an array of ``vertix_id``.
+  - :ref:`proposedNext`
+  - :ref:`proposed`
 
 .. toctree::
-	:hidden:
+    :hidden:
 
-        ../src/common/doc/convenience/index
+    ../src/proposedNext
+    ../src/proposed
 
-*******************************************************************************
-Experimental functions: by GSoC
-*******************************************************************************
 
-The following functions are experimental
- - They may lack documentation,
- - Were created by GSoC students.
- - they are unsupported.
- 
-  -  :ref:`pgr_vrp_basic` - VRP One Depot
-  -  :ref:`pgr_gsocvrppdtw` -  Pickup and Delivery problem
 
-.. toctree::
-	:hidden:
-
-	../src/vrp_basic/doc/index.rst
-	../src/vrppdtw/doc/index.rst
 
 *******************************************************************************
-Proposed functions: Proposed by Zia Mohammed
+Discontinued & Deprecated Functions
 *******************************************************************************
 
-About this proposal:
-  - Author: Zia Mohammed.
-  - Status: Needs a lot of testing. I am working on that.
-  - I did not add automated test.
-  - Temporary name: pgr_labelGraph
-  - Need: I need feedback from the community.
-
-  -  :ref:`pgr_labelGraph` - Analyze / label  subgraphs within a network
+  - :ref:`discontinued`
+  - :ref:`deprecated`
 
 .. toctree::
-  :hidden:
-
-  ../src/label_graph/doc/analyze_brokengraph.rst
-
+   :hidden:
 
-.. toctree::
-	:hidden:
+   src/developer/discontinued
+   deprecated
 
-	../src/common/doc/utilities/index
 
-*******************************************************************************
-Discontinued Functions
-*******************************************************************************
-
-.. toctree::
-	:maxdepth: 1
-
-	src/developer/discontinued
 
 
 *******************************************************************************
-Developer
+Change Log
 *******************************************************************************
 
-
-:ref:`developer_functions`
-
-
-.. warning:: In V3.0 This function are going to be discontinued. Use the already available underscored version instead.
-
-.. warning:: :ref:`developer_functions` documentation is going to be deleted from the pgRouting documentation in V3.0
-
-             
-The following functions are used internaly the topology functions.
-  -  :ref:`pgr_get_column_name` - to get the name of the column as is stored in the postgres administration tables.
-  -  :ref:`pgr_get_table_name` - to retrieve the name of the table as is stored in the postgres administration tables.
-  -  :ref:`pgr_is_column_indexed` - to check if the column is indexed.
-  -  :ref:`pgr_is_column_in_table` - to check only for the existance of the column.
-  -  :ref:`pgr_point_to_id` -to insert/get the id of the inserted point in a vertices table.
-  -  :ref:`pgr_quote_ident` - to quotes the input text to be used as an identifier in an SQL statement string.
-  -  :ref:`pgr_versionless` - to compare two version numbers.
-  -  :ref:`pgr_start_point` - to get the start point of a (multi)linestring.
-  -  :ref:`pgr_end_point` - to get the end point of a (multi)linestring.
-
-.. toctree::
-    :maxdepth: 2
-
-    src/developer/index
-
 :ref:`change_log`
 
+   - :ref:`changelog_2_2_0`
    - :ref:`changelog_2_1_0`
    - :ref:`changelog_2_0`
    - :ref:`changelog_1_x`
diff --git a/doc/index_man.rst b/doc/index_man.rst
deleted file mode 100644
index fd957d0..0000000
--- a/doc/index_man.rst
+++ /dev/null
@@ -1,89 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _man:
-
-pgRouting Reference
-===============================================================================
-
-pgRouting extends the `PostGIS <http://postgis.net>`_/`PostgreSQL <http://postgresql.org>`_ geospatial database to provide geospatial routing and other network analysis functionality.
-
-.. toctree::
-	:maxdepth: 1
-
-	src/introduction/index
-
-pgRouting provides several :ref:`common functions <common>`:
-
-.. toctree::
-	:maxdepth: 1
-	:hidden:
-
-	../src/common/doc/index
-
-.. toctree::
-	:maxdepth: 1
-	:glob: 
-
-	../src/common/doc/functions/*
-
-pgRouting defines a few :ref:`custom data types <data_types>`:
-
-.. toctree::
-	:maxdepth: 1
-	:hidden:
-
-	../src/common/doc/types/index
-
-.. toctree::
-	:maxdepth: 1
-	:glob: 
-
-	../src/common/doc/types/*
-
-pgRouting functions in alphabetical order:
-
-.. toctree::
-	:maxdepth: 1
-
-	../src/apsp_johnson/doc/index
-	../src/apsp_warshall/doc/index
-	../src/astar/doc/index
-	../src/bd_astar/doc/index
-	../src/bd_dijkstra/doc/index
-	../src/dijkstra/doc/index
-	../src/kdijkstra/doc/index
-	../src/ksp/doc/index
-	../src/tsp/doc/index
-	../src/trsp/doc/index
-
-If pgRouting is compiled with "Driving Distance" enabled:
-
-.. toctree::
-	:maxdepth: 1
-
-	../src/driving_distance/doc/dd_alphashape
-	../src/driving_distance/doc/index
-	../src/driving_distance/doc/dd_points_as_polygon
-
-Some functions from previous releases may have been removed. 
-
-.. toctree::
-	:maxdepth: 1
-
-	../src/common/doc/legacy
-	src/developer/discontinued
-
-.. toctree::
-	:maxdepth: 1
-
-	src/introduction/index
-	src/introduction/support
-
-
diff --git a/doc/src/changelog/2_2_0.rst b/doc/src/changelog/2_2_0.rst
new file mode 100644
index 0000000..25221c5
--- /dev/null
+++ b/doc/src/changelog/2_2_0.rst
@@ -0,0 +1,59 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _changelog_2_2_0:
+
+pgRouting 2.2.0 Release Notes
+===============================================================================
+
+With the release of pgRouting 2.2.0 fixes some bugs and issues.
+
+ - To see the full list of changes check the list of `Git commits <https://github.com/pgRouting/pgrouting/commits>`_ on Github.
+ - To see the issues closed by this release see the `Git closed issues <https://github.com/pgRouting/pgrouting/issues?utf8=%E2%9C%93&q=is%3Aissue+milestone%3A%22Release+2.2.0%22+is%3Aclosed>`_ on Github.
+ - For important changes see the following release notes.
+
+
+Release Notes
+-------------------------------------------------------------------------------
+
+
+Changes for release 2.2.0
+
+
+  - Improved:
+
+    - pgr_nodeNetwork
+
+     - Adding a row_where and outall optional parameters
+
+  - Signature fix
+
+    - pgr_dijkstra  -- to match what was documented
+
+  - New functions
+
+    - pgr_floydWarshall
+    - pgr_Johnson
+    - pgr_DijkstraCost
+
+  - New Proposed functions
+
+    - pgr_withPoints
+    - pgr_withPointsCost
+    - pgr_withPointsDD
+    - pgr_withPointsKSP
+    - pgr_dijkstraVia
+
+
+  - Deprecated functions:
+
+    - pgr_apspWarshall  use pgr_floydWarshall instead
+    - pgr_apspJohnson   use pgr_Johnson instead
+    - pgr_kDijkstraCost use pgr_dijkstraCost instead
+    - pgr_kDijkstraPath use pgr_dijkstra instead
diff --git a/doc/src/changelog/index.rst b/doc/src/changelog/index.rst
index a2f49c8..1e6da11 100644
--- a/doc/src/changelog/index.rst
+++ b/doc/src/changelog/index.rst
@@ -12,6 +12,7 @@
 Release Notes
 ===============================================================================
 
+   - :ref:`changelog_2_2_0`  
    - :ref:`changelog_2_1_0`  
    - :ref:`changelog_2_0`  
    - :ref:`changelog_1_x`  
@@ -19,7 +20,8 @@ Release Notes
 .. toctree::
    :hidden: 
 
-   pgRouting 2.1 develop Notes <2_1_0>
-   pgRouting 2.0 Release Notes <2_0>
-   pgRouting 1.x Release Notes <1_x>
+   2_2_0
+   2_1_0
+   2_0
+   1_x
 
diff --git a/doc/src/developer/developer_guide.rst b/doc/src/developer/developer_guide.rst
new file mode 100644
index 0000000..45d3ce2
--- /dev/null
+++ b/doc/src/developer/developer_guide.rst
@@ -0,0 +1,176 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share  
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _developer:
+
+Developer's Guide
+===============================================================================
+
+This contains some basic comments about developing.
+More detailed information can be found on:
+
+http://docs.pgrouting.org/doxy/2.2/index.html
+
+Source Tree Layout
+-------------------------------------------------------------------------------
+
+*cmake/*
+    cmake scripts used as part of our build system.
+
+*src/*
+    This is the algorithm source tree. Each algorithm is to be contained
+    in its on sub-tree with /doc, /sql, /src, and /test sub-directories.
+
+For example:
+
+  - ``src/dijkstra``  Main direcotry for dijkstra algorithm.
+  - ``src/dijkstra/doc``  Dijkstra's documentation directory.
+  - ``src/dijkstra/src``  Dijkstra's C and/or C++ code.
+  - ``src/dijkstra/sql``  Dijkstra's sql code.
+  - ``src/dijkstra/test``  Dijkstra's tests.
+  - ``src/dijkstra/test/pgtap``  Dijkstra's pgTaptests.
+
+
+Tools
+-------------------------------------------------------------------------------
+
+*tools/*
+    Miscellaneous scripts and tools.
+
+pre-commit
+**********
+
+To keep version/branch/commit up to date install pelase do the following:
+
+.. code::
+
+  cp tools/pre-commit .git/hooks/pre-commit
+
+After each commit a the file **VERSION** will remain. (The hash number will be one behind)
+
+
+
+doxygen
+*******
+
+.. warning:: :ref:`developer_functions` documentation is going to be deleted from the pgRouting documentation and included in the doxygen documentation.
+
+To use doxygen:
+
+
+.. code::
+
+  cd tools/doxygen/
+  make
+
+The code's documentation can be found in:
+
+
+.. code::
+
+  build/doxy/html/index.html
+
+
+cpplint
+*******
+
+We try to follow the following guidelines for C++ coding:
+
+https://google-styleguide.googlecode.com/svn/trunk/cppguide.html
+
+Sample use:
+
+.. code::
+
+  python cpplint.py ../src/dijkstra/src/dijkstra_driver.h
+  ../src/dijkstra/src/dijkstra_driver.h:34:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
+  ../src/dijkstra/src/dijkstra_driver.h:40:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]
+  Done processing ../src/dijkstra/src/dijkstra_driver.h
+  Total errors found: 2
+
+
+- Maybe line 34 is a very complicated calculation so you can just ignore the message
+- Delete whitespace at end of line is easy fix.
+- Use your judgement!!!
+
+Some files like ``postgres.h`` are system dependant so don't include the directory.
+
+
+Other tools
+***********
+
+Tools like:
+ - doit
+ - winnie
+ - publish_doc.sh
+
+are very specific for the deployment of new versions, so please ask first!
+
+Documentation Layout
+-------------------------------------------------------------------------------
+
+.. note:: 
+	All documentation should be in reStructuredText format.
+	See: <http://docutils.sf.net/rst.html> for introductory docs.
+
+
+Documentation is distributed into the source tree. This top level "doc"
+directory is intended for high level documentation cover subjects like:
+
+    * Compiling and testing
+    * Installation
+    * Tutorials
+    * Users' Guide front materials
+    * Reference Manual front materials
+    * etc
+
+Since the algorithm specific documentation is contained in the source
+tree with the algorithm specific files, the process of building the 
+documentation and publishing it will need to assemble the details with
+the front material as needed.
+
+Also, to keep the "doc" directory from getting cluttered, each major book
+like those listed above, should be contained in a separate directory under
+"doc". Any images or other materials related to the book should also be kept
+in that directory.
+
+
+Testing Infrastructure
+************************************
+
+Tests are part of the tree layout:
+
+  - ``src/dijkstra/test``  Dijkstra's tests.
+
+    - ``test.conf``  Configuraton file.
+    - ``<name>.test.sql``  Test file
+    - ``<name>.result``  Results file
+
+  - ``src/dijkstra/test/pgtap``  Dijkstra's pgTaptests.
+
+    - ``<name>.sql`` pgTap test file
+
+
+.. rubric:: Testing
+
+Testing is executed from the top level of the tree layout:
+
+.. code-block:: bash
+
+    tools/testers/algorithm-tester.pl
+    createdb  -U <user> ___pgr___test___
+    sh ./tools/testers/pg_prove_tests.sh <user>
+    dropdb  -U <user> ___pgr___test___
+
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/doc/src/developer/discontinued.rst b/doc/src/developer/discontinued.rst
index 27429fe..444815e 100644
--- a/doc/src/developer/discontinued.rst
+++ b/doc/src/developer/discontinued.rst
@@ -7,7 +7,7 @@
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
-.. _history:
+.. _discontinued:
 
 Discontinued Functions
 ===============================================================================
@@ -21,6 +21,6 @@ Functionality that has been discontinued will be listed here.
 Shooting Star algorithm
 ********************************************************************************
 
-:Version:	Removed with 2.0.0
+:Version:	Discontinued on 2.0.0
 :Reasons:	Unresolved bugs, no maintainer, replaced with :ref:`trsp`
-:Comment:	Please :ref:`contact us <support>` if you're interested to sponsor or maintain this algorithm. The function signature is still available in :ref:`common_legacy` but it is just a wrapper that throws an error. We have not included any of the old code for this in this release.
+:Comment:	Please :ref:`contact us <support>` if you're interested to sponsor or maintain this algorithm.
diff --git a/doc/src/developer/images/Fig1-originalData.png b/doc/src/developer/images/Fig1-originalData.png
new file mode 100644
index 0000000..f76fcd8
Binary files /dev/null and b/doc/src/developer/images/Fig1-originalData.png differ
diff --git a/src/common/doc/functions/images/Fig2-cost.png b/doc/src/developer/images/Fig2-cost.png
similarity index 100%
rename from src/common/doc/functions/images/Fig2-cost.png
rename to doc/src/developer/images/Fig2-cost.png
diff --git a/src/common/doc/functions/images/Fig4-costUndirected.png b/doc/src/developer/images/Fig4-costUndirected.png
similarity index 100%
rename from src/common/doc/functions/images/Fig4-costUndirected.png
rename to doc/src/developer/images/Fig4-costUndirected.png
diff --git a/src/common/doc/functions/images/Fig6-undirected.png b/doc/src/developer/images/Fig6-undirected.png
similarity index 100%
rename from src/common/doc/functions/images/Fig6-undirected.png
rename to doc/src/developer/images/Fig6-undirected.png
diff --git a/doc/src/developer/index.rst b/doc/src/developer/index.rst
deleted file mode 100644
index 32a985b..0000000
--- a/doc/src/developer/index.rst
+++ /dev/null
@@ -1,189 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _developer:
-
-Developer's Guide
-===============================================================================
-
-
-Source Tree Layout
--------------------------------------------------------------------------------
-
-*cmake/*
-    cmake scripts used as part of our build system.
-
-*src/*
-    This is the algorithm source tree. Each algorithm is to be contained
-    in its on sub-tree with /doc, /sql, /src, and /test sub-directories.
-
-For example:
-
-  - ``src/dijkstra``  Main direcotry for dijkstra algorithm.
-  - ``src/dijkstra/doc``  Dijkstra's documentation directory.
-  - ``src/dijkstra/src``  Dijkstra's C and/or C++ code.
-  - ``src/dijkstra/sql``  Dijkstra's sql code.
-  - ``src/dijkstra/test``  Dijkstra's tests.
-
-
-Tools
--------------------------------------------------------------------------------
-
-*tools/*
-    Miscellaneous scripts and tools.
-
-pre-commit
-**********
-
-To keep version/branch/commit up to date install pelase do the following:
-
-.. code::
-
-  cp tools/pre-commit .git/hooks/pre-commit
-
-After each commit a the file **VERSION** will remain. (The hash number will be one behind)
-
-
-tester
-******
-
-The tester is executed from the top level of the tree layout:
-
-.. code::
-
-  tools/test-runner.pl --help
-
-doxygen
-*******
-
-.. warning:: :ref:`developer_functions` documentation is going to be deleted from the pgRouting documentation and included in the doxygen documentation.
-
-To use doxygen:
-
-
-.. code::
-
-  cd tools/doxygen/
-  make
-
-The code's documentation can be found in:
-
-
-.. code::
-
-  build/doxy/html/index.html
-
-
-cpplint
-*******
-
-We try to follow the following guidelines for C++ coding:
-
-https://google-styleguide.googlecode.com/svn/trunk/cppguide.html
-
-Sample use:
-
-.. code::
-
- python cpplint.py ../src/dijkstra/src/dijkstra_driver.h
-  ../src/dijkstra/src/dijkstra_driver.h:34:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
-  ../src/dijkstra/src/dijkstra_driver.h:40:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]
-  Done processing ../src/dijkstra/src/dijkstra_driver.h
-  Total errors found: 2
-
-
-- Maybe line 34 is a very complicated calculation so you can just ignore the message
-- Delete whitespace at end of line is easy fix.
-- Use your judgement!!!
-
-Some files like ``postgres.h`` are system dependant so don't include the directory.
-
-
-Other tools
-***********
-
-Tools like:
- - doit
- - winnie
- - publish_doc.sh
-
-are very specific for the deployment of new versions, so please ask first!
-
-Documentation Layout
--------------------------------------------------------------------------------
-
-.. note:: 
-	All documentation should be in reStructuredText format.
-	See: <http://docutils.sf.net/rst.html> for introductory docs.
-
-
-Documentation is distributed into the source tree. This top level "doc"
-directory is intended for high level documentation cover subjects like:
-
-    * Compiling and testing
-    * Installation
-    * Tutorials
-    * Users' Guide front materials
-    * Reference Manual front materials
-    * etc
-
-Since the algorithm specific documentation is contained in the source
-tree with the algorithm specific files, the process of building the 
-documentation and publishing it will need to assemble the details with
-the front material as needed.
-
-Also, to keep the "doc" directory from getting cluttered, each major book
-like those listed above, should be contained in a separate directory under
-"doc". Any images or other materials related to the book should also be kept
-in that directory.
-
-
-Testing Infrastructure
--------------------------------------------------------------------------------
-
-There is a very basic testing infrastructure put in place. Here are the
-basics of how it works. We need more test cases. Longer term we should
-probably get someone to setup travis-ci or jenkins testing frameworks.
-
-Here is the graph for the TRSP tests.
-
-.. image:: images/trsp-test-image.png
-
-Tests are run via the script at the top level tools/test-runner.pl and it runs
-all the test configured tests and at the moment just dumps the results
-structure of the test. This can be prettied up later.
-
-    It also assumes that you have installed the libraries as it tests
-    using the installed postgresql. This probably needs to be made
-    smarter so we can test out of the build tree. I'll need to think
-    about that.
-
-Basically each .../test/ directory should include one *test.conf* file that
-is a perl script fragment that defines what data files to load and what
-tests to run. I have built in some mechanisms to allow test and data to
-be pg version and postgis version specific, but I'm not using that yet.
-So for example, *core/trsp/test/test-any-00.data* is a sql plain text dump
-that will load and needed data for a set of tests. This is also the graph
-in the image above. You can specify multiple files to load, but as a
-group they need to have unique names. 
-
-core/trsp/test/test-any-00.test is a sql command to be run. It will get
-run as:
-
-.. code-block:: bash
-
-    psql ... -A -t -q -f file.test dbname > tmpfile
-    diff -w file.rest tmpfile 
-
-Then if there is a difference then an test failure is reported.
-
-
-
-
-
diff --git a/doc/src/developer/sampledata.rst b/doc/src/developer/sampledata.rst
index 9712313..0ba515b 100644
--- a/doc/src/developer/sampledata.rst
+++ b/doc/src/developer/sampledata.rst
@@ -18,98 +18,70 @@ To be able to execute the sample queries, run the following SQL commands to crea
 
 .. rubric:: Create table
 
-.. code-block:: sql
-
-	CREATE TABLE edge_table (
-	    id serial,
-	    dir character varying,
-	    source integer,
-	    target integer,
-	    cost double precision,
-	    reverse_cost double precision,
-	    x1 double precision,
-	    y1 double precision,
-	    x2 double precision,
-	    y2 double precision,
-	    the_geom geometry
-	);
-
-
-
-.. rubric:: Insert network data
-
-.. code-block:: sql
-
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-        INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-
-        UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                              dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                         WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                         WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                         ELSE '' END;                                -- unknown
+.. literalinclude:: ../../../tools/testers/sampledata.sql
+   :start-after: --EDGE TABLE CREATE
+   :end-before: --EDGE TABLE ADD DATA
+
+
+.. rubric:: Insert data
+
+.. literalinclude:: ../../../tools/testers/sampledata.sql
+   :start-after: --EDGE TABLE ADD DATA
+   :end-before: --EDGE TABLE TOPOLOGY
 
 
 Before you test a routing function use this query to fill the source and target columns.
 
-.. code-block:: sql
+.. literalinclude:: ../../../tools/testers/sampledata.sql
+   :start-after: --EDGE TABLE TOPOLOGY
+   :end-before: --POINTS CREATE
+
+.. rubric:: Points of interest
 
-    SELECT pgr_createTopology('edge_table',0.001);
+When points outside of the graph
 
+.. literalinclude:: ../../../tools/testers/sampledata.sql
+   :start-after: --POINTS CREATE
+   :end-before: --RESTRICTIONS CREATE
 
-This table is used in some of our examples
+.. rubric:: Restrictions
 
-.. code-block:: sql
+.. literalinclude:: ../../../tools/testers/sampledata.sql
+   :start-after: --RESTRICTIONS CREATE
+   :end-before: --RESTRICTIONS END
 
-	CREATE TABLE vertex_table (
-	    id serial,
-	    x double precision,
-	    y double precision
-	);
 
-.. code-block:: sql
+Images
+------
 
-	INSERT INTO vertex_table VALUES
-		(1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
-		(8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
+* Red arrows correspond when ``cost`` > 0 in the edge table.
+* Blue arrows correspond when ``reverse_cost`` > 0 in the edge table.
+* Points are outside the graph.
+* Click on the graph to enlarge.
 
+.. note:: On all graphs, 
 
 .. rubric:: Network for queries marked as ``directed`` and ``cost`` and ``reverse_cost`` columns are used:
 
-.. _fig1:
+When working with city networks, this is recommended for point of view of vehicles.
 
-.. figure:: ../../../src/common/doc/functions/images/Fig1-originalData.png
+.. _fig1:
 
-    *Graph 1: Directed, with cost and reverse cost*
+.. figure:: images/Fig1-originalData.png
 
-Blue colored lines with line arrows, represent the ``cost`` of the edge table.
-Green colored lines with filled arrows, represent the ``reverse_cost`` of the edge table.
+   **Graph 1: Directed, with cost and reverse cost**
 
 
 .. rubric:: Network for queries marked as ``undirected`` and ``cost`` and ``reverse_cost`` columns are used:
 
+When working with city networks, this is recommended for point of view of pedestrians.
+
 .. _fig2:
 
-.. figure:: ../../../src/common/doc/functions/images/Fig6-undirected.png
+.. figure:: images/Fig6-undirected.png
+   :scale: 50%
 
-    *Graph 2: Undirected, with cost and reverse cost*
+   **Graph 2: Undirected, with cost and reverse cost**
 
 
 .. rubric:: Network for queries marked as ``directed`` and only ``cost`` column is used:
@@ -117,17 +89,19 @@ Green colored lines with filled arrows, represent the ``reverse_cost`` of the ed
 .. _fig3:
 
 
-.. figure:: ../../../src/common/doc/functions/images/Fig2-cost.png
+.. figure:: images/Fig2-cost.png
+   :scale: 20%
 
-    *Graph 3: Directed, with cost*
+   **Graph 3: Directed, with cost**
 
 
 .. rubric:: Network for queries marked as ``undirected`` and only ``cost`` column is used:
 
 .. _fig4:
 
-.. figure:: ../../../src/common/doc/functions/images/Fig4-costUndirected.png
-
-    *Graph 4: Undirected, with cost*
+.. figure:: images/Fig4-costUndirected.png
+   :scale: 20%
+   
+   **Graph 4: Undirected, with cost**
 
 
diff --git a/doc/src/installation/build.rst b/doc/src/installation/build.rst
index 5027668..8cdb842 100644
--- a/doc/src/installation/build.rst
+++ b/doc/src/installation/build.rst
@@ -21,7 +21,7 @@ To be able to compile pgRouting make sure that the following dependencies are me
 * C and C++0x compilers
 * Postgresql version >= 9.1 
 * PostGIS version >= 2.0 
-* The Boost Graph Library (BGL). Version >= 1.55
+* The Boost Graph Library (BGL). Version >= 1.46
 * CMake >= 2.8.8
 * CGAL >=  4.2
 * (optional, for Documentation) Sphinx >= 1.1 
@@ -112,5 +112,12 @@ The following instructions start from *path/to/pgrouting*
 	$ make
 	$ sudo make install
 
+Dependencies Installation
+===============================================================================
+
+.. toctree::
+    :maxdepth: 1
+
+    install-dependencies
 
 
diff --git a/doc/src/installation/index.rst b/doc/src/installation/index.rst
deleted file mode 100644
index 3a5cb4c..0000000
--- a/doc/src/installation/index.rst
+++ /dev/null
@@ -1,136 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _installation:
-
-Installation
-===============================================================================
-
-This is a basic guide to download and install pgRouting.
-
-.. note:: additional notes can be found in `Installation Notes`_
-
-.. _Installation Notes: https://github.com/pgRouting/pgrouting/wiki/Notes-on-Download%2C-Installation-and-building-pgRouting
-
-Download
---------
-
-Binary packages are provided for the current version on the following platforms:
-
-
-Windows
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Winnie Bot Builds:
-
-* `Winnie PostgreSQL 9.2-9.5 32-bit/64-bit <http://postgis.net/windows_downloads>`_
-
-Production Builds:
-
-* Production builds are part of the Spatial Extensions/PostGIS Bundle available via Application StackBuilder
-* `Can also get PostGIS Bundle from <http://download.osgeo.org/postgis/windows/>`_
-
-
-Ubuntu/Debian
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Ubuntu packages are available in Launchpad repositories:
-
-* *stable* https://launchpad.net/~georepublic/+archive/pgrouting
-* *unstable* https://launchpad.net/~georepublic/+archive/pgrouting-unstable
-
-.. code-block:: bash
-
-	# Add pgRouting launchpad repository ("stable" or "unstable")
-	sudo add-apt-repository ppa:georepublic/pgrouting[-unstable]
-	sudo apt-get update
-
-	# Install pgRouting packages
-	sudo apt-get install postgresql-9.1-pgrouting
-
-Use `UbuntuGIS-unstable PPA <https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable>`_ to install PostGIS 2.0.
-
-
-RHEL/CentOS/Fedora
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-* Fedora RPM's: https://admin.fedoraproject.org/pkgdb/acls/name/pgRouting
-
-
-FreeBSD
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-pgRouting can be installed via ports:
-
-.. code-block:: bash
-
-  cd /usr/ports/databases/pgRouting
-  make install clean
-
-
-OS X
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. See `builds from KingChaos <http://www.kyngchaos.com/software/postgres>`_.
-
-* Homebrew
-
-.. code-block:: bash
-
-	brew install pgrouting
-
-
-Source Package
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-You can find all the pgRouting Releases: 
-
-https://github.com/pgRouting/pgrouting/releases
-
-See :ref:`build` to build the binaries from the source.
-
-Using Git
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Git protocol (read-only):
-
-.. code-block:: bash
-
-	git clone git://github.com/pgRouting/pgrouting.git
-
-
-HTTPS protocol (read-only):
-
-.. code-block:: bash
-
-	git clone https://github.com/pgRouting/pgrouting.git
-
-See :ref:`build` to build the binaries from the source.
-
-Installing in the database
---------------------------
-
-pgRouting is an extension. 
-
-.. code-block:: sql
-
-  CREATE EXTENSION postgis;
-  CREATE EXTENSION pgrouting;
-
-
-Upgrading the database
-----------------------
-
-To upgrade pgRouting to version 2.1.0 use the following command:
-
-.. code-block:: sql
-
-   ALTER EXTENSION pgrouting UPDATE TO "2.1.0";
-
-
diff --git a/doc/src/installation/install-dependencies.rst b/doc/src/installation/install-dependencies.rst
new file mode 100644
index 0000000..eb3ebcf
--- /dev/null
+++ b/doc/src/installation/install-dependencies.rst
@@ -0,0 +1,157 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share  
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _dependencies:
+
+##########################
+Dependencies Installation
+##########################
+
+This guide was made while making a fresh ubuntu desktop 14.04.02 installation.
+Make the neceszry adjustments to fit your operative system.
+
+Dependencies
+===============================================================================
+
+
+To be able to compile pgRouting make sure that the following dependencies are met:
+
+* C and C++0x compilers
+* Postgresql version >= 9.1 
+* PostGIS version >= 2.0 
+* The Boost Graph Library (BGL). Version >= 1.46
+* CMake >= 2.8.8
+* CGAL >=  4.2
+* (optional, for Documentation) Sphinx >= 1.1 
+* (optional, for Documentation as PDF) Latex >= [TBD]
+
+Before starting, on a terminal window:
+
+sudo apt-get update
+
+
+CMake >= 2.8.8
+---------------------
+
+trusty provides: 2.8.8
+
+.. code-block:: none
+
+    sudo apt-get install cmake
+
+
+C and (C++0x or c++11) compilers
+----------------------------------
+
+trusty provides: 4.8
+
+.. code-block:: none
+
+    sudo apt-get install g++
+
+
+Postgresql version >= 9.1 
+--------------------------
+
+For example in trusty 9.3 is provided:
+
+.. code-block:: none
+
+    sudo apt-get install postgreSQL
+    sudo apt-get install postgresql-server-dev-9.3
+
+
+PostGIS version >= 2.0 
+-----------------------
+
+For example in trusty 2.1 is provided:
+
+.. code-block:: none
+
+    sudo apt-get install postgresql-9.3-postgis-2.1
+
+
+
+The Boost Graph Library (BGL). Version >= 1.46
+----------------------------------------------
+
+trusty provides: 1.54.0
+
+.. code-block:: none
+
+    sudo apt-get install libboost-graph-dev
+
+
+CGAL >=  4.2
+---------------------
+
+.. code-block:: none
+
+    sudo apt-get install libcgal-dev
+
+(optional, for Documentation) Sphinx >= 1.1 
+--------------------------------------------
+
+http://sphinx-doc.org/latest/install.html
+
+trusty provides: 1.2.2
+
+.. code-block:: none
+
+    sudo apt-get install python-sphinx
+
+
+(optional, for Documentation as PDF) Latex >= [TBD]
+---------------------------------------------------
+
+https://latex-project.org/ftp.html
+
+trusty provides: 1.2.2
+
+.. code-block:: none
+
+    sudo apt-get install texlive
+
+
+pgTap & pg_prove & perl for tests 
+-----------------------------------
+
+.. warning:: cmake does not test for this packages.
+
+Installing the tests dependencies:
+
+.. code-block:: none
+
+    sudo apt-get install -y perl
+    wget https://github.com/theory/pgtap/archive/master.zip
+    unzip master.zip
+    cd pgtap-master
+    make
+    sudo make install
+    sudo ldconfig
+    sudo apt-get install -y libtap-parser-sourcehandler-pgtap-perl
+
+To run the tests:
+
+.. code-block:: none
+
+    tools/testers/algorithm-tester.pl
+    createdb  -U <user> ___pgr___test___
+    sh ./tools/testers/pg_prove_tests.sh <user>
+    dropdb  -U <user> ___pgr___test___
+
+See Also
+-------------------------------------------------------------------------------
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
+
diff --git a/doc/src/installation/installation.rst b/doc/src/installation/installation.rst
new file mode 100644
index 0000000..93ed92d
--- /dev/null
+++ b/doc/src/installation/installation.rst
@@ -0,0 +1,165 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _installation:
+
+Installation
+===============================================================================
+
+This is a basic guide to download and install pgRouting.
+
+Additional notes can be found in `Installation Notes <https://github.com/pgRouting/pgrouting/wiki/Notes-on-Download%2C-Installation-and-building-pgRouting>`__
+
+Also PostGIS provides some information about installation in this `Install Guide <http://www.postgis.us/presentations/postgis_install_guide_22.html>`__
+
+Download
+--------
+
+Binary packages are provided for the current version on the following platforms:
+
+
+Windows
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Winnie Bot Builds:
+
+* `Winnie PostgreSQL 9.2-9.5 32-bit/64-bit <http://postgis.net/windows_downloads>`_
+
+Production Builds:
+
+* Production builds are part of the Spatial Extensions/PostGIS Bundle available via Application StackBuilder
+* Can also get PostGIS Bundle from http://download.osgeo.org/postgis/windows/
+
+
+Ubuntu/Debian
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Ubuntu packages are available in Launchpad repositories:
+
+* *stable* https://launchpad.net/~georepublic/+archive/pgrouting
+* *unstable* https://launchpad.net/~georepublic/+archive/pgrouting-unstable
+
+.. code-block:: bash
+
+	# Add pgRouting launchpad repository ("stable" or "unstable")
+	sudo add-apt-repository ppa:georepublic/pgrouting[-unstable]
+	sudo apt-get update
+
+	# Install pgRouting packages
+	sudo apt-get install postgresql-9.1-pgrouting
+
+Use `UbuntuGIS-unstable PPA <https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable>`_ to install PostGIS 2.0.
+
+
+RHEL/CentOS
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+* Add repositories for dependencies:
+
+  .. code-block:: bash
+
+     wget http://repo.enetres.net/enetres.repo -O /etc/yum.repos.d/enetres.repo
+     wget http://nextgis.ru/programs/centos/nextgis.repo -O /etc/yum.repos.d/nextgis.repo
+     yum install epel-release
+
+* Install PostgreSQL and PostGIS according to `this <https://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21CentOS6pgdg>`__ instructions.
+
+* Install CGAL:
+
+  .. code-block:: bash
+
+     yum install libCGAL10
+
+* Install pgRouting:
+
+  .. code-block:: bash
+
+     yum install pgrouting_94
+
+More info (and packages for CentOS) can be found `here <https://github.com/nextgis/gis_packages_centos/wiki/Using-this-repo>`__.
+
+
+
+Fedora
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+* Fedora RPM's: https://admin.fedoraproject.org/pkgdb/package/rpms/pgRouting/
+
+
+FreeBSD
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+pgRouting can be installed via ports:
+
+.. code-block:: bash
+
+  cd /usr/ports/databases/pgRouting
+  make install clean
+
+
+OS X
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. See `builds from KingChaos <http://www.kyngchaos.com/software/postgres>`_.
+
+* Homebrew
+
+.. code-block:: bash
+
+	brew install pgrouting
+
+
+Source Package
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can find all the pgRouting Releases: 
+
+https://github.com/pgRouting/pgrouting/releases
+
+See :ref:`build` to build the binaries from the source.
+
+Using Git
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Git protocol (read-only):
+
+.. code-block:: bash
+
+	git clone git://github.com/pgRouting/pgrouting.git
+
+
+HTTPS protocol (read-only):
+
+.. code-block:: bash
+
+	git clone https://github.com/pgRouting/pgrouting.git
+
+See :ref:`build` to build the binaries from the source.
+
+Installing in the database
+--------------------------
+
+pgRouting is an extension. 
+
+.. code-block:: sql
+
+  CREATE EXTENSION postgis;
+  CREATE EXTENSION pgrouting;
+
+
+Upgrading the database
+----------------------
+
+To upgrade pgRouting to version 2.1.0 use the following command:
+
+.. code-block:: sql
+
+   ALTER EXTENSION pgrouting UPDATE TO "2.1.0";
+
+
diff --git a/doc/src/introduction/index.rst b/doc/src/introduction/index.rst
deleted file mode 100644
index 34f1170..0000000
--- a/doc/src/introduction/index.rst
+++ /dev/null
@@ -1,26 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _intro:
-
- 
-===============================================================================
-
-
-.. toctree::
-	:maxdepth: 1
-
-        introduction	
-        support
-
-.. rubric:: Indices and tables
-
-* :ref:`genindex`
-* :ref:`search`
-
diff --git a/doc/src/introduction/introduction.rst b/doc/src/introduction/introduction.rst
index 56e4e1a..7f1b736 100644
--- a/doc/src/introduction/introduction.rst
+++ b/doc/src/introduction/introduction.rst
@@ -12,7 +12,7 @@
 Introduction
 ===============================================================================
 
-pgRouting is an extension of `PostGIS <http://postgis.net>`_ and `PostgreSQL <http://postgresql.org>`_ geospatial database and adds routing and other network analysis functionality. A predecessor of pgRouting – pgDijkstra, written by Sylvain Pasche from `Camptocamp <http://camptocamp.com>`_, was later extended by `Orkney <http://www.orkney.co.jp>`_ and renamed to pgRouting. The project is now supported and maintained by `Georepublic <http://georepublic.info>`_, `iMaptools <http://imaptoo [...]
+pgRouting is an extension of `PostGIS <http://postgis.net>`_ and `PostgreSQL <http://postgresql.org>`_ geospatial database and adds routing and other network analysis functionality. A predecessor of pgRouting – pgDijkstra, written by Sylvain Pasche from `Camptocamp <http://camptocamp.com>`_, was later extended by `Orkney <http://www.orkney.co.jp>`_ and renamed to pgRouting. The project is now supported and maintained by `Georepublic <http://georepublic.info>`_, `iMaptools <http://imaptoo [...]
 
 pgRouting is an `OSGeo Labs <http://wiki.osgeo.org/wiki/OSGeo_Labs>`_ project of the `OSGeo Foundation <http://osgeo.org>`_ and included on `OSGeo Live <http://live.osgeo.org/>`_. 
 
@@ -44,11 +44,33 @@ In general license information should be included in the header of each source f
 Contributors
 -------------------------------------------------------------------------------
 
+This Release Contributors
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
 Individuals (in alphabetical order)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-	Akio Takubo, Anton Patrushev, Ashraf Hossain, Christian Gonzalez, Daniel Kastl, Dave Potts, David Techer, Ema Miyawaki, Florian Thurkow, Frederic Junod, Gerald Fenoy, Jay Mahadeokar, Jinfu Leng, Kai Behncke, Kishore Kumar, Ko Nagase, Mario Basa, Martin Wiesenhaan, Razequl Islam, Stephen Woodbridge, Sylvain Housseman, Sylvain Pasche, Virginia Vergara
+Daniel Kastl, Ko Nagase, Mario Basa, Regina Obe, Stephen Woodbridge, Virginia Vergara
+
+And all the people that gives us a little of their time making comments, finding issues, making pull requests etc.
+
+Corporate Sponsors (in alphabetical order)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+These are corporate entities that have contributed developer time, hosting, or direct monetary funding to the pgRouting project:
+
+ - `Georepublic <https://georepublic.info/en/>`__
+ - `Google Summer of Code <https://developers.google.com/open-source/gsoc/>`_
+ - `iMaptools <http://imaptools.com>`__
+ - `Paragon Corporation <http://www.paragoncorporation.com/>`_
+
+Contributors Past & Present:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+Individuals (in alphabetical order)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+Akio Takubo, Anton Patrushev, Ashraf Hossain, Christian Gonzalez, Daniel Kastl, Dave Potts, David Techer, Denis Rykov, Ema Miyawaki, Florian Thurkow, Frederic Junod, Gerald Fenoy, Jay Mahadeokar, Jinfu Leng, Kai Behncke, Kishore Kumar, Ko Nagase, Manikata Kondeti, Mario Basa, Martin Wiesenhaan,  Maxim Dubinin, Mohamed Zia, Mukul Priya, Razequl Islam, Sarthak Agarwal, Stephen Woodbridge, Sylvain Housseman, Sylvain Pasche, Virginia Vergara
 
 Corporate Sponsors (in alphabetical order)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/src/introduction/support.rst b/doc/src/introduction/support.rst
index 7229316..0719297 100644
--- a/doc/src/introduction/support.rst
+++ b/doc/src/introduction/support.rst
@@ -12,7 +12,7 @@
 Support
 ===============================================================================
 
-pgRouting community support is available through `website <http://www.pgrouting.org>`_, `documentation <http://docs.pgrouting.org>`_, tutorials, mailing lists and others. If you’re looking for :ref:`commercial support <support_commercial>`, find below a list of companies providing pgRouting development and consulting services.
+pgRouting community support is available through the `pgRouting website <http://pgrouting.org/support.html>`_, `documentation <http://docs.pgrouting.org>`_, tutorials, mailing lists and others. If you’re looking for :ref:`commercial support <support_commercial>`, find below a list of companies providing pgRouting development and consulting services.
 
 
 Reporting Problems
@@ -67,6 +67,9 @@ For users who require professional support, development and consulting services,
    * - iMaptools
      - United States
      - http://imaptools.com
+   * - Paaragon Corporation
+     - United States
+     - http://www.paragoncorporation.com/
    * - Orkney Inc.
      - Japan
      - http://www.orkney.co.jp
diff --git a/doc/src/recipes/test/example_recipe.test.sql b/doc/src/recipes/test/example_recipe.test.sql
index 2e9b913..eeba9f0 100644
--- a/doc/src/recipes/test/example_recipe.test.sql
+++ b/doc/src/recipes/test/example_recipe.test.sql
@@ -1,3 +1,4 @@
+BEGIN;
 /*.. 
    ****************************************************************************
     pgRouting Manual
@@ -27,4 +28,4 @@ set client_min_messages = warning;
 	SELECT pgr_nodeNetwork('edge_table', 0.001);
 	SELECT pgr_createTopology('edge_table_noded', 0.001);
 	SELECT pgr_analyzegraph('edge_table_noded', 0.001); 
-
+ROLLBACK;
diff --git a/doc/src/recipes/test/parallel_handling.result b/doc/src/recipes/test/parallel_handling.result
index 4a815b0..7173ec1 100644
--- a/doc/src/recipes/test/parallel_handling.result
+++ b/doc/src/recipes/test/parallel_handling.result
@@ -1,12 +1,3 @@
-NOTICE:  table "parallel" does not exist, skipping
-NOTICE:  PROCESSING:
-NOTICE:  pgr_createTopology('parallel',0.001,'the_geom','id','source','target','true')
-NOTICE:  Performing checks, please wait .....
-NOTICE:  Creating Topology, Please wait...
-NOTICE:  -------------> TOPOLOGY CREATED FOR  8 edges
-NOTICE:  Rows with NULL geometry or NULL id: 0
-NOTICE:  Vertices table for table public.parallel is: public.parallel_vertices_pgr
-NOTICE:  ----------------------------------------------
 OK
 1|1|1
 1|2|2
diff --git a/doc/src/recipes/test/parallel_handling.test.sql b/doc/src/recipes/test/parallel_handling.test.sql
index 4ad16a0..006de02 100644
--- a/doc/src/recipes/test/parallel_handling.test.sql
+++ b/doc/src/recipes/test/parallel_handling.test.sql
@@ -1,3 +1,5 @@
+BEGIN;
+  SET client_min_messages = WARNING;
   drop table if exists parallel;
   CREATE TABLE parallel (
     id serial,
@@ -119,3 +121,4 @@
 
 
   select * from expand_parallel_edge_paths( 'paths' );
+ROLLBACK;
diff --git a/doc/src/recipes/test/test.conf b/doc/src/recipes/test/test.conf
index a030d77..54fc6f3 100644
--- a/doc/src/recipes/test/test.conf
+++ b/doc/src/recipes/test/test.conf
@@ -7,7 +7,6 @@
         'tests' => [qw(
 parallel_handling
 example_recipe
-zzz-remove_sampledata
 )]
         },
 
diff --git a/doc/src/recipes/test/zzz-remove_sampledata.test.sql b/doc/src/recipes/test/zzz-remove_sampledata.test.sql
index d6335c6..9ceaa20 100644
--- a/doc/src/recipes/test/zzz-remove_sampledata.test.sql
+++ b/doc/src/recipes/test/zzz-remove_sampledata.test.sql
@@ -1,4 +1,4 @@
-
+BEGIN;
 ------------------------------------------------------------------------------------------------------
 ------------------------------------------------------------------------------------------------------
 --  REMOVE            SAMPLE DATA                
@@ -6,3 +6,4 @@
 ------------------------------------------------------------------------------------------------------
 drop table if exists edge_table;
 drop table if exists vertex_table;
+ROLLBACK;
diff --git a/doc/src/tutorial/custom_wrapper.rst b/doc/src/tutorial/custom_wrapper.rst
deleted file mode 100644
index 36d1378..0000000
--- a/doc/src/tutorial/custom_wrapper.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _custom_wrapper:
-
-User's wrapper contributions 
-===============================================================================
-
-.. rubric:: How to contribute.
-
-Use an issue tracker (see :ref:`support`) with a title containing: *Proposing a wrapper: Mywrappername*. The body will contain: 
-
-  - author:  Required
-  - mail: if you are subscribed to the developers list this is not necessary
-  - date: Date posted
-  - comments and code:  using reStructuredText format
-
-Any contact with the author will be done using the developers mailing list. The pgRouting team will evaluate the wrapper and will be included it in this section when approved.
-
-
-*No contributions at this time*
diff --git a/doc/src/tutorial/tutorial.rst b/doc/src/tutorial/tutorial.rst
index 408457a..59874f4 100644
--- a/doc/src/tutorial/tutorial.rst
+++ b/doc/src/tutorial/tutorial.rst
@@ -23,7 +23,7 @@ with pgRouting. In this guide we will cover:
     * How to use other tools to view your graph and route
     * How to create a web app
 
-How to create a database to use for our project
+How to create a database
 -------------------------------------------------------------------------------
 
 The first thing we need to do is create a database and load pgrouting in 
@@ -41,36 +41,21 @@ For Postgresql 9.1 and later versions
 	psql mydatabase -c "create extension pgrouting"
 
 
-For older versions of postgresql
-
-.. code-block:: bash
-
-	createdb -T template1 template_postgis
-	psql template_postgis -c "create language plpgsql"
-	psql template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
-	psql template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql
-	psql template_postgis -f /usr/share/postgresql/9.0/contrib/postgis_comments.sql
-
-	createdb -T template_postgis template_pgrouting
-	psql template_pgrouting -f /usr/share/postgresql/9.0/contrib/pgrouting-2.0/pgrouting.sql
-
-	createdb -T template_pgrouting mydatabase
-
-
 How to load some data
 -------------------------------------------------------------------------------
 
 How you load your data will depend in what form it comes it. There are
 various OpenSource tools that can help you, like:
 
+:osm2pgrouting-alpha: - this is a tool for loading OSM data into postgresql with pgRouting requirements
 :shp2pgsql: - this is the postgresql shapefile loader
 :ogr2ogr: - this is a vector data conversion utility
 :osm2pgsql: - this is a tool for loading OSM data into postgresql
 
-So these tools and probably others will allow you to read vector data and
-and can load that data into your database as a table of some kind. At this
+So these tools and probably others will allow you to read vector data so that 
+you may then load that data into your database as a table of some kind. At this
 point you need to know a little about your data structure and content. One easy
-way to browse you data table is with pgAdmin3 or phpPgAdmin.
+way to browse your new data table is with pgAdmin3 or phpPgAdmin.
 
 
 How to build a topology
@@ -80,7 +65,9 @@ Next we need to build a topology for our street data. What this means is that
 for any given edge in your street data the ends of that edge will be connected
 to a unique node and to other edges that are also connected to that same unique
 node. Once all the edges are connected to nodes we have a graph that can be
-used for routing with pgrouting. We provide a tools the will help with this:
+used for routing with pgrouting. We provide a tool that will help with this:
+
+.. note:: this step is not needed if data is loaded with `osm2pgrouting-alpha`
 
 .. code-block:: sql
 
@@ -93,9 +80,9 @@ How to check your graph for errors
 -------------------------------------------------------------------------------
 
 There are lots of possible sources for errors in a graph. The data that you
-started with may not have been designed with routing in mind. A graph as some
-very specific requirments. One it that it is *NODED*, this means that except
-for some very specific use cases, each road segments starts and ends at a node
+started with may not have been designed with routing in mind. A graph has some
+very specific requirments. One is that it is *NODED*, this means that except
+for some very specific use cases, each road segment starts and ends at a node
 and that in general is does not cross another road segment that it should be
 connected to.
 
@@ -120,32 +107,25 @@ See :ref:`pgr_node_network` for more information.
 How to compute a route
 -------------------------------------------------------------------------------
 
-Once you have all the prep work done above, computing a route is fairly easy.
-We have a lot of different algorithms but they can work with your prepared
-road network. The general form of a route query is:
+Once you have all the preparation work done above, computing a route is fairly easy.
+We have a lot of different algorithms that can work with your prepared road
+network. The general form of a route query is:
 
 .. code-block:: sql
 
     select pgr_<algorithm>(<SQL for edges>, start, end, <additonal options>)
 
 As you can see this is fairly straight forward and you can look and the 
-specific algorithms for the details on how to use them. What you get as a
-result from these queries will be a set of record of type :ref:`type_cost_result`
-or :ref:`type_geom_result`. These results have information like edge id and/or the
+specific algorithms for the details of the signatures and how to use them.
+These results have information like edge id and/or the
 node id along with the cost or geometry for the step in the path from *start*
 to *end*. Using the ids you can join these result back to your edge table
 to get more information about each step in the path.
 
- * See also :ref:`type_cost_result` and :ref:`type_geom_result`.
-
-.. How to use other tools to view your graph and route
-.. -------------------------------------------------------------------------------
-
-.. TBD
 
-.. How to create a web app
-.. -------------------------------------------------------------------------------
 
-.. TBD
+.. rubric:: Indices and tables
 
+* :ref:`genindex`
+* :ref:`search`
 
diff --git a/doc/static/images/favicon.ico b/doc/static/images/favicon.ico
new file mode 100644
index 0000000..c1e5bc9
Binary files /dev/null and b/doc/static/images/favicon.ico differ
diff --git a/doc/test/alphashape-any.test.sql b/doc/test/alphashape-any.test.sql
deleted file mode 100644
index bd638a7..0000000
--- a/doc/test/alphashape-any.test.sql
+++ /dev/null
@@ -1,24 +0,0 @@
---------------------------------------------------------------------------------
---              PGR_alphaShape
---------------------------------------------------------------------------------
--- testing with areas
---SELECT * FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table');
---SELECT * FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr');
-
-SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
-FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
-(SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
-
-FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table')
-
-) AS a) AS foo;
-
-\echo '-----------------------------'
-
-SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
-FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
-(SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
-
-FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr')
-
-) AS a) AS foo;
diff --git a/doc/test/analyzeGraph-any.result b/doc/test/analyzeGraph-any.result
deleted file mode 100644
index 9e7807f..0000000
--- a/doc/test/analyzeGraph-any.result
+++ /dev/null
@@ -1,378 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait.....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Got function st_srid(integer) does not exist
- NOTICE:  ERROR: something went wrong when checking for SRID of id in table public.edge_table
-FAIL
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 4
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 5
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 10
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.0001,'gid','mygeom','src','tgt','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Got function st_srid(integer) does not exist
- NOTICE:  ERROR: something went wrong when checking for SRID of gid in table public.mytable
-FAIL
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 4
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 4
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 1
- NOTICE:                            Dead ends: 5
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 1
- NOTICE:                            Dead ends: 5
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='myhouse')')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 10
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='myhouse')')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 10
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 4
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id >= 10')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 8
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 17')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 3
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','id <17')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 3
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
diff --git a/doc/test/analyzeGraph-any.test.sql b/doc/test/analyzeGraph-any.test.sql
deleted file mode 100644
index c6c7a66..0000000
--- a/doc/test/analyzeGraph-any.test.sql
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_analyzegraph
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-         SELECT  pgr_createTopology('edge_table',0.001);
-	 SELECT  pgr_analyzeGraph('edge_table',0.001);
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target');
-	SELECT  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target');
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source');
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
-        DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ;
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-	DROP TABLE IF EXISTS mytable;
-	CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , the_geom AS mygeom FROM edge_table);
-	SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt');
-	SELECT  pgr_analyzeGraph('mytable',0.0001,'gid','mygeom','src','tgt');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-        DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 'myhouse'::text AS place, st_point(2.5,2.5) AS other_geom) ;
-	SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
-                 rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-                 rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
-                 --------------------
-	SELECT  pgr_createTopology('edge_table',0.001);
-	SELECT pgr_analyzeGraph('edge_table', 0.001);
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id >= 10');
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 17');
-
-	-- Simulate removal of edges
-	SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17');
-	SELECT pgr_analyzeGraph('edge_table', 0.001);
-
diff --git a/doc/test/analyzeOneway-any.test.sql b/doc/test/analyzeOneway-any.test.sql
deleted file mode 100644
index e09747f..0000000
--- a/doc/test/analyzeOneway-any.test.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-
----------------------------------------------------------------------------------------
---            pgr_analyzeOneway
----------------------------------------------------------------------------------------
-SELECT pgr_analyzeOneway('edge_table',
-ARRAY['', 'B', 'TF'],
-ARRAY['', 'B', 'FT'],
-ARRAY['', 'B', 'FT'],
-ARRAY['', 'B', 'TF'],
-oneway:='dir');
-
diff --git a/doc/test/apspJohnson-any.result b/doc/test/apspJohnson-any.result
deleted file mode 100644
index e4440c1..0000000
--- a/doc/test/apspJohnson-any.result
+++ /dev/null
@@ -1,10 +0,0 @@
-0|1|1|0
-1|1|2|1
-2|1|5|2
-3|1|6|3
-4|1|9|4
-5|1|10|3
-6|1|11|4
-7|1|12|5
-8|1|13|4
-9|2|2|0
diff --git a/doc/test/apspJohnson-any.test.sql b/doc/test/apspJohnson-any.test.sql
deleted file mode 100644
index 6a6c369..0000000
--- a/doc/test/apspJohnson-any.test.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_apspJohnson
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-SELECT seq, id1 AS FROM, id2 AS to, cost
-    FROM pgr_apspJohnson(
-        'SELECT source, target, cost FROM edge_table'
-    ) limit 10; 
diff --git a/doc/test/apspWarshall-any.result b/doc/test/apspWarshall-any.result
deleted file mode 100644
index 663e1a1..0000000
--- a/doc/test/apspWarshall-any.result
+++ /dev/null
@@ -1,10 +0,0 @@
-0|1|1|0
-1|1|2|1
-2|1|3|0
-3|1|4|-1
-4|1|5|2
-5|1|6|1
-6|1|11|2
-7|1|10|3
-8|1|12|1
-9|1|13|4
diff --git a/doc/test/apspWarshall-any.test.sql b/doc/test/apspWarshall-any.test.sql
deleted file mode 100644
index a3d8b51..0000000
--- a/doc/test/apspWarshall-any.test.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_apspWarshall
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-SELECT seq, id1 AS FROM, id2 AS to, cost
-    FROM pgr_apspWarshall(
-        'SELECT id, source, target, cost FROM edge_table',
-        false, false
-    ) limit 10;
-
diff --git a/doc/test/astar-any.result b/doc/test/astar-any.result
deleted file mode 100644
index 0add5ab..0000000
--- a/doc/test/astar-any.result
+++ /dev/null
@@ -1,10 +0,0 @@
-0|4|16|1
-1|9|9|1
-2|6|11|1
-3|11|12|1
-4|10|-1|0
-0 |4|3|1
-1 |3|5|1
-2 |6|8|1
-3 |5|10|1
-4 |10|-1|0
diff --git a/doc/test/astar-any.test.sql b/doc/test/astar-any.test.sql
deleted file mode 100644
index ee1d77f..0000000
--- a/doc/test/astar-any.test.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_AStar
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-SELECT seq, id1 AS node, id2 AS edge, cost
-        FROM pgr_AStar(
-                'SELECT id, source, target, cost, x1, y1, x2, y2 FROM edge_table order by id',
-                4, 10, false, false);
-SELECT seq, id1 AS node, id2 AS edge, round(cost) as cost
-        FROM pgr_AStar(
-                'SELECT id, source, target, cost, x1, y1, x2, y2, reverse_cost FROM edge_table ',
-                4, 10, true, true);
-
diff --git a/doc/test/bdDijkstra-any.result b/doc/test/bdDijkstra-any.result
deleted file mode 100644
index 4842276..0000000
--- a/doc/test/bdDijkstra-any.result
+++ /dev/null
@@ -1,12 +0,0 @@
-0|7|6|1
-1|8|7|1
-2|5|8|1
-3|6|9|1
-4|9|15|1
-5|12|-1|0
-0|7|6|1
-1|8|7|1
-2|5|8|1
-3|6|9|1
-4|9|15|1
-5|12|-1|0
diff --git a/doc/test/bdDijkstra-any.test.sql b/doc/test/bdDijkstra-any.test.sql
deleted file mode 100644
index c64f995..0000000
--- a/doc/test/bdDijkstra-any.test.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_bdDijkstra
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-SELECT seq, id1 AS node, id2 AS edge, round(cost) as cost
-    FROM pgr_bdDijkstra(
-        'SELECT id, source, target, cost FROM edge_table order by id',
-        7, 12, false, false);
-SELECT seq, id1 AS node, id2 AS edge, cost
-    FROM pgr_bdDijkstra(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        7, 12, true, true);
diff --git a/doc/test/bdstar-any.result b/doc/test/bdstar-any.result
deleted file mode 100644
index e055bce..0000000
--- a/doc/test/bdstar-any.result
+++ /dev/null
@@ -1,10 +0,0 @@
-0|4|3|0
-1|3|5|1
-2|6|11|1
-3|11|12|0
-4|10|-1|0
-0|4|3|1
-1|3|5|1
-2|6|8|1
-3|5|10|1
-4|10|-1|0
diff --git a/doc/test/bdstar-any.test.sql b/doc/test/bdstar-any.test.sql
deleted file mode 100644
index 5ac8608..0000000
--- a/doc/test/bdstar-any.test.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_pgr_bdAStar
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-SELECT seq, id1 AS node, id2 AS edge, round(cost) as cost
-    FROM pgr_bdAStar(
-        'SELECT id, source, target, cost, x1, y1, x2, y2 FROM edge_table order by id',
-        4, 10, false, false);
-SELECT seq, id1 AS node, id2 AS edge, cost
-    FROM pgr_bdAStar(
-        'SELECT id, source, target, cost, x1, y1, x2, y2, reverse_cost FROM edge_table ',
-        4, 10, true, true);
diff --git a/doc/test/createTopology-any.result b/doc/test/createTopology-any.result
deleted file mode 100644
index 8d60f7d..0000000
--- a/doc/test/createTopology-any.result
+++ /dev/null
@@ -1,173 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','id < 10')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  9 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  6 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  table "othertable" does not exist, skipping
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  12 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  table "mytable" does not exist, skipping
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  9 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  9 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  12 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  12 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','id<10')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  9 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
diff --git a/doc/test/createTopology-any.test.sql b/doc/test/createTopology-any.test.sql
deleted file mode 100644
index 83b84ce..0000000
--- a/doc/test/createTopology-any.test.sql
+++ /dev/null
@@ -1,45 +0,0 @@
-
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---                pgr_createTopology
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-\set verbosity terse
-
-
-	 SELECT  pgr_createTopology('edge_table',0.001);
-	 SELECT  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target');
-	 -- SELECT  pgr_createTopology('edge_table',0.001,'id','the_geom','source','target');
-	 SELECT  pgr_createTopology('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
-	 SELECT  pgr_createTopology('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
-	 SELECT  pgr_createTopology('edge_table',0.001,source:='source');
-	 SELECT  pgr_createTopology('edge_table',0.001,rows_where:='id < 10');
-	 SELECT  pgr_createTopology('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom);
-	SELECT  pgr_createTopology('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-	DROP TABLE IF EXISTS mytable;
-	CREATE TABLE mytable AS (SELECT id AS gid, the_geom AS mygeom,source AS src ,target AS tgt FROM edge_table) ;
-	SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt');
-	-- SELECT  pgr_createTopology('mytable',0.001,'gid','mygeom','src','tgt');
-	 SELECT  pgr_createTopology('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
-	 SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
-	 SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
-	SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt',
-                           rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-                           rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-
--------------------------------------------------------------------------------
-	SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id<10');
-	SELECT pgr_createTopology('edge_table', 0.001);
-	
diff --git a/doc/test/createVertTab-any.test.sql b/doc/test/createVertTab-any.test.sql
deleted file mode 100644
index fd245ba..0000000
--- a/doc/test/createVertTab-any.test.sql
+++ /dev/null
@@ -1,41 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---                  PGR_createVerticesTable
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
---    SELECT pgr_createTopology('edge_table',0.001);
-	 SELECT  pgr_createVerticesTable('edge_table');
-	 SELECT  pgr_createVerticesTable('edge_table','the_geom','source','target');
-	-- SELECT  pgr_createVerticesTable('edge_table','source','the_geom','target');
-	 SELECT  pgr_createVerticesTable('edge_table',the_geom:='the_geom',source:='source',target:='target');
-	 SELECT  pgr_createVerticesTable('edge_table',source:='source',target:='target',the_geom:='the_geom');
-	 SELECT  pgr_createVerticesTable('edge_table',source:='source');
-	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='id < 10');
-	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(the_geom,0.5) FROM edge_table WHERE id=5)');
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
-	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(other_geom,0.5) FROM otherTable WHERE gid=100)');
-	DROP TABLE IF EXISTS mytable;
-	CREATE TABLE mytable AS (SELECT id AS gid, the_geom AS mygeom,source AS src ,target AS tgt FROM edge_table) ;
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt');
-	-- SELECT  pgr_createVerticesTable('mytable','src','mygeom','tgt');
-	 SELECT  pgr_createVerticesTable('mytable',the_geom:='mygeom',source:='src',target:='tgt');
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom');
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',rows_where:='gid < 10');
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)');
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)');
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
-	                            rows_where:='mygeom && (SELECT st_buffer(other_geom,0.5) FROM otherTable WHERE gid=100)');
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(other_geom,0.5) FROM otherTable WHERE gid=100)');
-
--------------------------------------
-	SELECT pgr_createVerticesTable('edge_table');
-
-
diff --git a/doc/test/dijkstra-v2.result b/doc/test/dijkstra-v2.result
deleted file mode 100644
index 9518c72..0000000
--- a/doc/test/dijkstra-v2.result
+++ /dev/null
@@ -1,12 +0,0 @@
-0|2|4|1
-1|5|8|1
-2|6|9|1
-3|9|16|1
-4|4|3|1
-5|3|-1|0
-0|2|4|1
-1|5|8|1
-2|6|5|1
-3|3|-1|0
-0|2|2|1
-1|3|-1|0
diff --git a/doc/test/dijkstra-v2.test.sql b/doc/test/dijkstra-v2.test.sql
deleted file mode 100644
index 1f7c86e..0000000
--- a/doc/test/dijkstra-v2.test.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_dijkstra  V.2.0
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-SELECT seq, id1 AS node, id2 AS edge, cost
-        FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2,3, true, false
-        );
-
-SELECT seq, id1 AS node, id2 AS edge, cost
-        FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2,3, true, true
-        );
-
-SELECT seq, id1 AS node, id2 AS edge, cost
-         FROM pgr_dijkstra(
-                 'SELECT id, source, target, cost FROM edge_table',
-                 2, 3, false, false
-         );
-
-SELECT seq, id1 AS node, id2 AS edge, cost
-         FROM pgr_dijkstra(
-                 'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                 2, 3, false, true
-         );
-
diff --git a/doc/test/issue-353.test.sql b/doc/test/issue-353.test.sql
deleted file mode 100644
index f7da593..0000000
--- a/doc/test/issue-353.test.sql
+++ /dev/null
@@ -1,8 +0,0 @@
--- test for issue 353
-
-select * from pgr_dijkstra( 'select id, source, target, cost from edge_table',
-     array[2,7], array[5,6]);
-select * from pgr_dijkstra( 'select id, source, target, cost from edge_table', 
-    array[2,7], array[17,18]);
-select * from pgr_dijkstra( 'select id, source, target, cost from edge_table', 
-array[2,7], array[5,6,17,18]);
diff --git a/doc/test/kdijkstra-any.result b/doc/test/kdijkstra-any.result
deleted file mode 100644
index 7c775ea..0000000
--- a/doc/test/kdijkstra-any.result
+++ /dev/null
@@ -1,12 +0,0 @@
-0|10|4|4
-1|10|12|2
-0|4|10|12|1
-1|4|11|13|1
-2|4|12|15|1
-3|4|9|16|1
-4|4|4|-1|0
-5|12|10|12|1
-6|12|11|13|1
-7|12|12|-1|0
-4|LINESTRING(2 3,3 3,4 3,4 2,4 1)
-12|LINESTRING(2 3,3 3,4 3)
diff --git a/doc/test/kdijkstra-any.test.sql b/doc/test/kdijkstra-any.test.sql
deleted file mode 100644
index c311ae9..0000000
--- a/doc/test/kdijkstra-any.test.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_kdijkstraPath
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-SELECT seq, id1 AS source, id2 AS target, cost FROM pgr_kdijkstraCost(
-    'SELECT id, source, target, cost FROM edge_table',
-    10, array[4,12], false, false);
-SELECT seq, id1 AS path, id2 AS node, id3 AS edge, cost
-  FROM pgr_kdijkstraPath(
-      'SELECT id, source, target, cost FROM edge_table',
-      10, array[4,12], false, false);
-SELECT id1 AS path, st_AStext(st_linemerge(st_union(b.the_geom))) AS the_geom
-  FROM pgr_kdijkstraPath(
-                  'SELECT id, source, target, cost FROM edge_table',
-                  10, array[4,12], false, false
-            ) a,
-            edge_table b
-WHERE a.id3=b.id
-GROUP by id1
-ORDER by id1;
diff --git a/doc/test/ksp-any.result b/doc/test/ksp-any.result
deleted file mode 100644
index 0c1816f..0000000
--- a/doc/test/ksp-any.result
+++ /dev/null
@@ -1,24 +0,0 @@
-0|0|7|6|1
-1|0|8|7|1
-2|0|5|8|1
-3|0|6|9|1
-4|0|9|15|1
-5|0|12|-1|0
-6|1|7|6|1
-7|1|8|7|1
-8|1|5|8|1
-9|1|6|11|1
-10|1|11|13|1
-11|1|12|-1|0
-0|0|7|6|1
-1|0|8|7|1
-2|0|5|10|1
-3|0|10|12|1
-4|0|11|13|1
-5|0|12|-1|0
-6|1|7|6|1
-7|1|8|7|1
-8|1|5|8|1
-9|1|6|9|1
-10|1|9|15|1
-11|1|12|-1|0
diff --git a/doc/test/ksp-any.test.sql b/doc/test/ksp-any.test.sql
deleted file mode 100644
index 02432a3..0000000
--- a/doc/test/ksp-any.test.sql
+++ /dev/null
@@ -1,15 +0,0 @@
---------------------------------------------------------------------------------
---              PGR_ksp
---------------------------------------------------------------------------------
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
- FROM pgr_ksp(
-   'SELECT id, source, target, cost FROM edge_table order by id',
-   7, 12, 2, false
- );
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
- FROM pgr_ksp(
-   'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
-   7, 12, 2, true
- );
-
diff --git a/doc/test/makeTests.sh b/doc/test/makeTests.sh
deleted file mode 100644
index f56876b..0000000
--- a/doc/test/makeTests.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-psql  -U postgres -h localhost -A -t -q -f sampledata.test pgr_test &>tmp.aaa
-sed s/psql:sampledata.test:[0-9]*:// <tmp.aaa >sampledata.rest
-
-
-
-psql  -U postgres -h localhost -A -t -q -f alphashape-any.test pgr_test &> tmp.aaa
-sed s/psql:alphashape-any.test:[0-9]*:// <tmp.aaa >alphashape-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f apspJohnson-any.test pgr_test &> tmp.aaa
-sed s/psql:apspJohnson-any.test:[0-9]*:// <tmp.aaa >apspJohnson-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f apspWarshall-any.test pgr_test &> tmp.aaa
-sed s/psql:apspWarshall-any.test:[0-9]*:// <tmp.aaa >apspWarshall-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f astar-any.test pgr_test &> tmp.aaa
-sed s/psql:astar-any.test:[0-9]*:// <tmp.aaa >astar-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f bdstar-any.test pgr_test &> tmp.aaa
-sed s/psql:bdstar-any.test:[0-9]*:// <tmp.aaa >bdstar-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f bdDijkstra-any.test pgr_test &> tmp.aaa
-sed s/psql:bdDijkstra-any.test:[0-9]*:// <tmp.aaa >bdDijkstra-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f dijkstra-any.test pgr_test &> tmp.aaa
-sed s/psql:dijkstra-any.test:[0-9]*:// <tmp.aaa >dijkstra-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f drivingDistance-any.test pgr_test &> tmp.aaa
-sed s/psql:dt01-drivingDistance-any.test:[0-9]*:// <tmp.aaa >drivingDistance-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f pointsAsPolygon-any.test pgr_test &> tmp.aaa
-sed s/psql:pointsAsPolygon-any.test:[0-9]*:// <tmp.aaa >pointsAsPolygon-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f kdijkstra-any.test pgr_test &> tmp.aaa
-sed s/psql:kdijkstra-any.test:[0-9]*:// <tmp.aaa >kdijkstra-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f ksp-any.test pgr_test &> tmp.aaa
-sed s/psql:ksp-any.test:[0-9]*:// <tmp.aaa >ksp-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f tsp-any.test pgr_test &> tmp.aaa
-sed s/psql:tsp-any.test:[0-9]*:// <tmp.aaa >tsp-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f trsp-any.test pgr_test &> tmp.aaa
-sed s/psql:trsp-any.test:[0-9]*:// <tmp.aaa >trsp-any.rest
-
-
-psql  -U postgres -h localhost -A -t -q -f utilities-any.test pgr_test &> tmp.aaa
-sed s/psql:utilities-any.test:[0-9]*:// <tmp.aaa >utilities-any.rest
-
-
-
-psql  -U postgres -h localhost -A -t -q -f createTopology-any.test pgr_test &> tmp.aaa
-sed s/psql:createTopology-any.test:[0-9]*:// <tmp.aaa >createTopology-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f createVertTab-any.test pgr_test &> tmp.aaa
-sed s/psql:createVertTab-any.test:[0-9]*:// <tmp.aaa >createVertTab-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f analyzeGraph-any.test pgr_test &> tmp.aaa
-sed s/psql:analyzeGraph-any.test:[0-9]*:// <tmp.aaa >analyzeGraph-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f analyzeOneway-any.test pgr_test &> tmp.aaa
-sed s/psql:analyzeOneway-any.test:[0-9]*:// <tmp.aaa >analyzeOneway-any.rest
-
-psql  -U postgres -h localhost -A -t -q -f nodeNetwork-any.test pgr_test &> tmp.aaa
-sed s/psql:nodeNetwork-any.test:[0-9]*:// <tmp.aaa >nodeNetwork-any.rest
diff --git a/doc/test/nodeNetwork-any.result b/doc/test/nodeNetwork-any.result
deleted file mode 100644
index c09f3b8..0000000
--- a/doc/test/nodeNetwork-any.result
+++ /dev/null
@@ -1,136 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_nodeNetwork('edge_table',0.001,'the_geom','id','noded')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Processing, please wait .....
- NOTICE:    Splitted Edges: 2
- NOTICE:   Untouched Edges: 16
- NOTICE:       Total original Edges: 18
- NOTICE:   Edges generated: 4
- NOTICE:   Untouched Edges: 16
- NOTICE:         Total New segments: 20
- NOTICE:   New Table: public.edge_table_noded
- NOTICE:  ----------------------------------
-OK
-1|1
-2|1
-3|1
-4|1
-5|1
-6|1
-7|1
-8|1
-9|1
-10|1
-11|1
-12|1
-13|1
-13|2
-14|1
-15|1
-16|1
-17|1
-18|1
-18|2
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table_noded',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  20 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table_noded is: public.edge_table_noded_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table_noded',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 1
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  column "old_id" of relation "edge_table" does not exist, skipping
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  22 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id not in (select old_id from edge_table where old_id is not null)')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 1
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','old_id is null')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 2
- NOTICE:                            Dead ends: 7
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 1
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 1
- NOTICE:                            Dead ends: 5
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 5
- NOTICE:                      Ring geometries: 0
-OK
diff --git a/doc/test/nodeNetwork-any.test.sql b/doc/test/nodeNetwork-any.test.sql
deleted file mode 100644
index a98318a..0000000
--- a/doc/test/nodeNetwork-any.test.sql
+++ /dev/null
@@ -1,23 +0,0 @@
---                pgr_nodeNetwork
---------------------------------------------------------------------------------
-
-SELECT pgr_createTopology('edge_table', 0.001);
-SELECT pgr_analyzegraph('edge_table', 0.001);
-SELECT pgr_nodeNetwork('edge_table', 0.001);
-SELECT old_id,sub_id FROM edge_table_noded ORDER BY old_id,sub_id;
-SELECT pgr_createTopology('edge_table_noded', 0.001);
-SELECT pgr_analyzegraph('edge_table_noded', 0.001);
-alter table edge_table drop column if exists old_id;
-alter table edge_table add column old_id integer;
-insert into edge_table (old_id,dir,cost,reverse_cost,the_geom)
-   (with
-       segmented as (select old_id,count(*) as i from edge_table_noded group by old_id)
-   select  segments.old_id,dir,cost,reverse_cost,segments.the_geom
-       from edge_table as edges join edge_table_noded as segments on (edges.id = segments.old_id) 
-       where edges.id in (select old_id from segmented where i>1) );
-
-SELECT pgr_createTopology('edge_table', 0.001);
-SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='id not in (select old_id from edge_table where old_id is not null)');
-SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='old_id is null');
-SELECT pgr_analyzegraph('edge_table', 0.001);
-
diff --git a/doc/test/pointsAsPolygon-any.result b/doc/test/pointsAsPolygon-any.result
deleted file mode 100644
index 4db8136..0000000
--- a/doc/test/pointsAsPolygon-any.result
+++ /dev/null
@@ -1,2 +0,0 @@
-10.00
-11.75
diff --git a/doc/test/pointsAsPolygon-any.test.sql b/doc/test/pointsAsPolygon-any.test.sql
deleted file mode 100644
index 8922bae..0000000
--- a/doc/test/pointsAsPolygon-any.test.sql
+++ /dev/null
@@ -1,16 +0,0 @@
--------------------------------------------------------------------------------
---              PGR_pointsAsPolygon
--------------------------------------------------------------------------------
-
-
-SELECT round(ST_Area(pgr_pointsAsPolygon('SELECT id, x, y FROM vertex_table'))::numeric, 2);
-SELECT round(ST_Area(pgr_pointsASPolygon('SELECT id::integer, st_x(the_geom)::float as x, st_y(the_geom)::float as y  FROM edge_table_vertices_pgr'))::numeric, 2);
-
-
-
-
-
-
-
-
-
diff --git a/doc/test/sampledata.data b/doc/test/sampledata.data
deleted file mode 100644
index 37aa2d2..0000000
--- a/doc/test/sampledata.data
+++ /dev/null
@@ -1,59 +0,0 @@
-
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              SAMPLE DATA                
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-drop table if exists edge_table;
-CREATE TABLE edge_table (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-select pgr_createTopology('edge_table',0.001);
-
-drop table if exists vertex_table;
-CREATE TABLE vertex_table (
-    id serial,
-    x double precision,
-    y double precision
-);
-
-INSERT INTO vertex_table VALUES
-        (1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
-        (8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
diff --git a/doc/test/sampledata.result b/doc/test/sampledata.result
deleted file mode 100644
index 08945ce..0000000
--- a/doc/test/sampledata.result
+++ /dev/null
@@ -1,9 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
diff --git a/doc/test/sampledata.test.sql b/doc/test/sampledata.test.sql
deleted file mode 100644
index a5e899c..0000000
--- a/doc/test/sampledata.test.sql
+++ /dev/null
@@ -1,57 +0,0 @@
-
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              SAMPLE DATA                
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-CREATE TABLE edge_table (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-select pgr_createTopology('edge_table',0.001);
-
-CREATE TABLE vertex_table (
-    id serial,
-    x double precision,
-    y double precision
-);
-
-INSERT INTO vertex_table VALUES
-        (1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
-        (8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
diff --git a/doc/test/test.conf b/doc/test/test.conf
index 774feb2..790e81f 100644
--- a/doc/test/test.conf
+++ b/doc/test/test.conf
@@ -5,32 +5,11 @@
 %main::tests = (
     'any' => {
         'comment' => 'documentation SQL tests for any versions.',
-        'data' => ['sampledata'],
+        'data' => ['tsp.data'],
         'tests' => [qw( 
-sampledata
-alphashape-any
-apspJohnson-any
-astar-any
-bdstar-any         
-bdDijkstra-any     
-dijkstra-v2
-pointsAsPolygon-any
-kdijkstra-any
-tsp-any
-trsp-any
-utilities-any
-createTopology-any
-createVertTab-any
-analyzeGraph-any
-analyzeOneway-any
-nodeNetwork-any
-
-
-)],
-        'postgis2-2-notworking' => [qw( 
-apspWarsh-all-any
-)]
-        },
+            utilities-any
+            )]
+    },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
 #    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
diff --git a/doc/test/trsp-any.result b/doc/test/trsp-any.result
deleted file mode 100644
index 6695025..0000000
--- a/doc/test/trsp-any.result
+++ /dev/null
@@ -1,37 +0,0 @@
-0|7|6|1
-1|8|7|1
-2|5|8|1
-3|6|11|1
-4|11|13|1
-5|12|-1|0
-0|7|6|1
-1|8|7|1
-2|5|8|1
-3|6|11|1
-4|11|13|1
-5|12|-1|0
-1|1|1|1|1
-2|1|2|4|1
-3|1|5|8|1
-4|1|6|9|1
-5|1|9|16|1
-6|1|4|3|1
-7|1|3|5|1
-8|1|6|8|1
-9|1|5|7|1
-10|2|8|7|1
-11|2|5|10|1
-12|2|10|14|1
-13|3|13|14|1
-14|3|10|10|1
-15|3|5|-1|0
-1|1|-1|1|0.5
-2|1|2|4|1
-3|1|5|8|1
-4|1|6|11|1
-5|2|11|13|1
-6|2|12|15|1
-7|2|9|9|1
-8|2|6|8|1
-9|2|5|7|1
-10|2|8|6|0.5
diff --git a/doc/test/trsp-any.test.sql b/doc/test/trsp-any.test.sql
deleted file mode 100644
index 2b64e49..0000000
--- a/doc/test/trsp-any.test.sql
+++ /dev/null
@@ -1,56 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_pgr_trsp
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-set log_min_messages='NOTICE';  /** hack to force EDB to log so uses hack elog for test **/
-
-SELECT seq, id1 AS node, id2 AS edge, cost
-        FROM pgr_trsp(
-                'SELECT id, source, target, cost FROM edge_table',
-                7, 12, false, false
-        );
-
-CREATE TABLE restrictions (
-    rid serial,
-    to_cost double precision,
-    to_edge integer,
-    FROM_edge integer,
-    via text
-);
-
-INSERT INTO restrictions VALUES (1,100,7,4,null);
-INSERT INTO restrictions VALUES (2,4,8,3,5);
-INSERT INTO restrictions VALUES (3,100,9,16,null);
-
-   SELECT seq, id1 AS node, id2 AS edge, cost
-           FROM pgr_trsp(
-                   'SELECT id, source, target, cost FROM edge_table',
-                   7, 12, false, false,
-                   'SELECT to_cost, to_edge AS target_id,
-              FROM_edge || coalesce('','' || via, '''') AS via_path
-          FROM restrictions'
-           );
-
-    SELECT * FROM pgr_trspViaVertices(
-        'SELECT id, source::INTEGER, target::INTEGER, cost,
-            reverse_cost FROM edge_table',
-        ARRAY[1,8,13,5]::INTEGER[],     
-        true,  
-        true,  
-        
-        'SELECT to_cost, to_edge AS target_id, FROM_edge ||
-            coalesce('',''||via,'''') AS via_path FROM restrictions');
-
-
-    SELECT * FROM pgr_trspViaEdges(
-        'SELECT id, source::INTEGER, target::INTEGER,cost,
-             reverse_cost FROM edge_table',
-        ARRAY[1,11,6]::INTEGER[],           
-        ARRAY[0.5, 0.5, 0.5]::FLOAT8[],     
-        true,  
-        true,  
-        
-        'SELECT to_cost, to_edge AS target_id, FROM_edge ||
-            coalesce('',''||via,'''') AS via_path FROM restrictions');
-
diff --git a/doc/test/tsp-any.test.sql b/doc/test/tsp-any.test.sql
deleted file mode 100644
index d85a13a..0000000
--- a/doc/test/tsp-any.test.sql
+++ /dev/null
@@ -1,10 +0,0 @@
---------------------------------------------------------------------------------
---              PGR_pgr_tsp
---------------------------------------------------------------------------------
-
-SELECT round(sum(cost)::numeric, 4) as cost
-   FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
-select case when r=array[1,2,3,0] then 'OK' when r=array[1,0,3,2] then 'OK' else 'FAIL' end from (select array_agg(id) as r from (SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1)) as a) as b;
-SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1,2);
-SELECT round(sum(cost)::numeric, 4) as cost
-   FROM pgr_tsp('SELECT id::integer, st_x(the_geom) as x,st_x(the_geom) as y FROM edge_table_vertices_pgr  ORDER BY id', 6, 5);
diff --git a/doc/test/utilities-any.result b/doc/test/utilities-any.result
index 3a7fa76..ccbccc3 100644
--- a/doc/test/utilities-any.result
+++ b/doc/test/utilities-any.result
@@ -1 +1 @@
-2.1.0|pgrouting-2.1.0
+2.2.0
diff --git a/doc/test/utilities-any.test.sql b/doc/test/utilities-any.test.sql
index 7c24026..b8a7225 100644
--- a/doc/test/utilities-any.test.sql
+++ b/doc/test/utilities-any.test.sql
@@ -1,7 +1,8 @@
+BEGIN;
 
 --------------------------------------------------------------------------------
 --                pgr_version
 --------------------------------------------------------------------------------
 -- SELECT pgr_version(); -- DONT USE THIS IT CHANGES WITH EVERY COMMIT
-SELECT version, tag FROM pgr_version(); -- This changes infrequently
-
+SELECT version FROM pgr_version(); -- This changes infrequently
+ROLLBACK;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5a45bb6..dd572dc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -48,6 +48,9 @@ LIST(APPEND L_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
 ADD_SUBDIRECTORY(vrppdtw)
 LIST(APPEND L_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
 
+ADD_SUBDIRECTORY(allpairs)
+LIST(APPEND L_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
+
 
 #ADD_SUBDIRECTORY(shooting_star)
 #LIST(APPEND L_PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}")
diff --git a/src/apsp_johnson/test/CMakeLists.txt b/src/allpairs/doc/CMakeLists.txt
similarity index 100%
rename from src/apsp_johnson/test/CMakeLists.txt
rename to src/allpairs/doc/CMakeLists.txt
diff --git a/src/allpairs/doc/allpairs.rst b/src/allpairs/doc/allpairs.rst
new file mode 100644
index 0000000..d0d4eb9
--- /dev/null
+++ b/src/allpairs/doc/allpairs.rst
@@ -0,0 +1,182 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _all_pairs:
+
+
+All pairs
+===============================================================================
+
+The following functions work an all vertices pair combinations
+
+    - :ref:`pgr_floydWarshall` - Floyd-Warshall's algorithm.
+    - :ref:`pgr_johnson` - Johnson's algorithm
+
+     
+.. toctree::
+    :hidden: 
+
+    ./pgr_floydWarshall
+    ./pgr_johnson
+
+
+Performance
+===============================================================================
+
+The following tests:
+ - non server computer
+ - with AMD 64 CPU
+ - 4G memory
+ - trusty
+ - posgreSQL version 9.3
+
+Data
+----
+
+The following data was used
+
+.. code-block:: none
+
+    BBOX="-122.8,45.4,-122.5,45.6"
+    wget --progress=dot:mega -O "sampledata.osm" "http://www.overpass-api.de/api/xapi?*[bbox=${BBOX}][@meta]"
+
+
+Data processing was done with osm2pgrouting-alpha
+
+.. code-block:: none
+
+    createdb portland
+    psql -c "create extension postgis" portland
+    psql -c "create extension pgrouting" portland
+    osm2pgrouting -f sampledata.osm -d portland -s 0
+
+
+
+
+Results
+-----------
+
+Test One
+.........
+
+This test is not with a bounding box
+The density of the passed graph is extremely low.
+For each <SIZE> 30 tests were executed to get the average
+The tested query is:
+
+.. code-block:: none
+
+     SELECT count(*) FROM pgr_floydWarshall(
+        'SELECT gid as id, source, target, cost, reverse_cost FROM ways where id <=  <SIZE>');
+
+     SELECT count(*) FROM pgr_johnson(
+        'SELECT gid as id, source, target, cost, reverse_cost FROM ways where id <=  <SIZE>');
+
+The results of this tests are presented as:
+
+:SIZE: is the number of edges given as input.
+:EDGES: is the total number of records in the query.
+:DENSITY: is the density of the data :math:`\dfrac{E}{V \times (V-1)}`. 
+:OUT ROWS: is the number of records returned by the queries.
+:Floyd-Warshall: is the average execution time in seconds of pgr_floydWarshall.
+:Johnson: is the average execution time in seconds of pgr_johnson.  
+
+
+====== ======  ========== ======== ============== =============
+ SIZE  EDGES    DENSITY   OUT ROWS Floyd-Warshall  Johnson
+====== ======  ========== ======== ============== =============
+   500    500     0.18E-7     1346   0.14         0.13
+  1000   1000     0.36E-7     2655   0.23         0.18
+  1500   1500     0.55E-7     4110   0.37         0.34
+  2000   2000     0.73E-7     5676   0.56         0.37
+  2500   2500     0.89E-7     7177   0.84         0.51
+  3000   3000     1.07E-7     8778   1.28         0.68
+  3500   3500     1.24E-7    10526   2.08         0.95
+  4000   4000     1.41E-7    12484   3.16         1.24
+  4500   4500     1.58E-7    14354   4.49         1.47
+  5000   5000     1.76E-7    16503   6.05         1.78
+  5500   5500     1.93E-7    18623   7.53         2.03
+  6000   6000     2.11E-7    20710   8.47         2.37
+  6500   6500     2.28E-7    22752   9.99         2.68
+  7000   7000     2.46E-7    24687  11.82         3.12
+  7500   7500     2.64E-7    26861  13.94         3.60
+  8000   8000     2.83E-7    29050  15.61         4.09
+  8500   8500     3.01E-7    31693  17.43         4.63
+  9000   9000     3.17E-7    33879  19.19         5.34
+  9500   9500     3.35E-7    36287  20.77         6.24
+ 10000  10000     3.52E-7    38491  23.26         6.51
+====== ======  ========== ======== ============== =============
+
+Test Two
+.........
+
+This test is with a bounding box
+The density of the passed graph higher than of the Test One.
+For each <SIZE> 30 tests were executed to get the average
+The tested edge query is:
+
+.. code-block:: none
+
+    WITH  
+        buffer AS (SELECT ST_Buffer(ST_Centroid(ST_Extent(the_geom)), SIZE) AS geom FROM ways),
+        bbox AS (SELECT ST_Envelope(ST_Extent(geom)) as box from buffer)
+    SELECT gid as id, source, target, cost, reverse_cost FROM ways where the_geom && (SELECT box from bbox);
+
+The tested queries
+
+.. code-block:: none
+
+    SELECT count(*) FROM pgr_floydWarshall(<edge query>)
+    SELECT count(*) FROM pgr_johnson(<edge query>)
+
+The results of this tests are presented as:
+
+:SIZE: is the size of the bounding box.
+:EDGES: is the total number of records in the query.
+:DENSITY: is the density of the data :math:`\dfrac{E}{V \times (V-1)}`.
+:OUT ROWS: is the number of records returned by the queries.
+:Floyd-Warshall: is the average execution time in seconds of pgr_floydWarshall.
+:Johnson: is the average execution time in seconds of pgr_johnson.
+
+
+====== =====  ======== ======== ============== =============
+ SIZE  EDGES   DENSITY OUT ROWS Floyd-Warshall  Johnson
+====== =====  ======== ======== ============== =============
+ 0.001    44  0.0608       1197     0.10       0.10
+ 0.002    99  0.0251       4330     0.10       0.10
+ 0.003   223  0.0122      18849     0.12       0.12
+ 0.004   358  0.0085      71834     0.16       0.16
+ 0.005   470  0.0070     116290     0.22       0.19
+ 0.006   639  0.0055     207030     0.37       0.27
+ 0.007   843  0.0043     346930     0.64       0.38
+ 0.008   996  0.0037     469936     0.90       0.49
+ 0.009  1146  0.0032     613135     1.26       0.62
+ 0.010  1360  0.0027     849304     1.87       0.82
+ 0.011  1573  0.0024    1147101     2.65       1.04
+ 0.012  1789  0.0021    1483629     3.72       1.35
+ 0.013  1975  0.0019    1846897     4.86       1.68
+ 0.014  2281  0.0017    2438298     7.08       2.28
+ 0.015  2588  0.0015    3156007    10.28       2.80
+ 0.016  2958  0.0013    4090618    14.67       3.76
+ 0.017  3247  0.0012    4868919    18.12       4.48
+====== =====  ======== ======== ============== =============
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_johnson`
+* :ref:`pgr_floydWarshall`
+* `Boost floyd-Warshall <http://www.boost.org/libs/graph/doc/floyd_warshall_shortest.html>`_ algorithm
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/allpairs/doc/doc-floydWarshall.queries b/src/allpairs/doc/doc-floydWarshall.queries
new file mode 100644
index 0000000..c127371
--- /dev/null
+++ b/src/allpairs/doc/doc-floydWarshall.queries
@@ -0,0 +1,26 @@
+-- q1
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table where id < 5'
+);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         1 |       2 |        1
+         1 |       5 |        2
+         2 |       5 |        1
+(3 rows)
+
+-- q2
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table where id < 5',
+    false
+);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         1 |       2 |        1
+         1 |       5 |        2
+         2 |       1 |        1
+         2 |       5 |        1
+         5 |       1 |        2
+         5 |       2 |        1
+(6 rows)
+
diff --git a/src/allpairs/doc/doc-johnson.queries b/src/allpairs/doc/doc-johnson.queries
new file mode 100644
index 0000000..31ff135
--- /dev/null
+++ b/src/allpairs/doc/doc-johnson.queries
@@ -0,0 +1,28 @@
+-- q1
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost FROM edge_table WHERE id < 5
+         ORDER BY id'
+);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         1 |       2 |        1
+         1 |       5 |        2
+         2 |       5 |        1
+(3 rows)
+
+-- q2
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost FROM edge_table WHERE id < 5
+         ORDER BY id',
+    false
+);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         1 |       2 |        1
+         1 |       5 |        2
+         2 |       1 |        1
+         2 |       5 |        1
+         5 |       1 |        2
+         5 |       2 |        1
+(6 rows)
+
diff --git a/src/allpairs/doc/pgr_floydWarshall.rst b/src/allpairs/doc/pgr_floydWarshall.rst
new file mode 100644
index 0000000..b3195a6
--- /dev/null
+++ b/src/allpairs/doc/pgr_floydWarshall.rst
@@ -0,0 +1,161 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_floydWarshall:
+
+pgr_floydWarshall
+===============================================================================
+
+Synopsis
+-------------------------------------------------------------------------------
+
+``pgr_floydWarshall`` - Returns the sum of the costs of the shortest path for each
+pair of nodes in the graph using Floyd-Warshall algorithm.
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph/doc/floyd_warshall_shortest.html
+
+   Boost Graph Inside
+
+
+The Floyd-Warshall algorithm, also known as Floyd's algorithm,
+is a good choice to calculate the sum of the costs of the shortest path for each
+pair of nodes in the graph, for *dense graphs*. We make use of the  Boost's
+implementation which runs in :math:`\Theta(V^3)` time,
+
+    
+Signature
+===============================================================================
+
+
+.. index::
+    single: floydWarshall(edges_sql, directed)
+
+.. code-block:: none
+   
+    pgr_floydWarshall(edges_sql, directed:=true)
+         RETURNS SET OF (start_vid, end_vid,  agg_cost) or EMPTY SET
+
+Example
+-------
+.. code-block:: none
+   
+    pgr_floydWarshall(
+       'SELECT source, target, cost, reverse_cost FROM edge_table WHERE city_code = 304'
+    );
+
+Characteristics:
+----------------
+
+The main Characteristics are:
+  - It does not return a path.
+  - Returns the sum of the costs of the shortest path for each pair of nodes in the graph.
+  - Process is done only on edges with positive costs.
+  - Boost returns a :math:`V \times V` matrix, where the infinity values.
+    Represent the distance between vertices for which there is no path.
+
+    - We return only the non infinity values in form of a set of `(start_vid, end_vid, agg_cost)`.
+
+  - Let be the case the values returned are stored in a table, so the unique index would be the pair:
+    `(start_vid, end_vid)`.
+
+  - For the undirected graph, the results are symmetric.
+
+    - The  `agg_cost` of `(u, v)` is the same as for `(v, u)`.
+
+  - When  `start_vid` = `end_vid`, the `agg_cost` = 0.
+
+  - **Recomended, use a bounding box of no more than 3500 edges.**
+
+
+
+Description of the Signature
+============================
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+:edges_sql: is an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                      Description
+================  ===================   =================================================
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, if negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, if negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+Where:
+
+:ANY-INTEGER: SMALLINT, INTEGER, BIGINT
+:ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+Receives  ``(edges_sql, directed)``
+
+============= ============= =================================================
+Parameter     Type          Description
+============= ============= =================================================
+**edges_sql** ``TEXT``      SQL query as described above.
+**directed**  ``BOOLEAN``   (optional) Default is true (is directed). When set to false the graph is considered as Undirected
+============= ============= =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(start_vid, end_vid, agg_cost)``
+
+============= ============= =================================================
+Column        Type          Description
+============= ============= =================================================
+**start_vid** ``BIGINT``    Identifier of the starting vertex.
+**end_vid**   ``BIGINT``    Identifier of the ending vertex.
+**agg_cost**  ``FLOAT``     Total cost from ``start_vid`` to ``end_vid``.
+============= ============= =================================================
+
+
+
+Examples
+============================
+
+:Example 1: On a directed graph.
+
+.. literalinclude:: doc-floydWarshall.queries
+   :start-after: -- q1
+   :end-before: -- q2
+
+:Example 2: On an undirected graph.
+
+.. literalinclude:: doc-floydWarshall.queries
+   :start-after: -- q2
+
+
+These queries uses the :ref:`sampledata` network.
+
+
+.. rubric:: History
+
+* Re-design of pgr_apspWarshall in Version 2.2.0
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_johnson`
+* `Boost floyd-Warshall <http://www.boost.org/libs/graph/doc/floyd_warshall_shortest.html>`_ algorithm
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/allpairs/doc/pgr_johnson.rst b/src/allpairs/doc/pgr_johnson.rst
new file mode 100644
index 0000000..38cb014
--- /dev/null
+++ b/src/allpairs/doc/pgr_johnson.rst
@@ -0,0 +1,157 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_johnson:
+
+pgr_johnson
+===============================================================================
+
+Synopsis
+-------------------------------------------------------------------------------
+
+``pgr_johnson`` - Returns the sum of the costs of the shortest path for each
+pair of nodes in the graph using Johnson's algorithm.
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph/doc/johnson_all_pairs_shortest.html
+
+   Boost Graph Inside
+
+
+The Johnson algorithm, is a good choice to calculate the sum of the costs
+of the shortest path for each pair of nodes in the graph, for *sparse graphs*.
+We make use of the  Boost's implementation which runs in :math:`O(V E \log V)` time,
+
+    
+Signature
+===============================================================================
+
+
+.. index::
+    single: johnson(edges_sql, directed)
+
+.. code-block:: none
+   
+    pgr_johnson(edges_sql, directed:=true)
+         RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+Example
+-------
+.. code-block:: none
+   
+    pgr_johnson(
+       'SELECT source, target, cost, reverse_cost FROM edge_table WHERE city_code = 304'
+    );
+
+Characteristics:
+----------------
+
+The main Characteristics are:
+  - It does not return a path.
+  - Returns the sum of the costs of the shortest path for each pair of nodes in the graph.
+  - Process is done only on edges with positive costs.
+  - Boost returns a :math:`V \times V` matrix, where the infinity values.
+    Represent the distance between vertices for which there is no path.
+
+    - We return only the non infinity values in form of a set of `(start_vid, end_vid, agg_cost)`.
+
+  - Let be the case the values returned are stored in a table, so the unique index would be the pair:
+    `(start_vid, end_vid)`.
+
+  - For the undirected graph, the results are symmetric.
+
+    - The  `agg_cost` of `(u, v)` is the same as for `(v, u)`.
+
+  - When  `start_vid` = `end_vid`, the `agg_cost` = 0.
+
+
+Description of the Signature
+============================
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+:edges_sql: is an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                      Description
+================  ===================   =================================================
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, If negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, if negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+Where:
+
+:ANY-INTEGER: SMALLINT, INTEGER, BIGINT
+:ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+Receives  ``(edges_sql, directed)``
+
+============= ============= =================================================
+Parameter     Type          Description
+============= ============= =================================================
+**edges_sql** ``TEXT``      SQL query as described above.
+**directed**  ``BOOLEAN``   (optional) Default is true (is directed). When set to false the graph is considered as Undirected
+============= ============= =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(start_vid, end_vid, agg_cost)``
+
+============= ============= =================================================
+Column        Type          Description
+============= ============= =================================================
+**start_vid** ``BIGINT``    Identifier of the starting vertex.
+**end_vid**   ``BIGINT``    Identifier of the ending vertex.
+**agg_cost**  ``FLOAT``     Total cost from ``start_vid`` to ``end_vid``.
+============= ============= =================================================
+
+
+
+Examples
+============================
+
+:Example 1: On a directed graph.
+
+.. literalinclude:: doc-johnson.queries
+   :start-after: -- q1
+   :end-before: -- q2
+
+:Example 2: On an undirected graph.
+
+.. literalinclude:: doc-johnson.queries
+   :start-after: -- q2
+
+
+These queries uses the :ref:`sampledata` network.
+
+
+.. rubric:: History
+
+* Re-design of pgr_apspJohnson in version 2.2.0
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_floydWarshall`
+* `Boost Jhonson <http://www.boost.org/libs/graph/doc/johnson_all_pairs_shortest.html>`_ algorithm implementation.
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/allpairs/sql/CMakeLists.txt b/src/allpairs/sql/CMakeLists.txt
new file mode 100644
index 0000000..1ef45d9
--- /dev/null
+++ b/src/allpairs/sql/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/johnson.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/floydWarshall.sql
+    )
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/allpairs/sql/floydWarshall.sql b/src/allpairs/sql/floydWarshall.sql
new file mode 100644
index 0000000..169ea46
--- /dev/null
+++ b/src/allpairs/sql/floydWarshall.sql
@@ -0,0 +1,36 @@
+/*PGR-GNU*****************************************************************
+
+File: floydWarshall.sql
+
+Template:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function developer:
+Copyright (c) 2013 Vicky Vergara
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+CREATE OR REPLACE FUNCTION pgr_floydWarshall(edges_sql TEXT, directed BOOLEAN DEFAULT TRUE, 
+  OUT start_vid BIGINT, OUT end_vid BIGINT, OUT agg_cost float)
+  RETURNS SETOF RECORD AS
+ '$libdir/${PGROUTING_LIBRARY_NAME}', 'floydWarshall'  
+    LANGUAGE c IMMUTABLE STRICT;
+
diff --git a/src/allpairs/sql/johnson.sql b/src/allpairs/sql/johnson.sql
new file mode 100644
index 0000000..819980e
--- /dev/null
+++ b/src/allpairs/sql/johnson.sql
@@ -0,0 +1,36 @@
+/*PGR-GNU*****************************************************************
+
+File: johnson.sql
+
+Template:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function developer:
+Copyright (c) 2013 Vicky Vergara
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+CREATE OR REPLACE FUNCTION pgr_johnson(edges_sql TEXT, directed BOOLEAN DEFAULT TRUE,
+  OUT start_vid BIGINT, OUT end_vid BIGINT, OUT agg_cost float)
+  RETURNS SETOF RECORD AS
+ '$libdir/${PGROUTING_LIBRARY_NAME}', 'johnson'
+    LANGUAGE c IMMUTABLE STRICT;
+
diff --git a/src/allpairs/src/CMakeLists.txt b/src/allpairs/src/CMakeLists.txt
new file mode 100644
index 0000000..c661233
--- /dev/null
+++ b/src/allpairs/src/CMakeLists.txt
@@ -0,0 +1,6 @@
+ADD_LIBRARY(allpairs OBJECT 
+    floydWarshall.c 
+    floydWarshall_driver.cpp
+
+    johnson.c 
+    johnson_driver.cpp)
diff --git a/src/allpairs/src/floydWarshall.c b/src/allpairs/src/floydWarshall.c
new file mode 100644
index 0000000..4c7908b
--- /dev/null
+++ b/src/allpairs/src/floydWarshall.c
@@ -0,0 +1,192 @@
+/*PGR-GNU*****************************************************************
+File: floydWarshall.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include <unistd.h>
+
+#include "postgres.h"
+#include "funcapi.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+#include "fmgr.h"
+
+// #define DEBUG
+
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./floydWarshall_driver.h"
+
+PG_FUNCTION_INFO_V1(floydWarshall);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+floydWarshall(PG_FUNCTION_ARGS);
+
+static
+void
+process(
+        char* edges_sql,
+        bool directed,
+        Matrix_cell_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
+    pgr_get_data_4_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    clock_t start_t = clock();
+    PGR_DBG("Starting processing");
+    char *err_msg = (char *)"";
+    do_pgr_floydWarshall(
+            edges,
+            total_tuples,
+            directed,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing FloydWarshall", start_t, clock());
+
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    pfree(edges);
+    pgr_SPI_finish();
+}
+
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+floydWarshall(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                                                                        */
+    Matrix_cell_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*********************************************************************/
+        /*                                                                   */
+        // QUERY
+        // CREATE OR REPLACE FUNCTION pgr_floydWarshalll(
+        // edges_sql TEXT,
+        // directed BOOLEAN,
+        // OUT seq INTEGER,
+        // OUT from_vid bigint,
+        // OUT to_vid bigint,
+        // OUT cost float)
+
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                PG_GETARG_BOOL(1),
+                &result_tuples,
+                &result_count);
+
+        /*                                                                   */
+        /*********************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (Matrix_cell_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*********************************************************************/
+        values = palloc(3 * sizeof(Datum));
+        nulls = palloc(3 * sizeof(char));
+
+        // postgres starts counting from 1
+        values[0] = Int64GetDatum(result_tuples[call_cntr].from_vid);
+        nulls[0] = ' ';
+        values[1] = Int64GetDatum(result_tuples[call_cntr].to_vid);
+        nulls[1] = ' ';
+        values[2] = Float8GetDatum(result_tuples[call_cntr].cost);
+        nulls[2] = ' ';
+        /*********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/allpairs/src/floydWarshall_driver.cpp b/src/allpairs/src/floydWarshall_driver.cpp
new file mode 100644
index 0000000..9fe1824
--- /dev/null
+++ b/src/allpairs/src/floydWarshall_driver.cpp
@@ -0,0 +1,99 @@
+/*PGR-GNU*****************************************************************
+File: floydWarshall_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_allpairs.hpp"
+#include "./floydWarshall_driver.h"
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+
+void
+do_pgr_floydWarshall(
+    pgr_edge_t  *data_edges,
+    size_t total_tuples,
+    bool directedFlag,
+
+    // return values
+    Matrix_cell_t **postgres_rows,
+    size_t *result_tuple_count,
+    char ** err_msg) {
+// function starts
+  std::ostringstream log;
+  try {
+    graphType gType = directedFlag? DIRECTED: UNDIRECTED;
+    const size_t initial_size = total_tuples;
+
+
+    if (directedFlag) {
+      log << "Processing Directed graph\n";
+      Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+      digraph.graph_insert_data(data_edges, total_tuples);
+      pgr_floydWarshall(digraph, *result_tuple_count, postgres_rows);
+    } else {
+      log << "Processing Undirected graph\n";
+      Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+      undigraph.graph_insert_data(data_edges, total_tuples);
+      pgr_floydWarshall(undigraph, *result_tuple_count, postgres_rows);
+    }
+
+
+    if (*result_tuple_count == 0) {
+      log <<  "NOTICE: No Vertices found??? wiered error\n";
+      *err_msg = strdup(log.str().c_str());
+      *postgres_rows = NULL;
+      *result_tuple_count = 0;
+      return;
+    }
+#ifndef DEBUG
+    *err_msg = strdup("OK");
+#else
+    *err_msg = strdup(log.str().c_str());
+#endif
+    return;
+  } catch ( ... ) {
+    log << "Caught unknown expection!\n";
+    *err_msg = strdup(log.str().c_str());
+    *postgres_rows = NULL;
+    *result_tuple_count = 0;
+    return;
+  }
+}
+
+
diff --git a/src/allpairs/src/floydWarshall_driver.h b/src/allpairs/src/floydWarshall_driver.h
new file mode 100644
index 0000000..801bb6c
--- /dev/null
+++ b/src/allpairs/src/floydWarshall_driver.h
@@ -0,0 +1,54 @@
+/*PGR-GNU*****************************************************************
+File: floydWarshall_driver.h
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_ALLPAIRS_SRC_FLOYDWARSHALL_DRIVER_H_
+#define SRC_ALLPAIRS_SRC_FLOYDWARSHALL_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void
+do_pgr_floydWarshall(
+    pgr_edge_t  *data_edges,
+    size_t total_tuples,
+    bool directedFlag,
+
+    // return values
+    Matrix_cell_t **ret_matrix,
+    size_t *return_tuple_count,
+    char ** err_msg); 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_ALLPAIRS_SRC_FLOYDWARSHALL_DRIVER_H_
diff --git a/src/allpairs/src/johnson.c b/src/allpairs/src/johnson.c
new file mode 100644
index 0000000..b4ea162
--- /dev/null
+++ b/src/allpairs/src/johnson.c
@@ -0,0 +1,196 @@
+/*PGR-GNU*****************************************************************
+File: johnson.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer:
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include <unistd.h>
+
+#include "postgres.h"
+#include "funcapi.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+#include "fmgr.h"
+
+// #define DEBUG
+
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./johnson_driver.h"
+
+PG_FUNCTION_INFO_V1(johnson);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+johnson(PG_FUNCTION_ARGS);
+
+/******************************************************************************/
+/*                          MODIFY AS NEEDED                                  */
+static
+void process(
+        char* edges_sql,
+        bool directed,
+        Matrix_cell_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
+    pgr_get_data_4_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    PGR_DBG("Starting processing");
+    char *err_msg = (char *)"";
+    clock_t start_t = clock();
+    do_pgr_johnson(
+            edges,
+            total_tuples,
+            directed,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing Johnson", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+johnson(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    Matrix_cell_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // CREATE OR REPLACE FUNCTION pgr_johnson(
+        // edges_sql TEXT,
+        // directed BOOLEAN,
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                PG_GETARG_BOOL(1),
+                &result_tuples,
+                &result_count);
+
+        /*                                                                   */
+        /*********************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (Matrix_cell_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // OUT seq BIGINT,
+        // OUT from_vid BIGINT,
+        // OUT to_vid BIGINT,
+        // OUT cost float)
+
+        values = palloc(3 * sizeof(Datum));
+        nulls = palloc(3 * sizeof(char));
+
+        // postgres starts counting from 1
+        values[0] = Int64GetDatum(result_tuples[call_cntr].from_vid);
+        nulls[0] = ' ';
+        values[1] = Int64GetDatum(result_tuples[call_cntr].to_vid);
+        nulls[1] = ' ';
+        values[2] = Float8GetDatum(result_tuples[call_cntr].cost);
+        nulls[2] = ' ';
+
+        /*********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/allpairs/src/johnson_driver.cpp b/src/allpairs/src/johnson_driver.cpp
new file mode 100644
index 0000000..5581ec5
--- /dev/null
+++ b/src/allpairs/src/johnson_driver.cpp
@@ -0,0 +1,101 @@
+/*PGR-GNU*****************************************************************
+File: johnson_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_allpairs.hpp"
+#include "./johnson_driver.h"
+
+// #define DEBUG
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+// CREATE OR REPLACE FUNCTION pgr_johnson(edges_sql TEXT, directed BOOLEAN,
+void
+do_pgr_johnson(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        bool directed,
+        Matrix_cell_t **return_tuples,
+        size_t *return_count,
+        char **err_msg) {
+  std::ostringstream log;
+  try {
+    if (total_tuples == 1) {
+      log << "Requiered: more than one tuple\n";
+      (*return_tuples) = NULL;
+      (*return_count) = 0;
+      *err_msg = strdup(log.str().c_str());
+      return;
+    }
+
+    graphType gType = directed? DIRECTED: UNDIRECTED;
+    const auto initial_size = total_tuples;
+
+    std::deque< Path >paths;
+
+    if (directed) {
+      log << "Working with directed Graph\n";
+      Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+      digraph.graph_insert_data(data_edges, total_tuples);
+      pgr_johnson(digraph, *return_count, return_tuples);
+    } else {
+      log << "Working with Undirected Graph\n";
+      Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+      undigraph.graph_insert_data(data_edges, total_tuples);
+      pgr_johnson(undigraph, *return_count, return_tuples);
+    }
+
+    if (*return_count == 0) {
+      log <<  "NOTICE: No Vertices found??? wiered error\n";
+      *err_msg = strdup(log.str().c_str());
+      (*return_tuples) = NULL;
+      (*return_count) = 0;
+      return;
+    }
+
+    #ifndef DEBUG
+      *err_msg = strdup("OK");
+    #else
+      *err_msg = strdup(log.str().c_str());
+    #endif
+  } catch ( ... ) {
+    log << "Caught unknown expection!\n";
+    *err_msg = strdup(log.str().c_str());
+  }
+}
diff --git a/src/allpairs/src/johnson_driver.h b/src/allpairs/src/johnson_driver.h
new file mode 100644
index 0000000..8a64bf6
--- /dev/null
+++ b/src/allpairs/src/johnson_driver.h
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+File: johnson_driver.h
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//  CREATE OR REPLACE FUNCTION pgr_johnson(edges_sql TEXT, directed BOOLEAN,
+void
+do_pgr_johnson(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        bool directed,
+        Matrix_cell_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/allpairs/src/pgr_allpairs.hpp b/src/allpairs/src/pgr_allpairs.hpp
new file mode 100644
index 0000000..3e79bff
--- /dev/null
+++ b/src/allpairs/src/pgr_allpairs.hpp
@@ -0,0 +1,316 @@
+/*PGR-GNU*****************************************************************
+File:  pgr_allpairs.hpp
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+// http://www.cs.rpi.edu/~musser/archive/2005/gsd/restricted/FloydWarshall/FloydWarshall.pdf
+
+#ifndef SRC_ALLPAIRS_SRC_PGR_ALLPAIRS_HPP_
+#define SRC_ALLPAIRS_SRC_PGR_ALLPAIRS_HPP_
+
+
+#include <deque>
+#include <vector>
+#include <set>
+#include <limits>
+
+#include <boost/config.hpp>
+
+#include <boost/graph/adjacency_list.hpp>
+#include <boost/property_map/property_map.hpp>
+#include <boost/graph/johnson_all_pairs_shortest.hpp>
+#include <boost/graph/floyd_warshall_shortest.hpp>
+
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+#include "../../common/src/memory_func.hpp"
+#include "./../../common/src/basePath_SSEC.hpp"
+#include "./../../common/src/baseGraph.hpp"
+
+template < class G > class Pgr_allpairs;
+
+// user's functions
+template < class G >
+void
+pgr_johnson(G &graph, std::vector< Matrix_cell_t> &rows) {
+    Pgr_allpairs< G > fn_johnson;
+    fn_johnson.johnson(graph, rows);
+}
+
+template < class G >
+void
+pgr_floydWarshall(G &graph, std::vector< Matrix_cell_t> &rows) {
+    Pgr_allpairs< G > fn_floydWarshall;
+    fn_floydWarshall.floydWarshall(graph, rows);
+}
+
+// for postgres
+template < class G >
+void
+pgr_johnson(
+        G &graph,
+        size_t &result_tuple_count,
+        Matrix_cell_t **postgres_rows) {
+    Pgr_allpairs< G > fn_johnson;
+    fn_johnson.johnson(graph, result_tuple_count, postgres_rows);
+}
+
+
+template < class G >
+void
+pgr_floydWarshall(
+        G &graph,
+        size_t &result_tuple_count,
+        Matrix_cell_t **postgres_rows) {
+    Pgr_allpairs< G > fn_floydWarshall;
+    fn_floydWarshall.floydWarshall(graph, result_tuple_count, postgres_rows);
+}
+
+
+// template class
+template < class G >
+class Pgr_allpairs {
+    // defualt constructors and destructors
+    /*
+       Matrix_cell_t description:
+       int64_t from_vid;
+       int64_t to_vid;
+       float8 cost;
+       */
+ public:
+     void floydWarshall(
+             G &graph,
+             size_t &result_tuple_count,
+             Matrix_cell_t **postgres_rows);
+
+
+     void floydWarshall(
+             G &graph,
+             std::vector< Matrix_cell_t> &rows);
+
+     void johnson(
+             G &graph,
+             size_t &result_tuple_count,
+             Matrix_cell_t **postgres_rows);
+
+
+     void johnson(
+             G &graph,
+             std::vector< Matrix_cell_t> &rows);
+
+ private:
+     void make_matrix(
+             size_t v_size,
+             std::vector< std::vector<double>> &matrix) const;
+
+     void make_result(
+             const G &graph,
+             const std::vector< std::vector<double> > &matrix,
+             size_t &result_tuple_count,
+             Matrix_cell_t **postgres_rows) const;
+
+     size_t count_rows(
+             const G &graph,
+             const std::vector< std::vector<double> > &matrix) const;
+
+     void make_result(
+             G &graph,
+             std::vector< std::vector<double> > &matrix,
+             std::vector< Matrix_cell_t> &rows);
+
+     template <typename T>
+         struct inf_plus {
+             T operator()(const T& a, const T& b) const {
+                 T inf = std::numeric_limits<T>::max();
+                 if (a == inf || b == inf)
+                     return inf;
+                 return a + b;
+             }
+         };
+};
+
+/*
+ * PUBLIC FUNCTIONS
+ */
+
+template < class G >
+void Pgr_allpairs< G >::floydWarshall(
+        G &graph,
+        size_t &result_tuple_count,
+        Matrix_cell_t **postgres_rows) {
+    std::vector< std::vector<double>> matrix;
+    make_matrix(graph.num_vertices(), matrix);
+    inf_plus<double> combine;
+    boost::floyd_warshall_all_pairs_shortest_paths(
+            graph.graph,
+            matrix,
+            weight_map(get(&boost_edge_t::cost, graph.graph)).
+            distance_combine(combine).
+            distance_inf(std::numeric_limits<double>::max()).
+            distance_zero(0));
+
+    make_result(graph, matrix, result_tuple_count, postgres_rows);
+}
+
+
+template < class G >
+void Pgr_allpairs< G >::floydWarshall(
+        G &graph,
+        std::vector< Matrix_cell_t> &rows) {
+    std::vector< std::vector<double>> matrix;
+    make_matrix(boost::num_vertices(graph.graph), matrix);
+    inf_plus<double> combine;
+    boost::floyd_warshall_all_pairs_shortest_paths(
+            graph.graph,
+            matrix,
+            weight_map(get(&boost_edge_t::cost, graph.graph)).
+            distance_combine(combine).
+            distance_inf(std::numeric_limits<double>::max()).
+            distance_zero(0));
+
+    make_result(graph, matrix, rows);
+}
+
+template < class G >
+void Pgr_allpairs< G >::johnson(
+        G &graph,
+        size_t &result_tuple_count,
+        Matrix_cell_t **postgres_rows) {
+    std::vector< std::vector<double>> matrix;
+    make_matrix(graph.num_vertices(), matrix);
+    inf_plus<double> combine;
+    boost::johnson_all_pairs_shortest_paths(
+            graph.graph,
+            matrix,
+            weight_map(get(&boost_edge_t::cost, graph.graph)).
+            distance_combine(combine).
+            distance_inf(std::numeric_limits<double>::max()).
+            distance_zero(0));
+
+    make_result(graph, matrix, result_tuple_count, postgres_rows);
+}
+
+
+template < class G >
+void Pgr_allpairs< G >::johnson(
+        G &graph,
+        std::vector< Matrix_cell_t> &rows) {
+    std::vector< std::vector<double>> matrix;
+    make_matrix(boost::num_vertices(graph.graph), matrix);
+    inf_plus<double> combine;
+    boost::johnson_all_pairs_shortest_paths(
+            graph.graph,
+            matrix,
+            weight_map(get(&boost_edge_t::cost, graph.graph)).
+            distance_combine(combine).
+            distance_inf(std::numeric_limits<double>::max()).
+            distance_zero(0));
+
+    make_result(graph, matrix, rows);
+}
+
+
+
+
+/*
+ * PRIVATE FUNCTIONS
+ */
+
+template < class G >
+void
+Pgr_allpairs< G >::make_matrix(
+        size_t v_size,
+        std::vector< std::vector<double>> &matrix) const {
+    matrix.resize(v_size);
+    for (size_t i=0; i < v_size; i++)
+        matrix[i].resize(v_size);
+}
+
+template < class G >
+size_t
+Pgr_allpairs< G >::count_rows(
+        const G &graph,
+        const std::vector< std::vector<double> > &matrix) const {
+    size_t result_tuple_count = 0;
+    for (size_t i = 0; i < graph.num_vertices(); i++) {
+        for (size_t j = 0; j < graph.num_vertices(); j++) {
+            if (i == j) continue;
+            if (matrix[i][j] != std::numeric_limits<double>::max()) {
+                result_tuple_count++;
+            }  // if
+        }  // for j
+    }  // for i
+    return result_tuple_count;
+}
+
+// for postgres
+template < class G >
+void
+Pgr_allpairs< G >::make_result(
+        const G &graph,
+        const std::vector< std::vector<double> > &matrix,
+        size_t &result_tuple_count,
+        Matrix_cell_t **postgres_rows) const {
+    result_tuple_count = count_rows(graph, matrix);
+    *postgres_rows = get_memory(result_tuple_count, (*postgres_rows));
+
+
+    size_t seq = 0;
+    for (size_t i = 0; i < graph.num_vertices(); i++) {
+        for (size_t j = 0; j < graph.num_vertices(); j++) {
+            if (i == j) continue;
+            if (matrix[i][j] != std::numeric_limits<double>::max()) {
+                (*postgres_rows)[seq].from_vid = graph.graph[i].id;
+                (*postgres_rows)[seq].to_vid = graph.graph[j].id;
+                (*postgres_rows)[seq].cost =  matrix[i][j];
+                seq++;
+            }  // if
+        }  // for j
+    }  // for i
+}
+
+
+template < class G >
+void
+Pgr_allpairs< G >::make_result(
+        G &graph,
+        std::vector< std::vector<double> > &matrix,
+        std::vector< Matrix_cell_t> &rows) {
+    size_t count = count_rows(graph, matrix);
+    rows.resize(count);
+    size_t seq = 0;
+
+    for (size_t i = 0; i < graph.num_vertices(); i++) {
+        for (size_t j = 0; j < graph.num_vertices(); j++) {
+            if (matrix[i][j] != std::numeric_limits<double>::max()) {
+                rows[seq] =
+                    {graph.graph[i].id, graph.graph[j].id, matrix[i][j]};
+                seq++;
+            }  // if
+        }  // for j
+    }  // for i
+}
+
+#endif  // SRC_ALLPAIRS_SRC_PGR_ALLPAIRS_HPP_
diff --git a/src/allpairs/test/doc-floydWarshall.result b/src/allpairs/test/doc-floydWarshall.result
new file mode 100644
index 0000000..07c4312
--- /dev/null
+++ b/src/allpairs/test/doc-floydWarshall.result
@@ -0,0 +1,11 @@
+-- q1
+1|2|1
+1|5|2
+2|5|1
+-- q2
+1|2|1
+1|5|2
+2|1|1
+2|5|1
+5|1|2
+5|2|1
diff --git a/src/allpairs/test/doc-floydWarshall.test.sql b/src/allpairs/test/doc-floydWarshall.test.sql
new file mode 100644
index 0000000..19443ef
--- /dev/null
+++ b/src/allpairs/test/doc-floydWarshall.test.sql
@@ -0,0 +1,9 @@
+\echo -- q1
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table where id < 5'
+);
+\echo -- q2
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table where id < 5',
+    false
+);
diff --git a/src/allpairs/test/doc-johnson.result b/src/allpairs/test/doc-johnson.result
new file mode 100644
index 0000000..07c4312
--- /dev/null
+++ b/src/allpairs/test/doc-johnson.result
@@ -0,0 +1,11 @@
+-- q1
+1|2|1
+1|5|2
+2|5|1
+-- q2
+1|2|1
+1|5|2
+2|1|1
+2|5|1
+5|1|2
+5|2|1
diff --git a/src/allpairs/test/doc-johnson.test.sql b/src/allpairs/test/doc-johnson.test.sql
new file mode 100644
index 0000000..70f5cd0
--- /dev/null
+++ b/src/allpairs/test/doc-johnson.test.sql
@@ -0,0 +1,11 @@
+\echo -- q1
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost FROM edge_table WHERE id < 5
+         ORDER BY id'
+);
+\echo -- q2
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost FROM edge_table WHERE id < 5
+         ORDER BY id',
+    false
+);
diff --git a/src/allpairs/test/pgtap/compare-directed.test.sql b/src/allpairs/test/pgtap/compare-directed.test.sql
new file mode 100644
index 0000000..00883b3
--- /dev/null
+++ b/src/allpairs/test/pgtap/compare-directed.test.sql
@@ -0,0 +1,142 @@
+\i setup.sql
+
+SELECT plan(15);
+
+-- TESTS WITH DIRECTED
+
+-- all values must be >= 0
+PREPARE q1 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE
+) WHERE agg_cost < 0;
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    TRUE
+) WHERE agg_cost < 0;
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, -1::float as reverse_cost FROM edge_table ORDER BY id',
+    TRUE
+) WHERE agg_cost < 0;
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, -1::float as cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE
+) WHERE agg_cost < 0;
+
+
+SELECT is_empty('q1', '1: No cost can be negative');
+SELECT is_empty('q2', '2: No cost can be negative');
+SELECT is_empty('q3', '3: No cost can be negative');
+SELECT is_empty('q4', '4: No cost can be negative');
+
+PREPARE q10 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    TRUE
+);
+
+PREPARE q11 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE
+);
+
+SELECT set_ne('q10', 'q11', '5: Results of with reverse_cost must be different of the one without it');
+
+PREPARE q20 AS
+SELECT  *
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
+);
+
+PREPARE q21 AS
+SELECT  *
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
+);
+
+SELECT set_eq('q10', 'q20','6: With Out reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+SELECT set_eq('q11', 'q21','7: With reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+
+
+PREPARE q30 AS
+SELECT  *
+FROM pgr_johnson(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    TRUE
+);
+
+PREPARE q31 AS
+SELECT  *
+FROM pgr_johnson(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q30','8: With Out reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+SELECT set_eq('q11', 'q31','9: With reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+
+
+
+-- errors:
+
+-- flags
+SELECT lives_ok(
+    'SELECT * FROM pgr_floydWarshall(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id''
+    )',
+    '10: Documentation says works with no flags');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_floydWarshall(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE
+    )',
+    '11: Documentation says works with 1 flag');
+
+SELECT throws_ok(
+    'SELECT * FROM pgr_floydWarshall(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE, TRUE
+    )','42883','function pgr_floydwarshall(unknown, boolean, boolean) does not exist',
+    '12: Documentation says it does work with 2 flags');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_johnson(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id''
+    )',
+    '13: Documentation says works with no flags');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_johnson(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE
+    )',
+    '14: Documentation says works with 1 flag');
+
+SELECT throws_ok(
+    'SELECT * FROM pgr_johnson(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE, TRUE
+    )','42883','function pgr_johnson(unknown, boolean, boolean) does not exist',
+    '15: Documentation says it does work with 2 flags');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/allpairs/test/pgtap/compare-undirected.test.sql b/src/allpairs/test/pgtap/compare-undirected.test.sql
new file mode 100644
index 0000000..7539387
--- /dev/null
+++ b/src/allpairs/test/pgtap/compare-undirected.test.sql
@@ -0,0 +1,102 @@
+\i setup.sql
+
+SELECT plan(9);
+
+-- TESTS WITH DIRECTED
+
+-- all values must be >= 0
+PREPARE q1 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+) WHERE agg_cost < 0;
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    FALSE
+) WHERE agg_cost < 0;
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, -1::float as reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+) WHERE agg_cost < 0;
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, -1::float as cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+) WHERE agg_cost < 0;
+
+
+SELECT is_empty('q1', '1: No cost can be negative');
+SELECT is_empty('q2', '2: No cost can be negative');
+SELECT is_empty('q3', '3: No cost can be negative');
+SELECT is_empty('q4', '4: No cost can be negative');
+
+PREPARE q10 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+PREPARE q11 AS
+SELECT *
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+SELECT set_ne('q10', 'q11', '5: Results of with reverse_cost must be different of the one without it');
+
+PREPARE q20 AS
+SELECT  *
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    FALSE
+);
+
+PREPARE q21 AS
+SELECT  *
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    FALSE
+);
+
+SELECT set_eq('q10', 'q20','6: With Out reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+SELECT set_eq('q11', 'q21','7: With reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+
+
+PREPARE q30 AS
+SELECT  *
+FROM pgr_johnson(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+PREPARE q31 AS
+SELECT  *
+FROM pgr_johnson(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+SELECT set_eq('q10', 'q30','8: With Out reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+SELECT set_eq('q11', 'q31','9: With reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+
+
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/allpairs/test/pgtap/fw-types-check.sql b/src/allpairs/test/pgtap/fw-types-check.sql
new file mode 100644
index 0000000..4095bb6
--- /dev/null
+++ b/src/allpairs/test/pgtap/fw-types-check.sql
@@ -0,0 +1,85 @@
+
+\i setup.sql
+
+
+SELECT plan(10);
+
+PREPARE q1 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id::BIGINT, source::SMALLINT, target::BIGINT, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table'
+);
+
+PREPARE q2 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT source, target, cost, reverse_cost FROM edge_table'
+);
+
+PREPARE q3 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT source, target, cost, reverse_cost FROM edge_table',
+    false
+);
+
+PREPARE q4 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT source, target, cost, reverse_cost FROM edge_table',
+    true
+);
+
+
+SELECT lives_ok('q1', 'edges query accepts ANY-INTEGER & ANY NUMERICAL');
+SELECT lives_ok('q2', 'without id it works');
+SELECT lives_ok('q3', 'directed flag works ok with false');
+SELECT lives_ok('q4', 'directed flag works ok with true');
+
+
+PREPARE q10 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id::FLOAT, source, target, cost, reverse_cost FROM edge_table',
+    true);
+
+PREPARE q11 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id::REAL, source, target, cost, reverse_cost FROM edge_table',
+    true);
+
+SELECT throws_ok('q10', 'XX000', 'Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'Throws because id is FLOAT');
+SELECT throws_ok('q11', 'XX000', 'Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'Throws because id is REAL');
+
+PREPARE q12 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source::FLOAT, target, cost, reverse_cost FROM edge_table',
+    true);
+
+PREPARE q13 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source::REAL, target, cost, reverse_cost FROM edge_table',
+    true);
+
+SELECT throws_ok('q12', 'XX000', 'Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q13', 'XX000', 'Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'Throws because source is REAL');
+
+PREPARE q14 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source, target::FLOAT, cost, reverse_cost FROM edge_table',
+    true);
+
+PREPARE q15 AS
+SELECT * FROM pgr_floydWarshall(
+    'SELECT id, source, target::REAL, cost, reverse_cost FROM edge_table',
+    true);
+
+SELECT throws_ok('q14', 'XX000', 'Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q15', 'XX000', 'Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'Throws because source is REAL');
+
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/allpairs/test/pgtap/j-types-check.sql b/src/allpairs/test/pgtap/j-types-check.sql
new file mode 100644
index 0000000..9966e84
--- /dev/null
+++ b/src/allpairs/test/pgtap/j-types-check.sql
@@ -0,0 +1,85 @@
+
+\i setup.sql
+
+
+SELECT plan(10);
+
+PREPARE q1 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id::BIGINT, source::SMALLINT, target::BIGINT, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table'
+);
+
+PREPARE q2 AS
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost, reverse_cost FROM edge_table'
+);
+
+PREPARE q3 AS
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost, reverse_cost FROM edge_table',
+    false
+);
+
+PREPARE q4 AS
+SELECT * FROM pgr_johnson(
+    'SELECT source, target, cost, reverse_cost FROM edge_table',
+    true
+);
+
+
+SELECT lives_ok('q1', 'edges query accepts ANY-INTEGER & ANY NUMERICAL');
+SELECT lives_ok('q2', 'without id it works');
+SELECT lives_ok('q3', 'directed flag works ok with false');
+SELECT lives_ok('q4', 'directed flag works ok with true');
+
+
+PREPARE q10 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id::FLOAT, source, target, cost, reverse_cost FROM edge_table',
+    true);
+
+PREPARE q11 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id::REAL, source, target, cost, reverse_cost FROM edge_table',
+    true);
+
+SELECT throws_ok('q10', 'XX000', 'Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'Throws because id is FLOAT');
+SELECT throws_ok('q11', 'XX000', 'Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'Throws because id is REAL');
+
+PREPARE q12 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id, source::FLOAT, target, cost, reverse_cost FROM edge_table',
+    true);
+
+PREPARE q13 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id, source::REAL, target, cost, reverse_cost FROM edge_table',
+    true);
+
+SELECT throws_ok('q12', 'XX000', 'Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q13', 'XX000', 'Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'Throws because source is REAL');
+
+PREPARE q14 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id, source, target::FLOAT, cost, reverse_cost FROM edge_table',
+    true);
+
+PREPARE q15 AS
+SELECT * FROM pgr_johnson(
+    'SELECT id, source, target::REAL, cost, reverse_cost FROM edge_table',
+    true);
+
+SELECT throws_ok('q14', 'XX000', 'Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q15', 'XX000', 'Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'Throws because source is REAL');
+
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/allpairs/test/test.conf b/src/allpairs/test/test.conf
new file mode 100644
index 0000000..528a981
--- /dev/null
+++ b/src/allpairs/test/test.conf
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+    'any' => {
+        'comment' => 'All pairs tests.',
+        'data' => [''],
+        'tests' => [qw(
+            doc-johnson
+            doc-floydWarshall
+            )],
+
+        'documentation' => [qw(
+            doc-johnson
+            doc-floydWarshall
+            )]
+    },
+# I dont know what this are for or how to use them.
+#  TODO ask Steve 
+#    'vpg-vpgis' => {}, # for version specific tests
+#    '8-1' => {},       # for pg 8.x and postgis 1.x
+#    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
+
+);
+
+1;
diff --git a/src/alpha_shape/doc/doc-pgr_alphashape.queries b/src/alpha_shape/doc/doc-pgr_alphashape.queries
new file mode 100644
index 0000000..ac290c7
--- /dev/null
+++ b/src/alpha_shape/doc/doc-pgr_alphashape.queries
@@ -0,0 +1,20 @@
+BEGIN;
+BEGIN
+SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
+FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
+(SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
+FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table')
+) AS a) AS foo;
+ERROR:  relation "vertex_table" does not exist
+LINE 1: SELECT id, x, y FROM vertex_table
+                             ^
+QUERY:  SELECT id, x, y FROM vertex_table
+-----------------------------
+SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
+FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
+(SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
+FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr')
+) AS a) AS foo;
+ERROR:  current transaction is aborted, commands ignored until end of transaction block
+ROLLBACK;
+ROLLBACK
diff --git a/src/alpha_shape/doc/doc-pgr_pointsAsPolygon.queries b/src/alpha_shape/doc/doc-pgr_pointsAsPolygon.queries
new file mode 100644
index 0000000..32fefa9
--- /dev/null
+++ b/src/alpha_shape/doc/doc-pgr_pointsAsPolygon.queries
@@ -0,0 +1,13 @@
+BEGIN;
+BEGIN
+--q1
+SELECT ST_AsText(pgr_pointsAsPolygon('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y
+        FROM edge_table_vertices_pgr'));
+                      st_astext                       
+------------------------------------------------------
+ POLYGON((2 4,3.5 4,4 3,4 2,4 1,2 0,0 2,0.5 3.5,2 4))
+(1 row)
+
+--q2
+ROLLBACK;
+ROLLBACK
diff --git a/src/alpha_shape/doc/pgr_alphaShape.rst b/src/alpha_shape/doc/pgr_alphaShape.rst
new file mode 100644
index 0000000..44e48ab
--- /dev/null
+++ b/src/alpha_shape/doc/pgr_alphaShape.rst
@@ -0,0 +1,125 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_alphashape:
+
+pgr_alphaShape
+===============================================================================
+
+.. index:: 
+	single: pgr_alphashape(text,float8)
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_alphaShape`` — Core function for alpha shape computation.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Returns a table with (x, y) rows that describe the vertices of an alpha shape.
+
+.. code-block:: sql
+
+	table() pgr_alphaShape(text sql [, float8 alpha]);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: ``text`` a SQL query, which should return a set of rows with the following columns:
+
+    .. code-block:: sql
+
+        SELECT id, x, y FROM vertex_table
+
+    :id: ``int4`` identifier of the vertex
+    :x: ``float8`` x-coordinate
+    :y: ``float8`` y-coordinate
+
+:alpha: (optional) ``float8`` alpha value. If specified alpha value equals 0 (default), then optimal alpha value is used.
+    For more information, see `CGAL - 2D Alpha Shapes <http://doc.cgal.org/latest/Alpha_shapes_2/group__PkgAlphaShape2.html>`_.
+
+Returns a vertex record for each row:
+
+:x: x-coordinate
+:y: y-coordinate
+
+If a result includes multiple outer/inner rings, return those with separator row (x=NULL and y=NULL).
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+* Added alpha argument with default 0 (use optimal value) in version 2.1.0
+* Supported to return multiple outer/inner ring coordinates with separator row (x=NULL and y=NULL) in version 2.1.0
+
+Examples
+-------------------------------------------------------------------------------
+In the alpha shape code we have no way to control the order of the points so the actual output you might get could be similar but different. The simple query is followed by a more complex one that constructs a polygon and computes the areas of it. This should be the same as the result on your system. We leave the details of the complex query to the reader as an exercise if they wish to decompose it into understandable pieces or to just copy and paste it into a SQL window to run.
+
+.. code-block:: sql
+
+    SELECT * FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table');
+
+     x | y 
+    ---+---
+     2 | 4
+     0 | 2
+     2 | 0
+     4 | 1
+     4 | 2
+     4 | 3
+    (6 rows)
+
+    SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
+    FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
+    (SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
+    FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table')
+    ) AS a) AS foo;
+
+     st_area
+    ---------
+       10.00
+    (1 row)
+
+
+    SELECT * FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr');
+      x  |  y  
+    -----+-----
+       2 |   4
+     0.5 | 3.5
+       0 |   2
+       2 |   0
+       4 |   1
+       4 |   2
+       4 |   3
+     3.5 |   4
+    (8 rows)
+
+    SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
+    FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
+    (SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
+    FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr')
+    ) AS a) AS foo;
+
+     st_area
+    ---------
+       11.75
+    (1 row)
+
+ 
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_drivingDistance` - Driving Distance
+* :ref:`pgr_points_as_polygon` - Polygon around set of points
diff --git a/src/alpha_shape/doc/pgr_pointsAsPolygon.rst b/src/alpha_shape/doc/pgr_pointsAsPolygon.rst
new file mode 100644
index 0000000..57024a5
--- /dev/null
+++ b/src/alpha_shape/doc/pgr_pointsAsPolygon.rst
@@ -0,0 +1,76 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_points_as_polygon:
+
+pgr_pointsAsPolygon
+===============================================================================
+
+.. index:: 
+    single: pgr_pointsAsPolygon(text,float8)
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_pointsAsPolygon`` — Draws an alpha shape around given set of points.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Returns the alpha shape as (multi)polygon geometry.
+
+.. code-block:: sql
+
+    geometry pgr_pointsAsPolygon(text sql [, float8 alpha]);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: ``text`` a SQL query, which should return a set of rows with the following columns:
+
+    .. code-block:: sql
+
+        SELECT id, x, y FROM vertex_result;
+
+    :id: ``int4`` identifier of the vertex
+    :x: ``float8`` x-coordinate
+    :y: ``float8`` y-coordinate
+
+:alpha: (optional) ``float8`` alpha value. If specified alpha value equals 0 (default), then optimal alpha value is used.
+    For more information, see `CGAL - 2D Alpha Shapes <http://doc.cgal.org/latest/Alpha_shapes_2/group__PkgAlphaShape2.html>`_.
+
+Returns a (multi)polygon geometry (with holes).
+
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+* Added alpha argument with default 0 (use optimal value) in version 2.1.0
+* Supported to return a (multi)polygon geometry (with holes) in version 2.1.0
+
+
+Examples
+-------------------------------------------------------------------------------
+In the following query there is no way to control which point in the polygon is the first in the list, so you may get similar but different results than the following which are also correct.
+
+.. literalinclude:: doc-pgr_pointsAsPolygon.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+The query use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_drivingDistance` - Driving Distance
+* :ref:`pgr_alphashape` - Alpha shape computation
diff --git a/src/alpha_shape/sql/CMakeLists.txt b/src/alpha_shape/sql/CMakeLists.txt
new file mode 100644
index 0000000..05cbe17
--- /dev/null
+++ b/src/alpha_shape/sql/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/alpha_shape.sql
+    )
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/alpha_shape/sql/alpha_shape.sql b/src/alpha_shape/sql/alpha_shape.sql
new file mode 100644
index 0000000..d89a0b3
--- /dev/null
+++ b/src/alpha_shape/sql/alpha_shape.sql
@@ -0,0 +1,97 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Copyright (c) 2006-2007 Anton A. Patrushev, Orkney, Inc.
+Copyright (c) 2005 Sylvain Pasche,
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+-----------------------------------------------------------------------
+-- Core function for alpha shape computation.
+-- The sql should return vertex ids and x,y values. Return ordered
+-- vertex ids. 
+-----------------------------------------------------------------------
+CREATE OR REPLACE FUNCTION pgr_alphashape(sql text, alpha float8 DEFAULT 0, OUT x float8, OUT y float8)
+    RETURNS SETOF record
+    AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'alphashape'
+    LANGUAGE c IMMUTABLE STRICT;
+
+----------------------------------------------------------
+-- Draws an alpha shape around given set of points.
+-- ** This should be rewritten as an aggregate. **
+----------------------------------------------------------
+CREATE OR REPLACE FUNCTION pgr_pointsAsPolygon(query varchar, alpha float8 DEFAULT 0)
+	RETURNS geometry AS
+	$$
+	DECLARE
+		r record;
+		geoms geometry[];
+		vertex_result record;
+		i int;
+		n int;
+		spos int;
+		q text;
+		x float8[];
+		y float8[];
+
+	BEGIN
+		geoms := array[]::geometry[];
+		i := 1;
+
+		FOR vertex_result IN EXECUTE 'SELECT x, y FROM pgr_alphashape('''|| query || ''', ' || alpha || ')' 
+		LOOP
+			x[i] = vertex_result.x;
+			y[i] = vertex_result.y;
+			i := i+1;
+		END LOOP;
+
+		n := i;
+		IF n = 1 THEN
+			RAISE NOTICE 'n = 1';
+			RETURN NULL;
+		END IF;
+
+		spos := 1;
+		q := 'SELECT ST_GeometryFromText(''POLYGON((';
+		FOR i IN 1..n LOOP
+			IF x[i] IS NULL AND y[i] IS NULL THEN
+				q := q || ', ' || x[spos] || ' ' || y[spos] || '))'',0) AS geom;';
+				EXECUTE q INTO r;
+				geoms := geoms || array[r.geom];
+				q := '';
+			ELSE
+				IF q = '' THEN
+					spos := i;
+					q := 'SELECT ST_GeometryFromText(''POLYGON((';
+				END IF;
+				IF i = spos THEN
+					q := q || x[spos] || ' ' || y[spos];
+				ELSE
+					q := q || ', ' || x[i] || ' ' || y[i];
+				END IF;
+			END IF;
+		END LOOP;
+
+		RETURN ST_BuildArea(ST_Collect(geoms));
+	END;
+	$$
+	LANGUAGE 'plpgsql' VOLATILE STRICT;
+
diff --git a/src/alpha_shape/src/CMakeLists.txt b/src/alpha_shape/src/CMakeLists.txt
new file mode 100644
index 0000000..e11956d
--- /dev/null
+++ b/src/alpha_shape/src/CMakeLists.txt
@@ -0,0 +1,5 @@
+ADD_LIBRARY(alpha_shape OBJECT
+    alpha.c
+    alpha_drivedist.cpp
+ )
+
diff --git a/src/alpha_shape/src/alpha.c b/src/alpha_shape/src/alpha.c
new file mode 100644
index 0000000..6854b83
--- /dev/null
+++ b/src/alpha_shape/src/alpha.c
@@ -0,0 +1,414 @@
+/*PGR-GNU*****************************************************************
+FILE: alpha.c
+
+Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "../../common/src/pgr_types.h"
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+#include "alpha.h"
+
+#include "fmgr.h"
+
+
+#ifndef PG_MODULE_MAGIC
+PG_MODULE_MAGIC;
+#endif
+
+/*
+ * Define this to have profiling enabled
+ */
+//#define PROFILE
+
+#ifdef PROFILE
+#include <sys/time.h>
+
+/*! \def MAX_NODES
+  \brief Maximal number of nodes in the path (to avoid infinite loops)
+*/
+#define MAX_NODES 1000000
+
+struct timeval prof_alpha, prof_store, prof_extract, prof_total;
+long proftime[5];
+long profipts1, profipts2, profopts;
+#define profstart(x) do { gettimeofday(&x, NULL); } while (0);
+#define profstop(n, x) do { struct timeval _profstop;   \
+        long _proftime;                         \
+        gettimeofday(&_profstop, NULL);                         \
+        _proftime = ( _profstop.tv_sec*1000000+_profstop.tv_usec) -     \
+                ( x.tv_sec*1000000+x.tv_usec); \
+        elog(NOTICE, \
+                "PRF(%s) %lu (%f ms)", \
+                (n), \
+             _proftime, _proftime / 1000.0);    \
+        } while (0);
+
+#else
+
+#define profstart(x) do { } while (0);
+#define profstop(n, x) do { } while (0);
+
+
+#endif // PROFILE
+
+
+Datum alphashape(PG_FUNCTION_ARGS);
+
+#undef DEBUG
+//#define DEBUG 1
+#include "../../common/src/debug_macro.h"
+    
+// The number of tuples to fetch from the SPI cursor at each iteration
+#define TUPLIMIT 1000
+
+static char *
+text2char(text *in)
+{
+  char *out = palloc(VARSIZE(in));
+    
+  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
+  out[VARSIZE(in) - VARHDRSZ] = '\0';
+  return out;
+}
+
+static int
+finish(int code, int ret)
+{
+  code = SPI_finish();
+  if (code  != SPI_OK_FINISH )
+  {
+    elog(ERROR,"couldn't disconnect from SPI");
+    return -1 ;
+  }
+  return ret;
+}
+		  
+
+typedef struct vertex_columns 
+{
+  int id;
+  int x;
+  int y;
+
+} vertex_columns_t;
+
+
+
+static int
+fetch_vertices_columns(SPITupleTable *tuptable, 
+                       vertex_columns_t *vertex_columns)
+{
+  vertex_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
+  vertex_columns->x = SPI_fnumber(SPI_tuptable->tupdesc, "x");
+  vertex_columns->y = SPI_fnumber(SPI_tuptable->tupdesc, "y");
+
+  if (vertex_columns->id == SPI_ERROR_NOATTRIBUTE ||
+      vertex_columns->x == SPI_ERROR_NOATTRIBUTE ||
+      vertex_columns->y == SPI_ERROR_NOATTRIBUTE) 
+    {
+      elog(ERROR, "Error, query must return columns "
+           "'id', 'x' and 'y'");
+      return -1;
+    }
+
+  if (SPI_gettypeid(SPI_tuptable->tupdesc, vertex_columns->id) != INT4OID ||
+      SPI_gettypeid(SPI_tuptable->tupdesc, vertex_columns->x) != FLOAT8OID ||
+      SPI_gettypeid(SPI_tuptable->tupdesc, vertex_columns->y) != FLOAT8OID) 
+    {
+      elog(ERROR, 
+           "Error, column 'id' must be of type int4, 'x' and 'y' must be of type float8");
+      return -1;
+    }
+   
+  return 0;
+}
+
+static void
+fetch_vertex(HeapTuple *tuple, TupleDesc *tupdesc, 
+             vertex_columns_t *vertex_columns, vertex_t *target_vertex)
+{
+  Datum binval;
+  bool isnull;
+
+  binval = SPI_getbinval(*tuple, *tupdesc, vertex_columns->x, &isnull);
+  if (isnull)
+    elog(ERROR, "x contains a null value");
+  target_vertex->x = DatumGetFloat8(binval);
+
+  binval = SPI_getbinval(*tuple, *tupdesc, vertex_columns->y, &isnull);
+  if (isnull)
+    elog(ERROR, "y contains a null value");
+  target_vertex->y = DatumGetFloat8(binval);
+}
+
+static int compute_alpha_shape(char* sql, float8 alpha, vertex_t **res, size_t *res_count)
+{
+
+  int SPIcode;
+  void *SPIplan;
+  Portal SPIportal;
+  bool moredata = TRUE;
+  uint32_t ntuples;
+  vertex_t *vertices = NULL;
+  uint32_t total_tuples = 0;
+  vertex_columns_t vertex_columns = {.id= -1, .x= -1, .y= -1};
+  char *err_msg;
+  int ret = -1;
+
+  PGR_DBG("start alpha_shape\n");
+        
+  SPIcode = SPI_connect();
+  if (SPIcode  != SPI_OK_CONNECT)
+    {
+      elog(ERROR, "alpha_shape: couldn't open a connection to SPI");
+      return -1;
+    }
+
+  SPIplan = SPI_prepare(sql, 0, NULL);
+  if (SPIplan  == NULL)
+    {
+      elog(ERROR, "alpha_shape: couldn't create query plan via SPI");
+      return -1;
+    }
+
+  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) 
+    {
+      elog(ERROR, "alpha_shape: SPI_cursor_open('%s') returns NULL", sql);
+      return -1;
+    }
+
+  while (moredata == TRUE)
+    {
+      SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
+
+      if (vertex_columns.id == -1) 
+        {
+          if (fetch_vertices_columns(SPI_tuptable, &vertex_columns) == -1)
+	    return finish(SPIcode, ret);
+        }
+
+      ntuples = SPI_processed;
+      total_tuples += ntuples;
+      if (!vertices)
+        vertices = palloc(total_tuples * sizeof(vertex_t));
+      else
+        vertices = repalloc(vertices, total_tuples * sizeof(vertex_t));
+
+      if (vertices == NULL) 
+        {
+          elog(ERROR, "Out of memory");
+          return finish(SPIcode, ret);
+        }
+
+      if (ntuples > 0) 
+        {
+          uint32_t t;
+          SPITupleTable *tuptable = SPI_tuptable;
+          TupleDesc tupdesc = SPI_tuptable->tupdesc;
+                
+          for (t = 0; t < ntuples; t++) 
+            {
+              HeapTuple tuple = tuptable->vals[t];
+              fetch_vertex(&tuple, &tupdesc, &vertex_columns, 
+                           &vertices[total_tuples - ntuples + t]);
+            }
+          SPI_freetuptable(tuptable);
+        } 
+      else 
+        {
+          moredata = FALSE;
+        }
+    }
+
+
+  // if (total_tuples < 2) //this was the buggy code of the pgrouting project.
+  // TODO: report this as a bug to the pgrouting project
+  // the CGAL alpha-shape function crashes if called with less than three points!!!
+
+  if (total_tuples == 0) {
+  	  elog(ERROR, "Distance is too short. no vertex for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");
+  }
+  if (total_tuples == 1) {
+	  elog(ERROR, "Distance is too short. only 1 vertex for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");
+  }
+  if (total_tuples == 2) {
+	  elog(ERROR, "Distance is too short. only 2 vertices for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");
+  }
+  if (total_tuples < 3)
+  {
+    // elog(ERROR, "Distance is too short ....");
+    return finish(SPIcode, ret);
+  }
+
+  PGR_DBG("Calling CGAL alpha-shape\n");
+        
+  profstop("extract", prof_extract);
+  profstart(prof_alpha);
+
+  ret = alpha_shape(vertices, total_tuples, alpha, res, res_count, &err_msg);
+
+  profstop("alpha", prof_alpha);
+  profstart(prof_store);
+
+  if (ret < 0)
+    {
+      //elog(ERROR, "Error computing shape: %s", err_msg);
+      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), errmsg("Error computing shape: %s", err_msg)));
+    } 
+  
+  return finish(SPIcode, ret);    
+}
+
+PG_FUNCTION_INFO_V1(alphashape);
+
+Datum alphashape(PG_FUNCTION_ARGS)
+{
+  FuncCallContext      *funcctx;
+  uint32_t                  call_cntr;
+  uint32_t                  max_calls;
+  TupleDesc            tuple_desc;
+  vertex_t     *res = 0;
+                    
+  /* stuff done only on the first call of the function */
+  if (SRF_IS_FIRSTCALL())
+    {
+      MemoryContext   oldcontext;
+      size_t res_count;
+                            
+      // XXX profiling messages are not thread safe
+      profstart(prof_total);
+      profstart(prof_extract);
+                                            
+      /* create a function context for cross-call persistence */
+      funcctx = SRF_FIRSTCALL_INIT();
+                                                                    
+      /* switch to memory context appropriate for multiple function calls */
+      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+      compute_alpha_shape(text2char(PG_GETARG_TEXT_P(0)), 
+                                PG_GETARG_FLOAT8(1), &res, &res_count);
+
+      /* total number of tuples to be returned */
+      PGR_DBG("Conting tuples number\n");
+      funcctx->max_calls = (uint32_t)res_count;
+      funcctx->user_fctx = res;
+
+      PGR_DBG("Total count %i", res_count);
+
+      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+        ereport(ERROR,
+            (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+            errmsg("function returning record called in context "
+                   "that cannot accept type record")));
+
+      funcctx->tuple_desc = BlessTupleDesc(tuple_desc);
+
+      MemoryContextSwitchTo(oldcontext);
+    }
+
+  /* stuff done on every call of the function */
+  PGR_DBG("Strange stuff doing\n");
+  funcctx = SRF_PERCALL_SETUP();
+
+  call_cntr = funcctx->call_cntr;
+  max_calls = funcctx->max_calls;
+  tuple_desc = funcctx->tuple_desc;
+  res = (vertex_t*) funcctx->user_fctx;
+
+  PGR_DBG("Trying to allocate some memory\n");
+
+  if (call_cntr < max_calls)    /* do when there is more left to send */
+    {
+      HeapTuple    tuple;
+      Datum        result;
+      Datum *values;
+      char* nulls;
+      double x;
+      double y;
+
+      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one    
+
+      values = palloc(3 * sizeof(Datum));
+      nulls = palloc(3 * sizeof(char));
+
+      values[0] = call_cntr;
+      nulls[0] = ' ';
+      values[1] = Float8GetDatum(res[call_cntr].x);
+      nulls[1] = ' ';
+      values[2] = Float8GetDatum(res[call_cntr].y);
+      nulls[2] = ' ';
+      */
+    
+      values = palloc(2 * sizeof(Datum));
+      nulls = palloc(2 * sizeof(char));
+
+      x = res[call_cntr].x;
+      y = res[call_cntr].y;
+      if (x == DBL_MAX && y == DBL_MAX)
+      {
+        values[0] = 0;
+        values[1] = 0;
+        nulls[0] = 'n';
+        nulls[1] = 'n';
+      }
+      else
+      {
+        values[0] = Float8GetDatum(x);
+        values[1] = Float8GetDatum(y);
+        nulls[0] = ' ';
+        nulls[1] = ' ';
+      }
+	
+      PGR_DBG("Heap making\n");
+
+      tuple = heap_formtuple(tuple_desc, values, nulls);
+
+      PGR_DBG("Datum making\n");
+
+      /* make the tuple into a datum */
+      result = HeapTupleGetDatum(tuple);
+
+      PGR_DBG("Trying to free some memory\n");
+
+      /* clean up (this is not really necessary) */
+      pfree(values);
+      pfree(nulls);
+
+      SRF_RETURN_NEXT(funcctx, result);
+    }
+  else    /* do when there is no more left */
+    {
+      if (res) free(res);
+      profstop("store", prof_store);
+      profstop("total", prof_total);
+#ifdef PROFILE
+      elog(NOTICE, "_________");
+#endif
+      SRF_RETURN_DONE(funcctx);
+    }
+}
diff --git a/src/alpha_shape/src/alpha.h b/src/alpha_shape/src/alpha.h
new file mode 100644
index 0000000..259d0f5
--- /dev/null
+++ b/src/alpha_shape/src/alpha.h
@@ -0,0 +1,52 @@
+/*PGR-GNU*****************************************************************
+FILE: alpha.h
+
+Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#define _ALPHA_H
+
+#ifdef __MINGW64__
+#define ELOG_H
+#endif
+#include "postgres.h"
+#include "../../common/src/pgr_types.h"
+
+typedef struct vertex
+{
+  float8 x;
+  float8 y;
+} vertex_t;
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+                                                                     
+  int alpha_shape(vertex_t *vertices, size_t count, double alpha,
+                  vertex_t **res, size_t *res_count, char **err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
+                                        
diff --git a/src/alpha_shape/src/alpha_drivedist.cpp b/src/alpha_shape/src/alpha_drivedist.cpp
new file mode 100644
index 0000000..2d02381
--- /dev/null
+++ b/src/alpha_shape/src/alpha_drivedist.cpp
@@ -0,0 +1,280 @@
+/*PGR-GNU*****************************************************************
+File: alpha_drivedist.cpp 
+
+Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*
+ * As a special exception, you have permission to link this program
+ * with the CGAL library and distribute executables, as long as you
+ * follow the requirements of the GNU GPL in regard to all of the
+ * software in the executable aside from CGAL.
+ *
+ */
+
+
+/***********************************************************************
+Takes a list of points and returns a list of segments 
+corresponding to the Alpha shape.
+************************************************************************/
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+#ifdef __MINGW64__
+namespace boost {
+  void tss_cleanup_implemented() { }
+}
+#endif
+#include <CGAL/Simple_cartesian.h>
+#include <CGAL/Filtered_kernel.h>
+#include <CGAL/algorithm.h>
+
+#include <vector>
+#include <list>
+#include <cmath>
+
+#include "alpha.h"
+
+#include <CGAL/Polygon_2.h>
+#include <CGAL/Delaunay_triangulation_2.h>
+#include <CGAL/Triangulation_2.h>
+#include <CGAL/Triangulation_hierarchy_vertex_base_2.h>
+#include <CGAL/Triangulation_hierarchy_2.h>
+#include <CGAL/Triangulation_face_base_2.h>
+#include <CGAL/Triangulation_euclidean_traits_2.h>
+#include <CGAL/Alpha_shape_2.h>
+#include <CGAL/Alpha_shape_face_base_2.h>
+#include <CGAL/Alpha_shape_vertex_base_2.h>
+
+
+typedef double coord_type;
+
+typedef CGAL::Simple_cartesian<coord_type>  SC;
+typedef CGAL::Filtered_kernel<SC> K;
+typedef K::Point_2  Point;
+typedef K::Segment_2  Segment;
+typedef K::Vector_2 Vector;
+typedef CGAL::Polygon_2<K> Polygon_2;
+
+typedef CGAL::Alpha_shape_vertex_base_2<K> Avb;
+typedef CGAL::Triangulation_hierarchy_vertex_base_2<Avb> Av;
+
+typedef CGAL::Triangulation_face_base_2<K> Tf;
+typedef CGAL::Alpha_shape_face_base_2<K,Tf> Af;
+
+typedef CGAL::Triangulation_default_data_structure_2<K,Av,Af> Tds;
+typedef CGAL::Delaunay_triangulation_2<K,Tds> Dt;
+typedef CGAL::Triangulation_hierarchy_2<Dt> Ht;
+typedef CGAL::Alpha_shape_2<Ht> Alpha_shape_2;
+
+typedef Alpha_shape_2::Face_circulator  Face_circulator;
+typedef Alpha_shape_2::Vertex_circulator  Vertex_circulator;
+
+typedef Alpha_shape_2::Alpha_iterator Alpha_iterator;
+typedef Alpha_shape_2::Alpha_shape_edges_iterator Alpha_shape_edges_iterator;
+
+//---------------------------------------------------------------------
+
+double get_angle(Point p, Point q, Point r)
+{
+  double m_pi(3.14159265358979323846);
+  Vector v1(q, p);
+  Vector v2(q, r);
+  double cross = v1.x() * v2.y() - v1.y() * v2.x();
+  double dot = v1.x() * v2.x() + v1.y() * v2.y();
+  double angle = atan2(cross, dot);
+  if (angle < 0.0) {
+    angle += 2 * m_pi;
+  }
+  return angle;
+}
+
+size_t prev_size = 0;
+void find_next_edge(Segment s, std::vector<Segment>& segments, 
+                    std::set<int>& unusedIndexes, std::vector<Polygon_2>& rings)
+{
+  if(unusedIndexes.empty()
+    || prev_size == unusedIndexes.size())
+  {
+    return;
+  }
+  
+  prev_size = unusedIndexes.size();
+  
+  Point start = s.source();
+  Point end = s.target();
+  rings.back().push_back(end);
+  
+  std::vector<int> nextIndexes;
+  for(unsigned int i = 0;i < segments.size(); i++)
+  {
+    if (unusedIndexes.find(i) != unusedIndexes.end())
+    {
+      Point source = segments.at(i).source();
+      if(source == end)
+      {
+        nextIndexes.push_back(i);
+      }
+    }
+  }
+  if (nextIndexes.size() == 1)
+  {
+    int i = nextIndexes.at(0);
+    unusedIndexes.erase(i);
+    find_next_edge(segments.at(i), segments, unusedIndexes, rings);
+  }
+  else if (nextIndexes.size() > 1)
+  {
+    std::vector< std::pair<double, int> > nextAngles;
+    for (unsigned int i = 0; i < nextIndexes.size(); i++)
+    {
+      int j = nextIndexes.at(i);
+      Point target = segments.at(j).target();
+      double angle = get_angle(start, end, target);
+      nextAngles.push_back(std::pair<double, int>(angle, j));
+    }
+    std::sort(nextAngles.begin(), nextAngles.end());
+    int i = nextAngles.begin()->second;
+    unusedIndexes.erase(i);
+    find_next_edge(segments.at(i), segments, unusedIndexes, rings);
+  }
+  
+  if (!unusedIndexes.empty())
+  {
+    for (unsigned int i = 0; i < segments.size(); i++)
+    {
+      if (unusedIndexes.find(i) != unusedIndexes.end())
+      {
+        Polygon_2 ring;
+        ring.push_back(segments.at(i).source());
+        rings.push_back(ring);
+        unusedIndexes.erase(i);
+        find_next_edge(segments.at(i), segments, unusedIndexes, rings);
+      }
+    }
+  }
+}
+
+template <class OutputIterator>
+void
+alpha_edges( const Alpha_shape_2&  A,
+             OutputIterator out)
+{ 
+
+  for(Alpha_shape_edges_iterator it =  A.alpha_shape_edges_begin();
+      it != A.alpha_shape_edges_end();
+      ++it){
+    *out++ = A.segment(*it);
+  }
+}
+
+
+int alpha_shape(vertex_t *vertices, size_t count, double alpha,
+                vertex_t **res, size_t *res_count, char **err_msg)
+{
+  std::list<Point> points;
+
+  //std::copy(begin(vertices), end(vertices), std::back_inserter(points)); 
+  
+  for (std::size_t j = 0; j < count; ++j)
+  {
+    Point p(vertices[j].x, vertices[j].y);
+    points.push_back(p);
+  }
+  
+
+  Alpha_shape_2 A(points.begin(), points.end(),
+                  coord_type(10000),
+                  Alpha_shape_2::REGULARIZED);
+  
+  std::vector<Segment> segments;
+//  std::vector<Segment> result;
+
+//  Alpha_shape_2::Alpha_shape_vertices_iterator vit;
+//  Alpha_shape_2::Vertex_handle vertex;
+//  Alpha_shape_2::Alpha_shape_edges_iterator eit;
+//  Alpha_shape_2::Edge edge;
+//  Alpha_shape_2::Face_iterator fit;
+//  Alpha_shape_2::Face_handle face;
+  
+  if (alpha <= 0.0)
+  {
+    alpha = *A.find_optimal_alpha(1);
+  }
+  A.set_alpha(alpha);
+
+  alpha_edges( A, std::back_inserter(segments));
+
+//  Segment s = segments.at(0);
+//  find_next_edge(s, segments, result);
+  if (segments.empty())
+  {
+    *res = NULL;
+    *res_count = 0;
+  }
+  else
+  {
+    std::set<int> unusedIndexes;
+    for (unsigned int i = 0; i < segments.size(); i++)
+    {
+      unusedIndexes.insert(i);
+    }
+    
+    std::vector<Polygon_2> rings;
+    Polygon_2 ring;
+    ring.push_back(segments.at(0).source());
+    rings.push_back(ring);
+    unusedIndexes.erase(0);
+    find_next_edge(segments.at(0), segments, unusedIndexes, rings);
+
+    size_t result_count = 0;
+    for (unsigned int i = 0; i < rings.size(); i++)
+    {
+      Polygon_2 ring = rings.at(i);
+      result_count += ring.size();
+    }
+    result_count += rings.size() - 1;
+    *res = (vertex_t *) malloc(sizeof(vertex_t) * result_count);
+    *res_count = result_count;
+
+    int idx = 0;
+    for (unsigned int i = 0; i < rings.size(); i++)
+    {
+      if (i > 0)
+      {
+        (*res)[idx].x = DBL_MAX;
+        (*res)[idx].y = DBL_MAX;
+        idx++;
+      }
+      Polygon_2 ring = rings.at(i);
+      for(unsigned int j = 0; j < ring.size(); j++)
+      {
+        Point point = ring.vertex(j);
+        (*res)[idx].x = point.x();
+        (*res)[idx].y = point.y();
+        idx++;
+      }
+    }
+  }
+  *err_msg = NULL;
+
+  return EXIT_SUCCESS;
+}
diff --git a/doc/test/alphashape-any.result b/src/alpha_shape/test/doc-pgr_alphashape.result
similarity index 100%
rename from doc/test/alphashape-any.result
rename to src/alpha_shape/test/doc-pgr_alphashape.result
diff --git a/src/alpha_shape/test/doc-pgr_alphashape.test.sql b/src/alpha_shape/test/doc-pgr_alphashape.test.sql
new file mode 100644
index 0000000..0c4d48d
--- /dev/null
+++ b/src/alpha_shape/test/doc-pgr_alphashape.test.sql
@@ -0,0 +1,26 @@
+BEGIN;
+--------------------------------------------------------------------------------
+--              PGR_alphaShape
+--------------------------------------------------------------------------------
+-- testing with areas
+--SELECT * FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table');
+--SELECT * FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr');
+
+SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
+FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
+(SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
+
+FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table')
+
+) AS a) AS foo;
+
+\echo '-----------------------------'
+
+SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
+FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
+(SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
+
+FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr')
+
+) AS a) AS foo;
+ROLLBACK;
diff --git a/src/alpha_shape/test/doc-pgr_pointsAsPolygon.result b/src/alpha_shape/test/doc-pgr_pointsAsPolygon.result
new file mode 100644
index 0000000..47a1a81
--- /dev/null
+++ b/src/alpha_shape/test/doc-pgr_pointsAsPolygon.result
@@ -0,0 +1,3 @@
+--q1
+POLYGON((2 4,3.5 4,4 3,4 2,4 1,2 0,0 2,0.5 3.5,2 4))
+--q2
diff --git a/src/alpha_shape/test/doc-pgr_pointsAsPolygon.test.sql b/src/alpha_shape/test/doc-pgr_pointsAsPolygon.test.sql
new file mode 100644
index 0000000..56fa863
--- /dev/null
+++ b/src/alpha_shape/test/doc-pgr_pointsAsPolygon.test.sql
@@ -0,0 +1,10 @@
+BEGIN;
+-------------------------------------------------------------------------------
+--              PGR_pointsAsPolygon
+-------------------------------------------------------------------------------
+
+\echo --q1
+SELECT ST_AsText(pgr_pointsAsPolygon('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y
+        FROM edge_table_vertices_pgr'));
+\echo --q2
+ROLLBACK;
diff --git a/src/alpha_shape/test/test.conf b/src/alpha_shape/test/test.conf
new file mode 100644
index 0000000..0cadd42
--- /dev/null
+++ b/src/alpha_shape/test/test.conf
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+    'any' => {
+        'comment' => 'Driving Distance test for any versions.',
+        'data' => [],
+        'tests' => [qw(
+            doc-pgr_pointsAsPolygon
+            doc-pgr_alphashape
+            )],
+        'documentation' => [qw(
+            doc-pgr_pointsAsPolygon
+            doc-pgr_alphashape
+            )]
+    },
+#    'vpg-vpgis' => {}, # for version specific tests
+#    '8-1' => {},       # for pg 8.x and postgis 1.x
+#    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
+);
+
+1;
diff --git a/src/apsp_johnson/CMakeLists.txt b/src/apsp_johnson/CMakeLists.txt
deleted file mode 100644
index e878191..0000000
--- a/src/apsp_johnson/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-SET(PACKAGE_SQL_FILES "")
-ADD_SUBDIRECTORY(sql)
-SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
-#MESSAGE("core/apsp_johnson: ${PACKAGE_SQL_FILES}")
-SUBDIRS(doc src test)
diff --git a/src/apsp_johnson/doc/doc-apspJohnson.queries b/src/apsp_johnson/doc/doc-apspJohnson.queries
new file mode 100644
index 0000000..9b67e2d
--- /dev/null
+++ b/src/apsp_johnson/doc/doc-apspJohnson.queries
@@ -0,0 +1,13 @@
+--q1
+SELECT * FROM pgr_apspJohnson(
+        'SELECT source::INTEGER, target::INTEGER, cost FROM edge_table WHERE id < 5'
+    );
+NOTICE:  Deprecated function: Use pgr_johnson instead
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   1 |   2 |    1
+   1 |   1 |   5 |    2
+   2 |   2 |   5 |    1
+(3 rows)
+
+--q2
diff --git a/src/apsp_johnson/doc/index.rst b/src/apsp_johnson/doc/index.rst
deleted file mode 100644
index c3de5f4..0000000
--- a/src/apsp_johnson/doc/index.rst
+++ /dev/null
@@ -1,86 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_apsp_johnson:
-
-pgr_apspJohnson - All Pairs Shortest Path, Johnson's Algorithm
-===============================================================================
-
-.. index::
-    single: pgr_apspJohnson(text)
-    module: apsp
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_apspJohnson`` - Returns all costs for each pair of nodes in the graph.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-Johnson's algorithm is a way to find the shortest paths between all pairs of vertices in a sparse, edge weighted, directed graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows for every pair of nodes in the graph.
-
-.. code-block:: sql
-
-    pgr_costResult[] pgr_apspJohnson(sql text);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query that should return the edges for the graph that will be analyzed:
-
-    .. code-block:: sql
-
-        SELECT source, target, cost FROM edge_table;
-
-    :source: ``int4`` identifier of the source vertex for this edge
-    :target: ``int4`` identifier of the target vertex for this edge
-    :cost: ``float8`` a positive value for the cost to traverse this edge
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   source node ID
-:id2:   target node ID
-:cost:  cost to traverse from ``id1`` to ``id2``
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS from, id2 AS to, cost 
-        FROM pgr_apspJohnson(
-            'SELECT source, target, cost FROM edge_table'
-        );
-
-     seq | from | to | cost 
-    -----+------+----+------
-       0 |    1 |  1 |    0
-       1 |    1 |  2 |    1
-       2 |    1 |  5 |    2
-       3 |    1 |  6 |    3
-    [...]
-
-The query uses the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* :ref:`pgr_apsp_warshall`
-* http://en.wikipedia.org/wiki/Johnson%27s_algorithm
diff --git a/src/apsp_johnson/doc/pgr_apspJohnson.rst b/src/apsp_johnson/doc/pgr_apspJohnson.rst
new file mode 100644
index 0000000..24819ff
--- /dev/null
+++ b/src/apsp_johnson/doc/pgr_apspJohnson.rst
@@ -0,0 +1,77 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_apsp_johnson:
+
+pgr_apspJohnson
+===============================================================================
+
+.. index::
+    single: pgr_apspJohnson(text) -- deprecated
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_apspJohnson`` - Returns all costs for each pair of nodes in the graph.
+
+.. warning:: This function is deprecated in version 2.2
+             Use :ref:`pgr_johnson` instead
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Johnson's algorithm is a way to find the shortest paths between all pairs of vertices in a sparse, edge weighted, directed graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows for every pair of nodes in the graph.
+
+.. code-block:: sql
+
+    pgr_costResult[] pgr_apspJohnson(sql text);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query that should return the edges for the graph that will be analyzed:
+
+    .. code-block:: sql
+
+        SELECT source, target, cost FROM edge_table;
+
+    :source: ``int4`` identifier of the source vertex for this edge
+    :target: ``int4`` identifier of the target vertex for this edge
+    :cost: ``float8`` a positive value for the cost to traverse this edge
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   source node ID
+:id2:   target node ID
+:cost:  cost to traverse from ``id1`` to ``id2``
+
+.. rubric:: History
+
+* Deprecated in version 2.2.0
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+.. literalinclude:: doc-apspJohnson.queries
+   :start-after: --q1
+   :end-before: --q2
+
+The query uses the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* :ref:`pgr_johnson`
+* http://en.wikipedia.org/wiki/Johnson%27s_algorithm
diff --git a/src/apsp_johnson/sql/CMakeLists.txt b/src/apsp_johnson/sql/CMakeLists.txt
index 02a4561..ce719b5 100644
--- a/src/apsp_johnson/sql/CMakeLists.txt
+++ b/src/apsp_johnson/sql/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/apsp_johnson.sql
-)
+    ${CMAKE_CURRENT_SOURCE_DIR}/apsp_johnson_v2.2.sql
+    )
 
 # set in parent scope
 SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/apsp_johnson/sql/apsp_johnson.sql b/src/apsp_johnson/sql/apsp_johnson.sql
deleted file mode 100644
index 1eabb0e..0000000
--- a/src/apsp_johnson/sql/apsp_johnson.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-
-CREATE OR REPLACE FUNCTION pgr_apspJohnson(sql text)
-    RETURNS SETOF pgr_costResult
-    AS '$libdir/librouting-2.1', 'apsp_johnson'
-LANGUAGE C IMMUTABLE STRICT;
diff --git a/src/apsp_johnson/sql/apsp_johnson_v2.2.sql b/src/apsp_johnson/sql/apsp_johnson_v2.2.sql
new file mode 100644
index 0000000..2ec9a7f
--- /dev/null
+++ b/src/apsp_johnson/sql/apsp_johnson_v2.2.sql
@@ -0,0 +1,56 @@
+/*PGR-GNU*****************************************************************
+
+File: apsp_johnson.sql
+
+Template:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function developer:
+Copyright (c) 2013 Vicky Vergara
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+CREATE OR REPLACE FUNCTION pgr_apspJohnson(edges_sql text)
+    RETURNS SETOF pgr_costResult AS
+  $BODY$
+  DECLARE
+  has_reverse boolean;
+  sql TEXT;
+  BEGIN
+      RAISE NOTICE 'Deprecated function: Use pgr_johnson instead';
+      has_reverse =_pgr_parameter_check('johnson', edges_sql, false);
+      sql = edges_sql;
+      IF (has_reverse) THEN
+           RAISE NOTICE 'reverse_cost column found, removing.';
+           sql = 'SELECT source, target, cost FROM (' || edges_sql || ') a';
+      END IF;
+
+      RETURN query
+         SELECT (row_number() over () - 1)::integer as seq, start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+         FROM  pgr_johnson(sql, TRUE);
+  END
+$BODY$
+  LANGUAGE plpgsql VOLATILE
+  COST 100
+  ROWS 1000;
+
+
diff --git a/src/apsp_johnson/src/CMakeLists.txt b/src/apsp_johnson/src/CMakeLists.txt
deleted file mode 100644
index c777b22..0000000
--- a/src/apsp_johnson/src/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# FIXME: The following patch is required by apsp_johnson_boost_wrapper.cpp.
-# With -fdelete-null-pointer-checks optimization, the assignments
-# to Edge bundled properties doesn't occur.
-
-if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")
-endif()
-
-ADD_LIBRARY(apsp_johnson OBJECT apsp_johnson.c apsp_johnson_boost_wrapper.cpp)
diff --git a/src/apsp_johnson/src/apsp_johnson.c b/src/apsp_johnson/src/apsp_johnson.c
deleted file mode 100644
index 0b4e5eb..0000000
--- a/src/apsp_johnson/src/apsp_johnson.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * APSP Johnson algorithm for PostgreSQL
- *
- * Copyright (c) 2011 J Kishore Kumar
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include "apsp_johnson.h"
-
-//-------------------------------------------------------------------------
-
-Datum apsp_johnson(PG_FUNCTION_ARGS);
-
-#undef DEBUG
-//#define DEBUG 1
-
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-
-// The number of tuples to fetch from the SPI cursor at each iteration
-#define TUPLIMIT 1000
-
-static char *
-text2char(text *in) {
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-static int finish(int code, int ret) {
-  code = SPI_finish();
-  if (code != SPI_OK_FINISH) {
-    elog(ERROR, "couldn't disconnect from SPI");
-    return -1;
-  }
-
-  return ret;
-}
-
-static int fetch_edge_apsp_columns(SPITupleTable *tuptable,
-    edge_apsp_johnson_t *edge_columns) {
-  edge_columns->source = SPI_fnumber(SPI_tuptable->tupdesc, "source");
-  edge_columns->target = SPI_fnumber(SPI_tuptable->tupdesc, "target");
-  edge_columns->cost = SPI_fnumber(SPI_tuptable->tupdesc, "cost");
-  if (edge_columns->source == SPI_ERROR_NOATTRIBUTE
-      || edge_columns->target == SPI_ERROR_NOATTRIBUTE
-      || edge_columns->cost == SPI_ERROR_NOATTRIBUTE)
-      {
-    elog(ERROR, "Error, query must return columns "
-        "'source', 'target' and 'cost'");
-    return -1;
-  }
-
-  if (SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->source) != INT4OID
-      || SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->target) != INT4OID
-      || SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->cost) != FLOAT8OID)
-      {
-    elog(ERROR, "Error, columns 'source', 'target' must be of type int4, "
-        "'cost' must be of type float8");
-    return -1;
-  }
-
-  DBG("columns: source %i target %i cost %lf",
-      edge_columns->source, edge_columns->target, edge_columns->cost);
-  return 0;
-}
-
-static void fetch_edge_apsp_johnson(HeapTuple *tuple, TupleDesc *tupdesc,
-    edge_apsp_johnson_t *edge_columns, edge_apsp_johnson_t *target_edge) {
-  Datum binval;
-  bool isnull;
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->source, &isnull);
-  if (isnull)
-    elog(ERROR, "source contains a null value");
-  target_edge->source = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->target, &isnull);
-  if (isnull)
-    elog(ERROR, "target contains a null value");
-  target_edge->target = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->cost, &isnull);
-  if (isnull)
-    elog(ERROR, "cost contains a null value");
-  target_edge->cost = DatumGetFloat8(binval);
-}
-
-int compute_apsp_johnson(char* sql, edge_apsp_johnson_t **output_edges,
-    int *output_count) {
-
-  int SPIcode;
-  void *SPIplan;
-  Portal SPIportal;
-  bool moredata = TRUE;
-  int ntuples;
-  edge_apsp_johnson_t *edges = NULL;
-  int total_tuples = 0;
-
-  int v_max_id = 0;
-  int v_min_id = INT_MAX;
-
-  edge_apsp_johnson_t edge_columns = { .source= -1, .target= -1, .cost= -1 };
-  char *err_msg;
-  int ret = -1;
-  register int z;
-
-  DBG("start apsp-johnson\n");
-
-  SPIcode = SPI_connect();
-  if (SPIcode != SPI_OK_CONNECT)
-  {
-    elog(ERROR, "apsp-johnson: couldn't open a connection to SPI");
-    return -1;
-  }
-
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan == NULL)
-  {
-    elog(ERROR, "apsp-johnson: couldn't create query plan via SPI");
-    return -1;
-  }
-
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL)
-  {
-    elog(ERROR, "apsp-johnson: SPI_cursor_open('%s') returns NULL", sql);
-    return -1;
-  }
-
-  while (moredata == TRUE) {
-    SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-    if (edge_columns.cost == -1) {
-      if (fetch_edge_apsp_columns(SPI_tuptable, &edge_columns) == -1)
-        return finish(SPIcode, ret);
-    }
-
-    ntuples = SPI_processed;
-    total_tuples += ntuples;
-    if (!edges)
-      edges = palloc(total_tuples * sizeof(edge_apsp_johnson_t));
-    else
-      edges = repalloc(edges, total_tuples * sizeof(edge_apsp_johnson_t));
-
-    if (edges == NULL) {
-      elog(ERROR, "Out of memory");
-      return finish(SPIcode, ret);
-    }
-
-    if (ntuples > 0) {
-      int t;
-      SPITupleTable *tuptable = SPI_tuptable;
-      TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-      for (t = 0; t < ntuples; t++) {
-        HeapTuple tuple = tuptable->vals[t];
-        fetch_edge_apsp_johnson(&tuple, &tupdesc, &edge_columns,
-            &edges[total_tuples - ntuples + t]);
-      }
-      SPI_freetuptable(tuptable);
-    } else {
-      moredata = FALSE;
-    }
-  }
-
-  //defining min and max vertex id
-
-  DBG("Total %i tuples", total_tuples);
-
-  for (z = 0; z < total_tuples; z++) {
-    if (edges[z].source < v_min_id)
-      v_min_id = edges[z].source;
-
-    if (edges[z].source > v_max_id)
-      v_max_id = edges[z].source;
-
-    if (edges[z].target < v_min_id)
-      v_min_id = edges[z].target;
-
-    if (edges[z].target > v_max_id)
-      v_max_id = edges[z].target;
-
-    DBG("%i <-> %i", v_min_id, v_max_id);
-
-  }
-
-  //::::::::::::::::::::::::::::::::::::
-  //:: reducing vertex id (renumbering)
-  //::::::::::::::::::::::::::::::::::::
-  for (z = 0; z < total_tuples; z++) {
-
-    edges[z].source -= v_min_id;
-    edges[z].target -= v_min_id;
-    DBG("%i - %i", edges[z].source, edges[z].target);
-  }
-
-  DBG("Total %i tuples", total_tuples);
-
-  DBG("Calling boost_apsp_johnson <%i>\n", total_tuples);
-
-  // calling C++ apsp_johnson function
-  ret = boost_apsp_johnson(edges, total_tuples, output_edges, output_count,
-      &err_msg);
-
-  DBG("SIZE %i\n", *output_count);
-
-  DBG("ret =  %i\n", ret);
-
-  //::::::::::::::::::::::::::::::::
-  //:: restoring original vertex id
-  //::::::::::::::::::::::::::::::::
-  for (z = 0; z < *output_count; z++) {
-    //DBG("vertex %i\n",(*path)[z].vertex_id);
-    (*output_edges)[z].source += v_min_id;
-    (*output_edges)[z].target += v_min_id;
-  }
-
-  if (ret < 0) {
-    //elog(ERROR, "Error computing path: %s", err_msg);
-    ereport(
-        ERROR,
-        (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), errmsg("Error computing path: %s", err_msg)));
-  }
-  return finish(SPIcode, ret);
-}
-
-PG_FUNCTION_INFO_V1(apsp_johnson);
-Datum apsp_johnson(PG_FUNCTION_ARGS) {
-  FuncCallContext *funcctx;
-  int call_cntr;
-  int max_calls;
-  TupleDesc tuple_desc;
-  edge_apsp_johnson_t *output_edges;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-    MemoryContext oldcontext;
-    int output_count = 0;
-#ifdef DEBUG
-    int ret;
-#endif
-
-    /* create a function context for cross-call persistence */
-    funcctx = SRF_FIRSTCALL_INIT();
-
-    /* switch to memory context appropriate for multiple function calls */
-    oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-#ifdef DEBUG
-    ret =
-#endif
-    compute_apsp_johnson(text2char(PG_GETARG_TEXT_P(0)), &output_edges,
-        &output_count);
-
-#ifdef DEBUG
-    DBG("Ret is %i", ret);
-    if (ret >= 0) {
-      int i;
-      for (i = 0; i < output_count; i++) {
-        DBG("Step # %i source  %i ", i, output_edges[i].source);
-        DBG("        target    %i ", output_edges[i].target);
-        DBG("        cost       %f ", output_edges[i].cost);
-      }
-    }
-#endif
-
-    /* total number of tuples to be returned */
-    DBG("Conting tuples number\n");
-    funcctx->max_calls = output_count;
-    funcctx->user_fctx = output_edges;
-
-    DBG("Output count %i", output_count);
-
-    funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
-
-    MemoryContextSwitchTo(oldcontext);
-  }
-
-  /* stuff done on every call of the function */
-  DBG("Strange stuff doing\n");
-
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  output_edges = (edge_apsp_johnson_t*) funcctx->user_fctx;
-
-  DBG("Trying to allocate some memory\n");
-
-  if (call_cntr < max_calls) /* do when there is more left to send */
-  {
-    HeapTuple tuple;
-    Datum result;
-    Datum *values;
-    char* nulls;
-
-    values = palloc(4 * sizeof(Datum));
-    nulls = palloc(4 * sizeof(char));
-
-    values[0] = Int32GetDatum(call_cntr);
-    nulls[0] = ' ';
-    values[1] = Int32GetDatum(output_edges[call_cntr].source);
-    nulls[1] = ' ';
-    values[2] = Int32GetDatum(output_edges[call_cntr].target);
-    nulls[2] = ' ';
-    values[3] = Float8GetDatum(output_edges[call_cntr].cost);
-    nulls[3] = ' ';
-
-    DBG("Heap making\n");
-
-    tuple = heap_formtuple(tuple_desc, values, nulls);
-
-    DBG("Datum making\n");
-
-    /* make the tuple into a datum */
-    result = HeapTupleGetDatum(tuple);
-
-    DBG("Trying to free some memory\n");
-
-    /* clean up (this is not really necessary) */
-    pfree(values);
-    pfree(nulls);
-
-    SRF_RETURN_NEXT(funcctx, result);
-  } else /* do when there is no more left */
-  {
-    SRF_RETURN_DONE(funcctx);
-  }
-}
-
-#ifdef DEBUG
-void dbg(const char *fmt, ...) //FIXME:Refactor to a common place
-    {
-      char buff[1024];
-      va_list arg;
-      va_start(arg, fmt);
-      vsprintf(buff, fmt, arg);
-      elog(NOTICE, "%s", buff);
-      va_end(arg);
-    }
-#else
-void dbg(const char *fmt, ...)
-{
-  return;
-}
-#endif
diff --git a/src/apsp_johnson/src/apsp_johnson.h b/src/apsp_johnson/src/apsp_johnson.h
deleted file mode 100644
index c5fb380..0000000
--- a/src/apsp_johnson/src/apsp_johnson.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * APSP Johnson algorithm for PostgreSQL
- *
- * Copyright (c) 2011 J Kishore Kumar
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#ifndef _APSP_JOHNSON_H
-#define _APSP_JOHNSON_H
-
-typedef struct {
-  int source;
-  int target;
-  float cost;
-} edge_apsp_johnson_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-int boost_apsp_johnson(edge_apsp_johnson_t *edges, int count,
-    edge_apsp_johnson_t **output_edges, int *output_count, char **err_msg);
-void dbg(const char *format, ...);
-#ifdef __cplusplus
-  }
-#endif
-
-#endif
diff --git a/src/apsp_johnson/src/apsp_johnson_boost_wrapper.cpp b/src/apsp_johnson/src/apsp_johnson_boost_wrapper.cpp
deleted file mode 100644
index 2979289..0000000
--- a/src/apsp_johnson/src/apsp_johnson_boost_wrapper.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * APSP Johnson algorithm for PostgreSQL
- *
- * Copyright (c) 2011 J Kishore Kumar
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include <boost/config.hpp>
-#include <boost/version.hpp>
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-
-#if BOOST_VERSION > 103900
-#include <boost/property_map/property_map.hpp>
-#else
-#include <boost/vector_property_map.hpp>
-#endif
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/johnson_all_pairs_shortest.hpp>
-
-#include "apsp_johnson.h"
-
-#include <cmath>    // for sqrt
-using namespace std;
-using namespace boost;
-
-// Maximal number of nodes in the path (to avoid infinite loops)
-#define MAX_NODES 100000000
-
-struct Edge {
-  int source;
-  int target;
-  float cost;
-};
-
-// Adds an edge to the graph.
-template<class G, class E>
-static void graph_add_edge(G &graph, int source, int target, float cost) {
-  E e;
-  bool inserted;
-
-  if (cost < 0.0f) // edges are not inserted in the graph if cost is negative
-    return;
-
-  tie(e, inserted) = add_edge(source, target, graph);
-  graph[e].source = source;
-  graph[e].target = target;
-  graph[e].cost = cost;
-}
-
-int boost_apsp_johnson(edge_apsp_johnson_t *edges, int count,
-    edge_apsp_johnson_t **output_edges, int *output_count, char **err_msg) {
-try {
-  int i, j;
-  int V;
-  bool ret;
-
-  vector<edge_apsp_johnson_t>::iterator it;
-
-  // FIXME: use a template for the directedS parameters
-  typedef adjacency_list<vecS, vecS, directedS, no_property, Edge> graph_t;
-
-  // typedef graph_traits<graph_t>::vertex_descriptor vertex_descriptor;
-  typedef graph_traits<graph_t>::edge_descriptor edge_descriptor;
-  // typedef graph_traits<graph_t>::edge_iterator edge_iterator;
-
-  graph_t graph;
-
-  for (int j = 0; j < count; ++j) {
-
-    graph_add_edge<graph_t, edge_descriptor>(graph, edges[j].source,
-        edges[j].target, edges[j].cost);
-  }
-
-  V = num_vertices(graph);
-  float **D = (float **) malloc(sizeof(float *) * V);
-  for (i = 0; i < V; i++) {
-    D[i] = (float *) malloc(sizeof(float) * V);
-  }
-
-  std::vector<float> d(V, (std::numeric_limits<float>::max)());
-
-  graph_traits<graph_t>::edge_iterator ei, eend;
-  for (tie(ei, eend) = boost::edges(graph); ei != eend; ei++) {
-    dbg("Input Edge %d -> %d cost = %f", graph[*ei].source, graph[*ei].target,
-        graph[*ei].cost);
-  }
-
-  dbg("Calling johnson_all_pairs_shortest_paths boost library function");
-  ret = johnson_all_pairs_shortest_paths(graph, D,
-      distance_map(&d[0]).weight_map(get(&Edge::cost, graph)));
-  if (ret) {
-    dbg("Johnson returned true");
-  } else {
-    dbg("Johnson returned false");
-  }
-
-  vector<edge_apsp_johnson_t> output_vector;
-
-  for (i = 0; i < V; i++) {
-    for (j = 0; j < V; j++) {
-      if (D[i][j] != std::numeric_limits<float>::max()) {
-        dbg("%d -> %d >= %f\n", i, j, D[i][j]);
-        edge_apsp_johnson_t new_edge;
-        new_edge.source = i;
-        new_edge.target = j;
-        new_edge.cost = D[i][j];
-        output_vector.push_back(new_edge);
-      }
-    }
-  }
-  // FIXME: Double copy from Matrix to Vector and Vector to Array. Optimise!
-  dbg("output_vector.size() = %d", output_vector.size());
-  *output_edges = (edge_apsp_johnson_t *) (malloc(
-      sizeof(edge_apsp_johnson_t) * output_vector.size()));
-
-  for (i = 0, it = output_vector.begin(); it < output_vector.end(); it++, i++) {
-    (*output_edges)[i] = *it;
-  }
-  *output_count = i;
-  return 0;
- }
- catch(...) {
-     *err_msg = (char *) "Unknown exception caught!";
-     return -1;
- }
-}
diff --git a/src/apsp_johnson/test/apsp_johnson-any-00.data b/src/apsp_johnson/test/apsp_johnson-any-00.data
deleted file mode 100644
index 131c8d7..0000000
--- a/src/apsp_johnson/test/apsp_johnson-any-00.data
+++ /dev/null
@@ -1,14 +0,0 @@
-drop table if exists apspj cascade;
-create table apspj (
-    id serial primary key,
-    source integer,
-    target integer,
-    cost double precision
-);
-
-insert into apspj (source, target, cost) values
-( 1000, 1001, 1.29 ),
-( 1000, 1002, 0.11 ),
-( 1002, 1003, 0.32 ),
-( 1001, 1003, 0.23 );
-
diff --git a/src/apsp_johnson/test/apsp_johnson-any-00.result b/src/apsp_johnson/test/apsp_johnson-any-00.result
deleted file mode 100644
index 76e85ac..0000000
--- a/src/apsp_johnson/test/apsp_johnson-any-00.result
+++ /dev/null
@@ -1,9 +0,0 @@
-0|1000|1000|0.00
-1|1000|1001|1.29
-2|1000|1002|0.11
-3|1000|1003|0.43
-4|1001|1001|0.00
-5|1001|1003|0.23
-6|1002|1002|0.00
-7|1002|1003|0.32
-8|1003|1003|0.00
diff --git a/src/apsp_johnson/test/apsp_johnson-any-00.test.sql b/src/apsp_johnson/test/apsp_johnson-any-00.test.sql
deleted file mode 100644
index 42faf35..0000000
--- a/src/apsp_johnson/test/apsp_johnson-any-00.test.sql
+++ /dev/null
@@ -1 +0,0 @@
-select seq, id1, id2, round(cost::numeric, 2) as cost from pgr_apspJohnson('select source, target, cost from apspj');
diff --git a/src/apsp_johnson/test/doc-apspJohnson.result b/src/apsp_johnson/test/doc-apspJohnson.result
new file mode 100644
index 0000000..baed04f
--- /dev/null
+++ b/src/apsp_johnson/test/doc-apspJohnson.result
@@ -0,0 +1,6 @@
+--q1
+NOTICE:  Deprecated function: Use pgr_johnson instead
+0|1|2|1
+1|1|5|2
+2|2|5|1
+--q2
diff --git a/src/apsp_johnson/test/doc-apspJohnson.test.sql b/src/apsp_johnson/test/doc-apspJohnson.test.sql
new file mode 100644
index 0000000..1d48764
--- /dev/null
+++ b/src/apsp_johnson/test/doc-apspJohnson.test.sql
@@ -0,0 +1,10 @@
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_apspJohnson
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+\echo --q1
+SELECT * FROM pgr_apspJohnson(
+        'SELECT source::INTEGER, target::INTEGER, cost FROM edge_table WHERE id < 5'
+    ); 
+\echo --q2
diff --git a/src/apsp_johnson/test/pgtap/apsp_johnson-any-00.test.sql b/src/apsp_johnson/test/pgtap/apsp_johnson-any-00.test.sql
new file mode 100644
index 0000000..fa218e7
--- /dev/null
+++ b/src/apsp_johnson/test/pgtap/apsp_johnson-any-00.test.sql
@@ -0,0 +1,21 @@
+\i setup.sql
+
+set client_min_messages=WARNING;
+SELECT plan(1);
+
+PREPARE q1 AS
+SELECT id1, id2, round(cost::numeric, 2) as cost
+FROM pgr_apspJohnson('select id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table');
+
+
+PREPARE q11 AS
+SELECT start_vid::INTEGER AS id1, end_vid::INTEGER AS id2, round(agg_cost::numeric, 2) as cost
+FROM pgr_johnson('select id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table', TRUE);
+
+
+SELECT set_eq('q1', 'q11','1: With directed: Compare with pgr_johnson -> must give the same results');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/apsp_johnson/test/pgtap/types-check.sql b/src/apsp_johnson/test/pgtap/types-check.sql
new file mode 100644
index 0000000..a79165b
--- /dev/null
+++ b/src/apsp_johnson/test/pgtap/types-check.sql
@@ -0,0 +1,114 @@
+
+\i setup.sql
+
+
+SELECT plan(14);
+SET client_min_messages TO WARNING;
+
+PREPARE q1 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'
+);
+
+PREPARE q2 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'
+);
+
+
+
+SELECT lives_ok('q1', 'edges query accepts INTEGER & FLOAT');
+SELECT lives_ok('q2', 'without id it works');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspJohnson(
+        ''SELECT source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'',
+         false)',
+    '42883','function pgr_apspjohnson(unknown, boolean) does not exist',
+    'directed flag fails with false');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspJohnson(
+        ''SELECT source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'',
+         true)',
+    '42883','function pgr_apspjohnson(unknown, boolean) does not exist',
+    'directed flag fails with true');
+
+
+PREPARE q10 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id::FLOAT, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'
+);
+
+PREPARE q11 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id::REAL, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'
+);
+
+SELECT lives_ok('q10', 'id is ignored FLOAT');
+SELECT lives_ok('q11', 'id is ignored REAL');
+
+
+PREPARE q12 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::FLOAT, target, cost, reverse_cost FROM edge_table'
+);
+
+PREPARE q13 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::REAL, target, cost, reverse_cost FROM edge_table'
+);
+
+SELECT throws_ok('q12', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q13', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because source is REAL');
+
+PREPARE q14 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::INTEGER, target::INTEGER::FLOAT, cost, reverse_cost FROM edge_table'
+);
+
+PREPARE q15 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::INTEGER, target::INTEGER::REAL, cost, reverse_cost FROM edge_table'
+);
+
+SELECT throws_ok('q14', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because target is FLOAT');
+SELECT throws_ok('q15', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because source is REAL');
+
+PREPARE q16 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::INTEGER, target::INTEGER, cost::SMALLINT, reverse_cost FROM edge_table'
+);
+
+PREPARE q17 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost FROM edge_table'
+);
+
+PREPARE q18 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::INTEGER, target::INTEGER, cost::BIGINT, reverse_cost FROM edge_table'
+);
+
+PREPARE q19 AS
+SELECT * FROM pgr_apspJohnson(
+    'SELECT id, source::INTEGER, target::INTEGER, cost::REAL, reverse_cost FROM edge_table'
+);
+
+
+
+SELECT throws_ok('q16', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because cost is SMALLINT');
+SELECT throws_ok('q17', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because cost is INTEGER');
+SELECT throws_ok('q18', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because cost is BIGINT');
+SELECT throws_ok('q19', 'XX000', 'Support for source,target columns only of type: integer. Support for Cost: double precision',
+    'Throws because cost is REAL');
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/apsp_johnson/test/pgtap/v2-v3-equivalence.test.sql b/src/apsp_johnson/test/pgtap/v2-v3-equivalence.test.sql
new file mode 100644
index 0000000..25f38c7
--- /dev/null
+++ b/src/apsp_johnson/test/pgtap/v2-v3-equivalence.test.sql
@@ -0,0 +1,143 @@
+\i setup.sql
+set client_min_messages=WARNING;
+
+
+SELECT plan(15);
+
+
+-- all values must be >= 0
+PREPARE q1 AS
+SELECT *
+FROM pgr_apspjohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'
+) WHERE cost < 0;
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_apspjohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id'
+) WHERE cost < 0;
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_apspjohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, -1::float as reverse_cost FROM edge_table ORDER BY id'
+) WHERE cost < 0;
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_apspjohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, -1::float as cost, reverse_cost FROM edge_table ORDER BY id'
+) WHERE cost < 0;
+
+
+SELECT is_empty('q1', '1: All values are positive');
+SELECT is_empty('q2', '2: All values are positive');
+SELECT is_empty('q3', '3: All values are positive');
+SELECT is_empty('q4', '4: All values are positiv: All values are positivee');
+
+PREPARE q10 AS
+SELECT id1, id2, cost 
+FROM pgr_apspjohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id'
+);
+
+PREPARE q11 AS
+SELECT id1, id2, cost 
+FROM pgr_apspjohnson(
+    'SELECT id, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q11', '5: Results of with reverse_cost must be equal because documentation says it does not receive reverse_cost');
+
+PREPARE q20 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
+);
+
+PREPARE q21 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
+);
+
+SELECT set_eq('q10', 'q20','6: With Out reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+SELECT set_ne('q11', 'q21','7: With reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give different results (pgr_apspJohnson only works without reverse_cost');
+
+
+PREPARE q30 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_johnson(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    TRUE
+);
+
+PREPARE q31 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_johnson(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q30','8: With Out reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+SELECT set_ne('q11', 'q31','9: With reverse_cost: Compare with (directed) pgr_johnson -> must give different results (pgr_apspJohnson only works without reverse_cost');
+
+
+PREPARE q40 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    TRUE
+);
+
+PREPARE q41 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q40','10: With Out reverse_cost: Compare with (directed) pgr_floydWarshall -> must give the same results');
+SELECT set_ne('q11', 'q41','11: With reverse_cost: Compare with (directed) pgr_floydWarshall ->  must give different results (pgr_apspJohnson only works without reverse_cost');
+
+PREPARE q50 AS
+SELECT  id1, id2, cost
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id',
+    TRUE, FALSE
+);
+
+PREPARE q51 AS
+SELECT  id1, id2, cost
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE, TRUE
+);
+
+SELECT set_eq('q10', 'q50','12: With Out reverse_cost: Compare with (directed) pgr_apspWarshall -> must give the same results');
+SELECT set_ne('q11', 'q51','13: With reverse_cost: Compare with (directed) pgr_apspWarshall -> must give different results (pgr_apspJohnson only works without reverse_cost');
+
+-- errors:
+
+-- no flags
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspJohnson(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE
+    )','42883','function pgr_apspjohnson(unknown, boolean) does not exist',
+    '14: Documentation says it does not have a Directed flag');
+
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspJohnson(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE, TRUE
+    )','42883','function pgr_apspjohnson(unknown, boolean, boolean) does not exist',
+    '14: Documentation says it does not have a Directed & has_rcost flags');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/apsp_johnson/test/test.conf b/src/apsp_johnson/test/test.conf
index f74aa03..ae455cc 100644
--- a/src/apsp_johnson/test/test.conf
+++ b/src/apsp_johnson/test/test.conf
@@ -3,8 +3,15 @@
 %main::tests = (
     'any' => {
         'comment' => 'APSP Johnson test for any versions.',
-        'data' => ['apsp_johnson-any-00.data'],
-        'tests' => [qw(apsp_johnson-any-00)]
+        'data' => [],
+        'tests' => [qw(
+            doc-apspJohnson
+            )],
+        'documentation' => [qw(
+            doc-apspJohnson
+            )],
+
+
         },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/apsp_warshall/CMakeLists.txt b/src/apsp_warshall/CMakeLists.txt
deleted file mode 100644
index aeff731..0000000
--- a/src/apsp_warshall/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-SET(PACKAGE_SQL_FILES "")
-ADD_SUBDIRECTORY(sql)
-SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
-#MESSAGE("core/apsp_warshall: ${PACKAGE_SQL_FILES}")
-SUBDIRS(doc src test)
diff --git a/src/apsp_warshall/doc/doc-apspWarshall.queries b/src/apsp_warshall/doc/doc-apspWarshall.queries
new file mode 100644
index 0000000..981e712
--- /dev/null
+++ b/src/apsp_warshall/doc/doc-apspWarshall.queries
@@ -0,0 +1,17 @@
+--q1
+SELECT * FROM pgr_apspWarshall(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table WHERE id < 5',
+        false, false
+    );
+NOTICE:  Deprecated function: Use pgr_floydWarshall instead
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   1 |   2 |    1
+   1 |   1 |   5 |    2
+   2 |   2 |   1 |    1
+   3 |   2 |   5 |    1
+   4 |   5 |   1 |    2
+   5 |   5 |   2 |    1
+(6 rows)
+
+--q2
diff --git a/src/apsp_warshall/doc/index.rst b/src/apsp_warshall/doc/index.rst
deleted file mode 100644
index 92a1f9b..0000000
--- a/src/apsp_warshall/doc/index.rst
+++ /dev/null
@@ -1,92 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_apsp_warshall:
-
-pgr_apspWarshall - All Pairs Shortest Path, Floyd-Warshall Algorithm
-===============================================================================
-
-.. index::
-    single: pgr_apspWarshall(text, boolean, boolean)
-    module: apsp
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_apspWarshall`` - Returns all costs for each pair of nodes in the graph.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The Floyd-Warshall algorithm (also known as Floyd's algorithm and other names) is a graph analysis algorithm for finding the shortest paths between all pairs of nodes in a weighted graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows for every pair of nodes in the graph.
-
-.. code-block:: sql
-
-    pgr_costResult[] pgr_apspWarshall(sql text, directed boolean, reverse_cost boolean);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query that should return the edges for the graph that will be analyzed:
-
-    .. code-block:: sql
-
-        SELECT id, source, target, cost FROM edge_table;
-
-    :id: ``int4`` identifier of the edge
-    :source: ``int4`` identifier of the source vertex for this edge
-    :target: ``int4`` identifier of the target vertex for this edge
-    :cost: ``float8`` a positive value for the cost to traverse this edge
-
-:directed: ``true`` if the graph is directed
-:reverse_cost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   source node ID
-:id2:   target node ID
-:cost:  cost to traverse from ``id1`` to ``id2``
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS from, id2 AS to, cost 
-        FROM pgr_apspWarshall(
-            'SELECT id, source, target, cost FROM edge_table',
-            false, false
-        );
-
-     seq | from | to | cost 
-    -----+------+----+------
-       0 |    1 |  1 |    0
-       1 |    1 |  2 |    1
-       2 |    1 |  3 |    0
-       3 |    1 |  4 |   -1
-    [...]
-
-The query uses the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* :ref:`pgr_apsp_johnson`
-* http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
diff --git a/src/apsp_warshall/doc/pgr_apspWarshall.rst b/src/apsp_warshall/doc/pgr_apspWarshall.rst
new file mode 100644
index 0000000..a0c2ea5
--- /dev/null
+++ b/src/apsp_warshall/doc/pgr_apspWarshall.rst
@@ -0,0 +1,85 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_apsp_warshall:
+
+pgr_apspWarshall
+===============================================================================
+
+.. index::
+    single: pgr_apspWarshall(text, boolean, boolean) -- deprecated
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_apspWarshall`` - Returns all costs for each pair of nodes in the graph.
+
+.. warning:: This function is deprecated in version 2.2
+             Use :ref:`pgr_floydWarshall` instead
+
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The Floyd-Warshall algorithm (also known as Floyd's algorithm and other names) is a graph analysis algorithm for finding the shortest paths between all pairs of nodes in a weighted graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows for every pair of nodes in the graph.
+
+.. code-block:: sql
+
+    pgr_costResult[] pgr_apspWarshall(sql text, directed boolean, reverse_cost boolean);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query that should return the edges for the graph that will be analyzed:
+
+    .. code-block:: sql
+
+        SELECT id, source, target, cost FROM edge_table;
+
+    :id: ``int4`` identifier of the edge
+    :source: ``int4`` identifier of the source vertex for this edge
+    :target: ``int4`` identifier of the target vertex for this edge
+    :cost: ``float8`` a positive value for the cost to traverse this edge
+    :reverse_cost: ``float8`` (optional) a positive value for the reverse cost to traverse this edge
+
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   source node ID
+:id2:   target node ID
+:cost:  cost to traverse from ``id1`` to ``id2``
+
+
+.. rubric:: History
+
+* Deprecated in version 2.0.0
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+.. literalinclude:: doc-apspWarshall.queries
+   :start-after: --q1
+   :end-before: --q2
+
+The query uses the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* :ref:`pgr_floydWarshall`
+* http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
diff --git a/src/apsp_warshall/sql/CMakeLists.txt b/src/apsp_warshall/sql/CMakeLists.txt
index c9ac3b2..c1f52f5 100644
--- a/src/apsp_warshall/sql/CMakeLists.txt
+++ b/src/apsp_warshall/sql/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/apsp_warshall.sql
-)
+    ${CMAKE_CURRENT_SOURCE_DIR}/apsp_warshall_v2.2.sql
+    )
 
 # set in parent scope
 SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/apsp_warshall/sql/apsp_warshall.sql b/src/apsp_warshall/sql/apsp_warshall.sql
deleted file mode 100644
index bbe3886..0000000
--- a/src/apsp_warshall/sql/apsp_warshall.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-CREATE OR REPLACE FUNCTION pgr_apspWarshall(sql text, directed boolean, has_reverse_cost boolean)
-    RETURNS SETOF pgr_costResult
-    AS '$libdir/librouting-2.1', 'apsp_warshall'
-    LANGUAGE 'c' IMMUTABLE STRICT;
diff --git a/src/apsp_warshall/sql/apsp_warshall_v2.2.sql b/src/apsp_warshall/sql/apsp_warshall_v2.2.sql
new file mode 100644
index 0000000..740ffd8
--- /dev/null
+++ b/src/apsp_warshall/sql/apsp_warshall_v2.2.sql
@@ -0,0 +1,56 @@
+/*PGR-GNU*****************************************************************
+
+File: apsp_warshall.sql
+
+Template:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function developer:
+Copyright (c) 2013 Vicky Vergara
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+CREATE OR REPLACE FUNCTION pgr_apspWarshall(edges_sql text, directed boolean, has_rcost boolean)
+    RETURNS SETOF pgr_costResult AS
+  $BODY$
+  DECLARE
+  has_reverse boolean;
+  sql TEXT;
+  BEGIN
+      RAISE NOTICE 'Deprecated function: Use pgr_floydWarshall instead';
+      has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);
+      sql := edges_sql;
+      IF (has_reverse != has_rcost) THEN
+         IF (has_reverse) THEN
+           sql = 'SELECT id, source, target, cost FROM (' || edges_sql || ') a';
+         ELSE raise EXCEPTION 'has_rcost set to true but reverse_cost not found';
+         END IF;
+      END IF;
+
+      RETURN query
+         SELECT (row_number() over () -1)::integer as seq, start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+         FROM  pgr_floydWarshall(sql, directed);
+  END
+  $BODY$
+  LANGUAGE plpgsql VOLATILE
+  COST 100
+  ROWS 1000;
+
diff --git a/src/apsp_warshall/src/CMakeLists.txt b/src/apsp_warshall/src/CMakeLists.txt
deleted file mode 100644
index 80fee0d..0000000
--- a/src/apsp_warshall/src/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# FIXME: The following patch is required by apsp_johnson_boost_wrapper.cpp.
-# With -fdelete-null-pointer-checks optimization, the assignments
-# to Edge bundled properties doesn't occur.
-#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")
-
-ADD_LIBRARY(apsp_warshall OBJECT apsp.c apsp_boost_wrapper.cpp)
diff --git a/src/apsp_warshall/src/apsp.c b/src/apsp_warshall/src/apsp.c
deleted file mode 100644
index f57d5c8..0000000
--- a/src/apsp_warshall/src/apsp.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * All pairs shortest path - Warshall's algorithm
- *
- * Copyright (c) 2011 Jay Mahadeokar
- *
- * This code was integrated into the pgRoutimg tree 2012 by
- * Stephen Woodbridge from:
- * https://github.com/jay-mahadeokar/pgrouting
- *
- */
-
-
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-//#include <set>
-
-#include "fmgr.h"
-
-#include "apsp.h"   
-
-//using namespace std;
-
-Datum apsp_warshall(PG_FUNCTION_ARGS);
-
-#undef DEBUG
-//#define DEBUG 1
-
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-
-
-// The number of tuples to fetch from the SPI cursor at each iteration
-#define TUPLIMIT 1000
-
-#ifdef PG_MODULE_MAGIC
-//PG_MODULE_MAGIC;
-#endif
-
-static char *
-text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-static int
-finish(int code, int ret)
-{
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH )
-  {
-    elog(ERROR,"couldn't disconnect from SPI");
-    return -1 ;
-  }			
-  return ret;
-}
-			  
-typedef struct edge_columns 
-{
-  int id;
-  int source;
-  int target;
-  float8 cost;
-  float8 reverse_cost;
-} edge_columns_t;
-
-
-//This probably fetches the edge columns from SPITuple table into the edgeColumns
-
-static int
-fetch_edge_columns(SPITupleTable *tuptable, edge_columns_t *edge_columns, 
-                   bool has_reverse_cost)
-{
-  edge_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
-  edge_columns->source = SPI_fnumber(SPI_tuptable->tupdesc, "source");
-  edge_columns->target = SPI_fnumber(SPI_tuptable->tupdesc, "target");
-  edge_columns->cost = SPI_fnumber(SPI_tuptable->tupdesc, "cost");
-  if (edge_columns->id == SPI_ERROR_NOATTRIBUTE ||
-      edge_columns->source == SPI_ERROR_NOATTRIBUTE ||
-      edge_columns->target == SPI_ERROR_NOATTRIBUTE ||
-      edge_columns->cost == SPI_ERROR_NOATTRIBUTE) 
-    {
-      elog(ERROR, "Error, query must return columns "
-           "'id', 'source', 'target' and 'cost'");
-      return -1;
-    }
-
-  if (SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->source) != INT4OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->target) != INT4OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->cost) != FLOAT8OID) 
-    {
-      elog(ERROR, "Error, columns 'source', 'target' must be of type int4, 'cost' must be of type float8");
-      return -1;
-    }
-
-  DBG("columns: id %i source %i target %i cost %i", edge_columns->id, edge_columns->source, edge_columns->target, edge_columns->cost);
-
-  if (has_reverse_cost)
-    {
-      edge_columns->reverse_cost = SPI_fnumber(SPI_tuptable->tupdesc, 
-                                               "reverse_cost");
-
-      if (edge_columns->reverse_cost == SPI_ERROR_NOATTRIBUTE) 
-        {
-          elog(ERROR, "Error, reverse_cost is used, but query did't return "
-               "'reverse_cost' column");
-          return -1;
-        }
-
-      if (SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->reverse_cost) 
-          != FLOAT8OID) 
-        {
-          elog(ERROR, "Error, columns 'reverse_cost' must be of type float8");
-          return -1;
-        }
-
-      DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
-    }
-    
-  return 0;
-}
-
-static void
-fetch_edge(HeapTuple *tuple, TupleDesc *tupdesc, 
-           edge_columns_t *edge_columns, edge_t *target_edge)
-{
-  Datum binval;
-  bool isnull;
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->id, &isnull);
-  if (isnull)
-    elog(ERROR, "id contains a null value");
-  target_edge->id = DatumGetInt32(binval);
-  
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->source, &isnull);
-  if (isnull)
-    elog(ERROR, "source contains a null value");
-  target_edge->source = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->target, &isnull);
-  if (isnull)
-    elog(ERROR, "target contains a null value");
-  target_edge->target = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->cost, &isnull);
-  if (isnull)
-    elog(ERROR, "cost contains a null value");
-  target_edge->cost = DatumGetFloat8(binval);
-
-  if (edge_columns->reverse_cost != -1) 
-    {
-      binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->reverse_cost, 
-                             &isnull);
-      if (isnull)
-        elog(ERROR, "reverse_cost contains a null value");
-      target_edge->reverse_cost =  DatumGetFloat8(binval);
-    }
-    //DBG("Fetched Edge.  id: %d \tsource: %i\ttarget: %f\tcost: %i",target_edge->id,target_edge->source,target_edge->target,target_edge->cost);
-}
-
-
-
-static int compute_apsp_warshall(char* sql, bool directed, 
-                                 bool has_reverse_cost, 
-                                 apsp_element_t **pair, int *pair_count) 
-{
-  // int i;
-  int SPIcode;
-  void *SPIplan;
-  Portal SPIportal;
-  bool moredata = TRUE;
-  int ntuples;
-  edge_t *edges = NULL;
-  int total_tuples = 0;
-  edge_columns_t edge_columns = {.id= -1, .source= -1, .target= -1, 
-                                 .cost= -1, .reverse_cost= -1};
-  // int v_max_id=0;
-  // int v_min_id=INT_MAX;
-
-  // int s_count = 0;
-  // int t_count = 0;
-
-  char *err_msg;
-  int ret = -1;
-  // register int z;
-
-//  set<int> vertices;
-  
-  DBG("start compute_apsp_warshall\n");
-        
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT)
-    {
-      elog(ERROR, "compute_apsp_warshall: couldn't open a connection to SPI");
-      return -1;
-    }
-
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL)
-    {
-      elog(ERROR, "compute_apsp_warshall: couldn't create query plan via SPI");
-      return -1;
-    }
-
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) 
-    {
-      elog(ERROR, "compute_apsp_warshall: SPI_cursor_open('%s') returns NULL", sql);
-      return -1;
-    }
-
-  while (moredata == TRUE)
-    {
-      SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-      if (edge_columns.id == -1) 
-        {
-          if (fetch_edge_columns(SPI_tuptable, &edge_columns, 
-                                 has_reverse_cost) == -1)
-	    return finish(SPIcode, ret);
-        }
-
-      ntuples = SPI_processed;
-      total_tuples += ntuples;
-      if (!edges)
-        edges = palloc(total_tuples * sizeof(edge_t));
-      else
-        edges = repalloc(edges, total_tuples * sizeof(edge_t));
-
-      if (edges == NULL) 
-        {
-          elog(ERROR, "Out of memory");
-	    return finish(SPIcode, ret);	  
-        }
-
-      DBG("Number of tuples fetched: %i",ntuples);
-      
-      if (ntuples > 0) 
-        {
-          int t;
-          SPITupleTable *tuptable = SPI_tuptable;
-          TupleDesc tupdesc = SPI_tuptable->tupdesc;
-                
-          for (t = 0; t < ntuples; t++) 
-            {
-              HeapTuple tuple = tuptable->vals[t];
-              fetch_edge(&tuple, &tupdesc, &edge_columns, 
-                         &edges[total_tuples - ntuples + t]);
-//	      vertices.insert(edges[total_tuples - ntuples + t].source);
-//	      vertices.insert(edges[total_tuples - ntuples + t].target);
-            }
-          SPI_freetuptable(tuptable);
-        } 
-      else 
-        {
-          moredata = FALSE;
-        }
-    }
-    
-#ifdef DEBUG
-      
-      
-          
-          for (i = 0; i < total_tuples; i++) 
-            {
-              DBG("Step %i src_vertex_id  %i ", i, edges[i].source);
-              DBG("        dest_vertex_id    %i ", edges[i].target);
-              DBG("        cost       %f ", edges[i].cost);
-            }
-      
-#endif
-    
-
-  DBG("Calling boost_apsp\n");
-        
-  //start_vertex -= v_min_id;
-  //end_vertex   -= v_min_id;
-
-  ret = boost_apsp(edges, total_tuples, 0,                        //vertices.size()
-                       directed, has_reverse_cost,
-                       pair, pair_count, &err_msg);
-  DBG("Boost message: \n%s",err_msg);
-  DBG("SIZE %i\n",*pair_count);
-
-/*  //::::::::::::::::::::::::::::::::
-  //:: restoring original vertex id
-  //::::::::::::::::::::::::::::::::
-  for(z=0;z<*path_count;z++)
-  {
-    //DBG("vetex %i\n",(*path)[z].vertex_id);
-    (*path)[z].vertex_id+=v_min_id;
-  }
-
-  DBG("ret = %i\n", ret);
-
-  DBG("*path_count = %i\n", *path_count);
-
-  DBG("ret = %i\n", ret);
-  */
-  if (ret < 0)
-    {
-      //elog(ERROR, "Error computing path: %s", err_msg);
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), 
-        errmsg("Error computing path: %s", err_msg)));
-    } 
-    
-  return finish(SPIcode, ret);
-}
-
-
-PG_FUNCTION_INFO_V1(apsp_warshall);
-Datum
-apsp_warshall(PG_FUNCTION_ARGS)
-{
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  apsp_element_t      *pair;                         
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL())
-    {
-      MemoryContext   oldcontext;
-      int pair_count = 0;  
-#ifdef DEBUG
-      int ret;
-#endif
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-
-#ifdef DEBUG
-      ret =
-#endif
-       compute_apsp_warshall(text2char(PG_GETARG_TEXT_P(0)),
-                                  PG_GETARG_BOOL(1),
-                                  PG_GETARG_BOOL(2), &pair, &pair_count);                  
-#ifdef DEBUG
-      DBG("Ret is %i", ret);
-      if (ret >= 0) 
-        {
-          int i;
-          for (i = 0; i < pair_count; i++) 
-            {
-              DBG("Step: %i, source_id: %i, target_id: %i, cost: %f ", i, pair[i].src_vertex_id, pair[i].dest_vertex_id, pair[i].cost);
-            }
-        }
-#endif
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = pair_count;
-      funcctx->user_fctx = pair;
-
-      funcctx->tuple_desc = 
-        BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
-
-      MemoryContextSwitchTo(oldcontext);
-    }
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  pair = (apsp_element_t*) funcctx->user_fctx;
-
-  if (call_cntr < max_calls)    /* do when there is more left to send */
-    {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one    
- 
-      values = palloc(4 * sizeof(Datum));
-      nulls = palloc(4 * sizeof(char));
-  
-      values[0] = call_cntr;
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(path[call_cntr].vertex_id);
-      nulls[1] = ' ';
-      values[2] = Int32GetDatum(path[call_cntr].edge_id);
-      nulls[2] = ' ';
-      values[3] = Float8GetDatum(path[call_cntr].cost);
-      nulls[3] = ' ';
-      */
-    
-      values = palloc(4 * sizeof(Datum));
-      nulls = palloc(4 * sizeof(char));
-
-      values[0] = Int32GetDatum(call_cntr);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(pair[call_cntr].src_vertex_id);
-      nulls[1] = ' ';
-      values[2] = Int32GetDatum(pair[call_cntr].dest_vertex_id);
-      nulls[2] = ' ';
-      values[3] = Float8GetDatum(pair[call_cntr].cost);
-      nulls[3] = ' ';
-		      
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-    }
-  else    /* do when there is no more left */
-    {
-      SRF_RETURN_DONE(funcctx);
-    }
-}
-
diff --git a/src/apsp_warshall/src/apsp.h b/src/apsp_warshall/src/apsp.h
deleted file mode 100644
index d3c1b14..0000000
--- a/src/apsp_warshall/src/apsp.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Shortest path algorithm for PostgreSQL
- *
- * Copyright (c) 2005 Sylvain Pasche
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
-rm ap * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
- 
-#ifndef _APSP_H
-#define _APSP_H
-
-#include "postgres.h"
-
-typedef struct edge 
-{
-    int id;
-    int source;
-    int target;
-    float8 cost;
-    float8 reverse_cost;
-} edge_t;
-
-typedef struct apsp_element 
-{
-    int src_vertex_id;
-    int dest_vertex_id;
-    float8 cost;
-    
-} apsp_element_t;
-
-//TODO modify
-#ifdef __cplusplus
-extern "C"
-#endif
-int 
-boost_apsp(edge_t *edges, unsigned int edge_count, const int node_count,
-	       bool directed, bool has_reverse_cost,
-	       apsp_element_t **pair, int *pair_count, char **err_msg);
-
-#endif
diff --git a/src/apsp_warshall/src/apsp_boost_wrapper.cpp b/src/apsp_warshall/src/apsp_boost_wrapper.cpp
deleted file mode 100644
index 246c8e5..0000000
--- a/src/apsp_warshall/src/apsp_boost_wrapper.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Shortest path algorithm for PostgreSQL
- *
- * Copyright (c) 2005 Sylvain Pasche
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include <boost/lexical_cast.hpp>
-#include <boost/config.hpp>
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-
-//#include <iostream>
-//#include <fstream>
-
-#include <boost/graph/graph_traits.hpp>
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/floyd_warshall_shortest.hpp>
-//#include <boost/graph/johnson_all_pairs_shortest_paths.hpp>
-
-#include "string"
-#include "apsp.h"
-#include "set"
-#include "map"
-using namespace std;
-using namespace boost;
-
-/*
-//    FIXME: use this to avoid heap allocation ?
-
-void* operator new(size_t size)
-{
-return palloc(size);
-}
-
-void operator delete(void *p)
-{
-    pfree(p);
-}
-
-*/
-
-
-typedef adjacency_list<vecS, vecS, directedS, no_property,property<edge_weight_t, float, property<edge_weight2_t, float> > > Graph;
-
-int 
-boost_apsp(edge_t *edges,
-            unsigned int edge_count,
-            const int node_cnt,   //TODO deal with this later - node_count
-            bool directed,
-            bool has_reverse_cost, //TODO this is not implemented
-            apsp_element_t **pair,
-            int *pair_count,
-            char **err_msg)
-{
-try {
-    string msg;
-    msg.append("\nStarting with boost_apsp");
-    msg.append("\nEdge count is: ");
-    msg.append(boost::lexical_cast<std::string>(edge_count));
-
-    set<int> vertices;
-    typedef std::pair<int,int> Edge;
-    map<int,int> vertex_map;
-    map<int,int> echo_map;
-    int map_counter = 0;
-
-    //cout<<edge_count;
-    Edge *edge_array = (Edge *) malloc(sizeof(Edge) * (edge_count));   
-    float *weights = (float*) malloc(sizeof(float) * (edge_count));
-
-
-    for(unsigned int i=0;i<edge_count;i++)
-    {
-        weights[i] = edges[i].cost;
-        vertices.insert(edges[i].source);
-        vertices.insert(edges[i].target);
-
-        if(vertex_map.find(edges[i].source) == vertex_map.end())
-        {
-          vertex_map[edges[i].source] = map_counter;
-          echo_map[map_counter++] = edges[i].source;
-        }
-        if(vertex_map.find(edges[i].target) == vertex_map.end())
-        {
-          vertex_map[edges[i].target] = map_counter;
-          echo_map[map_counter++] = edges[i].target;
-        }
-
-        edge_array[i].first = vertex_map.find(edges[i].source)->second;
-        edge_array[i].second = vertex_map.find(edges[i].target)->second;
-
-    }
-
-    msg.append("\nPopulated edge_array and vertices");
-    //*err_msg = (char*)msg.c_str();
-    /*for(int i=0;i<edge_count;i++)
-    {
-        cout<<edge_array[i].first<<" "<<edge_array[i].second<<"\t";
-        cout<<weights[i]<<endl;
-    }*/
-    int node_count = vertices.size();
-
-    msg.append("\nNode_Count is: ");
-    msg.append(boost::lexical_cast<std::string>(node_count));
-
-
-    Graph g(edge_array, edge_array + edge_count, weights, node_count);
-
-    std::vector<float> d(node_count, std::numeric_limits<float>::max());
-    float ** D = (float**) malloc(sizeof(float*) * node_count);
-
-    for(int i = 0; i < node_count; i++)
-        {
-        D[i] = (float*)malloc(node_count * sizeof(float));
-        //D[i] = (double*)malloc(node_count * sizeof(double));
-        if(D[i] == NULL)
-            {
-            //fprintf(stderr, "out of memory\n");
-            msg.append("\nout of memory");
-            //*err_msg = (char*)msg.c_str();
-            //*err_msg = (char*) "out of memory";
-
-            // TODO: free memory cause this is a huge leak
-            return -1;
-            }
-        }
-
-
-    msg.append("\nNow calling actual boost function");
-
-    floyd_warshall_all_pairs_shortest_paths(g, D, distance_map(&d[0]));
-
-    //msg.append("\nactual boost function call successfull");
-    //*err_msg = (char*)msg.c_str();
-
-    /*for(int i=0;i<node_count;i++) {
-        for(int j=0;j<node_count;j++) {
-            std::cout<<D[i][j]<<" ";
-        }
-        std::cout<<std::endl;
-    } */
-
-    *pair = (apsp_element_t *) malloc(sizeof(apsp_element_t) * (node_count*node_count));
-    //pair_count = (int*)malloc(sizeof(int));
-    *pair_count = 0;
-
-    graph_traits<Graph>::vertex_iterator vi1, vi_end1, vi2, vi_end2;
-
-    tie(vi1,vi_end1)= boost::vertices(g);
-
-    for(int i = 0; vi1 != vi_end1; vi1++,i++)
-    {
-
-        tie(vi2,vi_end2) = boost::vertices(g);
-        for(int j = 0; vi2 != vi_end2; vi2++,j++)
-        {
-            // *SEW* added the follow if to skip over these values
-            if (D[i][j] == std::numeric_limits<float>::max()) continue;
-
-            (*pair)[*pair_count].src_vertex_id = echo_map.find(*vi1)->second;
-            (*pair)[*pair_count].dest_vertex_id = echo_map.find(*vi2)->second;
-
-            (*pair)[*pair_count].cost = (float8) D[i][j];
-            (*pair_count)++;
-            //cout<<" "<<(*pair_count);
-        }
-    }
-    //cout<<"Number of pairs: "<<(*pair_count)<<endl;
-
-    return EXIT_SUCCESS;
-  }
-  catch(...) {
-     *err_msg = (char *) "Unknown exception caught!";
-     return -1;
-  }
-}
-
-#if 0
-/*
-void static_warshall()
-{
-
-      const int V = 6;
-    const int E = 4;
-    typedef std::pair<int,int> Edge;
-
-    */
-    /*Edge edge_array[ ] =
-    { Edge(169,153), Edge(171,172), Edge(171,176), Edge(169,1469)};
-
-    //float weights[] = { 2034374301,215378334,506308873,186331927};
-    float weights[] = { 20,21,50,18};*/
-
-    /*Edge edge_array[ ] =
-    { Edge(0,1), Edge(0,2), Edge(0,3), Edge(0,4), Edge(0,5),
-    Edge(1,2), Edge(1,5), Edge(1,3), Edge(2,4), Edge(2,5),
-    Edge(3,2), Edge(4,3), Edge(4,1), Edge(5,4) };
-
-
-    const int E = sizeof (edge_array)/sizeof (Edge);
-    cout<<"Number of edges = "<<E<<endl;
-    int weights[] = { 0, 0, 0, 0, 0, 3, -4, 8, 1, 7, 4, -5, 2, 6 };    */
-/*
-    Edge edge_array[ ] =
-    { Edge(0,3), Edge(1,2), Edge(1,4), Edge(0,5)};
-
-
-
-    cout<<"Number of edges = "<<E<<endl;
-    int weights[] = { 20,21,50,18 };    
-
-
-    Graph g(edge_array, edge_array + E, weights, V);
-
-    std::vector<int> d(V, std::numeric_limits<int>::max());
-    int ** D = (int**) malloc(sizeof(int*) * V);
-
-    for(int i = 0; i < V; i++)
-        {
-        D[i] = (int*)malloc(V * sizeof(int));
-        if(D[i] == NULL)
-            {
-            fprintf(stderr, "out of memory\n");
-            return ;
-            }
-        }
-
-
-
-    floyd_warshall_all_pairs_shortest_paths(g, D, distance_map(&d[0]));
-//    johnsons_all_pairs_shortest_paths(g,D,distance_map(&d[0]));
-
-    for(int i=0;i<V;i++)
-    {
-        for(int j=0;j<V;j++)
-        {
-            std::cout<<D[i][j]<<" ";
-
-        }
-        std::cout<<std::endl;
-    } 
-}
-*/
-/*
-int main()
-{
-  static_warshall();
-    typedef std::pair<int,int> Edge;
-    unsigned int edge_count = 4;
-    edge_t *edges = (edge_t*) malloc(sizeof(edge_t)*edge_count);
-    Edge edge_array[ ] =
-    { Edge(0,1), Edge(0,2), Edge(0,3), Edge(0,4), Edge(0,5),
-    Edge(1,2), Edge(1,5), Edge(1,3), Edge(2,4), Edge(2,5),
-    Edge(3,2), Edge(4,3), Edge(4,1), Edge(5,4) };
-
-    float weights[] = { 0, 0, 0, 0, 0, 3, -4, 8, 1, 7, 4, -5, 2, 6 };    */
-  /*  Edge edge_array[ ] =
-    { Edge(169,153), Edge(171,172), Edge(171,176), Edge(169,1469)};
-
-    //float weights[] = { 2034374301,215378334,506308873,186331927};
-    float weights[] = { 20,21,50,18};
-    for(int i=0;i<edge_count;i++)
-    {
-    edges[i].source = edge_array[i].first;
-    edges[i].target = edge_array[i].second;
-    edges[i].cost = weights[i];
-    }
-
-
-    unsigned int num_nodes = 6;
-    apsp_element_t **pair;
-    int pair_count;
-    char **err_msg;
-    bool directed;
-    bool has_reverse_cost;
-
-    //static_warshall();
-
-    boost_apsp(edges, edge_count,0,//num_nodes,
-           directed, has_reverse_cost,
-           pair, &pair_count, err_msg);
-
-    cout<<endl<<endl;
-
-    cout<<"pairs: "<< (pair_count)<<endl;
-    for(int i=0;i<pair_count;i++)
-    {
-    cout<<(*pair)[i].src_vertex_id<<" "<<(*pair)[i].dest_vertex_id<<" "<<(*pair)[i].cost;
-    cout<<endl;
-
-    }
-    return 1;
-}*/
-#endif
diff --git a/src/apsp_warshall/test/apsp_warshall-any-00.data b/src/apsp_warshall/test/apsp_warshall-any-00.data
deleted file mode 100644
index 9a2f050..0000000
--- a/src/apsp_warshall/test/apsp_warshall-any-00.data
+++ /dev/null
@@ -1,14 +0,0 @@
-drop table if exists apspw cascade;
-create table apspw (
-    id serial primary key,
-    source integer,
-    target integer,
-    cost double precision
-);
-
-insert into apspw (source, target, cost) values
-( 1000, 1001, 1.29 ),
-( 1000, 1002, 0.11 ),
-( 1002, 1003, 0.32 ),
-( 1001, 1003, 0.23 );
-
diff --git a/src/apsp_warshall/test/apsp_warshall-any-00.result b/src/apsp_warshall/test/apsp_warshall-any-00.result
deleted file mode 100644
index 76e85ac..0000000
--- a/src/apsp_warshall/test/apsp_warshall-any-00.result
+++ /dev/null
@@ -1,9 +0,0 @@
-0|1000|1000|0.00
-1|1000|1001|1.29
-2|1000|1002|0.11
-3|1000|1003|0.43
-4|1001|1001|0.00
-5|1001|1003|0.23
-6|1002|1002|0.00
-7|1002|1003|0.32
-8|1003|1003|0.00
diff --git a/src/apsp_warshall/test/apsp_warshall-any-00.test.sql b/src/apsp_warshall/test/apsp_warshall-any-00.test.sql
deleted file mode 100644
index 0263860..0000000
--- a/src/apsp_warshall/test/apsp_warshall-any-00.test.sql
+++ /dev/null
@@ -1 +0,0 @@
-select seq, id1, id2, round(cost::numeric, 2) as cost from pgr_apspWarshall('select id, source, target, cost from apspw', false, false);
diff --git a/src/apsp_warshall/test/doc-apspWarshall.result b/src/apsp_warshall/test/doc-apspWarshall.result
new file mode 100644
index 0000000..ef25591
--- /dev/null
+++ b/src/apsp_warshall/test/doc-apspWarshall.result
@@ -0,0 +1,9 @@
+--q1
+NOTICE:  Deprecated function: Use pgr_floydWarshall instead
+0|1|2|1
+1|1|5|2
+2|2|1|1
+3|2|5|1
+4|5|1|2
+5|5|2|1
+--q2
diff --git a/src/apsp_warshall/test/doc-apspWarshall.test.sql b/src/apsp_warshall/test/doc-apspWarshall.test.sql
new file mode 100644
index 0000000..892e55f
--- /dev/null
+++ b/src/apsp_warshall/test/doc-apspWarshall.test.sql
@@ -0,0 +1,12 @@
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_apspWarshall
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+\echo --q1
+SELECT * FROM pgr_apspWarshall(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table WHERE id < 5',
+        false, false
+    );
+
+\echo --q2
diff --git a/src/apsp_warshall/test/pgtap/apsp_warshall-any-00.test.sql b/src/apsp_warshall/test/pgtap/apsp_warshall-any-00.test.sql
new file mode 100644
index 0000000..a7a7bda
--- /dev/null
+++ b/src/apsp_warshall/test/pgtap/apsp_warshall-any-00.test.sql
@@ -0,0 +1,28 @@
+\i setup.sql
+SET client_min_messages=WARNING;
+
+SELECT plan(2);
+
+PREPARE q1 AS
+SELECT id1, id2, round(cost::numeric, 2) as cost
+FROM pgr_apspWarshall('select id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table', false, false);
+
+PREPARE q2 AS
+SELECT  id1, id2, round(cost::numeric, 2) as cost
+FROM pgr_apspWarshall('select id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table', TRUE, false);
+
+PREPARE q11 AS
+SELECT start_vid::INTEGER AS id1, end_vid::INTEGER AS id2, round(agg_cost::numeric, 2) as cost
+FROM pgr_floydWarshall('select id, source, target, cost from edge_table', false);
+
+PREPARE q12 AS
+SELECT start_vid::INTEGER AS id1, end_vid::INTEGER AS id2, round(agg_cost::numeric, 2) as cost
+FROM pgr_floydWarshall('select id, source, target, cost from edge_table', true);
+
+SELECT set_eq('q1', 'q11','1: With undirected: Compare with pgr_floydWarshall -> must give the same results');
+SELECT set_eq('q2', 'q12','2: With directed: Compare with pgr_floydWarshall -> must give the same results');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/apsp_warshall/test/pgtap/types-check.sql b/src/apsp_warshall/test/pgtap/types-check.sql
new file mode 100644
index 0000000..512f56a
--- /dev/null
+++ b/src/apsp_warshall/test/pgtap/types-check.sql
@@ -0,0 +1,164 @@
+
+\i setup.sql
+
+
+SELECT plan(20);
+SET client_min_messages TO WARNING;
+
+PREPARE q1 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    true, true
+);
+
+PREPARE q2 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT source, target, cost, reverse_cost FROM edge_table',
+    true, true
+);
+
+
+
+SELECT lives_ok('q1', '1: edges query accepts INTEGER & FLOAT');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        true, true)',
+    'XX000','An expected column was not found in the query',
+    'without id fails');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        true, true)',
+    'XX000','An expected column was not found in the query',
+    'without source fails');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        true, true)',
+    'XX000','An expected column was not found in the query',
+    'without target fails');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id, source, target, reverse_cost FROM edge_table'',
+        true, true)',
+    'XX000','An expected column was not found in the query',
+    'without cost fails');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table'',
+         true, false)', '6: Without reverse_cost works');
+SELECT lives_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'',
+         true, false)',
+    '7: Contradiction works');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table'',
+         true, true)',
+    'P0001','has_rcost set to true but reverse_cost not found',
+    '8: Contradiction fails');
+
+
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'',
+         false)',
+    '42883','function pgr_apspwarshall(unknown, boolean) does not exist',
+    'One flag fails');
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table'',
+         true)',
+    '42883','function pgr_apspwarshall(unknown, boolean) does not exist',
+    'One flag fails');
+
+
+
+PREPARE q10 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id::FLOAT, source, target, cost, reverse_cost FROM edge_table',
+    true, true);
+PREPARE q11 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id::REAL, source, target, cost, reverse_cost FROM edge_table',
+    true, true);
+SELECT throws_ok('q10', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '11: Throws because id is FLOAT');
+SELECT throws_ok('q11', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because id is REAL');
+
+PREPARE q12 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source::FLOAT, target, cost, reverse_cost FROM edge_table',
+    true, true
+);
+
+PREPARE q13 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source::REAL, target, cost, reverse_cost FROM edge_table',
+    true, true
+);
+
+SELECT throws_ok('q12', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q13', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because source is REAL');
+
+PREPARE q14 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source, target::FLOAT, cost, reverse_cost FROM edge_table',
+    true, true
+);
+
+PREPARE q15 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source, target::REAL, cost, reverse_cost FROM edge_table',
+    true, true
+);
+
+SELECT throws_ok('q14', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because target is FLOAT');
+SELECT throws_ok('q15', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because source is REAL');
+
+PREPARE q16 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source, target, cost::SMALLINT, reverse_cost FROM edge_table',
+    true, true
+);
+
+PREPARE q17 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source, target, cost::INTEGER, reverse_cost FROM edge_table',
+    true, true
+);
+
+PREPARE q18 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source, target, cost::BIGINT, reverse_cost FROM edge_table',
+    true, true
+);
+
+PREPARE q19 AS
+SELECT * FROM pgr_apspWarshall(
+    'SELECT id, source, target, cost::REAL, reverse_cost FROM edge_table',
+    true, true
+);
+
+
+
+SELECT throws_ok('q16', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because cost is SMALLINT');
+SELECT throws_ok('q17', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because cost is INTEGER');
+SELECT throws_ok('q18', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because cost is BIGINT');
+SELECT throws_ok('q19', 'XX000', 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'Throws because cost is REAL');
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/apsp_warshall/test/pgtap/v2-v3-equivalence-directed.test.sql b/src/apsp_warshall/test/pgtap/v2-v3-equivalence-directed.test.sql
new file mode 100644
index 0000000..17ef3e6
--- /dev/null
+++ b/src/apsp_warshall/test/pgtap/v2-v3-equivalence-directed.test.sql
@@ -0,0 +1,153 @@
+
+\i setup.sql
+SET client_min_messages=WARNING;
+
+SELECT plan(16);
+
+-- TESTS WITH DIRECTED
+
+-- all values must be >= 0
+PREPARE q1 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE, TRUE
+) WHERE cost < 0;
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id',
+    TRUE, FALSE
+) WHERE cost < 0;
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, -1::float as reverse_cost FROM edge_table ORDER BY id',
+    TRUE, TRUE
+) WHERE cost < 0;
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, -1::float as cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE, TRUE
+) WHERE cost < 0;
+
+
+SELECT is_empty('q1', '1: No cost can be negative');
+SELECT is_empty('q2', '2: No cost can be negative');
+SELECT is_empty('q3', '3: No cost can be negative');
+SELECT is_empty('q4', '4: No cost can be negative');
+
+PREPARE q10 AS
+SELECT id1, id2, cost 
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id',
+    TRUE, FALSE
+);
+
+PREPARE q11 AS
+SELECT id1, id2, cost 
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id',
+    TRUE, TRUE
+);
+
+SELECT set_ne('q10', 'q11', '5: Results of with reverse_cost must be different of the one without it');
+
+PREPARE q20 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
+);
+
+PREPARE q21 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
+);
+
+SELECT set_eq('q10', 'q20','6: With Out reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+SELECT set_eq('q11', 'q21','7: With reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+
+
+PREPARE q30 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_johnson(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    TRUE
+);
+
+PREPARE q31 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_johnson(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q30','8: With Out reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+SELECT set_eq('q11', 'q31','9: With reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+
+
+PREPARE q40 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id'
+);
+
+PREPARE q41 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q40','10: With Out reverse_cost: Compare with (directed) pgr_floydWarshall -> must give the same results');
+SELECT set_eq('q11', 'q41','11: With reverse_cost: Compare with (directed) pgr_floydWarshall -> must give the same results');
+
+PREPARE q50 AS
+SELECT  id1, id2, cost
+FROM pgr_apspJohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id'
+);
+
+PREPARE q51 AS
+SELECT  id1, id2, cost
+FROM pgr_apspJohnson(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'
+);
+
+SELECT set_eq('q10', 'q50','12: With Out reverse_cost: Compare with pgr_apspJohnson -> must give the same results');
+SELECT set_ne('q11', 'q51','13: With reverse_cost: Compare with pgr_apspJohnson -> Results must be different (pgr_apspJohnson only workds without reverse_cost');
+
+-- errors:
+
+-- flags
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id''
+    )','42883','function pgr_apspwarshall(unknown) does not exist',
+    '14: Documentation says it does needs 2 flags');
+
+SELECT throws_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE
+    )','42883','function pgr_apspwarshall(unknown, boolean) does not exist',
+    '15: Documentation says it does needs 2 flags');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_apspWarshall(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        FALSE, TRUE
+    )',
+    '16: Documentation says it does have a Directed & has_rcost flags');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/apsp_warshall/test/pgtap/v2-v3-equivalence-undirected.test.sql b/src/apsp_warshall/test/pgtap/v2-v3-equivalence-undirected.test.sql
new file mode 100644
index 0000000..39baf32
--- /dev/null
+++ b/src/apsp_warshall/test/pgtap/v2-v3-equivalence-undirected.test.sql
@@ -0,0 +1,120 @@
+
+\i setup.sql
+SET client_min_messages= WARNING;
+
+SELECT plan(11);
+
+-- TESTS WITH UNDIRECTED
+
+-- all values must be >= 0
+PREPARE q1 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE, TRUE
+) WHERE cost < 0;
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id',
+    FALSE, FALSE
+) WHERE cost < 0;
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, -1::float as reverse_cost FROM edge_table ORDER BY id',
+    FALSE, TRUE
+) WHERE cost < 0;
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, -1::float as cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE, TRUE
+) WHERE cost < 0;
+
+
+SELECT is_empty('q1', '1: No cost can be negative');
+SELECT is_empty('q2', '2: No cost can be negative');
+SELECT is_empty('q3', '3: No cost can be negative');
+SELECT is_empty('q4', '4: No cost can be negative');
+
+PREPARE q10 AS
+SELECT id1, id2, cost 
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id',
+    FALSE, FALSE
+);
+
+PREPARE q11 AS
+SELECT id1, id2, cost 
+FROM pgr_apspWarshall(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE, TRUE
+);
+
+SELECT set_ne('q10', 'q11', '5: Results of with reverse_cost must be different of the one without it');
+
+PREPARE q20 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    FALSE
+);
+
+PREPARE q21 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_dijkstraCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],
+    FALSE
+);
+
+SELECT set_eq('q10', 'q20','6: With Out reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+SELECT set_eq('q11', 'q21','7: With reverse_cost: Compare with (directed) pgr_dijkstraCost -> must give the same results');
+
+
+PREPARE q30 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_johnson(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+PREPARE q31 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_johnson(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+SELECT set_eq('q10', 'q30','8: With Out reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+SELECT set_eq('q11', 'q31','9: With reverse_cost: Compare with (directed) pgr_johnson -> must give the same results');
+
+
+PREPARE q40 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+PREPARE q41 AS
+SELECT  start_vid::integer AS id1, end_vid::integer AS id2, agg_cost AS cost
+FROM pgr_floydWarshall(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    FALSE
+);
+
+SELECT set_eq('q10', 'q40','10: With Out reverse_cost: Compare with (directed) pgr_floydWarshall -> must give the same results');
+SELECT set_eq('q11', 'q41','11: With reverse_cost: Compare with (directed) pgr_floydWarshall -> must give the same results');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/apsp_warshall/test/test.conf b/src/apsp_warshall/test/test.conf
index 3407e3e..4f3c351 100644
--- a/src/apsp_warshall/test/test.conf
+++ b/src/apsp_warshall/test/test.conf
@@ -3,8 +3,13 @@
 %main::tests = (
     'any' => {
         'comment' => 'APSP Warshall test for any versions.',
-        'data' => ['apsp_warshall-any-00.data'],
-        'tests' => [qw(apsp_warshall-any-00)]
+        'data' => [],
+        'tests' => [qw(
+            doc-apspWarshall
+            )],
+        'documentation' => [qw(
+            doc-apspWarshall
+            )]
         },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/astar/doc/doc-astar.queries b/src/astar/doc/doc-astar.queries
new file mode 100644
index 0000000..382d0a9
--- /dev/null
+++ b/src/astar/doc/doc-astar.queries
@@ -0,0 +1,31 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_AStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2 FROM edge_table',
+    4, 1, false, false);
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   4 |  16 |    1
+   1 |   9 |   9 |    1
+   2 |   6 |   8 |    1
+   3 |   5 |   4 |    1
+   4 |   2 |   1 |    1
+   5 |   1 |  -1 |    0
+(6 rows)
+
+--q2
+SELECT * FROM pgr_AStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2, reverse_cost FROM edge_table ',
+    4, 1, true, true);
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   4 |   3 |    1
+   1 |   3 |   2 |    1
+   2 |   2 |   1 |    1
+   3 |   1 |  -1 |    0
+(4 rows)
+
+--q3
+ROLLBACK;
+ROLLBACK
diff --git a/src/astar/doc/index.rst b/src/astar/doc/index.rst
deleted file mode 100644
index d77c1bd..0000000
--- a/src/astar/doc/index.rst
+++ /dev/null
@@ -1,123 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_astar:
-
-pgr_astar - Shortest Path A*
-===============================================================================
-
-.. index:: 
-	single: pgr_astar(text,integer,integer,boolean,boolean)
-	module: astar
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_astar`` — Returns the shortest path using A* algorithm.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The A* (pronounced "A Star") algorithm is based on Dijkstra's algorithm with a heuristic that allow it to solve most shortest path problems by evaluation only a sub-set of the overall graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-	pgr_costResult[] pgr_astar(sql text, source integer, target integer,
-                               directed boolean, has_rcost boolean);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT id, source, target, cost, x1, y1, x2, y2 [,reverse_cost] FROM edge_table
-
-
-	:id: ``int4`` identifier of the edge
-	:source: ``int4`` identifier of the source vertex
-	:target: ``int4`` identifier of the target vertex
-	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-	:x1: ``x`` coordinate of the start point of the edge
-	:y1: ``y`` coordinate of the start point of the edge
-	:x2: ``x`` coordinate of the end point of the edge
-	:y2: ``y`` coordinate of the end point of the edge
-	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:target: ``int4`` id of the end point
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   node ID
-:id2:   edge ID (``-1`` for the last row)
-:cost:  cost to traverse from ``id1`` using ``id2``
-
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-	SELECT seq, id1 AS node, id2 AS edge, cost 
-		FROM pgr_astar(
-			'SELECT id, source, target, cost, x1, y1, x2, y2 FROM edge_table',
-			4, 1, false, false
-		);
-
-   seq | node | edge | cost 
-  -----+------+------+------
-     0 |    4 |   16 |    1
-     1 |    9 |    9 |    1
-     2 |    6 |    8 |    1
-     3 |    5 |    4 |    1
-     4 |    2 |    1 |    1
-     5 |    1 |   -1 |    0
-
-  (6 rows)
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-	SELECT seq, id1 AS node, id2 AS edge, cost 
-		FROM pgr_astar(
-			'SELECT id, source, target, cost, x1, y1, x2, y2, reverse_cost FROM edge_table',
-			4, 1, true, true
-		);
-
-	 seq | node | edge | cost 
-	-----+------+------+------
-	   0 |    4 |    3 |    1
-	   1 |    3 |    2 |    1
-	   2 |    2 |    1 |    1
-	   3 |    1 |   -1 |    0
-	(4 rows)
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* http://en.wikipedia.org/wiki/A*_search_algorithm
diff --git a/src/astar/doc/pgr_astar.rst b/src/astar/doc/pgr_astar.rst
new file mode 100644
index 0000000..b974a3d
--- /dev/null
+++ b/src/astar/doc/pgr_astar.rst
@@ -0,0 +1,96 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_astar:
+
+pgr_astar - Shortest Path A*
+===============================================================================
+
+.. index:: 
+	single: pgr_astar(text, integer, integer, boolean, boolean)
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_astar`` — Returns the shortest path using A* algorithm.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The A* (pronounced "A Star") algorithm is based on Dijkstra's algorithm with a heuristic that allow it to solve most shortest path problems by evaluation only a sub-set of the overall graph. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+	pgr_costResult[] pgr_astar(sql text, source integer, target integer,
+                               directed boolean, has_rcost boolean);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT id, source, target, cost, x1, y1, x2, y2 [,reverse_cost] FROM edge_table
+
+
+	:id: ``int4`` identifier of the edge
+	:source: ``int4`` identifier of the source vertex
+	:target: ``int4`` identifier of the target vertex
+	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+	:x1: ``x`` coordinate of the start point of the edge
+	:y1: ``y`` coordinate of the start point of the edge
+	:x2: ``x`` coordinate of the end point of the edge
+	:y2: ``y`` coordinate of the end point of the edge
+	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:target: ``int4`` id of the end point
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   node ID
+:id2:   edge ID (``-1`` for the last row)
+:cost:  cost to traverse from ``id1`` using ``id2``
+
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+
+.. literalinclude:: doc-astar.queries
+   :start-after: --q1
+   :end-before: --q2
+
+* With ``reverse_cost``
+
+.. literalinclude:: doc-astar.queries
+   :start-after: --q2
+   :end-before: --q3
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* http://en.wikipedia.org/wiki/A*_search_algorithm
diff --git a/src/astar/sql/CMakeLists.txt b/src/astar/sql/CMakeLists.txt
index d8ddfef..d34e55b 100644
--- a/src/astar/sql/CMakeLists.txt
+++ b/src/astar/sql/CMakeLists.txt
@@ -1,7 +1,6 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
     ${CMAKE_CURRENT_SOURCE_DIR}/astar.sql
-#    ${CMAKE_CURRENT_SOURCE_DIR}/astar_wrappers.sql
 )
 
 # set in parent scope
diff --git a/src/astar/sql/astar.sql b/src/astar/sql/astar.sql
index f6b778a..4585da4 100644
--- a/src/astar/sql/astar.sql
+++ b/src/astar/sql/astar.sql
@@ -1,21 +1,26 @@
---
+/*PGR-GNU*****************************************************************
+
 -- Copyright (c) 2005 Sylvain Pasche,
 --               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
---
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 
 -----------------------------------------------------------------------
@@ -25,5 +30,5 @@
 -----------------------------------------------------------------------
 CREATE OR REPLACE FUNCTION pgr_astar(sql text, source_id integer, target_id integer, directed boolean, has_reverse_cost boolean)
     RETURNS SETOF pgr_costResult
-    AS '$libdir/librouting-2.1', 'shortest_path_astar'
+    AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'shortest_path_astar'
     LANGUAGE c IMMUTABLE STRICT; 
diff --git a/src/astar/src/CMakeLists.txt b/src/astar/src/CMakeLists.txt
index c9a0932..23220ea 100644
--- a/src/astar/src/CMakeLists.txt
+++ b/src/astar/src/CMakeLists.txt
@@ -1,13 +1,3 @@
-#SET(LIBRARY_OUTPUT_PATH ../../../lib/)
-#IF(APPLE)
-#    SET(LIBRARY_MODE_TARGET "MODULE")
-#ELSE(APPLE)
-#    SET(LIBRARY_MODE_TARGET "SHARED")
-#ENDIF(APPLE)
-#ADD_LIBRARY(routing ${LIBRARY_MODE_TARGET} astar.c astar_boost_wrapper.cpp)
-#INSTALL(TARGETS routing DESTINATION ${LIBRARY_INSTALL_PATH})
-#IF(APPLE)
-#    SET_TARGET_PROPERTIES(routing PROPERTIES LINK_FLAGS "-bundle_loader ${POSTGRESQL_EXECUTABLE} -bundle")
-#ENDIF(APPLE)
-
-ADD_LIBRARY(astar OBJECT astar.c astar_boost_wrapper.cpp)
+ADD_LIBRARY(astar OBJECT
+    astar.c
+    astar_boost_wrapper.cpp)
diff --git a/src/astar/src/astar.c b/src/astar/src/astar.c
index 11b7b44..107053e 100644
--- a/src/astar/src/astar.c
+++ b/src/astar/src/astar.c
@@ -1,24 +1,29 @@
-/*
+/*PGR-GNU*****************************************************************
+
  * A* Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "../../common/src/pgr_types.h"
 #include "postgres.h"
 #include "executor/spi.h"
 #include "funcapi.h"
@@ -73,40 +78,13 @@ Datum shortest_path_astar(PG_FUNCTION_ARGS);
 
 #undef DEBUG
 //#define DEBUG 1
-
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
+#include "../../common/src/debug_macro.h"
+#include "../../common/src/pgr_types.h"
+#include "../../common/src/postgres_connection.h"
 
 // The number of tuples to fetch from the SPI cursor at each iteration
 #define TUPLIMIT 1000
 
-static char *
-text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-static int 
-finish(int code, int ret)
-{
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH )
-    {
-      elog(ERROR,"couldn't disconnect from SPI");
-      return -1 ;
-    }
-
-  return ret;
-}
-
 typedef struct edge_astar_columns 
 {
   int id;
@@ -151,7 +129,7 @@ fetch_edge_astar_columns(SPITupleTable *tuptable,
       return -1;
   }
 
-  DBG("columns: id %i source %i target %i cost %i", 
+  PGR_DBG("columns: id %i source %i target %i cost %i", 
       edge_columns->id, edge_columns->source, 
       edge_columns->target, edge_columns->cost);
 
@@ -171,7 +149,7 @@ fetch_edge_astar_columns(SPITupleTable *tuptable,
           return -1;
       }
 
-      DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
+      PGR_DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
   }
 
   edge_columns->s_x = SPI_fnumber(SPI_tuptable->tupdesc, "x1");
@@ -189,7 +167,7 @@ fetch_edge_astar_columns(SPITupleTable *tuptable,
       return -1;
   }
 
-  DBG("columns: x1 %i y1 %i x2 %i y2 %i", 
+  PGR_DBG("columns: x1 %i y1 %i x2 %i y2 %i", 
       edge_columns->s_x, edge_columns->s_y,
       edge_columns->t_x,edge_columns->t_y);
 
@@ -248,16 +226,15 @@ fetch_edge_astar(HeapTuple *tuple, TupleDesc *tupdesc,
 static int compute_shortest_path_astar(char* sql, int source_vertex_id, 
                        int target_vertex_id, bool directed, 
                        bool has_reverse_cost, 
-                       path_element_t **path, int *path_count) 
+                       path_element_t **path, size_t *path_count) 
 {
 
-  int SPIcode;
   void *SPIplan;
   Portal SPIportal;
   bool moredata = TRUE;
-  int ntuples;
+  size_t ntuples;
   edge_astar_t *edges = NULL;
-  int total_tuples = 0;
+  size_t total_tuples = 0;
 
   int v_max_id=0;
   int v_min_id=INT_MAX;  
@@ -278,33 +255,22 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
     int key;
   };
 
-  DBG("start shortest_path_astar\n");
-
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT) {
-      elog(ERROR, "shortest_path_astar: couldn't open a connection to SPI");
-      return -1;
-  }
+  PGR_DBG("start shortest_path_astar\n");
 
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL) {
-      elog(ERROR, "shortest_path_astar: couldn't create query plan via SPI");
-      return -1;
-  }
+  pgr_SPI_connect();
+  SPIplan = pgr_SPI_prepare(sql);
+  SPIportal = pgr_SPI_cursor_open(SPIplan);
 
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-      elog(ERROR, "shortest_path_astar: SPI_cursor_open('%s') returns NULL", 
-       sql);
-      return -1;
-  }
 
   while (moredata == TRUE) {
       SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
 
       if (edge_columns.id == -1) {
           if (fetch_edge_astar_columns(SPI_tuptable, &edge_columns, 
-                           has_reverse_cost) == -1)
-              return finish(SPIcode, ret);
+                           has_reverse_cost) == -1) {
+              pgr_SPI_finish();
+              return -1;
+          }
       }
 
       ntuples = SPI_processed;
@@ -316,11 +282,12 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
 
       if (edges == NULL) {
           elog(ERROR, "Out of memory");
-          return finish(SPIcode, ret);
+              pgr_SPI_finish();
+              return -1;
       }
 
       if (ntuples > 0) {
-          int t;
+          size_t t;
           SPITupleTable *tuptable = SPI_tuptable;
           TupleDesc tupdesc = SPI_tuptable->tupdesc;
 
@@ -338,7 +305,7 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
 
   //defining min and max vertex id
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   for(z=0; z<total_tuples; z++) {
     if(edges[z].source<v_min_id) v_min_id=edges[z].source;
@@ -346,7 +313,7 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
     if(edges[z].target<v_min_id) v_min_id=edges[z].target;
     if(edges[z].target>v_max_id) v_max_id=edges[z].target;      
 
-    DBG("%i <-> %i", v_min_id, v_max_id);
+    PGR_DBG("%i <-> %i", v_min_id, v_max_id);
   }
 
   //::::::::::::::::::::::::::::::::::::  
@@ -363,10 +330,10 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
 
     edges[z].source-=v_min_id;
     edges[z].target-=v_min_id;
-    DBG("%i - %i", edges[z].source, edges[z].target);
+    PGR_DBG("%i - %i", edges[z].source, edges[z].target);
   }
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   if(s_count == 0) {
     elog(ERROR, "Start vertex was not found.");
@@ -378,12 +345,12 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
     return -1;
   }
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   profstop("extract", prof_extract);
   profstart(prof_astar);
 
-  DBG("Calling boost_astar <%i>\n", total_tuples);
+  PGR_DBG("Calling boost_astar <%i>\n", total_tuples);
 
   // calling C++ A* function    
   ret = boost_astar(edges, total_tuples, source_vertex_id-v_min_id, 
@@ -395,21 +362,23 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
       elog(ERROR, "Error computing path: %s", err_msg);
   } 
 
-  DBG("SIZE %i\n",*path_count);
-  DBG("ret =  %i\n",ret);
+  PGR_DBG("SIZE %i\n",*path_count);
+  PGR_DBG("ret =  %i\n",ret);
 
   //::::::::::::::::::::::::::::::::
   //:: restoring original vertex id
   //::::::::::::::::::::::::::::::::
   for(z=0; z<*path_count; z++) {
-    //DBG("vetex %i\n",(*path)[z].vertex_id);
+    //PGR_DBG("vetex %i\n",(*path)[z].vertex_id);
     (*path)[z].vertex_id += v_min_id;
   }  
 
   profstop("astar", prof_astar);
   profstart(prof_store);
 
-  return finish(SPIcode, ret);
+  pgr_SPI_finish();
+  return 0;
+
 }
 
 
@@ -418,15 +387,15 @@ Datum
 shortest_path_astar(PG_FUNCTION_ARGS)
 {
   FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
+  uint32_t                  call_cntr;
+  uint32_t                  max_calls;
   TupleDesc            tuple_desc;
   path_element_t      *path = 0;
 
   /* stuff done only on the first call of the function */
   if (SRF_IS_FIRSTCALL()) {
       MemoryContext   oldcontext;
-      int path_count = 0;
+      size_t path_count = 0;
 #ifdef DEBUG
       int ret;
 #endif
@@ -445,7 +414,7 @@ shortest_path_astar(PG_FUNCTION_ARGS)
 #ifdef DEBUG
       ret =
 #endif
- compute_shortest_path_astar(text2char(PG_GETARG_TEXT_P(0)),
+ compute_shortest_path_astar(pgr_text2char(PG_GETARG_TEXT_P(0)),
                     PG_GETARG_INT32(1),
                     PG_GETARG_INT32(2),
                     PG_GETARG_BOOL(3),
@@ -453,21 +422,21 @@ shortest_path_astar(PG_FUNCTION_ARGS)
                     &path, &path_count);
 
 #ifdef DEBUG
-      DBG("Ret is %i", ret);
+      PGR_DBG("Ret is %i", ret);
       int i;
       for (i = 0; i < path_count; i++) {
-          DBG("Step # %i vertex_id  %i ", i, path[i].vertex_id);
-          DBG("        edge_id    %i ", path[i].edge_id);
-          DBG("        cost       %f ", path[i].cost);
+          PGR_DBG("Step # %i vertex_id  %i ", i, path[i].vertex_id);
+          PGR_DBG("        edge_id    %i ", path[i].edge_id);
+          PGR_DBG("        cost       %f ", path[i].cost);
       }
 #endif
 
       /* total number of tuples to be returned */
-      DBG("Conting tuples number\n");
-      funcctx->max_calls = path_count;
+      PGR_DBG("Conting tuples number\n");
+      funcctx->max_calls = (uint32_t)path_count;
       funcctx->user_fctx = path;
 
-      DBG("Path count %i", path_count);
+      PGR_DBG("Path count %i", path_count);
 
       funcctx->tuple_desc = 
             BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
@@ -476,7 +445,7 @@ shortest_path_astar(PG_FUNCTION_ARGS)
   }
 
   /* stuff done on every call of the function */
-  DBG("Strange stuff doing\n");
+  PGR_DBG("Strange stuff doing\n");
 
   funcctx = SRF_PERCALL_SETUP();
 
@@ -485,7 +454,7 @@ shortest_path_astar(PG_FUNCTION_ARGS)
   tuple_desc = funcctx->tuple_desc;
   path = (path_element_t*) funcctx->user_fctx;
 
-  DBG("Trying to allocate some memory\n");
+  PGR_DBG("Trying to allocate some memory\n");
 
   if (call_cntr < max_calls) {   /* do when there is more left to send */
         HeapTuple    tuple;
@@ -505,16 +474,16 @@ shortest_path_astar(PG_FUNCTION_ARGS)
         values[3] = Float8GetDatum(path[call_cntr].cost);
         nulls[3] = ' ';
 
-        DBG("Heap making\n");
+        PGR_DBG("Heap making\n");
 
         tuple = heap_formtuple(tuple_desc, values, nulls);
 
-        DBG("Datum making\n");
+        PGR_DBG("Datum making\n");
 
         /* make the tuple into a datum */
         result = HeapTupleGetDatum(tuple);
 
-        DBG("Trying to free some memory\n");
+        PGR_DBG("Trying to free some memory\n");
 
         /* clean up (this is not really necessary) */
         pfree(values);
diff --git a/src/astar/src/astar.h b/src/astar/src/astar.h
index 41ddb36..7853b5a 100644
--- a/src/astar/src/astar.h
+++ b/src/astar/src/astar.h
@@ -1,54 +1,41 @@
-/*
+/*PGR-GNU*****************************************************************
+
  * A* Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
  
 #define _ASTAR_H
 
-#include <unistd.h>
-#include "postgres.h"
-#include "../../common/src/pgr_types.h"
-
-#if 0
-typedef struct edge_astar 
-{
-  int id;
-  int source;
-  int target;
-  float8 cost;
-  float8 reverse_cost;
-  float8 s_x;
-  float8 s_y;
-  float8 t_x;
-  float8 t_y;
-} edge_astar_t;
-#endif
 
 
 #ifdef __cplusplus
 extern "C"
 {
 #endif
-  int boost_astar(edge_astar_t *edges, unsigned int count, 
+#include "../../common/src/pgr_types.h"
+  int boost_astar(edge_astar_t *edges, size_t count, 
                   int source_vertex_id, int target_vertex_id,
                   bool directed, bool has_reverse_cost,
-                  path_element_t **path, int *path_count, char **err_msg);
+                  path_element_t **path, size_t *path_count, char **err_msg);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/astar/src/astar_boost_wrapper.cpp b/src/astar/src/astar_boost_wrapper.cpp
index 96e80dd..186aab3 100644
--- a/src/astar/src/astar_boost_wrapper.cpp
+++ b/src/astar/src/astar_boost_wrapper.cpp
@@ -1,32 +1,45 @@
-/*
+/*PGR-GNU*****************************************************************
+
  * A* Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 // Include C header first for windows build issue
 
 #ifdef __MINGW32__
 #include <winsock2.h>
 #include <windows.h>
+#ifdef unlink
+#undef unlink
+#endif
 #endif
 
 
+#if 0
+extern "C" {
+#include "postgres.h"
+}
+#endif
+
 #include <boost/config.hpp>
 
 #include <boost/graph/graph_traits.hpp>
@@ -45,15 +58,15 @@ using namespace boost;
 struct Edge
 {
   int id;
-  float8 cost;
-  //float8 distance;
+  double cost;
+  //double distance;
 };
   
 struct Vertex
 {
   int id;
-  float8 x;
-  float8 y;
+  double x;
+  double y;
 };
 
 
@@ -69,6 +82,7 @@ class astar_goal_visitor : public boost::default_astar_visitor
       void examine_vertex(Vertex u, Graph& g) {
         if(u == m_goal)
           throw found_goal();
+        num_vertices(g); 
       }
     private:
       Vertex m_goal;
@@ -105,7 +119,7 @@ class distance_heuristic : public astar_heuristic<Graph, CostType>
 template <class G, class E>
 static void
 graph_add_edge(G &graph, int id, int source, int target, 
-         float8 cost, float8 s_x, float8 s_y, float8 t_x, float8 t_y)
+         double cost, double s_x, double s_y, double t_x, double t_y)
 {
   E e;
   bool inserted;
@@ -128,10 +142,10 @@ graph_add_edge(G &graph, int id, int source, int target,
 }
 
 int 
-boost_astar(edge_astar_t *edges, unsigned int count, 
+boost_astar(edge_astar_t *edges, size_t count, 
       int source_vertex_id, int target_vertex_id,
       bool directed, bool has_reverse_cost,
-      path_element_t **path, int *path_count, char **err_msg)
+      path_element_t **path, size_t *path_count, char **err_msg)
 {
 try {
 
@@ -142,7 +156,7 @@ try {
   typedef graph_traits < graph_t >::edge_descriptor edge_descriptor;
 
   // FIXME: compute this value
-  const unsigned int num_nodes = ((directed && has_reverse_cost ? 2 : 1) * 
+  const  auto num_nodes = ((directed && has_reverse_cost ? 2 : 1) * 
           count) + 100;
 
   graph_t graph(num_nodes);
@@ -162,7 +176,7 @@ try {
 
       if (!directed || (directed && has_reverse_cost))
       {
-        float8 cost;
+        double cost;
 
         if (has_reverse_cost)
         {
@@ -202,13 +216,13 @@ try {
       return -1;
   }
 
-  std::vector<float8> distances(num_vertices(graph));
+  std::vector<double> distances(num_vertices(graph));
 
   try {
     // Call A* named parameter interface
     astar_search
       (graph, source_vertex,
-       distance_heuristic<graph_t, float>(graph, target_vertex),
+       distance_heuristic<graph_t, double>(graph, target_vertex),
        predecessor_map(&predecessors[0]).
        weight_map(get(&Edge::cost, graph)).
        distance_map(&distances[0]).
@@ -217,7 +231,7 @@ try {
   } 
   catch(found_goal& fg) {
     // Target vertex found
-    vector<int> path_vect;
+    vector<vertex_descriptor> path_vect;
     int max = MAX_NODES;
     path_vect.push_back(target_vertex);
   
@@ -243,14 +257,14 @@ try {
               (path_vect.size() + 1));
     *path_count = path_vect.size();
 
-    for(int i = path_vect.size() - 1, j = 0; i >= 0; i--, j++)
+    for(int64_t i = static_cast<int64_t>(path_vect.size()) - 1, j = 0; i >= 0; i--, j++)
     {
         graph_traits < graph_t >::vertex_descriptor v_src;
         graph_traits < graph_t >::vertex_descriptor v_targ;
         graph_traits < graph_t >::edge_descriptor e;
         graph_traits < graph_t >::out_edge_iterator out_i, out_end;
 
-        (*path)[j].vertex_id = path_vect.at(i);
+        (*path)[j].vertex_id = static_cast<int>(path_vect.at(i));
 
         (*path)[j].edge_id = -1;
         (*path)[j].cost = distances[target_vertex];
diff --git a/src/astar/test/doc-astar.result b/src/astar/test/doc-astar.result
new file mode 100644
index 0000000..8041ba8
--- /dev/null
+++ b/src/astar/test/doc-astar.result
@@ -0,0 +1,13 @@
+--q1
+0|4|16|1
+1|9|9|1
+2|6|8|1
+3|5|4|1
+4|2|1|1
+5|1|-1|0
+--q2
+0|4|3|1
+1|3|2|1
+2|2|1|1
+3|1|-1|0
+--q3
diff --git a/src/astar/test/doc-astar.test.sql b/src/astar/test/doc-astar.test.sql
new file mode 100644
index 0000000..857e70e
--- /dev/null
+++ b/src/astar/test/doc-astar.test.sql
@@ -0,0 +1,16 @@
+BEGIN;
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_AStar
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+\echo --q1
+SELECT * FROM pgr_AStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2 FROM edge_table',
+    4, 1, false, false);
+\echo --q2
+SELECT * FROM pgr_AStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2, reverse_cost FROM edge_table ',
+    4, 1, true, true);
+\echo --q3
+ROLLBACK;
diff --git a/src/astar/test/pgtap/astar-types-check.sql b/src/astar/test/pgtap/astar-types-check.sql
new file mode 100644
index 0000000..ba74850
--- /dev/null
+++ b/src/astar/test/pgtap/astar-types-check.sql
@@ -0,0 +1,198 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(33);
+
+-- RECEIVES 5 PARAMETERS
+
+SELECT has_function('pgr_astar',ARRAY['text', 'integer', 'integer', 'boolean', 'boolean']);
+SELECT function_returns('pgr_astar', 'setof pgr_costresult','Returns set of costResult[]');
+
+
+-- CHECKING THE INNER QUERY
+
+
+
+PREPARE q1 AS
+SELECT * FROM pgr_astar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table',
+    2, 3, true, true);
+SELECT lives_ok('q1', 'edges query accepts INTEGER & FLOAT');
+
+
+
+SELECT todo_start('issue #140 must accept ANY-INTEGER and ANY-NUMERICAL');
+-- some test pass because the code is not checking
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'id accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'id accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'source accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'source accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'target accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'target accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts REAL');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::BIGINT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::INTEGER, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::SMALLINT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::REAL, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts REAL');
+
+-- x1
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::BIGINT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::INTEGER, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::SMALLINT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::REAL, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts REAL');
+
+-- x2
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::BIGINT, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::INTEGER, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::SMALLINT, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::REAL, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts REAL');
+
+
+-- y1
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::BIGINT, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::INTEGER, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::SMALLINT, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::REAL, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts REAL');
+
+-- y2
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::BIGINT, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::INTEGER, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::SMALLINT, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_astar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::REAL, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts REAL');
+
+SELECT todo_end();
+
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/astar/test/spas-any-00.data b/src/astar/test/spas-any-00.data
deleted file mode 100644
index 0b883d6..0000000
--- a/src/astar/test/spas-any-00.data
+++ /dev/null
@@ -1,212 +0,0 @@
-BEGIN;
---
--- PostgreSQL database dump
---
-
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET escape_string_warning = off;
-
-SET search_path = public, pg_catalog;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: edges1; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS edges1 CASCADE;
-
-CREATE TABLE edges1 (
-    eid integer NOT NULL,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    to_cost double precision,
-    rule text,
-    the_geom geometry,
-    CONSTRAINT enforce_dims_the_geom CHECK ((st_ndims(the_geom) = 2)),
-    CONSTRAINT enforce_geotype_the_geom CHECK (((geometrytype(the_geom) = 'LINESTRING'::text) OR (the_geom IS NULL)))
---    , CONSTRAINT enforce_srid_the_geom CHECK ((st_srid(the_geom) = (0)))
-);
-
-
---
--- Name: restrictions1; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS restrictions1 CASCADE;
-
-CREATE TABLE restrictions1 (
-    rid integer NOT NULL,
-    to_cost double precision,
-    teid integer,
-    feid integer,
-    via text
-);
-
-
---
--- Name: restrictions1_rid_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE restrictions1_rid_seq
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
--- Name: restrictions1_rid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE restrictions1_rid_seq OWNED BY restrictions1.rid;
-
-
---
--- Name: restrictions1_rid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
---
-
-SELECT pg_catalog.setval('restrictions1_rid_seq', 1, true);
-
-
---
--- Name: restrictions1a; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS restrictions1a CASCADE;
-
-CREATE TABLE restrictions1a (
-    rid integer,
-    to_cost double precision,
-    teid integer,
-    feid integer,
-    via text
-);
-
-
---
--- Name: rid; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE restrictions1 ALTER COLUMN rid SET DEFAULT nextval('restrictions1_rid_seq'::regclass);
-
-
---
--- Data for Name: edges1; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY edges1 (eid, dir, source, target, cost, reverse_cost, x1, y1, x2, y2, to_cost, rule, the_geom) FROM stdin WITH NULL '__NULL__';
-1	B	1	2	1	1	2	0	2	1	__NULL__	__NULL__	010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2	TF	2	3	-1	1	2	1	3	1	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3	TF	3	4	-1	1	3	1	4	1	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4	B	2	7	1	1	2	1	2	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5	FT	3	8	1	-1	3	1	3	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6	B	5	6	1	1	0	2	1	2	__NULL__	__NULL__	01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7	B	6	7	1	1	1	2	2	2	__NULL__	__NULL__	010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8	B	7	8	1	1	2	2	3	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9	B	8	9	1	1	3	2	4	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10	B	7	10	1	1	2	2	2	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11	FT	8	11	1	-1	3	2	3	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12	FT	10	11	1	-1	2	3	3	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13	FT	11	12	1	-1	3	3	4	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14	B	10	13	1	1	2	3	2	4	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15	B	9	12	1	1	4	2	4	3	__NULL__	__NULL__	0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16	B	4	9	1	1	4	1	4	2	__NULL__	__NULL__	0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-\.
-
-
---
--- Data for Name: restrictions1; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY restrictions1 (rid, to_cost, teid, feid, via) FROM stdin WITH NULL '__NULL__';
-1	100	7	4	__NULL__
-2	4	8	3	5
-3	100	9	16	__NULL__
-\.
-
-
---
--- Data for Name: restrictions1a; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY restrictions1a (rid, to_cost, teid, feid, via) FROM stdin WITH NULL '__NULL__';
-1	100	7	4	__NULL__
-\.
-
-
---
--- Name: edges1_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY edges1
-    ADD CONSTRAINT edges1_pkey PRIMARY KEY (eid);
-
-
---
--- Name: restrictions1_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY restrictions1
-    ADD CONSTRAINT restrictions1_pkey PRIMARY KEY (rid);
-
-
---
--- PostgreSQL database dump complete
---
-COMMIT;
-
-/*
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- edge_id for start
-    0.5,   -- midpoint of edge
-    6,     -- edge_id of route end
-    0.5,   -- midpoint of edge
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    null); -- no turn restrictions
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- node_id of start
-    5,     -- node_id of end
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    null); -- no turn restrictions
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,    -- edge_id for start
-    0.5,  -- midpoint of edge
-    6,    -- edge_id of route end
-    0.5,  -- midpoint of edge
-    true, -- directed graph?
-    true, -- has_reverse_cost?
-              -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- node_id of start
-    5,     -- node_id of end
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-               -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-
-*/
-
diff --git a/src/astar/test/spas-any-00.result b/src/astar/test/spas-any-00.result
index f1081c0..e0f6167 100644
--- a/src/astar/test/spas-any-00.result
+++ b/src/astar/test/spas-any-00.result
@@ -1,7 +1,5 @@
 0|11|13|1
 1|12|15|1
 2|9|9|1
-3|8|8|1
-4|7|7|1
-5|6|6|1
-6|5|-1|0
+3|6|8|1
+4|5|-1|0
diff --git a/src/astar/test/spas-any-00.test.sql b/src/astar/test/spas-any-00.test.sql
index c36ebcc..558b21e 100644
--- a/src/astar/test/spas-any-00.test.sql
+++ b/src/astar/test/spas-any-00.test.sql
@@ -1,2 +1,27 @@
-select * from pgr_astar('select eid as id, source::int4, target::int4, case when cost<=0 then 999 else cost end as cost, case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost, x1, y1, x2, y2 from edges1', 11, 5, false, true);
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+select * from pgr_astar('select id::INTEGER, source::INTEGER, target::INTEGER,
+    case when cost<=0 then 999 else cost end as cost,
+    case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost,
+     x1, y1, x2, y2 from edge_table', 11, 5, false, true);
 
diff --git a/src/astar/test/spas-any-01.test.sql b/src/astar/test/spas-any-01.test.sql
index 74c7138..60f6f48 100644
--- a/src/astar/test/spas-any-01.test.sql
+++ b/src/astar/test/spas-any-01.test.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select * from pgr_astar('
     SELECT unnest(array[1,2]) as id,
     unnest(array[10,10]) as source,
diff --git a/src/astar/test/test.conf b/src/astar/test/test.conf
index d2ef694..6667a22 100644
--- a/src/astar/test/test.conf
+++ b/src/astar/test/test.conf
@@ -3,9 +3,14 @@
 %main::tests = (
     'any' => {
         'comment' => 'astar test for any versions.',
-        'data' => ['spas-any-00.data'],
-        'tests' => [qw(spas-any-00 spas-any-01)]
-        },
+        'data' => [''],
+        'tests' => [qw(
+            spas-any-00
+            spas-any-01
+            doc-astar)],
+        'documentation' => [qw(
+            doc-astar)]
+    },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
 #    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
diff --git a/src/bd_astar/doc/doc-bdAstar.queries b/src/bd_astar/doc/doc-bdAstar.queries
new file mode 100644
index 0000000..ff55d9b
--- /dev/null
+++ b/src/bd_astar/doc/doc-bdAstar.queries
@@ -0,0 +1,33 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_bdAStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2
+     FROM edge_table',
+    4, 10, false, false);
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   4 |   3 |    0
+   1 |   3 |   5 |    1
+   2 |   6 |  11 |    1
+   3 |  11 |  12 |    0
+   4 |  10 |  -1 |    0
+(5 rows)
+
+--q2
+SELECT * FROM pgr_bdAStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2, reverse_cost
+     FROM edge_table ',
+    4, 10, true, true);
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   4 |   3 |    1
+   1 |   3 |   5 |    1
+   2 |   6 |   8 |    1
+   3 |   5 |  10 |    1
+   4 |  10 |  -1 |    0
+(5 rows)
+
+--q3
+ROLLBACK;
+ROLLBACK
diff --git a/src/bd_astar/doc/index.rst b/src/bd_astar/doc/index.rst
deleted file mode 100644
index cb2d26d..0000000
--- a/src/bd_astar/doc/index.rst
+++ /dev/null
@@ -1,129 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _bd_astar:
-
-pgr_bdAstar - Bi-directional A* Shortest Path
-===============================================================================
-
-.. index:: 
-	single: pgr_bdAstar(text, integer, integer, boolean, boolean)
-	module: bidirectional, astar
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_bdAstar`` - Returns the shortest path using Bidirectional A* algorithm.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-This is a bi-directional A* search algorithm. It searchs from the source toward the distination and at the same time from the destination to the source and terminates whe these to searchs meet in the middle. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-  pgr_costResult[] pgr_bdAstar(sql text, source integer, target integer,
-                               directed boolean, has_rcost boolean);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-  .. code-block:: sql
-
-    SELECT id, source, target, cost, x1, y1, x2, y2 [,reverse_cost] FROM edge_table
-
-
-  :id: ``int4`` identifier of the edge
-  :source: ``int4`` identifier of the source vertex
-  :target: ``int4`` identifier of the target vertex
-  :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-  :x1: ``x`` coordinate of the start point of the edge
-  :y1: ``y`` coordinate of the start point of the edge
-  :x2: ``x`` coordinate of the end point of the edge
-  :y2: ``y`` coordinate of the end point of the edge
-  :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:target: ``int4`` id of the end point
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   node ID
-:id2:   edge ID (``-1`` for the last row)
-:cost:  cost to traverse from ``id1`` using ``id2``
-
-.. warning::
-
-  You must reconnect to the database after ``CREATE EXTENSION pgrouting``. Otherwise the function will return ``Error computing path: std::bad_alloc``.
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS node, id2 AS edge, cost 
-        FROM pgr_bdAstar(
-            'SELECT id, source, target, cost, x1, y1, x2, y2 FROM edge_table',
-            4, 10, false, false
-        );
-
-     seq | node | edge | cost 
-    -----+------+------+------
-       0 |    4 |    3 |    0
-       1 |    3 |    5 |    1
-       2 |    6 |   11 |    1
-       3 |   11 |   12 |    0
-       4 |   10 |   -1 |    0
-    (5 rows)
-
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS node, id2 AS edge, cost 
-        FROM pgr_bdAstar(
-            'SELECT id, source, target, cost, x1, y1, x2, y2, reverse_cost FROM edge_table',
-            4, 10, true, true
-        );
-
-     seq | node | edge | cost 
-    -----+------+------+------
-       0 |    4 |    3 |    1
-       1 |    3 |    5 |    1
-       2 |    6 |    8 |    1
-       3 |    5 |   10 |    1
-       4 |   10 |   -1 |    0
-    (5 rows)
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* :ref:`bd_dijkstra`
-* http://en.wikipedia.org/wiki/Bidirectional_search
-* http://en.wikipedia.org/wiki/A*_search_algorithm
diff --git a/src/bd_astar/doc/pgr_bdAstar.rst b/src/bd_astar/doc/pgr_bdAstar.rst
new file mode 100644
index 0000000..b446669
--- /dev/null
+++ b/src/bd_astar/doc/pgr_bdAstar.rst
@@ -0,0 +1,102 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _bd_astar:
+
+pgr_bdAstar - Bi-directional A* Shortest Path
+===============================================================================
+
+.. index:: 
+	single: pgr_bdAstar(text, integer, integer, boolean, boolean)
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_bdAstar`` - Returns the shortest path using Bidirectional A* algorithm.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+This is a bi-directional A* search algorithm. It searchs from the source toward the distination and at the same time from the destination to the source and terminates whe these to searchs meet in the middle. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+  pgr_costResult[] pgr_bdAstar(sql text, source integer, target integer,
+                               directed boolean, has_rcost boolean);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+  .. code-block:: sql
+
+    SELECT id, source, target, cost, x1, y1, x2, y2 [,reverse_cost] FROM edge_table
+
+
+  :id: ``int4`` identifier of the edge
+  :source: ``int4`` identifier of the source vertex
+  :target: ``int4`` identifier of the target vertex
+  :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+  :x1: ``x`` coordinate of the start point of the edge
+  :y1: ``y`` coordinate of the start point of the edge
+  :x2: ``x`` coordinate of the end point of the edge
+  :y2: ``y`` coordinate of the end point of the edge
+  :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:target: ``int4`` id of the end point
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   node ID
+:id2:   edge ID (``-1`` for the last row)
+:cost:  cost to traverse from ``id1`` using ``id2``
+
+.. warning::
+
+  You must reconnect to the database after ``CREATE EXTENSION pgrouting``. Otherwise the function will return ``Error computing path: std::bad_alloc``.
+
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+
+.. literalinclude:: doc-bdAstar.queries
+   :start-after: --q1
+   :end-before: --q2
+
+* With ``reverse_cost``
+
+.. literalinclude:: doc-bdAstar.queries
+   :start-after: --q2
+   :end-before: --q3
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* :ref:`bd_dijkstra`
+* http://en.wikipedia.org/wiki/Bidirectional_search
+* http://en.wikipedia.org/wiki/A*_search_algorithm
diff --git a/src/bd_astar/sql/routing_bd_astar.sql b/src/bd_astar/sql/routing_bd_astar.sql
index ea59370..362e060 100644
--- a/src/bd_astar/sql/routing_bd_astar.sql
+++ b/src/bd_astar/sql/routing_bd_astar.sql
@@ -1,3 +1,27 @@
+/*PGR-GNU*****************************************************************
+
+Bi Directional A* Shortest path algorithm for PostgreSQL
+
+Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 -----------------------------------------------------------------------
 -- Core function for bi_directional_astar_shortest_path computation
 -- See README for description
@@ -12,6 +36,6 @@ CREATE OR REPLACE FUNCTION pgr_bdAstar(
         directed boolean, 
         has_reverse_cost boolean)
         RETURNS SETOF pgr_costResult
-        AS '$libdir/librouting-2.1', 'bidir_astar_shortest_path'
+        AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'bidir_astar_shortest_path'
         LANGUAGE 'c' IMMUTABLE STRICT;
 
diff --git a/src/bd_astar/src/BiDirAStar.cpp b/src/bd_astar/src/BiDirAStar.cpp
index 28ccd1a..b0a9156 100644
--- a/src/bd_astar/src/BiDirAStar.cpp
+++ b/src/bd_astar/src/BiDirAStar.cpp
@@ -1,547 +1,535 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#undef DEBUG
-//#define DEBUG
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-
-#ifdef DEBUG
-#include <stdio.h>
-static FILE *dbg;
-#define DBG(format, arg...) \
-    dbg = fopen("/tmp/sew-debug", "a"); \
-    if (dbg) { \
-        fprintf(dbg, format,  ## arg); \
-        fclose(dbg); \
-    }
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-
-
-#include "BiDirAStar.h"
-
-BiDirAStar::BiDirAStar(void)
-{
-}
-
-BiDirAStar::~BiDirAStar(void)
-{
-}
-
-void BiDirAStar::init()
-{
-	//max_edge_id = 0;
-	//max_node_id = 0;
-	
-}
-
-/*
-	Initialization and allocation of memories.
-*/
-
-void BiDirAStar::initall(int maxNode)
-{
-	int i;
-
-    DBG("BiDirAStar::initall(%d) called\n", maxNode);
-
-	m_pFParent = new PARENT_PATH[maxNode + 1];
-	m_pRParent = new PARENT_PATH[maxNode + 1];
-
-	m_pFCost = new double[maxNode + 1];
-	m_pRCost = new double[maxNode + 1];
-
-	for(i = 0; i <= maxNode; i++)
-	{
-		m_pFParent[i].par_Node = -2;
-		m_pRParent[i].par_Node = -2;
-		m_pFCost[i] = INF;
-		m_pRCost[i] = INF;
-		
-	}
-	m_MinCost = INF;
-	m_MidNode = -1;
-
-    // reserve space for nodes and edges
-    m_vecNodeVector.reserve(maxNode + 1);
-
-    DBG("Leaving BiDirAStar::initall\n");
-}
-
-/*
-	Delete the allocated memories to avoid memory leak.
-*/
-
-void BiDirAStar::deleteall()
-{
-    DBG("Calling BiDirAStar::deleteall\n");
-	delete [] m_pFParent;
-	delete [] m_pRParent;
-	delete [] m_pFCost;
-	delete [] m_pRCost;
-    DBG("Leaving BiDirAStar::deleteall\n");
-}
-
-/*
-	Get the current cost from source to the current node if direction is 1 else the cost to reach target from the current node.
-*/
-
-double BiDirAStar::getcost(int node_id, int dir)
-{
-	if(dir == 1)
-	{
-		return(m_pFCost[node_id]);
-	}
-	else
-	{
-		return(m_pRCost[node_id]);
-	}
-}
-
-
-double BiDirAStar::dist(double x1, double y1, double x2, double y2)
-{
-	double ret = fabs((x1 - x2) + fabs(y1 - y2));
-	//double ret = sqrt(x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
-	return(ret * 10);
-}
-
-/*
-	Get the heuristic cost of the node depending on dir (1 for forward search and -1 for reverse search).
-*/
-double BiDirAStar::gethcost(int node_id, int dir)
-{
-	if(dir == -1)
-	{
-		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lStartNodeId].xpos, m_vecNodeVector[m_lStartNodeId].ypos));
-	}
-	else
-	{
-		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lEndNodeId].xpos, m_vecNodeVector[m_lEndNodeId].ypos));
-	}
-}
-
-/*
-	Set the forward or reverse cost list depending on dir (1 for forward search and -1 for reverse search).
-*/
-
-
-void BiDirAStar::setcost(int node_id, int dir, double c)
-{
-	if(dir == 1)
-	{
-		m_pFCost[node_id] = c;
-	}
-	else
-	{
-		m_pRCost[node_id] = c;
-	}
-}
-
-void BiDirAStar::setparent(int node_id, int dir, int parnode, int paredge)
-{
-	if(dir == 1)
-	{
-		m_pFParent[node_id].par_Node = parnode;
-		m_pFParent[node_id].par_Edge = paredge;
-	}
-	else
-	{
-		m_pRParent[node_id].par_Node = parnode;
-		m_pRParent[node_id].par_Edge = paredge;
-	}
-}
-
-/*
-	Reconstruct path for forward search. It is like normal dijkstra. The parent array contains the parent of the current node and there is a -1 in the source.
-	So one need to recurse upto the source and then add the current node and edge to the list.
-*/
-
-void BiDirAStar::fconstruct_path(int node_id)
-{
-	if(m_pFParent[node_id].par_Node == -1)
-		return;
-	fconstruct_path(m_pFParent[node_id].par_Node);
-	path_element_t pt;
-	pt.vertex_id = m_pFParent[node_id].par_Node;
-	pt.edge_id = m_pFParent[node_id].par_Edge;
-	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
-	m_vecPath.push_back(pt);
-}
-
-/*
-	Reconstruct path for the reverse search. In this case the subsequent node is stored in the parent and the target contains a -1. So one need to add the node
-	and edge to the list and then recurse through the parent upto hitting a -1.
-*/
-
-void BiDirAStar::rconstruct_path(int node_id)
-{
-	path_element_t pt;
-	if(m_pRParent[node_id].par_Node == -1)
-	{
-		pt.vertex_id = node_id;
-		pt.edge_id = -1;
-		pt.cost = 0.0;
-		return;
-	}
-	pt.vertex_id = node_id;
-	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
-	pt.edge_id = m_pRParent[node_id].par_Edge;
-	m_vecPath.push_back(pt);
-	rconstruct_path(m_pRParent[node_id].par_Node);
-}
-
-/*
-	This is the main exploration module. The parameter dir indicates whether the exploration will be in forward or reverser direction. The reference to the corresponding
-	que is also passed as parameter que. The current node and the current costs are also available as parameter.
-*/
-
-//void BiDirAStar::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
-void BiDirAStar::explore(int cur_node, double cur_cost, int dir, MinHeap &que)
-{
-	int i;
-	// Number of connected edges
-	int con_edge = m_vecNodeVector[cur_node].Connected_Edges_Index.size();
-	double edge_cost;
-	for(i = 0; i < con_edge; i++)
-	{
-		int edge_index = m_vecNodeVector[cur_node].Connected_Edges_Index[i];
-		// Get the edge from the edge list.
-		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
-		// Get the connected node
-		int new_node = m_vecNodeVector[cur_node].Connected_Nodes[i];
-#if 0  // mult is set but not used
-		int mult;
-		
-		if(edge.Direction == 0)
-			mult = 1;
-		else
-			mult = dir;
-#endif
-		if(cur_node == edge.StartNode)
-		{
-			// Current node is the startnode of the edge. For forward search it should use forward cost, otherwise it should use the reverse cost,
-			// i.e. if the reverse direction is valid then this node may be visited from the end node.
-			if(dir > 0)
-				edge_cost = edge.Cost;
-			else
-				edge_cost = edge.ReverseCost;
-			// Check if the direction is valid for exploration
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				//edge_cost = edge.Cost * mult;
-				// Check if the current edge gives better result
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
-
-					// Update the minimum cost found so far.
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-		else
-		{
-			// Current node is the endnode of the edge. For forward search it should use reverse cost, otherwise it should use the forward cost,
-			// i.e. if the forward direction is valid then this node may be visited from the start node.
-			if(dir > 0)
-				edge_cost = edge.ReverseCost;
-			else
-				edge_cost = edge.Cost;
-			// Check if the direction is valid for exploration
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				//edge_cost = edge.ReverseCost * mult;
-				
-				// Check if the current edge gives better result
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
-					// Update the minimum cost found so far.
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-	}
-}
-
-/* 
-	This is the entry function that the wrappers should call. Most of the parameters are trivial. maxNode refers to Maximum
-	node id. As we run node based exploration cost, parent etc will be based on maximam node id.
-*/
-
-int BiDirAStar:: bidir_astar(edge_astar_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-				path_element_t **path, int *path_count, char **err_msg)
-{
-	max_node_id = maxNode;
-	max_edge_id = -1;
-	
-	// Allocate memory for local storage like cost and parent holder
-	initall(maxNode);
-
-	// construct the graph from the edge list, i.e. populate node and edge data structures
-	construct_graph(edges, edge_count, maxNode);
-	
-	m_lStartNodeId = start_vertex;
-	m_lEndNodeId = end_vertex;
-
-	// int nodeCount = m_vecNodeVector.size();
-	
-	MinHeap fque(maxNode + 2);
-	MinHeap rque(maxNode + 2);
-	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
-	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
-	
-	m_vecPath.clear();
-
-	// Initialize the forward search
-	m_pFParent[start_vertex].par_Node = -1;
-	m_pFParent[start_vertex].par_Edge = -1;
-	m_pFCost[start_vertex] = 0.0;
-	fque.push(std::make_pair(0.0, start_vertex));
-
-	// Initialize the reverse search
-	m_pRParent[end_vertex].par_Node = -1;
-	m_pRParent[end_vertex].par_Edge = -1;
-	m_pRCost[end_vertex] = 0.0;
-	rque.push(std::make_pair(0.0, end_vertex));
-
-	int i;
-	// int new_node;
-	int cur_node;
-	// int dir;
-/*
-	The main loop. The algorithm is as follows:
-	1. IF the sum of the current minimum of both heap is greater than so far found path, we cannot get any better, so break the loop.
-	2. IF the reverse heap minimum is lower than the forward heap minimum, explore from reverse direction.
-	3. ELSE explore from the forward directtion.
-*/
-
-	while(!fque.empty() && !rque.empty())
-	{
-		PDI fTop = fque.top();
-		PDI rTop = rque.top();
-		if(m_pFCost[fTop.second] + m_pRCost[rTop.second] > m_MinCost) //We are done, there is no path with lower cost
-			break;
-
-		if(rTop.first < fTop.first) // Explore from reverse queue
-		{
-			if(rTop.first > m_MinCost)
-				break;
-			cur_node = rTop.second;
-			int dir = -1;
-			rque.pop();
-			explore(cur_node, m_pRCost[rTop.second], dir, rque);
-		}
-		else                        // Explore from forward queue
-		{
-			if(fTop.first > m_MinCost)
-				break;
-			cur_node = fTop.second;
-			int dir = 1;
-			fque.pop();
-			explore(cur_node, m_pFCost[fTop.second], dir, fque);
-		}
-	}
-
-/*
-	Path reconstruction part. m_MidNode is the joining point where two searches meet to make a shortest path. It is updated in explore.
-	If it contains -1, then no path is found. Other wise we have a shortest path and that is reconstructed in the m_vecPath.
-*/
-
-	if(m_MidNode == -1)
-	{
-		*err_msg = (char *)"Path Not Found";
-		deleteall();
-		return -1;
-	}
-	else
-	{
-		// reconstruct path from forward search
-		fconstruct_path(m_MidNode);
-		// reconstruct path from backward search
-		rconstruct_path(m_MidNode);
-
-		// insert the last row in the path trace (having edge_id = -1 and cost = 0.0)
-		path_element_t pelement;
-		pelement.vertex_id = end_vertex;
-		pelement.edge_id = -1;
-		pelement.cost = 0.0;
-		m_vecPath.push_back(pelement);
-
-		// Transfer data path to path_element_t format and allocate memory and populate the pointer
-		*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
-		*path_count = m_vecPath.size();
-
-		for(i = 0; i < *path_count; i++)
-		{
-			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
-			(*path)[i].edge_id = m_vecPath[i].edge_id;
-			(*path)[i].cost = m_vecPath[i].cost;
-		}
-		
-	}
-	deleteall();
-	return 0;
-}
-
-/*
-	Populate the member variables of the class using the edge list. Basically there is a node list and an edge list. Each node contains the list of adjacent nodes and 
-	corresponding edge indices from edge list that connect this node with the adjacent nodes.
-*/
-
-bool BiDirAStar::construct_graph(edge_astar_t* edges, int edge_count, int maxNode)
-{
-	int i;
-
-    DBG("Calling BiDirAStar::construct_graph(edges, ecnt:%d, maxNode:%d)\n", edge_count, maxNode);
-
-	// Create a dummy node
-	GraphNodeInfo nodeInfo;
-	nodeInfo.Connected_Edges_Index.clear();
-	nodeInfo.Connected_Nodes.clear();
-
-	// Insert the dummy node into the node list. This acts as place holder. Also change the nodeId so that nodeId and node index in the vector are same.
-	// There may be some nodes here that does not appear in the edge list. The size of the list is upto maxNode which is equal to maximum node id.
-    DBG("    Adding nodes to m_vecNodeVector\n");
-	for(i = 0; i <= maxNode; i++)
-	{
-		nodeInfo.NodeID = i;
-		m_vecNodeVector.push_back(nodeInfo);
-	}
-
-	// Process each edge from the edge list and update the member data structures accordingly.
-    DBG("    Reserving edges for graph(%d)\n", edge_count);
-    m_vecEdgeVector.reserve(edge_count);
-    DBG("    Adding edges to graph\n");
-	for(i = 0; i < edge_count; i++)
-	{
-		addEdge(edges[i]);
-	}
-
-    DBG("Leaving BiDirAStar::construct_graph\n");
-	return true;
-}
-
-/*
-	Process the edge and populate the member nodelist and edgelist. The nodelist already contains upto maxNode dummy entries with nodeId same as index. Now the
-	connectivity information needs to be updated.
-*/
-
-bool BiDirAStar::addEdge(edge_astar_t edgeIn)
-{
-	// long lTest;
-	// Check if the edge is already processed.
-	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
-	if(itMap != m_mapEdgeId2Index.end())	
-		return false;
-
-	// Create a GraphEdgeInfo using the information of the current edge
-	GraphEdgeInfo newEdge;
-	newEdge.EdgeID = edgeIn.id;
-	newEdge.EdgeIndex = m_vecEdgeVector.size();	
-	newEdge.StartNode = edgeIn.source;
-	newEdge.EndNode = edgeIn.target;
-	newEdge.Cost = edgeIn.cost;
-	newEdge.ReverseCost = edgeIn.reverse_cost;
-
-	// Set the direction. If both cost and reverse cost has positive value the edge is bidirectional and direction field is 0. If cost is positive and reverse cost
-	// negative then the edge is unidirectional with direction = 1 (goes from source to target) otherwise it is unidirectional with direction = -1 (goes from target
-	// to source). Another way of creating unidirectional edge is assigning big values in cost or reverse_cost. In that case the direction is still zero and this case
-	// is handled in the algorithm automatically.
-	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
-	{
-		newEdge.Direction = 0;
-	}
-	else if(newEdge.Cost >= 0.0)
-	{
-		newEdge.Direction = 1;
-	}
-	else
-	{
-		newEdge.Direction = -1;
-	}
-
-	if(edgeIn.id > max_edge_id)
-	{
-		max_edge_id = edgeIn.id;
-	}
-
-	// Update max_edge_id
-	if(newEdge.StartNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.StartNode;
-	}
-	if(newEdge.EndNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.EdgeIndex;
-	}
-
-	m_vecNodeVector[newEdge.StartNode].xpos = edgeIn.s_x;
-	m_vecNodeVector[newEdge.StartNode].ypos = edgeIn.s_y;
-
-	m_vecNodeVector[newEdge.EndNode].xpos = edgeIn.t_x;
-	m_vecNodeVector[newEdge.EndNode].ypos = edgeIn.t_y;
-
-	// update connectivity information for the start node.
-	m_vecNodeVector[newEdge.StartNode].Connected_Nodes.push_back(newEdge.EndNode);
-	m_vecNodeVector[newEdge.StartNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-	// update connectivity information for the end node.
-	m_vecNodeVector[newEdge.EndNode].Connected_Nodes.push_back(newEdge.StartNode);
-	m_vecNodeVector[newEdge.EndNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-
-	
-	//Adding edge to the list
-	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
-	m_vecEdgeVector.push_back(newEdge);
-
-	//
-	return true;
-}
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+*
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include "BiDirAStar.h"
+
+BiDirAStar::BiDirAStar(void)
+{
+}
+
+BiDirAStar::~BiDirAStar(void)
+{
+}
+
+void BiDirAStar::init()
+{
+	//max_edge_id = 0;
+	//max_node_id = 0;
+	
+}
+
+/*
+	Initialization and allocation of memories.
+*/
+
+void BiDirAStar::initall(int maxNode)
+{
+	int i;
+
+    // DBG("BiDirAStar::initall(%d) called\n", maxNode);
+
+	m_pFParent = new PARENT_PATH[maxNode + 1];
+	m_pRParent = new PARENT_PATH[maxNode + 1];
+
+	m_pFCost = new double[maxNode + 1];
+	m_pRCost = new double[maxNode + 1];
+
+	for(i = 0; i <= maxNode; i++)
+	{
+		m_pFParent[i].par_Node = -2;
+		m_pRParent[i].par_Node = -2;
+		m_pFCost[i] = INF;
+		m_pRCost[i] = INF;
+		
+	}
+	m_MinCost = INF;
+	m_MidNode = -1;
+
+    // reserve space for nodes and edges
+    m_vecNodeVector.reserve(maxNode + 1);
+
+    // DBG("Leaving BiDirAStar::initall\n");
+}
+
+/*
+	Delete the allocated memories to avoid memory leak.
+*/
+
+void BiDirAStar::deleteall()
+{
+    // DBG("Calling BiDirAStar::deleteall\n");
+	delete [] m_pFParent;
+	delete [] m_pRParent;
+	delete [] m_pFCost;
+	delete [] m_pRCost;
+    // DBG("Leaving BiDirAStar::deleteall\n");
+}
+
+/*
+	Get the current cost from source to the current node if direction is 1 else the cost to reach target from the current node.
+*/
+
+double BiDirAStar::getcost(int node_id, int dir)
+{
+	if(dir == 1)
+	{
+		return(m_pFCost[node_id]);
+	}
+	else
+	{
+		return(m_pRCost[node_id]);
+	}
+}
+
+
+double BiDirAStar::dist(double x1, double y1, double x2, double y2)
+{
+	double ret = fabs((x1 - x2) + fabs(y1 - y2));
+	//double ret = sqrt(x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+	return(ret * 10);
+}
+
+/*
+	Get the heuristic cost of the node depending on dir (1 for forward search and -1 for reverse search).
+*/
+double BiDirAStar::gethcost(int node_id, int dir)
+{
+	if(dir == -1)
+	{
+		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lStartNodeId].xpos, m_vecNodeVector[m_lStartNodeId].ypos));
+	}
+	else
+	{
+		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lEndNodeId].xpos, m_vecNodeVector[m_lEndNodeId].ypos));
+	}
+}
+
+/*
+	Set the forward or reverse cost list depending on dir (1 for forward search and -1 for reverse search).
+*/
+
+
+void BiDirAStar::setcost(int node_id, int dir, double c)
+{
+	if(dir == 1)
+	{
+		m_pFCost[node_id] = c;
+	}
+	else
+	{
+		m_pRCost[node_id] = c;
+	}
+}
+
+void BiDirAStar::setparent(int node_id, int dir, int parnode, int paredge)
+{
+	if(dir == 1)
+	{
+		m_pFParent[node_id].par_Node = parnode;
+		m_pFParent[node_id].par_Edge = paredge;
+	}
+	else
+	{
+		m_pRParent[node_id].par_Node = parnode;
+		m_pRParent[node_id].par_Edge = paredge;
+	}
+}
+
+/*
+	Reconstruct path for forward search. It is like normal dijkstra. The parent array contains the parent of the current node and there is a -1 in the source.
+	So one need to recurse upto the source and then add the current node and edge to the list.
+*/
+
+void BiDirAStar::fconstruct_path(int node_id)
+{
+	if(m_pFParent[node_id].par_Node == -1)
+		return;
+	fconstruct_path(m_pFParent[node_id].par_Node);
+	path_element_t pt;
+	pt.vertex_id = m_pFParent[node_id].par_Node;
+	pt.edge_id = m_pFParent[node_id].par_Edge;
+	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
+	m_vecPath.push_back(pt);
+}
+
+/*
+	Reconstruct path for the reverse search. In this case the subsequent node is stored in the parent and the target contains a -1. So one need to add the node
+	and edge to the list and then recurse through the parent upto hitting a -1.
+*/
+
+void BiDirAStar::rconstruct_path(int node_id)
+{
+	path_element_t pt;
+	if(m_pRParent[node_id].par_Node == -1)
+	{
+		pt.vertex_id = node_id;
+		pt.edge_id = -1;
+		pt.cost = 0.0;
+		return;
+	}
+	pt.vertex_id = node_id;
+	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
+	pt.edge_id = m_pRParent[node_id].par_Edge;
+	m_vecPath.push_back(pt);
+	rconstruct_path(m_pRParent[node_id].par_Node);
+}
+
+/*
+	This is the main exploration module. The parameter dir indicates whether the exploration will be in forward or reverser direction. The reference to the corresponding
+	que is also passed as parameter que. The current node and the current costs are also available as parameter.
+*/
+
+//void BiDirAStar::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
+void BiDirAStar::explore(int cur_node, double cur_cost, int dir, MinHeap &que)
+{
+	size_t i;
+	// Number of connected edges
+	auto con_edge = m_vecNodeVector[cur_node].Connected_Edges_Index.size();
+	double edge_cost;
+	for(i = 0; i < con_edge; i++)
+	{
+		auto edge_index = m_vecNodeVector[cur_node].Connected_Edges_Index[i];
+		// Get the edge from the edge list.
+		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
+		// Get the connected node
+		int new_node = m_vecNodeVector[cur_node].Connected_Nodes[i];
+#if 0  // mult is set but not used
+		int mult;
+		
+		if(edge.Direction == 0)
+			mult = 1;
+		else
+			mult = dir;
+#endif
+		if(cur_node == edge.StartNode)
+		{
+			// Current node is the startnode of the edge. For forward search it should use forward cost, otherwise it should use the reverse cost,
+			// i.e. if the reverse direction is valid then this node may be visited from the end node.
+			if(dir > 0)
+				edge_cost = edge.Cost;
+			else
+				edge_cost = edge.ReverseCost;
+			// Check if the direction is valid for exploration
+			if(edge.Direction == 0 || edge_cost >= 0.0)
+			{
+				//edge_cost = edge.Cost * mult;
+				// Check if the current edge gives better result
+				if(cur_cost + edge_cost < getcost(new_node, dir))
+				{
+					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
+					setcost(new_node, dir, cur_cost + edge_cost);
+					setparent(new_node, dir, cur_node, edge.EdgeID);
+					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
+
+					// Update the minimum cost found so far.
+					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
+					{
+						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
+						m_MidNode = new_node;
+					}
+				}
+			}
+		}
+		else
+		{
+			// Current node is the endnode of the edge. For forward search it should use reverse cost, otherwise it should use the forward cost,
+			// i.e. if the forward direction is valid then this node may be visited from the start node.
+			if(dir > 0)
+				edge_cost = edge.ReverseCost;
+			else
+				edge_cost = edge.Cost;
+			// Check if the direction is valid for exploration
+			if(edge.Direction == 0 || edge_cost >= 0.0)
+			{
+				//edge_cost = edge.ReverseCost * mult;
+				
+				// Check if the current edge gives better result
+				if(cur_cost + edge_cost < getcost(new_node, dir))
+				{
+					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
+					setcost(new_node, dir, cur_cost + edge_cost);
+					setparent(new_node, dir, cur_node, edge.EdgeID);
+					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
+					// Update the minimum cost found so far.
+					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
+					{
+						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
+						m_MidNode = new_node;
+					}
+				}
+			}
+		}
+	}
+}
+
+/* 
+	This is the entry function that the wrappers should call. Most of the parameters are trivial. maxNode refers to Maximum
+	node id. As we run node based exploration cost, parent etc will be based on maximam node id.
+*/
+
+int BiDirAStar:: bidir_astar(edge_astar_t *edges, size_t edge_count, int maxNode, int start_vertex, int end_vertex,
+				path_element_t **path, size_t *path_count, char **err_msg)
+{
+	max_node_id = maxNode;
+	max_edge_id = -1;
+	
+	// Allocate memory for local storage like cost and parent holder
+	initall(maxNode);
+
+	// construct the graph from the edge list, i.e. populate node and edge data structures
+	construct_graph(edges, edge_count, maxNode);
+	
+	m_lStartNodeId = start_vertex;
+	m_lEndNodeId = end_vertex;
+
+	// int nodeCount = m_vecNodeVector.size();
+	
+	MinHeap fque(maxNode + 2);
+	MinHeap rque(maxNode + 2);
+	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
+	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
+	
+	m_vecPath.clear();
+
+	// Initialize the forward search
+	m_pFParent[start_vertex].par_Node = -1;
+	m_pFParent[start_vertex].par_Edge = -1;
+	m_pFCost[start_vertex] = 0.0;
+	fque.push(std::make_pair(0.0, start_vertex));
+
+	// Initialize the reverse search
+	m_pRParent[end_vertex].par_Node = -1;
+	m_pRParent[end_vertex].par_Edge = -1;
+	m_pRCost[end_vertex] = 0.0;
+	rque.push(std::make_pair(0.0, end_vertex));
+
+	// int new_node;
+	int cur_node;
+	// int dir;
+/*
+	The main loop. The algorithm is as follows:
+	1. IF the sum of the current minimum of both heap is greater than so far found path, we cannot get any better, so break the loop.
+	2. IF the reverse heap minimum is lower than the forward heap minimum, explore from reverse direction.
+	3. ELSE explore from the forward directtion.
+*/
+
+	while(!fque.empty() && !rque.empty())
+	{
+		PDI fTop = fque.top();
+		PDI rTop = rque.top();
+		if(m_pFCost[fTop.second] + m_pRCost[rTop.second] > m_MinCost) //We are done, there is no path with lower cost
+			break;
+
+		if(rTop.first < fTop.first) // Explore from reverse queue
+		{
+			if(rTop.first > m_MinCost)
+				break;
+			cur_node = rTop.second;
+			int dir = -1;
+			rque.pop();
+			explore(cur_node, m_pRCost[rTop.second], dir, rque);
+		}
+		else                        // Explore from forward queue
+		{
+			if(fTop.first > m_MinCost)
+				break;
+			cur_node = fTop.second;
+			int dir = 1;
+			fque.pop();
+			explore(cur_node, m_pFCost[fTop.second], dir, fque);
+		}
+	}
+
+/*
+	Path reconstruction part. m_MidNode is the joining point where two searches meet to make a shortest path. It is updated in explore.
+	If it contains -1, then no path is found. Other wise we have a shortest path and that is reconstructed in the m_vecPath.
+*/
+
+	if(m_MidNode == -1)
+	{
+		*err_msg = (char *)"Path Not Found";
+		deleteall();
+		return -1;
+	}
+	else
+	{
+		// reconstruct path from forward search
+		fconstruct_path(m_MidNode);
+		// reconstruct path from backward search
+		rconstruct_path(m_MidNode);
+
+		// insert the last row in the path trace (having edge_id = -1 and cost = 0.0)
+		path_element_t pelement;
+		pelement.vertex_id = end_vertex;
+		pelement.edge_id = -1;
+		pelement.cost = 0.0;
+		m_vecPath.push_back(pelement);
+
+		// Transfer data path to path_element_t format and allocate memory and populate the pointer
+		*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
+		*path_count = m_vecPath.size();
+
+		for(size_t i = 0; i < *path_count; i++)
+		{
+			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
+			(*path)[i].edge_id = m_vecPath[i].edge_id;
+			(*path)[i].cost = m_vecPath[i].cost;
+		}
+		
+	}
+	deleteall();
+	return 0;
+}
+
+/*
+	Populate the member variables of the class using the edge list. Basically there is a node list and an edge list. Each node contains the list of adjacent nodes and 
+	corresponding edge indices from edge list that connect this node with the adjacent nodes.
+*/
+
+bool BiDirAStar::construct_graph(edge_astar_t* edges, size_t edge_count, int maxNode)
+{
+	int i;
+
+    // DBG("Calling BiDirAStar::construct_graph(edges, ecnt:%d, maxNode:%d)\n", edge_count, maxNode);
+
+	// Create a dummy node
+	GraphNodeInfo nodeInfo;
+	nodeInfo.Connected_Edges_Index.clear();
+	nodeInfo.Connected_Nodes.clear();
+
+	// Insert the dummy node into the node list. This acts as place holder. Also change the nodeId so that nodeId and node index in the vector are same.
+	// There may be some nodes here that does not appear in the edge list. The size of the list is upto maxNode which is equal to maximum node id.
+    // DBG("    Adding nodes to m_vecNodeVector\n");
+	for(i = 0; i <= maxNode; i++)
+	{
+		nodeInfo.NodeID = i;
+		m_vecNodeVector.push_back(nodeInfo);
+	}
+
+	// Process each edge from the edge list and update the member data structures accordingly.
+    // DBG("    Reserving edges for graph(%d)\n", edge_count);
+    m_vecEdgeVector.reserve(edge_count);
+    // DBG("    Adding edges to graph\n");
+	for(size_t i = 0; i < edge_count; i++)
+	{
+		addEdge(edges[i]);
+	}
+
+    // DBG("Leaving BiDirAStar::construct_graph\n");
+	return true;
+}
+
+/*
+	Process the edge and populate the member nodelist and edgelist. The nodelist already contains upto maxNode dummy entries with nodeId same as index. Now the
+	connectivity information needs to be updated.
+*/
+
+bool BiDirAStar::addEdge(edge_astar_t edgeIn)
+{
+	// long lTest;
+	// Check if the edge is already processed.
+	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
+	if(itMap != m_mapEdgeId2Index.end())	
+		return false;
+
+	// Create a GraphEdgeInfo using the information of the current edge
+	GraphEdgeInfo newEdge;
+	newEdge.EdgeID = edgeIn.id;
+	newEdge.EdgeIndex = m_vecEdgeVector.size();	
+	newEdge.StartNode = edgeIn.source;
+	newEdge.EndNode = edgeIn.target;
+	newEdge.Cost = edgeIn.cost;
+	newEdge.ReverseCost = edgeIn.reverse_cost;
+
+	// Set the direction. If both cost and reverse cost has positive value the edge is bidirectional and direction field is 0. If cost is positive and reverse cost
+	// negative then the edge is unidirectional with direction = 1 (goes from source to target) otherwise it is unidirectional with direction = -1 (goes from target
+	// to source). Another way of creating unidirectional edge is assigning big values in cost or reverse_cost. In that case the direction is still zero and this case
+	// is handled in the algorithm automatically.
+	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
+	{
+		newEdge.Direction = 0;
+	}
+	else if(newEdge.Cost >= 0.0)
+	{
+		newEdge.Direction = 1;
+	}
+	else
+	{
+		newEdge.Direction = -1;
+	}
+
+	if(edgeIn.id > max_edge_id)
+	{
+		max_edge_id = edgeIn.id;
+	}
+
+	// Update max_edge_id
+	if(newEdge.StartNode > max_node_id)
+	{
+		return false;//max_node_id = newEdge.StartNode;
+	}
+	if(newEdge.EndNode > max_node_id)
+	{
+		return false;//max_node_id = newEdge.EdgeIndex;
+	}
+
+	m_vecNodeVector[newEdge.StartNode].xpos = edgeIn.s_x;
+	m_vecNodeVector[newEdge.StartNode].ypos = edgeIn.s_y;
+
+	m_vecNodeVector[newEdge.EndNode].xpos = edgeIn.t_x;
+	m_vecNodeVector[newEdge.EndNode].ypos = edgeIn.t_y;
+
+	// update connectivity information for the start node.
+	m_vecNodeVector[newEdge.StartNode].Connected_Nodes.push_back(newEdge.EndNode);
+	m_vecNodeVector[newEdge.StartNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
+
+	// update connectivity information for the end node.
+	m_vecNodeVector[newEdge.EndNode].Connected_Nodes.push_back(newEdge.StartNode);
+	m_vecNodeVector[newEdge.EndNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
+
+
+	
+	//Adding edge to the list
+	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
+	m_vecEdgeVector.push_back(newEdge);
+
+	//
+	return true;
+}
diff --git a/src/bd_astar/src/BiDirAStar.h b/src/bd_astar/src/BiDirAStar.h
index df43bba..2c699c8 100644
--- a/src/bd_astar/src/BiDirAStar.h
+++ b/src/bd_astar/src/BiDirAStar.h
@@ -1,154 +1,129 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef BIDIRASTAR_H
-#define BIDIRASTAR_H
-
-#include <vector>
-#include <map>
-#include <queue>
-#include <string>
-#include <stdlib.h>
-#include <iostream>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "MinHeap.h"
-#include "bdastar.h"
-
-#define INF 1e15
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<LongVector> VectorOfLongVector;
-//typedef std::pair<int, bool> PIB;
-typedef std::pair<double, int> PDI;
-//typedef std::pair<double, std::vector<int> > PDVI;
-/*
-typedef struct edge 
-{
-	int id;
-	int source;
-	int target;
-	double s_x;
-	double s_y;
-	double t_x;
-	double t_y;
-	double cost;
-	double reverse_cost;
-} edge_astar_t;
-
-typedef struct path_element 
-{
-	int vertex_id;
-	int edge_id;
-	double cost;
-}path_element_t;
-*/
-
-typedef struct{
-	int par_Node;
-	int par_Edge;
-}PARENT_PATH;
-
-typedef struct{
-	int NodeID;
-	double xpos;
-	double ypos;
-	std::vector<int> Connected_Nodes;
-	std::vector<int> Connected_Edges_Index;
-}GraphNodeInfo;
-
-struct GraphEdgeInfo
-{
-public:
-	int EdgeID;
-	int EdgeIndex;
-	int Direction;
-	double Cost;
-	double ReverseCost;
-	int StartNode;
-	int EndNode;
-};
-
-typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
-typedef std::map<long,LongVector> Long2LongVectorMap;
-typedef std::map<long,long> Long2LongMap;
-typedef std::vector<GraphNodeInfo> GraphNodeVector;
-
-
-class BiDirAStar
-{
-public:
-	BiDirAStar(void);
-	~BiDirAStar(void);
-	
-	int bidir_astar(edge_astar_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-		path_element_t **path, int *path_count, char **err_msg);
-	
-
-private:
-	bool construct_graph(edge_astar_t *edges, int edge_count, int maxNode);
-	void fconstruct_path(int node_id);
-	void rconstruct_path(int node_id);
-	bool addEdge(edge_astar_t edgeIn);
-	bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
-	void init();
-	void initall(int maxNode);
-	void deleteall();
-	//void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
-	void explore(int cur_node, double cur_cost, int dir, MinHeap &que);
-	double getcost(int node_id, int dir);
-	void setcost(int node_id, int dir, double c);
-	void setparent(int node_id, int dir, int parnode, int paredge);
-	double gethcost(int node_id, int dir);
-	double dist(double x1, double y1, double x2, double y2);
-
-private:
-	GraphEdgeVector m_vecEdgeVector;
-	Long2LongMap m_mapEdgeId2Index;
-	Long2LongVectorMap m_mapNodeId2Edge;
-	GraphNodeVector m_vecNodeVector;
-	int max_node_id;
-	int max_edge_id;
-	int m_lStartNodeId;
-	int m_lEndNodeId;
-
-	double m_MinCost;
-	int m_MidNode;
-	std::vector <path_element_t> m_vecPath;
-	PARENT_PATH *m_pFParent;
-	PARENT_PATH *m_pRParent;
-	double *m_pFCost;
-	double *m_pRCost;
-};
-
-#endif
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+*
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+#ifndef BIDIRASTAR_H
+#define BIDIRASTAR_H
+
+#include <vector>
+#include <map>
+#include <utility>
+
+#include "MinHeap.h"
+#include "bdastar.h"
+
+#define INF 1e15
+
+
+
+typedef std::vector<long> LongVector;
+typedef std::vector<LongVector> VectorOfLongVector;
+typedef std::pair<double, int> PDI;
+
+typedef struct{
+    int par_Node;
+    int par_Edge;
+}PARENT_PATH;
+
+typedef struct{
+    int NodeID;
+    double xpos;
+    double ypos;
+    std::vector<int> Connected_Nodes;
+    std::vector<size_t> Connected_Edges_Index;
+}GraphNodeInfo;
+
+struct GraphEdgeInfo
+{
+public:
+    int EdgeID;
+    size_t EdgeIndex;
+    int Direction;
+    double Cost;
+    double ReverseCost;
+    int StartNode;
+    int EndNode;
+};
+
+typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
+typedef std::map<long,LongVector> Long2LongVectorMap;
+typedef std::map<long,long> Long2LongMap;
+typedef std::vector<GraphNodeInfo> GraphNodeVector;
+
+
+class BiDirAStar
+{
+public:
+    BiDirAStar(void);
+    ~BiDirAStar(void);
+    
+    int bidir_astar(edge_astar_t *edges, size_t edge_count, int maxNode, int start_vertex, int end_vertex,
+        path_element_t **path, size_t *path_count, char **err_msg);
+    
+
+private:
+    bool construct_graph(edge_astar_t *edges, size_t edge_count, int maxNode);
+    void fconstruct_path(int node_id);
+    void rconstruct_path(int node_id);
+    bool addEdge(edge_astar_t edgeIn);
+    bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
+    void init();
+    void initall(int maxNode);
+    void deleteall();
+    //void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
+    void explore(int cur_node, double cur_cost, int dir, MinHeap &que);
+    double getcost(int node_id, int dir);
+    void setcost(int node_id, int dir, double c);
+    void setparent(int node_id, int dir, int parnode, int paredge);
+    double gethcost(int node_id, int dir);
+    double dist(double x1, double y1, double x2, double y2);
+
+private:
+    GraphEdgeVector m_vecEdgeVector;
+    Long2LongMap m_mapEdgeId2Index;
+    Long2LongVectorMap m_mapNodeId2Edge;
+    GraphNodeVector m_vecNodeVector;
+    int max_node_id;
+    int max_edge_id;
+    int m_lStartNodeId;
+    int m_lEndNodeId;
+
+    double m_MinCost;
+    int m_MidNode;
+    std::vector <path_element_t> m_vecPath;
+    PARENT_PATH *m_pFParent;
+    PARENT_PATH *m_pRParent;
+    double *m_pFCost;
+    double *m_pRCost;
+};
+
+#endif
diff --git a/src/bd_astar/src/CMakeLists.txt b/src/bd_astar/src/CMakeLists.txt
index af7f142..2d19acb 100644
--- a/src/bd_astar/src/CMakeLists.txt
+++ b/src/bd_astar/src/CMakeLists.txt
@@ -1,2 +1,4 @@
-add_library(bd_astar OBJECT bdastar.h bdastar.c MinHeap.h MinHeap.cpp BiDirAStar.h bdastar_core.cpp BiDirAStar.cpp)
-
+add_library(bd_astar OBJECT 
+    bdastar.c 
+    MinHeap.cpp 
+    bdastar_core.cpp BiDirAStar.cpp)
diff --git a/src/bd_astar/src/MinHeap.cpp b/src/bd_astar/src/MinHeap.cpp
index 234e263..1288654 100644
--- a/src/bd_astar/src/MinHeap.cpp
+++ b/src/bd_astar/src/MinHeap.cpp
@@ -1,4 +1,5 @@
-/******************************************************************************
+/*PGR-MIT*****************************************************************
+
 * $Id$
 *
 * Project:  pgRouting bdsp and bdastar algorithms
@@ -6,26 +7,30 @@
 * Author:   Razequl Islam <ziboncsedu at gmail.com>
 *
 
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 #include "MinHeap.h"
 
diff --git a/src/bd_astar/src/MinHeap.h b/src/bd_astar/src/MinHeap.h
index 2b3868f..2760a3a 100644
--- a/src/bd_astar/src/MinHeap.h
+++ b/src/bd_astar/src/MinHeap.h
@@ -1,4 +1,5 @@
-/******************************************************************************
+/*PGR-MIT*****************************************************************
+
 * $Id$
 *
 * Project:  pgRouting bdsp and bdastar algorithms
@@ -6,26 +7,30 @@
 * Author:   Razequl Islam <ziboncsedu at gmail.com>
 *
 
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 #ifndef MINHEAP_H
 #define MINHEAP_H
diff --git a/src/bd_astar/src/bdastar.c b/src/bd_astar/src/bdastar.c
index 03bd604..4a9ee7a 100644
--- a/src/bd_astar/src/bdastar.c
+++ b/src/bd_astar/src/bdastar.c
@@ -1,24 +1,29 @@
-/*
- * Bi Directional A* Shortest path algorithm for PostgreSQL
- *
- * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+/*PGR-GNU*****************************************************************
+
+Bi Directional A* Shortest path algorithm for PostgreSQL
+
+Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
+#include "../../common/src/pgr_types.h"
 #include "postgres.h"
 #include "executor/spi.h"
 #include "funcapi.h"
@@ -31,6 +36,7 @@
 #include <stdlib.h>
 #include <search.h>
 
+#include "../../common/src/postgres_connection.h"
 #include "bdastar.h"
 
 //-------------------------------------------------------------------------
@@ -72,44 +78,12 @@ long profipts1, profipts2, profopts;
 Datum bidir_astar_shortest_path(PG_FUNCTION_ARGS);
 
 #undef DEBUG
-//#define DEBUG 1
+#include "../../common/src/debug_macro.h"
 
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
 
 // The number of tuples to fetch from the SPI cursor at each iteration
 #define TUPLIMIT 1000
 
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-static char *
-text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-static int
-finish(int code, int ret)
-{
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH ) {
-      elog(ERROR,"couldn't disconnect from SPI");
-      return -1 ;
-  }
-
-  return ret;
-}
-
 typedef struct edge_astar_columns
 {
   int id;
@@ -155,7 +129,7 @@ fetch_edge_astar_columns(SPITupleTable *tuptable,
       return -1;
     }
 
-  DBG("columns: id %i source %i target %i cost %i",
+  PGR_DBG("columns: id %i source %i target %i cost %i",
       edge_columns->id, edge_columns->source,
       edge_columns->target, edge_columns->cost);
 
@@ -175,7 +149,7 @@ fetch_edge_astar_columns(SPITupleTable *tuptable,
           return -1;
       }
 
-      DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
+      PGR_DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
   }
 
   edge_columns->s_x = SPI_fnumber(SPI_tuptable->tupdesc, "x1");
@@ -193,7 +167,7 @@ fetch_edge_astar_columns(SPITupleTable *tuptable,
       return -1;
   }
 
-  DBG("columns: x1 %i y1 %i x2 %i y2 %i",
+  PGR_DBG("columns: x1 %i y1 %i x2 %i y2 %i",
       edge_columns->s_x, edge_columns->s_y,
       edge_columns->t_x,edge_columns->t_y);
 
@@ -253,15 +227,14 @@ fetch_edge_astar(HeapTuple *tuple, TupleDesc *tupdesc,
 static int compute_shortest_path_astar(char* sql, int source_vertex_id,
                        int target_vertex_id, bool directed,
                        bool has_reverse_cost,
-                       path_element_t **path, int *path_count)
+                       path_element_t **path, size_t *path_count)
 {
-  int SPIcode;
   void *SPIplan;
   Portal SPIportal;
   bool moredata = TRUE;
-  int ntuples;
+  size_t ntuples;
   edge_astar_t *edges = NULL;
-  int total_tuples = 0;
+  size_t total_tuples = 0;
 
   int v_max_id=0;
   int v_min_id=INT_MAX;
@@ -281,33 +254,21 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
     int key;
   };
 
-  DBG("start shortest_path_astar\n");
+  PGR_DBG("start shortest_path_astar\n");
 
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT) {
-      elog(ERROR, "shortest_path_astar: couldn't open a connection to SPI");
-      return -1;
-  }
-
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL) {
-      elog(ERROR, "shortest_path_astar: couldn't create query plan via SPI");
-      return -1;
-  }
-
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-      elog(ERROR, "shortest_path_astar: SPI_cursor_open('%s') returns NULL",
-            sql);
-      return -1;
-  }
+  pgr_SPI_connect();
+  SPIplan = pgr_SPI_prepare(sql);
+  SPIportal = pgr_SPI_cursor_open(SPIplan);
 
   while (moredata == TRUE) {
       SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
 
       if (edge_columns.id == -1) {
           if (fetch_edge_astar_columns(SPI_tuptable, &edge_columns,
-                           has_reverse_cost) == -1)
-            return finish(SPIcode, ret);
+                           has_reverse_cost) == -1) {
+            pgr_SPI_finish();
+            return -1;
+          }
       }
 
       ntuples = SPI_processed;
@@ -319,11 +280,12 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
 
       if (edges == NULL) {
           elog(ERROR, "Out of memory");
-          return finish(SPIcode, ret);
+            pgr_SPI_finish();
+            return -1;
       }
 
       if (ntuples > 0) {
-          int t;
+          size_t t;
           SPITupleTable *tuptable = SPI_tuptable;
           TupleDesc tupdesc = SPI_tuptable->tupdesc;
 
@@ -341,7 +303,7 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
 
   //defining min and max vertex id
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   for(z=0; z<total_tuples; z++)
   {
@@ -349,7 +311,7 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
     if(edges[z].source>v_max_id) v_max_id=edges[z].source;
     if(edges[z].target<v_min_id) v_min_id=edges[z].target;
     if(edges[z].target>v_max_id) v_max_id=edges[z].target;
-    DBG("%i <-> %i", v_min_id, v_max_id);
+    PGR_DBG("%i <-> %i", v_min_id, v_max_id);
   }
 
   //::::::::::::::::::::::::::::::::::::
@@ -366,10 +328,10 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
 
     edges[z].source-=v_min_id;
     edges[z].target-=v_min_id;
-    DBG("%i - %i", edges[z].source, edges[z].target);
+    PGR_DBG("%i - %i", edges[z].source, edges[z].target);
   }
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   if(s_count == 0) {
     elog(ERROR, "Start vertex was not found.");
@@ -381,12 +343,12 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
     return -1;
   }
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   profstop("extract", prof_extract);
   profstart(prof_astar);
 
-  DBG("Calling bidir_astar <%i>\n", total_tuples);
+  PGR_DBG("Calling bidir_astar <%i>\n", total_tuples);
 
   // calling C++ A* function
   ret = bdastar_wrapper(edges, total_tuples, v_max_id + 1, source_vertex_id-v_min_id,
@@ -394,15 +356,15 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
             directed, has_reverse_cost,
             path, path_count, &err_msg);
 
-  DBG("SIZE %i\n",*path_count);
+  PGR_DBG("SIZE %i\n",*path_count);
 
-  DBG("ret =  %i\n",ret);
+  PGR_DBG("ret =  %i\n",ret);
 
   //::::::::::::::::::::::::::::::::
   //:: restoring original vertex id
   //::::::::::::::::::::::::::::::::
   for(z=0; z<*path_count; z++) {
-    //DBG("vetex %i\n",(*path)[z].vertex_id);
+    //PGR_DBG("vetex %i\n",(*path)[z].vertex_id);
     (*path)[z].vertex_id+=v_min_id;
   }
 
@@ -412,7 +374,8 @@ static int compute_shortest_path_astar(char* sql, int source_vertex_id,
   if (ret < 0) {
       elog(ERROR, "Error computing path: %s", err_msg);
   }
-  return finish(SPIcode, ret);
+  pgr_SPI_finish();
+  return ret;
 }
 
 
@@ -421,15 +384,15 @@ Datum
 bidir_astar_shortest_path(PG_FUNCTION_ARGS)
 {
   FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
+  uint32_t                  call_cntr;
+  uint32_t                  max_calls;
   TupleDesc            tuple_desc;
   path_element_t      *path;
 
   /* stuff done only on the first call of the function */
   if (SRF_IS_FIRSTCALL()) {
       MemoryContext   oldcontext;
-      int path_count = 0;
+      size_t path_count = 0;
 #ifdef DEBUG
       int ret;
 #endif
@@ -448,7 +411,7 @@ bidir_astar_shortest_path(PG_FUNCTION_ARGS)
 #ifdef DEBUG
       ret =
 #endif
-         compute_shortest_path_astar(text2char(PG_GETARG_TEXT_P(0)),
+         compute_shortest_path_astar(pgr_text2char(PG_GETARG_TEXT_P(0)),
                     PG_GETARG_INT32(1),
                     PG_GETARG_INT32(2),
                     PG_GETARG_BOOL(3),
@@ -456,23 +419,23 @@ bidir_astar_shortest_path(PG_FUNCTION_ARGS)
                     &path, &path_count);
 
 #ifdef DEBUG
-      DBG("Ret is %i", ret);
+      PGR_DBG("Ret is %i", ret);
       if (ret >= 0) {
           int i;
           for (i = 0; i < path_count; i++) {
-              DBG("Step # %i vertex_id  %i ", i, path[i].vertex_id);
-              DBG("        edge_id    %i ", path[i].edge_id);
-              DBG("        cost       %f ", path[i].cost);
+              PGR_DBG("Step # %i vertex_id  %i ", i, path[i].vertex_id);
+              PGR_DBG("        edge_id    %i ", path[i].edge_id);
+              PGR_DBG("        cost       %f ", path[i].cost);
           }
       }
 #endif
 
       /* total number of tuples to be returned */
-      DBG("Conting tuples number\n");
-      funcctx->max_calls = path_count;
+      PGR_DBG("Conting tuples number\n");
+      funcctx->max_calls = (uint32_t)path_count;
       funcctx->user_fctx = path;
 
-      DBG("Path count %i", path_count);
+      PGR_DBG("Path count %i", path_count);
 
       funcctx->tuple_desc =
             BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
@@ -481,7 +444,7 @@ bidir_astar_shortest_path(PG_FUNCTION_ARGS)
   }
 
   /* stuff done on every call of the function */
-  DBG("Strange stuff doing\n");
+  PGR_DBG("Strange stuff doing\n");
 
   funcctx = SRF_PERCALL_SETUP();
 
@@ -490,7 +453,7 @@ bidir_astar_shortest_path(PG_FUNCTION_ARGS)
   tuple_desc = funcctx->tuple_desc;
   path = (path_element_t*) funcctx->user_fctx;
 
-  DBG("Trying to allocate some memory\n");
+  PGR_DBG("Trying to allocate some memory\n");
 
   if (call_cntr < max_calls) {   /* do when there is more left to send */
       HeapTuple    tuple;
@@ -510,17 +473,17 @@ bidir_astar_shortest_path(PG_FUNCTION_ARGS)
       values[3] = Float8GetDatum(path[call_cntr].cost);
       nulls[3] = ' ';
 
-      DBG("Heap making\n");
+      PGR_DBG("Heap making\n");
 
       tuple = heap_formtuple(tuple_desc, values, nulls);
 
-      DBG("Datum making\n");
+      PGR_DBG("Datum making\n");
 
       /* make the tuple into a datum */
       result = HeapTupleGetDatum(tuple);
 
 
-      DBG("Trying to free some memory\n");
+      PGR_DBG("Trying to free some memory\n");
 
       /* clean up (this is not really necessary) */
       pfree(values);
@@ -529,7 +492,7 @@ bidir_astar_shortest_path(PG_FUNCTION_ARGS)
       SRF_RETURN_NEXT(funcctx, result);
   }
   else {   /* do when there is no more left */
-      DBG("Freeing path");
+      PGR_DBG("Freeing path");
       if (path) free(path);
 
       profstop("store", prof_store);
diff --git a/src/bd_astar/src/bdastar.h b/src/bd_astar/src/bdastar.h
index c631325..5b60f09 100644
--- a/src/bd_astar/src/bdastar.h
+++ b/src/bd_astar/src/bdastar.h
@@ -1,58 +1,43 @@
-/*
+/*PGR-GNU*****************************************************************
+ *
  * Bi Directional A* Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-#ifndef _BDASTAR_H
-#define _BDASTAR_H
 
-#include "postgres.h"
+Mail: project at pgrouting.org
 
+------
 
-typedef struct edge_astar 
-{
-  int id;
-  int source;
-  int target;
-  float8 cost;
-  float8 reverse_cost;
-  float8 s_x;
-  float8 s_y;
-  float8 t_x;
-  float8 t_y;
-} edge_astar_t;
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef _BDASTAR_H
+#define _BDASTAR_H
 
-typedef struct path_element 
-{
-    int vertex_id;
-    int edge_id;
-    float8 cost;
-} path_element_t;
+#include "../../common/src/pgr_types.h"
 
 
 #ifdef __cplusplus
 extern "C"
 #endif
 
-  int bdastar_wrapper(edge_astar_t *edges, unsigned int count, int maxnode,
+  int bdastar_wrapper(edge_astar_t *edges, size_t count, int maxnode,
                   int source_vertex_id, int target_vertex_id,
                   bool directed, bool has_reverse_cost,
-                  path_element_t **path, int *path_count, char **err_msg);
+                  path_element_t **path, size_t *path_count, char **err_msg);
 #ifdef __cplusplus
 extern "C"
 #endif
diff --git a/src/bd_astar/src/bdastar_core.cpp b/src/bd_astar/src/bdastar_core.cpp
index 038b010..1267fa8 100644
--- a/src/bd_astar/src/bdastar_core.cpp
+++ b/src/bd_astar/src/bdastar_core.cpp
@@ -1,4 +1,5 @@
-/******************************************************************************
+/*PGR-MIT*****************************************************************
+
 * $Id$
 *
 * Project:  pgRouting bdsp and bdastar algorithms
@@ -6,26 +7,31 @@
 * Author:   Razequl Islam <ziboncsedu at gmail.com>
 *
 
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
-*****************************************************************************/
 #ifdef __MINGW32__
 #include <winsock2.h>
 #include <windows.h>
@@ -36,16 +42,19 @@
 #include "BiDirAStar.h"
 #include "bdastar.h"
 
-int bdastar_wrapper(edge_astar_t *edges, unsigned int edge_count, int maxnode,
+int bdastar_wrapper(edge_astar_t *edges, size_t edge_count, int maxnode,
                   int source_vertex_id, int target_vertex_id,
                   bool directed, bool has_reverse_cost,
-                  path_element_t **path, int *path_count, char **err_msg)
+                  path_element_t **path, size_t *path_count, char **err_msg)
 {
     int res;
 
     try {
 	    BiDirAStar bdastar;
 	    res = bdastar.bidir_astar(edges, edge_count, maxnode, source_vertex_id, target_vertex_id, path, path_count, err_msg);
+        // TODO  this are an unused parameters have to be used
+        if (has_reverse_cost) {};
+        if (directed) {};
     }
     catch(std::exception& e) {
         *err_msg = (char *) e.what();
diff --git a/src/bd_astar/src/utils.h b/src/bd_astar/src/utils.h
deleted file mode 100644
index 935cd96..0000000
--- a/src/bd_astar/src/utils.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <string>
-#include <map>
-#include <vector>
-#include <queue>
-#include <iostream>
-
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<int> IntVector;
-typedef std::vector<double> DoubleVector;
-typedef std::vector<std::string> StringVector;
-
-
-class StringOperation
-{
-	
-public:
-	
-	static std::string TRIMWHITESPACE(std::string strInput)
-	{
-		std::string strOut = strInput;
-		std::string strWht = " \f\n\r\t\v";	
-
-		strOut.erase(0,strOut.find_first_not_of(strWht));
-		strOut.erase(strOut.find_last_not_of(strWht) + 1);
-		return strOut;
-	};
-};
-
-class StringTokenizer
-{
-public:
-	StringTokenizer()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		vecTokens.clear();
-		strInput = "";
-	}
-
-	bool parse(std::string strInput, std::string chDelim)
-	{
-		size_t iStartPos = 0;
-		while(true)	
-		{
-			size_t iPos = strInput.find(chDelim[0],iStartPos);
-			if(iPos != std::string::npos)
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos,iPos - iStartPos);
-				vecTokens.push_back(strToken);
-				iStartPos = iPos + 1;
-			}
-			else if(iPos == std::string::npos && strInput.length() > 0 )
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos, strInput.length() - iStartPos);
-				if(strToken.length() > 0)
-					vecTokens.push_back(strToken);
-				break;
-			}		
-			else 
-				break;
-
-		}		
-		return true;
-	}
-
-	size_t getTokenCount() 
-	{
-		return vecTokens.size();
-	}
-
-	bool getToken(std::string& strToken, size_t iTokenIndex)
-	{
-		long lTokenCount = vecTokens.size();
-		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
-		{
-			strToken = vecTokens[iTokenIndex];
-			return true;
-		}
-		return false;
-	}
-
-	bool getTokens(StringVector& vecTokensRef)
-	{
-		vecTokensRef = vecTokens;
-		return true;
-	}
-
-private:
-	std::string strInput;
-	StringVector vecTokens;
-	
-};
-
-#endif
diff --git a/src/bd_astar/test/bd_astar-any-01.test.sql b/src/bd_astar/test/bd_astar-any-01.test.sql
index 35d55d4..6d9a455 100644
--- a/src/bd_astar/test/bd_astar-any-01.test.sql
+++ b/src/bd_astar/test/bd_astar-any-01.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bdastar('select * from bdaways'::text, 5700, 6733, true, true) as r ) as foo;
diff --git a/src/bd_astar/test/bd_astar-any-02.test.sql b/src/bd_astar/test/bd_astar-any-02.test.sql
index d1d6a0d..ef88680 100644
--- a/src/bd_astar/test/bd_astar-any-02.test.sql
+++ b/src/bd_astar/test/bd_astar-any-02.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bdastar('select * from bdaways'::text, 6585, 8247, true, true) as r ) as foo;
diff --git a/src/bd_astar/test/bd_astar-any-03.test.sql b/src/bd_astar/test/bd_astar-any-03.test.sql
index 714d4e0..f90a660 100644
--- a/src/bd_astar/test/bd_astar-any-03.test.sql
+++ b/src/bd_astar/test/bd_astar-any-03.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bdastar('select * from bdaways'::text, 9426, 3606, true, true) as r ) as foo;
diff --git a/src/bd_astar/test/bd_astar-any-04.test.sql b/src/bd_astar/test/bd_astar-any-04.test.sql
index 9297ff7..275babd 100644
--- a/src/bd_astar/test/bd_astar-any-04.test.sql
+++ b/src/bd_astar/test/bd_astar-any-04.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bdastar('select * from bdaways'::text, 3606, 9426, true, true) as r ) as foo;
diff --git a/src/bd_astar/test/bd_astar-any-05.test.sql b/src/bd_astar/test/bd_astar-any-05.test.sql
index 2e4b4d5..d20162d 100644
--- a/src/bd_astar/test/bd_astar-any-05.test.sql
+++ b/src/bd_astar/test/bd_astar-any-05.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bdastar('select * from bdaways'::text, 6733, 5700, true, true) as r ) as foo;
diff --git a/src/bd_astar/test/bd_astar-any-06.test.sql b/src/bd_astar/test/bd_astar-any-06.test.sql
index 3bc3224..07867be 100644
--- a/src/bd_astar/test/bd_astar-any-06.test.sql
+++ b/src/bd_astar/test/bd_astar-any-06.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bdastar('select * from bdaways'::text, 8247, 6585, true, true) as r ) as foo;
diff --git a/src/bd_astar/test/doc-bdAstar.result b/src/bd_astar/test/doc-bdAstar.result
new file mode 100644
index 0000000..5f8531b
--- /dev/null
+++ b/src/bd_astar/test/doc-bdAstar.result
@@ -0,0 +1,13 @@
+--q1
+0|4|3|0
+1|3|5|1
+2|6|11|1
+3|11|12|0
+4|10|-1|0
+--q2
+0|4|3|1
+1|3|5|1
+2|6|8|1
+3|5|10|1
+4|10|-1|0
+--q3
diff --git a/src/bd_astar/test/doc-bdAstar.test.sql b/src/bd_astar/test/doc-bdAstar.test.sql
new file mode 100644
index 0000000..7bba7de
--- /dev/null
+++ b/src/bd_astar/test/doc-bdAstar.test.sql
@@ -0,0 +1,18 @@
+BEGIN;
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_pgr_bdAStar
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+\echo --q1
+SELECT * FROM pgr_bdAStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2
+     FROM edge_table',
+    4, 10, false, false);
+\echo --q2
+SELECT * FROM pgr_bdAStar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, x1, y1, x2, y2, reverse_cost
+     FROM edge_table ',
+    4, 10, true, true);
+\echo --q3
+ROLLBACK;
diff --git a/src/bd_astar/test/pgtap/bdAstar-types-check.sql b/src/bd_astar/test/pgtap/bdAstar-types-check.sql
new file mode 100644
index 0000000..9c7212b
--- /dev/null
+++ b/src/bd_astar/test/pgtap/bdAstar-types-check.sql
@@ -0,0 +1,198 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(33);
+
+-- RECEIVES 5 PARAMETERS
+
+SELECT has_function('pgr_bdastar',ARRAY['text', 'integer', 'integer', 'boolean', 'boolean']);
+SELECT function_returns('pgr_bdastar', 'setof pgr_costresult','Returns set of costResult[]');
+
+
+-- CHECKING THE INNER QUERY
+
+
+
+PREPARE q1 AS
+SELECT * FROM pgr_bdastar(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table',
+    2, 3, true, true);
+SELECT lives_ok('q1', 'edges query accepts INTEGER & FLOAT');
+
+
+
+SELECT todo_start('issue #140 must accept ANY-INTEGER and ANY-NUMERICAL');
+-- some test pass because the code is not checking
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'id accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'id accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'source accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'source accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'target accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'target accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL, reverse_cost::FLOAT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts REAL');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::BIGINT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::INTEGER, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::SMALLINT, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::REAL, x1::FLOAT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts REAL');
+
+-- x1
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::BIGINT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::INTEGER, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::SMALLINT, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x1::REAL, y1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x1 accepts REAL');
+
+-- x2
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::BIGINT, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::INTEGER, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::SMALLINT, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, x2::REAL, y1::FLOAT, x1::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'x2 accepts REAL');
+
+
+-- y1
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::BIGINT, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::INTEGER, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::SMALLINT, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y1::REAL, x1::FLOAT, x2::FLOAT, y2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y1 accepts REAL');
+
+-- y2
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::BIGINT, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::INTEGER, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::SMALLINT, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bdastar(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT, y2::REAL, y1::FLOAT, x1::FLOAT, x2::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'y2 accepts REAL');
+
+SELECT todo_end();
+
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/bd_astar/test/test.conf b/src/bd_astar/test/test.conf
index d506bed..5e26425 100644
--- a/src/bd_astar/test/test.conf
+++ b/src/bd_astar/test/test.conf
@@ -4,7 +4,17 @@
     'any' => {
         'comment' => 'Bi-directional AStar test for any versions.',
         'data' => ['bd_astar-any-00.data'],
-        'tests' => [qw(bd_astar-any-01 bd_astar-any-02 bd_astar-any-03 bd_astar-any-04 bd_astar-any-05 bd_astar-any-06)]
+        'tests' => [qw(
+            bd_astar-any-01 
+            bd_astar-any-02 
+            bd_astar-any-03 
+            bd_astar-any-04 
+            bd_astar-any-05 
+            bd_astar-any-06
+            )],
+        'documentation' => [qw(
+            doc-bdAstar
+            )],
         },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/bd_astar/tester/BDATester.cpp b/src/bd_astar/tester/BDATester.cpp
index f433645..7fa45d9 100644
--- a/src/bd_astar/tester/BDATester.cpp
+++ b/src/bd_astar/tester/BDATester.cpp
@@ -1,307 +1,312 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#include "BiDirAStar.h"
-#include "utils.h"
-#include<math.h>
-#include<time.h>
-#include<stdio.h>
-#include<string.h>
-
-#define EPS 1e-8
-
-
-std::vector<edge_astar_t> vecEdges;
-edge_astar_t *edges;
-int edge_count, maxNode;
-char buff[1024];
-path_element_t *path;
-char *err_msg;
-int path_count;
-int kase;
-
-/*
-	This method load the edge information from a csv file and put them in the edge_t array that can be passed to the algorithm to find route
-*/
-
-void loadGraph(std::string edgeFile)
-{
-	// Open file for reading
-	freopen(edgeFile.c_str(), "rt", stdin);
-
-	edge_count = 0;
-	vecEdges.clear();
-	maxNode = -1;
-
-	// Read line by line edge info
-	while(gets(buff))
-	{
-		if(strlen(buff) == 0)
-			break;
-		edge_count++;
-
-		StringTokenizer token;
-		// tokenize using comma
-		token.parse(buff, ",");
-		std::vector<std::string> vecToken;
-		vecToken.clear();
-		token.getTokens(vecToken);
-
-		// There should be exactly 9 values: edge_id, start_node_id, end_node_id, 
-		// start_node_longitude, start_node_latitude, end_node_longitude, end_node_latitude, cost, reverse_cost
-		if(vecToken.size() < 5)
-			fprintf(stderr, "Error in %d edge\n", edge_count);
-
-		// Populate Edge_t structure
-		edge_astar_t tempEdge;
-		tempEdge.id = atoi(vecToken[0].c_str());
-		tempEdge.source = atoi(vecToken[1].c_str());
-		tempEdge.target = atoi(vecToken[2].c_str());
-		tempEdge.cost = atof(vecToken[3].c_str());
-		tempEdge.reverse_cost = atof(vecToken[4].c_str());
-		tempEdge.s_x = atof(vecToken[5].c_str());
-		tempEdge.s_y = atof(vecToken[6].c_str());
-		tempEdge.t_x = atof(vecToken[7].c_str());
-		tempEdge.t_y = atof(vecToken[8].c_str());
-
-		// Update max_node_id
-		if(tempEdge.source > maxNode)
-			maxNode = tempEdge.source;
-		if(tempEdge.target > maxNode)
-			maxNode = tempEdge.target;
-		
-		vecEdges.push_back(tempEdge);
-	}
-
-	edges = new edge_astar_t[edge_count];
-	int i;
-
-	for(i = 0; i < edge_count; i++)
-	{
-		edges[i] = vecEdges[i];
-	}
-	fclose(stdin);
-}
-/*
-	Write the route in the path file
-*/
-void write_result(std::string fileName, int res)
-{
-	int i;
-	freopen(fileName.c_str(), "wt", stdout);
-	if(res < 0)
-		printf("%s\n", err_msg);
-	else
-	{
-		for(i = 0; i < path_count; i++)
-		{
-			printf("%d\t|%d\t|%.6lf\n", path[i].vertex_id, path[i].edge_id, path[i].cost);
-		}
-	}
-	fclose(stdout);
-}
-
-/*
-	Match output with answer file and write result in the result file
-*/
-
-void match(std::string fileName1, std::string fileName2, std::string outFile, double ttime)
-{
-	// Open the first file
-	freopen(fileName1.c_str(), "rt", stdin);
-
-	// Initialization
-	std::vector<int> nodeList1;
-	nodeList1.clear();
-	double totCost1, totCost2;
-	int nid, eid;
-	double cost;
-	totCost1 = 0.0;
-	
-	// Read paths push node_id, edge_id inthe vector and update total cost
-	while(gets(buff))
-	{
-		if(sscanf(buff, "%d |%d |%lf", &nid, &eid, &cost) != 3)
-		{
-			totCost1 = -1;
-			break;
-		}
-		nodeList1.push_back(nid);
-		nodeList1.push_back(eid);
-		totCost1 += cost;
-	}
-	fclose(stdin);
-	bool flag = true;
-	// Open the second file
-	freopen(fileName2.c_str(), "rt", stdin);
-	totCost2 = 0.0;
-	int pos = 0;
-
-	// Read paths compare with previously constructed vector of node-id, edge_id and updte total cost
-	while(gets(buff))
-	{
-		if(sscanf(buff, "%d |%d |%lf", &nid, &eid, &cost) != 3)
-		{
-			totCost2 = -1;
-			break;
-		}
-		if(pos >= nodeList1.size() || nodeList1[pos] != nid)
-		{
-			flag = false;
-		}
-		pos++;
-		if(pos >= nodeList1.size() || nodeList1[pos] != eid)
-		{
-			flag = false;
-		}
-		pos++;
-		totCost2 += cost;
-	}
-	fclose(stdin);
-
-	// Open output file to write
-	freopen(outFile.c_str(), "a+", stdout);
-	printf("Case %d: ", kase);
-
-	// Both costs matches
-	if(fabs(totCost1 - totCost2) < EPS)
-	{
-		// Path also matches
-		if(flag == true)
-		{
-			printf("Perfect Match!!!\n");
-		}
-		else	// path mismatch
-		{
-			printf("Cost same, but path differs!!!\n");
-		}
-	}
-	else // Cost mispatch
-	{
-		printf("Cost differs, %s costs %lf and %s costs %lf\n", fileName1.c_str(), totCost1, fileName2.c_str(), totCost2);
-	}
-	printf("Query time: %lf sec\n\n", ttime);
-	fclose(stdout);
-}
-
-int main()
-{
-	int i;
-	double cl;
-	kase = 1;
-
-	// The final output will be written in the outFile and the initial input will be read from inFile
-	std::string outFile = "output.txt";
-	std::string inFile = "input.txt";
-
-	// Create the output file
-	FILE *fpout = fopen(outFile.c_str(), "wt");
-	fclose(fpout);
-
-	// Open the input file
-	FILE *fpin = fopen(inFile.c_str(), "rt");
-
-	// Reading each of the cases, There may be two types of cases, with 4 parameters, with 5 parameters
-	// There may also be comments that starts with #
-	while(fgets(buff, 1000, fpin))
-	{
-		// No data
-		if(strlen(buff) == 0)
-			continue;
-		// Comment
-		if(buff[0] == '#')
-			continue;
-		StringTokenizer token;
-
-		// tokeniize using space
-		token.parse(buff, " \n\r");
-		std::vector<std::string> vecToken; 
-		token.getTokens(vecToken);
-
-		int totParam = vecToken.size();
-
-		// Not enough parameters
-		if(totParam < 4)
-			continue;
-
-		// First token is the graph file name
-		std::string graphFile = vecToken[0];
-
-		// 2nd and 3rd tokens are start and end node id respectively
-		int startNode = atoi(vecToken[1].c_str());
-		int endNode = atoi(vecToken[2].c_str());
-
-		// 4th Token is the result file for this query
-		std::string pathFile = vecToken[3];
-		int ind = pathFile.length() - 1;
-		while(pathFile[ind] < 32)
-		{
-			pathFile[ind] = '\0';
-			ind--;
-		}
-
-		// Load edge information from graph file
-		loadGraph(graphFile);
-
-		// Use bidirectional AStar to get the route
-		BiDirAStar gdef;
-		cl = clock();
-		int res = gdef.bidir_astar(edges, edge_count, maxNode, startNode, endNode, &path, &path_count, &err_msg);
-		cl = clock() - cl;
-
-		// Write the route in the result file
-		write_result(pathFile, res);
-		
-		// There is an answer file
-		if(totParam > 4)
-		{
-			std::string ansFile = vecToken[4];
-			ind = ansFile.length() - 1;
-			while(ansFile[ind] < 32)
-			{
-				ansFile[ind] = '\0';
-				ind--;
-			}
-			// Match and write result in the final output file
-			match(pathFile, ansFile, outFile, cl / CLOCKS_PER_SEC);
-		}
-		else
-		{
-			// Provide information that the route is generated in path file.
-			fpout = fopen(outFile.c_str(), "a+");
-			fprintf(fpout, "Case %d: Path Written to file %s", kase, pathFile.c_str());
-			fprintf(fpout, "Query Time: %lf sec\n\n", cl / CLOCKS_PER_SEC);
-			fclose(fpout);
-		}
-		kase++;
-		free(path);
-		delete [] edges;
-	}
-	return 0;
-}
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+*
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+
+#include "BiDirAStar.h"
+#include "utils.h"
+#include<math.h>
+#include<time.h>
+#include<stdio.h>
+#include<string.h>
+
+#define EPS 1e-8
+
+
+std::vector<edge_astar_t> vecEdges;
+edge_astar_t *edges;
+int edge_count, maxNode;
+char buff[1024];
+path_element_t *path;
+char *err_msg;
+int path_count;
+int kase;
+
+/*
+	This method load the edge information from a csv file and put them in the edge_t array that can be passed to the algorithm to find route
+*/
+
+void loadGraph(std::string edgeFile)
+{
+	// Open file for reading
+	freopen(edgeFile.c_str(), "rt", stdin);
+
+	edge_count = 0;
+	vecEdges.clear();
+	maxNode = -1;
+
+	// Read line by line edge info
+	while(gets(buff))
+	{
+		if(strlen(buff) == 0)
+			break;
+		edge_count++;
+
+		StringTokenizer token;
+		// tokenize using comma
+		token.parse(buff, ",");
+		std::vector<std::string> vecToken;
+		vecToken.clear();
+		token.getTokens(vecToken);
+
+		// There should be exactly 9 values: edge_id, start_node_id, end_node_id, 
+		// start_node_longitude, start_node_latitude, end_node_longitude, end_node_latitude, cost, reverse_cost
+		if(vecToken.size() < 5)
+			fprintf(stderr, "Error in %d edge\n", edge_count);
+
+		// Populate Edge_t structure
+		edge_astar_t tempEdge;
+		tempEdge.id = atoi(vecToken[0].c_str());
+		tempEdge.source = atoi(vecToken[1].c_str());
+		tempEdge.target = atoi(vecToken[2].c_str());
+		tempEdge.cost = atof(vecToken[3].c_str());
+		tempEdge.reverse_cost = atof(vecToken[4].c_str());
+		tempEdge.s_x = atof(vecToken[5].c_str());
+		tempEdge.s_y = atof(vecToken[6].c_str());
+		tempEdge.t_x = atof(vecToken[7].c_str());
+		tempEdge.t_y = atof(vecToken[8].c_str());
+
+		// Update max_node_id
+		if(tempEdge.source > maxNode)
+			maxNode = tempEdge.source;
+		if(tempEdge.target > maxNode)
+			maxNode = tempEdge.target;
+		
+		vecEdges.push_back(tempEdge);
+	}
+
+	edges = new edge_astar_t[edge_count];
+	int i;
+
+	for(i = 0; i < edge_count; i++)
+	{
+		edges[i] = vecEdges[i];
+	}
+	fclose(stdin);
+}
+/*
+	Write the route in the path file
+*/
+void write_result(std::string fileName, int res)
+{
+	int i;
+	freopen(fileName.c_str(), "wt", stdout);
+	if(res < 0)
+		printf("%s\n", err_msg);
+	else
+	{
+		for(i = 0; i < path_count; i++)
+		{
+			printf("%d\t|%d\t|%.6lf\n", path[i].vertex_id, path[i].edge_id, path[i].cost);
+		}
+	}
+	fclose(stdout);
+}
+
+/*
+	Match output with answer file and write result in the result file
+*/
+
+void match(std::string fileName1, std::string fileName2, std::string outFile, double ttime)
+{
+	// Open the first file
+	freopen(fileName1.c_str(), "rt", stdin);
+
+	// Initialization
+	std::vector<int> nodeList1;
+	nodeList1.clear();
+	double totCost1, totCost2;
+	int nid, eid;
+	double cost;
+	totCost1 = 0.0;
+	
+	// Read paths push node_id, edge_id inthe vector and update total cost
+	while(gets(buff))
+	{
+		if(sscanf(buff, "%d |%d |%lf", &nid, &eid, &cost) != 3)
+		{
+			totCost1 = -1;
+			break;
+		}
+		nodeList1.push_back(nid);
+		nodeList1.push_back(eid);
+		totCost1 += cost;
+	}
+	fclose(stdin);
+	bool flag = true;
+	// Open the second file
+	freopen(fileName2.c_str(), "rt", stdin);
+	totCost2 = 0.0;
+	int pos = 0;
+
+	// Read paths compare with previously constructed vector of node-id, edge_id and updte total cost
+	while(gets(buff))
+	{
+		if(sscanf(buff, "%d |%d |%lf", &nid, &eid, &cost) != 3)
+		{
+			totCost2 = -1;
+			break;
+		}
+		if(pos >= nodeList1.size() || nodeList1[pos] != nid)
+		{
+			flag = false;
+		}
+		pos++;
+		if(pos >= nodeList1.size() || nodeList1[pos] != eid)
+		{
+			flag = false;
+		}
+		pos++;
+		totCost2 += cost;
+	}
+	fclose(stdin);
+
+	// Open output file to write
+	freopen(outFile.c_str(), "a+", stdout);
+	printf("Case %d: ", kase);
+
+	// Both costs matches
+	if(fabs(totCost1 - totCost2) < EPS)
+	{
+		// Path also matches
+		if(flag == true)
+		{
+			printf("Perfect Match!!!\n");
+		}
+		else	// path mismatch
+		{
+			printf("Cost same, but path differs!!!\n");
+		}
+	}
+	else // Cost mispatch
+	{
+		printf("Cost differs, %s costs %lf and %s costs %lf\n", fileName1.c_str(), totCost1, fileName2.c_str(), totCost2);
+	}
+	printf("Query time: %lf sec\n\n", ttime);
+	fclose(stdout);
+}
+
+int main()
+{
+	int i;
+	double cl;
+	kase = 1;
+
+	// The final output will be written in the outFile and the initial input will be read from inFile
+	std::string outFile = "output.txt";
+	std::string inFile = "input.txt";
+
+	// Create the output file
+	FILE *fpout = fopen(outFile.c_str(), "wt");
+	fclose(fpout);
+
+	// Open the input file
+	FILE *fpin = fopen(inFile.c_str(), "rt");
+
+	// Reading each of the cases, There may be two types of cases, with 4 parameters, with 5 parameters
+	// There may also be comments that starts with #
+	while(fgets(buff, 1000, fpin))
+	{
+		// No data
+		if(strlen(buff) == 0)
+			continue;
+		// Comment
+		if(buff[0] == '#')
+			continue;
+		StringTokenizer token;
+
+		// tokeniize using space
+		token.parse(buff, " \n\r");
+		std::vector<std::string> vecToken; 
+		token.getTokens(vecToken);
+
+		int totParam = vecToken.size();
+
+		// Not enough parameters
+		if(totParam < 4)
+			continue;
+
+		// First token is the graph file name
+		std::string graphFile = vecToken[0];
+
+		// 2nd and 3rd tokens are start and end node id respectively
+		int startNode = atoi(vecToken[1].c_str());
+		int endNode = atoi(vecToken[2].c_str());
+
+		// 4th Token is the result file for this query
+		std::string pathFile = vecToken[3];
+		int ind = pathFile.length() - 1;
+		while(pathFile[ind] < 32)
+		{
+			pathFile[ind] = '\0';
+			ind--;
+		}
+
+		// Load edge information from graph file
+		loadGraph(graphFile);
+
+		// Use bidirectional AStar to get the route
+		BiDirAStar gdef;
+		cl = clock();
+		int res = gdef.bidir_astar(edges, edge_count, maxNode, startNode, endNode, &path, &path_count, &err_msg);
+		cl = clock() - cl;
+
+		// Write the route in the result file
+		write_result(pathFile, res);
+		
+		// There is an answer file
+		if(totParam > 4)
+		{
+			std::string ansFile = vecToken[4];
+			ind = ansFile.length() - 1;
+			while(ansFile[ind] < 32)
+			{
+				ansFile[ind] = '\0';
+				ind--;
+			}
+			// Match and write result in the final output file
+			match(pathFile, ansFile, outFile, cl / CLOCKS_PER_SEC);
+		}
+		else
+		{
+			// Provide information that the route is generated in path file.
+			fpout = fopen(outFile.c_str(), "a+");
+			fprintf(fpout, "Case %d: Path Written to file %s", kase, pathFile.c_str());
+			fprintf(fpout, "Query Time: %lf sec\n\n", cl / CLOCKS_PER_SEC);
+			fclose(fpout);
+		}
+		kase++;
+		free(path);
+		delete [] edges;
+	}
+	return 0;
+}
diff --git a/src/bd_astar/tester/BiDirAStar.cpp b/src/bd_astar/tester/BiDirAStar.cpp
index cc72264..773de69 100644
--- a/src/bd_astar/tester/BiDirAStar.cpp
+++ b/src/bd_astar/tester/BiDirAStar.cpp
@@ -1,506 +1,511 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#include "BiDirAStar.h"
-
-BiDirAStar::BiDirAStar(void)
-{
-}
-
-BiDirAStar::~BiDirAStar(void)
-{
-}
-
-void BiDirAStar::init()
-{
-	//max_edge_id = 0;
-	//max_node_id = 0;
-	
-}
-
-/*
-	Initialization and allocation of memories.
-*/
-
-void BiDirAStar::initall(int maxNode)
-{
-	int i;
-	m_pFParent = new PARENT_PATH[maxNode + 1];
-	m_pRParent = new PARENT_PATH[maxNode + 1];
-
-	m_pFCost = new double[maxNode + 1];
-	m_pRCost = new double[maxNode + 1];
-
-	for(i = 0; i <= maxNode; i++)
-	{
-		m_pFParent[i].par_Node = -2;
-		m_pRParent[i].par_Node = -2;
-		m_pFCost[i] = INF;
-		m_pRCost[i] = INF;
-		
-	}
-	m_MinCost = INF;
-	m_MidNode = -1;
-}
-
-/*
-	Delete the allocated memories to avoid memory leak.
-*/
-
-void BiDirAStar::deleteall()
-{
-	delete [] m_pFParent;
-	delete [] m_pRParent;
-	delete [] m_pFCost;
-	delete [] m_pRCost;
-}
-
-/*
-	Get the current cost from source to the current node if direction is 1 else the cost to reach target from the current node.
-*/
-
-double BiDirAStar::getcost(int node_id, int dir)
-{
-	if(dir == 1)
-	{
-		return(m_pFCost[node_id]);
-	}
-	else
-	{
-		return(m_pRCost[node_id]);
-	}
-}
-
-
-double BiDirAStar::dist(double x1, double y1, double x2, double y2)
-{
-	double ret = fabs((x1 - x2) + fabs(y1 - y2));
-	//double ret = sqrt(x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
-	return(ret * 10);
-}
-
-/*
-	Get the heuristic cost of the node depending on dir (1 for forward search and -1 for reverse search).
-*/
-double BiDirAStar::gethcost(int node_id, int dir)
-{
-	if(dir == -1)
-	{
-		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lStartNodeId].xpos, m_vecNodeVector[m_lStartNodeId].ypos));
-	}
-	else
-	{
-		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lEndNodeId].xpos, m_vecNodeVector[m_lEndNodeId].ypos));
-	}
-}
-
-/*
-	Set the forward or reverse cost list depending on dir (1 for forward search and -1 for reverse search).
-*/
-
-
-void BiDirAStar::setcost(int node_id, int dir, double c)
-{
-	if(dir == 1)
-	{
-		m_pFCost[node_id] = c;
-	}
-	else
-	{
-		m_pRCost[node_id] = c;
-	}
-}
-
-void BiDirAStar::setparent(int node_id, int dir, int parnode, int paredge)
-{
-	if(dir == 1)
-	{
-		m_pFParent[node_id].par_Node = parnode;
-		m_pFParent[node_id].par_Edge = paredge;
-	}
-	else
-	{
-		m_pRParent[node_id].par_Node = parnode;
-		m_pRParent[node_id].par_Edge = paredge;
-	}
-}
-
-/*
-	Reconstruct path for forward search. It is like normal dijkstra. The parent array contains the parent of the current node and there is a -1 in the source.
-	So one need to recurse upto the source and then add the current node and edge to the list.
-*/
-
-void BiDirAStar::fconstruct_path(int node_id)
-{
-	if(m_pFParent[node_id].par_Node == -1)
-		return;
-	fconstruct_path(m_pFParent[node_id].par_Node);
-	path_element_t pt;
-	pt.vertex_id = m_pFParent[node_id].par_Node;
-	pt.edge_id = m_pFParent[node_id].par_Edge;
-	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
-	m_vecPath.push_back(pt);
-}
-
-/*
-	Reconstruct path for the reverse search. In this case the subsequent node is stored in the parent and the target contains a -1. So one need to add the node
-	and edge to the list and then recurse through the parent upto hitting a -1.
-*/
-
-void BiDirAStar::rconstruct_path(int node_id)
-{
-	path_element_t pt;
-	if(m_pRParent[node_id].par_Node == -1)
-	{
-		pt.vertex_id = node_id;
-		pt.edge_id = -1;
-		pt.cost = 0.0;
-		return;
-	}
-	pt.vertex_id = node_id;
-	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
-	pt.edge_id = m_pRParent[node_id].par_Edge;
-	m_vecPath.push_back(pt);
-	rconstruct_path(m_pRParent[node_id].par_Node);
-}
-
-/*
-	This is the main exploration module. The parameter dir indicates whether the exploration will be in forward or reverser direction. The reference to the corresponding
-	que is also passed as parameter que. The current node and the current costs are also available as parameter.
-*/
-
-//void BiDirAStar::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
-void BiDirAStar::explore(int cur_node, double cur_cost, int dir, MinHeap &que)
-{
-	int i;
-	// Number of connected edges
-	int con_edge = m_vecNodeVector[cur_node].Connected_Edges_Index.size();
-	double edge_cost;
-	for(i = 0; i < con_edge; i++)
-	{
-		int edge_index = m_vecNodeVector[cur_node].Connected_Edges_Index[i];
-		// Get the edge from the edge list.
-		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
-		// Get the connected node
-		int new_node = m_vecNodeVector[cur_node].Connected_Nodes[i];
-		int mult;
-		
-		if(edge.Direction == 0)
-			mult = 1;
-		else
-			mult = dir;
-		if(cur_node == edge.StartNode)
-		{
-			// Current node is the startnode of the edge. For forward search it should use forward cost, otherwise it should use the reverse cost,
-			// i.e. if the reverse direction is valid then this node may be visited from the end node.
-			if(dir > 0)
-				edge_cost = edge.Cost;
-			else
-				edge_cost = edge.ReverseCost;
-			// Check if the direction is valid for exploration
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				//edge_cost = edge.Cost * mult;
-				// Check if the current edge gives better result
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
-
-					// Update the minimum cost found so far.
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-		else
-		{
-			// Current node is the endnode of the edge. For forward search it should use reverse cost, otherwise it should use the forward cost,
-			// i.e. if the forward direction is valid then this node may be visited from the start node.
-			if(dir > 0)
-				edge_cost = edge.ReverseCost;
-			else
-				edge_cost = edge.Cost;
-			// Check if the direction is valid for exploration
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				//edge_cost = edge.ReverseCost * mult;
-				
-				// Check if the current edge gives better result
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
-					// Update the minimum cost found so far.
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-	}
-}
-
-/* 
-	This is the entry function that the wrappers should call. Most of the parameters are trivial. maxNode refers to Maximum
-	node id. As we run node based exploration cost, parent etc will be based on maximam node id.
-*/
-
-int BiDirAStar:: bidir_astar(edge_astar_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-				path_element_t **path, int *path_count, char **err_msg)
-{
-	max_node_id = maxNode;
-	max_edge_id = -1;
-	
-	// construct the graph from the edge list, i.e. populate node and edge data structures
-	construct_graph(edges, edge_count, maxNode);
-	
-	m_lStartNodeId = start_vertex;
-	m_lEndNodeId = end_vertex;
-
-	int nodeCount = m_vecNodeVector.size();
-	
-	MinHeap fque(maxNode + 2);
-	MinHeap rque(maxNode + 2);
-	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
-	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
-	
-	m_vecPath.clear();
-
-	int i;
-	// Allocate memory for local storage like cost and parent holder
-	initall(maxNode);
-
-	// Initialize the forward search
-	m_pFParent[start_vertex].par_Node = -1;
-	m_pFParent[start_vertex].par_Edge = -1;
-	m_pFCost[start_vertex] = 0.0;
-	fque.push(std::make_pair(0.0, start_vertex));
-
-	// Initialize the reverse search
-	m_pRParent[end_vertex].par_Node = -1;
-	m_pRParent[end_vertex].par_Edge = -1;
-	m_pRCost[end_vertex] = 0.0;
-	rque.push(std::make_pair(0.0, end_vertex));
-
-
-	int new_node;
-	int cur_node;
-	int dir;
-/*
-	The main loop. The algorithm is as follows:
-	1. IF the sum of the current minimum of both heap is greater than so far found path, we cannot get any better, so break the loop.
-	2. IF the reverse heap minimum is lower than the forward heap minimum, explore from reverse direction.
-	3. ELSE explore from the forward directtion.
-*/
-
-	while(!fque.empty() && !rque.empty())
-	{
-		PDI fTop = fque.top();
-		PDI rTop = rque.top();
-		if(m_pFCost[fTop.second] + m_pRCost[rTop.second] > m_MinCost) //We are done, there is no path with lower cost
-			break;
-
-		if(rTop.first < fTop.first) // Explore from reverse queue
-		{
-			if(rTop.first > m_MinCost)
-				break;
-			cur_node = rTop.second;
-			int dir = -1;
-			rque.pop();
-			explore(cur_node, m_pRCost[rTop.second], dir, rque);
-		}
-		else                        // Explore from forward queue
-		{
-			if(fTop.first > m_MinCost)
-				break;
-			cur_node = fTop.second;
-			int dir = 1;
-			fque.pop();
-			explore(cur_node, m_pFCost[fTop.second], dir, fque);
-		}
-	}
-
-/*
-	Path reconstruction part. m_MidNode is the joining point where two searches meet to make a shortest path. It is updated in explore.
-	If it contains -1, then no path is found. Other wise we have a shortest path and that is reconstructed in the m_vecPath.
-*/
-
-	if(m_MidNode == -1)
-	{
-		*err_msg = (char *)"Path Not Found";
-		deleteall();
-		return -1;
-	}
-	else
-	{
-		// reconstruct path from forward search
-		fconstruct_path(m_MidNode);
-		// reconstruct path from backward search
-		rconstruct_path(m_MidNode);
-
-		// insert the last row in the path trace (having edge_id = -1 and cost = 0.0)
-		path_element_t pelement;
-		pelement.vertex_id = end_vertex;
-		pelement.edge_id = -1;
-		pelement.cost = 0.0;
-		m_vecPath.push_back(pelement);
-
-		// Transfer data path to path_element_t format and allocate memory and populate the pointer
-		*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
-		*path_count = m_vecPath.size();
-
-		for(i = 0; i < *path_count; i++)
-		{
-			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
-			(*path)[i].edge_id = m_vecPath[i].edge_id;
-			(*path)[i].cost = m_vecPath[i].cost;
-		}
-		
-	}
-	deleteall();
-	return 0;
-}
-
-/*
-	Populate the member variables of the class using the edge list. Basically there is a node list and an edge list. Each node contains the list of adjacent nodes and 
-	corresponding edge indices from edge list that connect this node with the adjacent nodes.
-*/
-
-bool BiDirAStar::construct_graph(edge_astar_t* edges, int edge_count, int maxNode)
-{
-	int i;
-	// Create a dummy node
-	GraphNodeInfo nodeInfo;
-	nodeInfo.Connected_Edges_Index.clear();
-	nodeInfo.Connected_Nodes.clear();
-
-	// Insert the dummy node into the node list. This acts as place holder. Also change the nodeId so that nodeId and node index in the vector are same.
-	// There may be some nodes here that does not appear in the edge list. The size of the list is upto maxNode which is equal to maximum node id.
-	for(i = 0; i <= maxNode; i++)
-	{
-		nodeInfo.NodeID = i;
-		m_vecNodeVector.push_back(nodeInfo);
-	}
-
-	// Process each edge from the edge list and update the member data structures accordingly.
-	for(i = 0; i < edge_count; i++)
-	{
-		addEdge(edges[i]);
-	}
-
-	return true;
-}
-
-/*
-	Process the edge and populate the member nodelist and edgelist. The nodelist already contains upto maxNode dummy entries with nodeId same as index. Now the
-	connectivity information needs to be updated.
-*/
-
-bool BiDirAStar::addEdge(edge_astar_t edgeIn)
-{
-	long lTest;
-	// Check if the edge is already processed.
-	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
-	if(itMap != m_mapEdgeId2Index.end())	
-		return false;
-
-	// Create a GraphEdgeInfo using the information of the current edge
-	GraphEdgeInfo newEdge;
-	newEdge.EdgeID = edgeIn.id;
-	newEdge.EdgeIndex = m_vecEdgeVector.size();	
-	newEdge.StartNode = edgeIn.source;
-	newEdge.EndNode = edgeIn.target;
-	newEdge.Cost = edgeIn.cost;
-	newEdge.ReverseCost = edgeIn.reverse_cost;
-
-	// Set the direction. If both cost and reverse cost has positive value the edge is bidirectional and direction field is 0. If cost is positive and reverse cost
-	// negative then the edge is unidirectional with direction = 1 (goes from source to target) otherwise it is unidirectional with direction = -1 (goes from target
-	// to source). Another way of creating unidirectional edge is assigning big values in cost or reverse_cost. In that case the direction is still zero and this case
-	// is handled in the algorithm automatically.
-	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
-	{
-		newEdge.Direction = 0;
-	}
-	else if(newEdge.Cost >= 0.0)
-	{
-		newEdge.Direction = 1;
-	}
-	else
-	{
-		newEdge.Direction = -1;
-	}
-
-	if(edgeIn.id > max_edge_id)
-	{
-		max_edge_id = edgeIn.id;
-	}
-
-	// Update max_edge_id
-	if(newEdge.StartNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.StartNode;
-	}
-	if(newEdge.EndNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.EdgeIndex;
-	}
-
-	m_vecNodeVector[newEdge.StartNode].xpos = edgeIn.s_x;
-	m_vecNodeVector[newEdge.StartNode].ypos = edgeIn.s_y;
-
-	m_vecNodeVector[newEdge.EndNode].xpos = edgeIn.t_x;
-	m_vecNodeVector[newEdge.EndNode].ypos = edgeIn.t_y;
-
-	// update connectivity information for the start node.
-	m_vecNodeVector[newEdge.StartNode].Connected_Nodes.push_back(newEdge.EndNode);
-	m_vecNodeVector[newEdge.StartNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-	// update connectivity information for the end node.
-	m_vecNodeVector[newEdge.EndNode].Connected_Nodes.push_back(newEdge.StartNode);
-	m_vecNodeVector[newEdge.EndNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-
-	
-	//Adding edge to the list
-	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
-	m_vecEdgeVector.push_back(newEdge);
-
-	//
-	return true;
-}
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+*
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+
+#include "BiDirAStar.h"
+
+BiDirAStar::BiDirAStar(void)
+{
+}
+
+BiDirAStar::~BiDirAStar(void)
+{
+}
+
+void BiDirAStar::init()
+{
+	//max_edge_id = 0;
+	//max_node_id = 0;
+	
+}
+
+/*
+	Initialization and allocation of memories.
+*/
+
+void BiDirAStar::initall(int maxNode)
+{
+	int i;
+	m_pFParent = new PARENT_PATH[maxNode + 1];
+	m_pRParent = new PARENT_PATH[maxNode + 1];
+
+	m_pFCost = new double[maxNode + 1];
+	m_pRCost = new double[maxNode + 1];
+
+	for(i = 0; i <= maxNode; i++)
+	{
+		m_pFParent[i].par_Node = -2;
+		m_pRParent[i].par_Node = -2;
+		m_pFCost[i] = INF;
+		m_pRCost[i] = INF;
+		
+	}
+	m_MinCost = INF;
+	m_MidNode = -1;
+}
+
+/*
+	Delete the allocated memories to avoid memory leak.
+*/
+
+void BiDirAStar::deleteall()
+{
+	delete [] m_pFParent;
+	delete [] m_pRParent;
+	delete [] m_pFCost;
+	delete [] m_pRCost;
+}
+
+/*
+	Get the current cost from source to the current node if direction is 1 else the cost to reach target from the current node.
+*/
+
+double BiDirAStar::getcost(int node_id, int dir)
+{
+	if(dir == 1)
+	{
+		return(m_pFCost[node_id]);
+	}
+	else
+	{
+		return(m_pRCost[node_id]);
+	}
+}
+
+
+double BiDirAStar::dist(double x1, double y1, double x2, double y2)
+{
+	double ret = fabs((x1 - x2) + fabs(y1 - y2));
+	//double ret = sqrt(x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+	return(ret * 10);
+}
+
+/*
+	Get the heuristic cost of the node depending on dir (1 for forward search and -1 for reverse search).
+*/
+double BiDirAStar::gethcost(int node_id, int dir)
+{
+	if(dir == -1)
+	{
+		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lStartNodeId].xpos, m_vecNodeVector[m_lStartNodeId].ypos));
+	}
+	else
+	{
+		return(dist(m_vecNodeVector[node_id].xpos, m_vecNodeVector[node_id].ypos, m_vecNodeVector[m_lEndNodeId].xpos, m_vecNodeVector[m_lEndNodeId].ypos));
+	}
+}
+
+/*
+	Set the forward or reverse cost list depending on dir (1 for forward search and -1 for reverse search).
+*/
+
+
+void BiDirAStar::setcost(int node_id, int dir, double c)
+{
+	if(dir == 1)
+	{
+		m_pFCost[node_id] = c;
+	}
+	else
+	{
+		m_pRCost[node_id] = c;
+	}
+}
+
+void BiDirAStar::setparent(int node_id, int dir, int parnode, int paredge)
+{
+	if(dir == 1)
+	{
+		m_pFParent[node_id].par_Node = parnode;
+		m_pFParent[node_id].par_Edge = paredge;
+	}
+	else
+	{
+		m_pRParent[node_id].par_Node = parnode;
+		m_pRParent[node_id].par_Edge = paredge;
+	}
+}
+
+/*
+	Reconstruct path for forward search. It is like normal dijkstra. The parent array contains the parent of the current node and there is a -1 in the source.
+	So one need to recurse upto the source and then add the current node and edge to the list.
+*/
+
+void BiDirAStar::fconstruct_path(int node_id)
+{
+	if(m_pFParent[node_id].par_Node == -1)
+		return;
+	fconstruct_path(m_pFParent[node_id].par_Node);
+	path_element_t pt;
+	pt.vertex_id = m_pFParent[node_id].par_Node;
+	pt.edge_id = m_pFParent[node_id].par_Edge;
+	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
+	m_vecPath.push_back(pt);
+}
+
+/*
+	Reconstruct path for the reverse search. In this case the subsequent node is stored in the parent and the target contains a -1. So one need to add the node
+	and edge to the list and then recurse through the parent upto hitting a -1.
+*/
+
+void BiDirAStar::rconstruct_path(int node_id)
+{
+	path_element_t pt;
+	if(m_pRParent[node_id].par_Node == -1)
+	{
+		pt.vertex_id = node_id;
+		pt.edge_id = -1;
+		pt.cost = 0.0;
+		return;
+	}
+	pt.vertex_id = node_id;
+	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
+	pt.edge_id = m_pRParent[node_id].par_Edge;
+	m_vecPath.push_back(pt);
+	rconstruct_path(m_pRParent[node_id].par_Node);
+}
+
+/*
+	This is the main exploration module. The parameter dir indicates whether the exploration will be in forward or reverser direction. The reference to the corresponding
+	que is also passed as parameter que. The current node and the current costs are also available as parameter.
+*/
+
+//void BiDirAStar::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
+void BiDirAStar::explore(int cur_node, double cur_cost, int dir, MinHeap &que)
+{
+	int i;
+	// Number of connected edges
+	int con_edge = m_vecNodeVector[cur_node].Connected_Edges_Index.size();
+	double edge_cost;
+	for(i = 0; i < con_edge; i++)
+	{
+		int edge_index = m_vecNodeVector[cur_node].Connected_Edges_Index[i];
+		// Get the edge from the edge list.
+		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
+		// Get the connected node
+		int new_node = m_vecNodeVector[cur_node].Connected_Nodes[i];
+		int mult;
+		
+		if(edge.Direction == 0)
+			mult = 1;
+		else
+			mult = dir;
+		if(cur_node == edge.StartNode)
+		{
+			// Current node is the startnode of the edge. For forward search it should use forward cost, otherwise it should use the reverse cost,
+			// i.e. if the reverse direction is valid then this node may be visited from the end node.
+			if(dir > 0)
+				edge_cost = edge.Cost;
+			else
+				edge_cost = edge.ReverseCost;
+			// Check if the direction is valid for exploration
+			if(edge.Direction == 0 || edge_cost >= 0.0)
+			{
+				//edge_cost = edge.Cost * mult;
+				// Check if the current edge gives better result
+				if(cur_cost + edge_cost < getcost(new_node, dir))
+				{
+					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
+					setcost(new_node, dir, cur_cost + edge_cost);
+					setparent(new_node, dir, cur_node, edge.EdgeID);
+					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
+
+					// Update the minimum cost found so far.
+					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
+					{
+						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
+						m_MidNode = new_node;
+					}
+				}
+			}
+		}
+		else
+		{
+			// Current node is the endnode of the edge. For forward search it should use reverse cost, otherwise it should use the forward cost,
+			// i.e. if the forward direction is valid then this node may be visited from the start node.
+			if(dir > 0)
+				edge_cost = edge.ReverseCost;
+			else
+				edge_cost = edge.Cost;
+			// Check if the direction is valid for exploration
+			if(edge.Direction == 0 || edge_cost >= 0.0)
+			{
+				//edge_cost = edge.ReverseCost * mult;
+				
+				// Check if the current edge gives better result
+				if(cur_cost + edge_cost < getcost(new_node, dir))
+				{
+					// explore the node, and push it in the queue. the value in the queue will also contain the heuristic cost
+					setcost(new_node, dir, cur_cost + edge_cost);
+					setparent(new_node, dir, cur_node, edge.EdgeID);
+					que.push(std::make_pair(cur_cost + edge_cost + gethcost(new_node, dir), new_node));
+					// Update the minimum cost found so far.
+					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
+					{
+						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
+						m_MidNode = new_node;
+					}
+				}
+			}
+		}
+	}
+}
+
+/* 
+	This is the entry function that the wrappers should call. Most of the parameters are trivial. maxNode refers to Maximum
+	node id. As we run node based exploration cost, parent etc will be based on maximam node id.
+*/
+
+int BiDirAStar:: bidir_astar(edge_astar_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
+				path_element_t **path, int *path_count, char **err_msg)
+{
+	max_node_id = maxNode;
+	max_edge_id = -1;
+	
+	// construct the graph from the edge list, i.e. populate node and edge data structures
+	construct_graph(edges, edge_count, maxNode);
+	
+	m_lStartNodeId = start_vertex;
+	m_lEndNodeId = end_vertex;
+
+	int nodeCount = m_vecNodeVector.size();
+	
+	MinHeap fque(maxNode + 2);
+	MinHeap rque(maxNode + 2);
+	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
+	//std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
+	
+	m_vecPath.clear();
+
+	int i;
+	// Allocate memory for local storage like cost and parent holder
+	initall(maxNode);
+
+	// Initialize the forward search
+	m_pFParent[start_vertex].par_Node = -1;
+	m_pFParent[start_vertex].par_Edge = -1;
+	m_pFCost[start_vertex] = 0.0;
+	fque.push(std::make_pair(0.0, start_vertex));
+
+	// Initialize the reverse search
+	m_pRParent[end_vertex].par_Node = -1;
+	m_pRParent[end_vertex].par_Edge = -1;
+	m_pRCost[end_vertex] = 0.0;
+	rque.push(std::make_pair(0.0, end_vertex));
+
+
+	int new_node;
+	int cur_node;
+	int dir;
+/*
+	The main loop. The algorithm is as follows:
+	1. IF the sum of the current minimum of both heap is greater than so far found path, we cannot get any better, so break the loop.
+	2. IF the reverse heap minimum is lower than the forward heap minimum, explore from reverse direction.
+	3. ELSE explore from the forward directtion.
+*/
+
+	while(!fque.empty() && !rque.empty())
+	{
+		PDI fTop = fque.top();
+		PDI rTop = rque.top();
+		if(m_pFCost[fTop.second] + m_pRCost[rTop.second] > m_MinCost) //We are done, there is no path with lower cost
+			break;
+
+		if(rTop.first < fTop.first) // Explore from reverse queue
+		{
+			if(rTop.first > m_MinCost)
+				break;
+			cur_node = rTop.second;
+			int dir = -1;
+			rque.pop();
+			explore(cur_node, m_pRCost[rTop.second], dir, rque);
+		}
+		else                        // Explore from forward queue
+		{
+			if(fTop.first > m_MinCost)
+				break;
+			cur_node = fTop.second;
+			int dir = 1;
+			fque.pop();
+			explore(cur_node, m_pFCost[fTop.second], dir, fque);
+		}
+	}
+
+/*
+	Path reconstruction part. m_MidNode is the joining point where two searches meet to make a shortest path. It is updated in explore.
+	If it contains -1, then no path is found. Other wise we have a shortest path and that is reconstructed in the m_vecPath.
+*/
+
+	if(m_MidNode == -1)
+	{
+		*err_msg = (char *)"Path Not Found";
+		deleteall();
+		return -1;
+	}
+	else
+	{
+		// reconstruct path from forward search
+		fconstruct_path(m_MidNode);
+		// reconstruct path from backward search
+		rconstruct_path(m_MidNode);
+
+		// insert the last row in the path trace (having edge_id = -1 and cost = 0.0)
+		path_element_t pelement;
+		pelement.vertex_id = end_vertex;
+		pelement.edge_id = -1;
+		pelement.cost = 0.0;
+		m_vecPath.push_back(pelement);
+
+		// Transfer data path to path_element_t format and allocate memory and populate the pointer
+		*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
+		*path_count = m_vecPath.size();
+
+		for(i = 0; i < *path_count; i++)
+		{
+			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
+			(*path)[i].edge_id = m_vecPath[i].edge_id;
+			(*path)[i].cost = m_vecPath[i].cost;
+		}
+		
+	}
+	deleteall();
+	return 0;
+}
+
+/*
+	Populate the member variables of the class using the edge list. Basically there is a node list and an edge list. Each node contains the list of adjacent nodes and 
+	corresponding edge indices from edge list that connect this node with the adjacent nodes.
+*/
+
+bool BiDirAStar::construct_graph(edge_astar_t* edges, int edge_count, int maxNode)
+{
+	int i;
+	// Create a dummy node
+	GraphNodeInfo nodeInfo;
+	nodeInfo.Connected_Edges_Index.clear();
+	nodeInfo.Connected_Nodes.clear();
+
+	// Insert the dummy node into the node list. This acts as place holder. Also change the nodeId so that nodeId and node index in the vector are same.
+	// There may be some nodes here that does not appear in the edge list. The size of the list is upto maxNode which is equal to maximum node id.
+	for(i = 0; i <= maxNode; i++)
+	{
+		nodeInfo.NodeID = i;
+		m_vecNodeVector.push_back(nodeInfo);
+	}
+
+	// Process each edge from the edge list and update the member data structures accordingly.
+	for(i = 0; i < edge_count; i++)
+	{
+		addEdge(edges[i]);
+	}
+
+	return true;
+}
+
+/*
+	Process the edge and populate the member nodelist and edgelist. The nodelist already contains upto maxNode dummy entries with nodeId same as index. Now the
+	connectivity information needs to be updated.
+*/
+
+bool BiDirAStar::addEdge(edge_astar_t edgeIn)
+{
+	long lTest;
+	// Check if the edge is already processed.
+	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
+	if(itMap != m_mapEdgeId2Index.end())	
+		return false;
+
+	// Create a GraphEdgeInfo using the information of the current edge
+	GraphEdgeInfo newEdge;
+	newEdge.EdgeID = edgeIn.id;
+	newEdge.EdgeIndex = m_vecEdgeVector.size();	
+	newEdge.StartNode = edgeIn.source;
+	newEdge.EndNode = edgeIn.target;
+	newEdge.Cost = edgeIn.cost;
+	newEdge.ReverseCost = edgeIn.reverse_cost;
+
+	// Set the direction. If both cost and reverse cost has positive value the edge is bidirectional and direction field is 0. If cost is positive and reverse cost
+	// negative then the edge is unidirectional with direction = 1 (goes from source to target) otherwise it is unidirectional with direction = -1 (goes from target
+	// to source). Another way of creating unidirectional edge is assigning big values in cost or reverse_cost. In that case the direction is still zero and this case
+	// is handled in the algorithm automatically.
+	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
+	{
+		newEdge.Direction = 0;
+	}
+	else if(newEdge.Cost >= 0.0)
+	{
+		newEdge.Direction = 1;
+	}
+	else
+	{
+		newEdge.Direction = -1;
+	}
+
+	if(edgeIn.id > max_edge_id)
+	{
+		max_edge_id = edgeIn.id;
+	}
+
+	// Update max_edge_id
+	if(newEdge.StartNode > max_node_id)
+	{
+		return false;//max_node_id = newEdge.StartNode;
+	}
+	if(newEdge.EndNode > max_node_id)
+	{
+		return false;//max_node_id = newEdge.EdgeIndex;
+	}
+
+	m_vecNodeVector[newEdge.StartNode].xpos = edgeIn.s_x;
+	m_vecNodeVector[newEdge.StartNode].ypos = edgeIn.s_y;
+
+	m_vecNodeVector[newEdge.EndNode].xpos = edgeIn.t_x;
+	m_vecNodeVector[newEdge.EndNode].ypos = edgeIn.t_y;
+
+	// update connectivity information for the start node.
+	m_vecNodeVector[newEdge.StartNode].Connected_Nodes.push_back(newEdge.EndNode);
+	m_vecNodeVector[newEdge.StartNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
+
+	// update connectivity information for the end node.
+	m_vecNodeVector[newEdge.EndNode].Connected_Nodes.push_back(newEdge.StartNode);
+	m_vecNodeVector[newEdge.EndNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
+
+
+	
+	//Adding edge to the list
+	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
+	m_vecEdgeVector.push_back(newEdge);
+
+	//
+	return true;
+}
diff --git a/src/bd_astar/tester/BiDirAStar.h b/src/bd_astar/tester/BiDirAStar.h
index e9e6def..8060cd0 100644
--- a/src/bd_astar/tester/BiDirAStar.h
+++ b/src/bd_astar/tester/BiDirAStar.h
@@ -1,154 +1,159 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef BIDIRASTAR_H
-#define BIDIRASTAR_H
-
-#include <vector>
-#include <map>
-#include <queue>
-#include <string>
-#include <stdlib.h>
-#include <iostream>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "MinHeap.h"
-//#include "bdastar.h"
-
-#define INF 1e15
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<LongVector> VectorOfLongVector;
-//typedef std::pair<int, bool> PIB;
-typedef std::pair<double, int> PDI;
-//typedef std::pair<double, std::vector<int> > PDVI;
-
-typedef struct edge 
-{
-	int id;
-	int source;
-	int target;
-	double s_x;
-	double s_y;
-	double t_x;
-	double t_y;
-	double cost;
-	double reverse_cost;
-} edge_astar_t;
-
-typedef struct path_element 
-{
-	int vertex_id;
-	int edge_id;
-	double cost;
-}path_element_t;
-
-
-typedef struct{
-	int par_Node;
-	int par_Edge;
-}PARENT_PATH;
-
-typedef struct{
-	int NodeID;
-	double xpos;
-	double ypos;
-	std::vector<int> Connected_Nodes;
-	std::vector<int> Connected_Edges_Index;
-}GraphNodeInfo;
-
-struct GraphEdgeInfo
-{
-public:
-	int EdgeID;
-	int EdgeIndex;
-	int Direction;
-	double Cost;
-	double ReverseCost;
-	int StartNode;
-	int EndNode;
-};
-
-typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
-typedef std::map<long,LongVector> Long2LongVectorMap;
-typedef std::map<long,long> Long2LongMap;
-typedef std::vector<GraphNodeInfo> GraphNodeVector;
-
-
-class BiDirAStar
-{
-public:
-	BiDirAStar(void);
-	~BiDirAStar(void);
-	
-	int bidir_astar(edge_astar_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-		path_element_t **path, int *path_count, char **err_msg);
-	
-
-private:
-	bool construct_graph(edge_astar_t *edges, int edge_count, int maxNode);
-	void fconstruct_path(int node_id);
-	void rconstruct_path(int node_id);
-	bool addEdge(edge_astar_t edgeIn);
-	bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
-	void init();
-	void initall(int maxNode);
-	void deleteall();
-	//void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
-	void explore(int cur_node, double cur_cost, int dir, MinHeap &que);
-	double getcost(int node_id, int dir);
-	void setcost(int node_id, int dir, double c);
-	void setparent(int node_id, int dir, int parnode, int paredge);
-	double gethcost(int node_id, int dir);
-	double dist(double x1, double y1, double x2, double y2);
-
-private:
-	GraphEdgeVector m_vecEdgeVector;
-	Long2LongMap m_mapEdgeId2Index;
-	Long2LongVectorMap m_mapNodeId2Edge;
-	GraphNodeVector m_vecNodeVector;
-	int max_node_id;
-	int max_edge_id;
-	int m_lStartNodeId;
-	int m_lEndNodeId;
-
-	double m_MinCost;
-	int m_MidNode;
-	std::vector <path_element_t> m_vecPath;
-	PARENT_PATH *m_pFParent;
-	PARENT_PATH *m_pRParent;
-	double *m_pFCost;
-	double *m_pRCost;
-};
-
-#endif
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+*
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+
+#ifndef BIDIRASTAR_H
+#define BIDIRASTAR_H
+
+#include <vector>
+#include <map>
+#include <queue>
+#include <string>
+#include <stdlib.h>
+#include <iostream>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "MinHeap.h"
+//#include "bdastar.h"
+
+#define INF 1e15
+
+
+
+typedef std::vector<long> LongVector;
+typedef std::vector<LongVector> VectorOfLongVector;
+//typedef std::pair<int, bool> PIB;
+typedef std::pair<double, int> PDI;
+//typedef std::pair<double, std::vector<int> > PDVI;
+
+typedef struct edge 
+{
+	int id;
+	int source;
+	int target;
+	double s_x;
+	double s_y;
+	double t_x;
+	double t_y;
+	double cost;
+	double reverse_cost;
+} edge_astar_t;
+
+typedef struct path_element 
+{
+	int vertex_id;
+	int edge_id;
+	double cost;
+}path_element_t;
+
+
+typedef struct{
+	int par_Node;
+	int par_Edge;
+}PARENT_PATH;
+
+typedef struct{
+	int NodeID;
+	double xpos;
+	double ypos;
+	std::vector<int> Connected_Nodes;
+	std::vector<int> Connected_Edges_Index;
+}GraphNodeInfo;
+
+struct GraphEdgeInfo
+{
+public:
+	int EdgeID;
+	int EdgeIndex;
+	int Direction;
+	double Cost;
+	double ReverseCost;
+	int StartNode;
+	int EndNode;
+};
+
+typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
+typedef std::map<long,LongVector> Long2LongVectorMap;
+typedef std::map<long,long> Long2LongMap;
+typedef std::vector<GraphNodeInfo> GraphNodeVector;
+
+
+class BiDirAStar
+{
+public:
+	BiDirAStar(void);
+	~BiDirAStar(void);
+	
+	int bidir_astar(edge_astar_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
+		path_element_t **path, int *path_count, char **err_msg);
+	
+
+private:
+	bool construct_graph(edge_astar_t *edges, int edge_count, int maxNode);
+	void fconstruct_path(int node_id);
+	void rconstruct_path(int node_id);
+	bool addEdge(edge_astar_t edgeIn);
+	bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
+	void init();
+	void initall(int maxNode);
+	void deleteall();
+	//void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
+	void explore(int cur_node, double cur_cost, int dir, MinHeap &que);
+	double getcost(int node_id, int dir);
+	void setcost(int node_id, int dir, double c);
+	void setparent(int node_id, int dir, int parnode, int paredge);
+	double gethcost(int node_id, int dir);
+	double dist(double x1, double y1, double x2, double y2);
+
+private:
+	GraphEdgeVector m_vecEdgeVector;
+	Long2LongMap m_mapEdgeId2Index;
+	Long2LongVectorMap m_mapNodeId2Edge;
+	GraphNodeVector m_vecNodeVector;
+	int max_node_id;
+	int max_edge_id;
+	int m_lStartNodeId;
+	int m_lEndNodeId;
+
+	double m_MinCost;
+	int m_MidNode;
+	std::vector <path_element_t> m_vecPath;
+	PARENT_PATH *m_pFParent;
+	PARENT_PATH *m_pRParent;
+	double *m_pFCost;
+	double *m_pRCost;
+};
+
+#endif
diff --git a/src/bd_astar/tester/MinHeap.cpp b/src/bd_astar/tester/MinHeap.cpp
index 234e263..1288654 100644
--- a/src/bd_astar/tester/MinHeap.cpp
+++ b/src/bd_astar/tester/MinHeap.cpp
@@ -1,4 +1,5 @@
-/******************************************************************************
+/*PGR-MIT*****************************************************************
+
 * $Id$
 *
 * Project:  pgRouting bdsp and bdastar algorithms
@@ -6,26 +7,30 @@
 * Author:   Razequl Islam <ziboncsedu at gmail.com>
 *
 
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 #include "MinHeap.h"
 
diff --git a/src/bd_astar/tester/MinHeap.h b/src/bd_astar/tester/MinHeap.h
index 2b3868f..2760a3a 100644
--- a/src/bd_astar/tester/MinHeap.h
+++ b/src/bd_astar/tester/MinHeap.h
@@ -1,4 +1,5 @@
-/******************************************************************************
+/*PGR-MIT*****************************************************************
+
 * $Id$
 *
 * Project:  pgRouting bdsp and bdastar algorithms
@@ -6,26 +7,30 @@
 * Author:   Razequl Islam <ziboncsedu at gmail.com>
 *
 
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 #ifndef MINHEAP_H
 #define MINHEAP_H
diff --git a/src/bd_astar/tester/utils.h b/src/bd_astar/tester/utils.h
index 2ae3fb0..3cc70d5 100644
--- a/src/bd_astar/tester/utils.h
+++ b/src/bd_astar/tester/utils.h
@@ -1,106 +1,128 @@
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <string>
-#include <map>
-#include <vector>
-#include <queue>
-#include <iostream>
-
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<int> IntVector;
-typedef std::vector<double> DoubleVector;
-typedef std::vector<std::string> StringVector;
-
-
-class StringOperation
-{
-	
-public:
-	
-	static std::string TRIMWHITESPACE(std::string strInput)
-	{
-		std::string strOut = strInput;
-		std::string strWht = " \f\n\r\t\v";	
-
-		strOut.erase(0,strOut.find_first_not_of(strWht));
-		strOut.erase(strOut.find_last_not_of(strWht) + 1);
-		return strOut;
-	};
-};
-
-class StringTokenizer
-{
-public:
-	StringTokenizer()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		vecTokens.clear();
-		strInput = "";
-	}
-
-	bool parse(std::string strInput, std::string chDelim)
-	{
-		size_t iStartPos = 0;
-		while(true)	
-		{
-			size_t iPos = strInput.find(chDelim[0],iStartPos);
-			if(iPos != std::string::npos)
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos,iPos - iStartPos);
-				vecTokens.push_back(strToken);
-				iStartPos = iPos + 1;
-			}
-			else if(iPos == std::string::npos && strInput.length() > 0 )
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos, strInput.length() - iStartPos);
-				if(strToken.length() > 0)
-					vecTokens.push_back(strToken);
-				break;
-			}		
-			else 
-				break;
-
-		}		
-		return true;
-	}
-
-	size_t getTokenCount() 
-	{
-		return vecTokens.size();
-	}
-
-	bool getToken(std::string& strToken, size_t iTokenIndex)
-	{
-		long lTokenCount = vecTokens.size();
-		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
-		{
-			strToken = vecTokens[iTokenIndex];
-			return true;
-		}
-		return false;
-	}
-
-	bool getTokens(StringVector& vecTokensRef)
-	{
-		vecTokensRef = vecTokens;
-		return true;
-	}
-
-private:
-	std::string strInput;
-	StringVector vecTokens;
-	
-};
-
-#endif
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <string>
+#include <map>
+#include <vector>
+#include <queue>
+#include <iostream>
+
+
+
+
+typedef std::vector<long> LongVector;
+typedef std::vector<int> IntVector;
+typedef std::vector<double> DoubleVector;
+typedef std::vector<std::string> StringVector;
+
+
+class StringOperation
+{
+	
+public:
+	
+	static std::string TRIMWHITESPACE(std::string strInput)
+	{
+		std::string strOut = strInput;
+		std::string strWht = " \f\n\r\t\v";	
+
+		strOut.erase(0,strOut.find_first_not_of(strWht));
+		strOut.erase(strOut.find_last_not_of(strWht) + 1);
+		return strOut;
+	};
+};
+
+class StringTokenizer
+{
+public:
+	StringTokenizer()
+	{
+		reset();
+	}
+
+	void reset()
+	{
+		vecTokens.clear();
+		strInput = "";
+	}
+
+	bool parse(std::string strInput, std::string chDelim)
+	{
+		size_t iStartPos = 0;
+		while(true)	
+		{
+			size_t iPos = strInput.find(chDelim[0],iStartPos);
+			if(iPos != std::string::npos)
+			{
+				std::string strToken;
+				strToken = strInput.substr(iStartPos,iPos - iStartPos);
+				vecTokens.push_back(strToken);
+				iStartPos = iPos + 1;
+			}
+			else if(iPos == std::string::npos && strInput.length() > 0 )
+			{
+				std::string strToken;
+				strToken = strInput.substr(iStartPos, strInput.length() - iStartPos);
+				if(strToken.length() > 0)
+					vecTokens.push_back(strToken);
+				break;
+			}		
+			else 
+				break;
+
+		}		
+		return true;
+	}
+
+	size_t getTokenCount() 
+	{
+		return vecTokens.size();
+	}
+
+	bool getToken(std::string& strToken, size_t iTokenIndex)
+	{
+		long lTokenCount = vecTokens.size();
+		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
+		{
+			strToken = vecTokens[iTokenIndex];
+			return true;
+		}
+		return false;
+	}
+
+	bool getTokens(StringVector& vecTokensRef)
+	{
+		vecTokensRef = vecTokens;
+		return true;
+	}
+
+private:
+	std::string strInput;
+	StringVector vecTokens;
+	
+};
+
+#endif
diff --git a/src/bd_dijkstra/doc/doc-bdDijkstra.queries b/src/bd_dijkstra/doc/doc-bdDijkstra.queries
new file mode 100644
index 0000000..47cd559
--- /dev/null
+++ b/src/bd_dijkstra/doc/doc-bdDijkstra.queries
@@ -0,0 +1,31 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_bdDijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+    4, 10, false, false);
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   4 |   3 |    0
+   1 |   3 |   2 |    0
+   2 |   2 |   4 |    1
+   3 |   5 |  10 |    1
+   4 |  10 |  -1 |    0
+(5 rows)
+
+--q2
+SELECT * FROM pgr_bdDijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    4, 10, true, true);
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   4 |   3 |    1
+   1 |   3 |   2 |    1
+   2 |   2 |   4 |    1
+   3 |   5 |  10 |    1
+   4 |  10 |  -1 |    0
+(5 rows)
+
+--q3
+ROLLBACK;
+ROLLBACK
diff --git a/src/bd_dijkstra/doc/index.rst b/src/bd_dijkstra/doc/index.rst
deleted file mode 100644
index 585f3c1..0000000
--- a/src/bd_dijkstra/doc/index.rst
+++ /dev/null
@@ -1,123 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _bd_dijkstra:
-
-pgr_bdDijkstra - Bi-directional Dijkstra Shortest Path
-===============================================================================
-
-.. index:: 
-	single: pgr_bdDijkstra(text, integer, integer, boolean, boolean)
-	module: bidirectional, dijkstra
-
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_bdDijkstra`` - Returns the shortest path using Bidirectional Dijkstra algorithm.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-This is a bi-directional Dijkstra search algorithm. It searchs from the source toward the distination and at the same time from the destination to the source and terminates whe these to searchs meet in the middle. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-  pgr_costResult[] pgr_bdDijkstra(sql text, source integer, target integer,
-                                  directed boolean, has_rcost boolean);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-  .. code-block:: sql
-
-    SELECT id, source, target, cost [,reverse_cost] FROM edge_table
-
-
-  :id: ``int4`` identifier of the edge
-  :source: ``int4`` identifier of the source vertex
-  :target: ``int4`` identifier of the target vertex
-  :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-  :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:target: ``int4`` id of the end point
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   node ID
-:id2:   edge ID (``-1`` for the last row)
-:cost:  cost to traverse from ``id1`` using ``id2``
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS node, id2 AS edge, cost 
-        FROM pgr_bdDijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            4, 10, false, false
-        );
-
-	 seq | node | edge | cost 
-	-----+------+------+------
-	   0 |    4 |    3 |    0
-	   1 |    3 |    5 |    1
-	   2 |    6 |   11 |    1
-	   3 |   11 |   12 |    0
-	   4 |   10 |   -1 |    0
-	(5 rows)
-
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS node, id2 AS edge, cost 
-        FROM pgr_bdDijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            4, 10, true, true
-        );
-
-	 seq | node | edge | cost 
-	-----+------+------+------
-	   0 |    4 |    3 |    1
-	   1 |    3 |    2 |    1
-	   2 |    2 |    4 |    1
-	   3 |    5 |   10 |    1
-	   4 |   10 |   -1 |    0
-	(5 rows)
-
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* :ref:`bd_astar`
-* http://en.wikipedia.org/wiki/Bidirectional_search
-* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
-
diff --git a/src/bd_dijkstra/doc/pgr_bdDijkstra.rst b/src/bd_dijkstra/doc/pgr_bdDijkstra.rst
new file mode 100644
index 0000000..52801ae
--- /dev/null
+++ b/src/bd_dijkstra/doc/pgr_bdDijkstra.rst
@@ -0,0 +1,96 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _bd_dijkstra:
+
+pgr_bdDijkstra - Bi-directional Dijkstra Shortest Path
+===============================================================================
+
+.. index:: 
+	single: pgr_bdDijkstra(text, integer, integer, boolean, boolean)
+	module: bidirectional, dijkstra
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_bdDijkstra`` - Returns the shortest path using Bidirectional Dijkstra algorithm.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+This is a bi-directional Dijkstra search algorithm. It searchs from the source toward the distination and at the same time from the destination to the source and terminates whe these to searchs meet in the middle. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+  pgr_costResult[] pgr_bdDijkstra(sql text, source integer, target integer,
+                                  directed boolean, has_rcost boolean);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+  .. code-block:: sql
+
+    SELECT id, source, target, cost [,reverse_cost] FROM edge_table
+
+
+  :id: ``int4`` identifier of the edge
+  :source: ``int4`` identifier of the source vertex
+  :target: ``int4`` identifier of the target vertex
+  :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+  :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:target: ``int4`` id of the end point
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   node ID
+:id2:   edge ID (``-1`` for the last row)
+:cost:  cost to traverse from ``id1`` using ``id2``
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+
+.. literalinclude:: doc-bdDijkstra.queries
+   :start-after: --q1
+   :end-before: --q2
+
+* With ``reverse_cost``
+
+.. literalinclude:: doc-bdDijkstra.queries
+   :start-after: --q2
+   :end-before: --q3
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* :ref:`bd_astar`
+* http://en.wikipedia.org/wiki/Bidirectional_search
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
+
diff --git a/src/bd_dijkstra/sql/routing_bd_dijkstra.sql b/src/bd_dijkstra/sql/routing_bd_dijkstra.sql
index 6565711..f6d62ac 100644
--- a/src/bd_dijkstra/sql/routing_bd_dijkstra.sql
+++ b/src/bd_dijkstra/sql/routing_bd_dijkstra.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 -----------------------------------------------------------------------
 -- Core function for bi_directional_dijkstra_shortest_path computation
 -- See README for description
@@ -12,6 +34,6 @@ CREATE OR REPLACE FUNCTION pgr_bdDijkstra(
         directed boolean, 
         has_reverse_cost boolean)
         RETURNS SETOF pgr_costResult
-        AS '$libdir/librouting-2.1', 'bidir_dijkstra_shortest_path'
+        AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'bidir_dijkstra_shortest_path'
         LANGUAGE c IMMUTABLE STRICT;
 
diff --git a/src/bd_dijkstra/src/BiDirDijkstra.cpp b/src/bd_dijkstra/src/BiDirDijkstra.cpp
index 4014c5a..76fca3a 100644
--- a/src/bd_dijkstra/src/BiDirDijkstra.cpp
+++ b/src/bd_dijkstra/src/BiDirDijkstra.cpp
@@ -1,519 +1,506 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-#include "BiDirDijkstra.h"
-
-#undef DEBUG
-//#define DEBUG
-
-#ifdef DEBUG
-#include <stdio.h>
-static FILE *dbg;
-#define DBG(format, arg...) \
-    dbg = fopen("/tmp/sew-debug", "a"); \
-    if (dbg) { \
-        fprintf(dbg, format,  ## arg); \
-        fclose(dbg); \
-    }
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-
-
-BiDirDijkstra::BiDirDijkstra(void)
-{
-}
-
-BiDirDijkstra::~BiDirDijkstra(void)
-{
-}
-
-void BiDirDijkstra::init()
-{
-	//max_edge_id = 0;
-	//max_node_id = 0;
-	
-}
-
-/*
-	Initialization and allocation of memories.
-*/
-void BiDirDijkstra::initall(int maxNode)
-{
-	int i;
-	m_vecPath.clear();
-    DBG("BiDirDijkstra::initall: allocating m_pFParent, m_pRParent maxNode: %d\n", maxNode+1);
-	m_pFParent = new PARENT_PATH[maxNode + 1];
-	m_pRParent = new PARENT_PATH[maxNode + 1];
-    DBG("BiDirDijkstra::initall: allocated m_pFParent, m_pRParent\n");
-
-    DBG("BiDirDijkstra::initall: allocating m_pFCost, m_pRCost maxNode: %d\n", maxNode+1);
-	m_pFCost = new double[maxNode + 1];
-	m_pRCost = new double[maxNode + 1];
-    DBG("BiDirDijkstra::initall: allocated m_pFCost, m_pRCost\n");
-
-	for(i = 0; i <= maxNode; i++)
-	{
-		m_pFParent[i].par_Node = -2;
-		m_pRParent[i].par_Node = -2;
-		m_pFCost[i] = INF;
-		m_pRCost[i] = INF;
-		
-	}
-	m_MinCost = INF;
-	m_MidNode = -1;
-
-    DBG("BiDirDijkstra::initall: m_vecNodeVector.reserve(%d)\n", maxNode + 1);
-    // reserve space for nodes
-    m_vecNodeVector.reserve(maxNode + 1);
-    DBG("           space reserved!\n");
-}
-
-/*
-	Delete the allocated memories to avoid memory leak.
-*/
-void BiDirDijkstra::deleteall()
-{
-	std::vector<GraphNodeInfo*>::iterator it;
-	for(it  = m_vecNodeVector.begin(); it != m_vecNodeVector.end(); it++){
-		delete *it;
-	}
-	m_vecNodeVector.clear();
-	delete [] m_pFParent;
-	delete [] m_pRParent;
-	delete [] m_pFCost;
-	delete [] m_pRCost;
-}
-
-/*
-	Get the current cost from source to the current node if direction is 1 else the cost to reach target from the current node.
-*/
-double BiDirDijkstra::getcost(int node_id, int dir)
-{
-	if(dir == 1)
-	{
-		return(m_pFCost[node_id]);
-	}
-	else
-	{
-		return(m_pRCost[node_id]);
-	}
-}
-/*
-	Set the forward or reverse cost list depending on dir (1 for forward search and -1 for reverse search.
-*/
-void BiDirDijkstra::setcost(int node_id, int dir, double c)
-{
-	if(dir == 1)
-	{
-		m_pFCost[node_id] = c;
-	}
-	else
-	{
-		m_pRCost[node_id] = c;
-	}
-}
-
-void BiDirDijkstra::setparent(int node_id, int dir, int parnode, int paredge)
-{
-	if(dir == 1)
-	{
-		m_pFParent[node_id].par_Node = parnode;
-		m_pFParent[node_id].par_Edge = paredge;
-	}
-	else
-	{
-		m_pRParent[node_id].par_Node = parnode;
-		m_pRParent[node_id].par_Edge = paredge;
-	}
-}
-
-/*
-	Reconstruct path for forward search. It is like normal dijkstra. The parent array contains the parent of the current node and there is a -1 in the source.
-	So one need to recurse upto the source and then add the current node and edge to the list.
-*/
-void BiDirDijkstra::fconstruct_path(int node_id)
-{
-	if(m_pFParent[node_id].par_Node == -1)
-		return;
-	fconstruct_path(m_pFParent[node_id].par_Node);
-	path_element_t pt;
-	pt.vertex_id = m_pFParent[node_id].par_Node;
-	pt.edge_id = m_pFParent[node_id].par_Edge;
-	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
-	m_vecPath.push_back(pt);
-}
-
-/*
-	Reconstruct path for the reverse search. In this case the subsequent node is stored in the parent and the target contains a -1. So one need to add the node
-	and edge to the list and then recurse through the parent upto hitting a -1.
-*/
-
-void BiDirDijkstra::rconstruct_path(int node_id)
-{
-	path_element_t pt;
-	if(m_pRParent[node_id].par_Node == -1)
-	{
-		pt.vertex_id = node_id;
-		pt.edge_id = -1;
-		pt.cost = 0.0;
-		return;
-	}
-	pt.vertex_id = node_id;
-	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
-	pt.edge_id = m_pRParent[node_id].par_Edge;
-	m_vecPath.push_back(pt);
-	rconstruct_path(m_pRParent[node_id].par_Node);
-}
-
-/*
-	This is the main exploration module. The parameter dir indicates whether the exploration will be in forward or reverser direction. The reference to the corresponding
-	que is also passed as parameter que. The current node and the current costs are also available as parameter.
-*/
-
-void BiDirDijkstra::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
-{
-	int i;
-	// Number of connected edges
-	int con_edge = m_vecNodeVector[cur_node]->Connected_Edges_Index.size();
-	double edge_cost;
-
-	for(i = 0; i < con_edge; i++)
-	{
-		int edge_index = m_vecNodeVector[cur_node]->Connected_Edges_Index[i];
-		// Get the edge from the edge list.
-		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
-		// Get the connected node
-		int new_node = m_vecNodeVector[cur_node]->Connected_Nodes[i];
-		
-		if(cur_node == edge.StartNode)
-		{
-			// Current node is the startnode of the edge. For forward search it should use forward cost, otherwise it should use the reverse cost,
-			// i.e. if the reverse direction is valid then this node may be visited from the end node.
-			if(dir > 0)
-				edge_cost = edge.Cost;
-			else
-				edge_cost = edge.ReverseCost;
-
-			// Check if the direction is valid for exploration
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{			
-				// Check if the current edge gives better result
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					// explore the node, and push it in the queue
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost, new_node));
-
-					// Update the minimum cost found so far.
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-		else
-		{
-			// Current node is the endnode of the edge. For forward search it should use reverse cost, otherwise it should use the forward cost,
-			// i.e. if the forward direction is valid then this node may be visited from the start node.
-			if(dir > 0)
-				edge_cost = edge.ReverseCost;
-			else
-				edge_cost = edge.Cost;
-
-			// Check if the direction is valid for exploration
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				// Check if the current edge gives better result
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost, new_node));
-
-					// Update the minimum cost found so far.
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-	}
-}
-
-/* 
-	This is the entry function that the wrappers should call. Most of the parameters are trivial. maxNode refers to Maximum
-	node id. As we run node based exploration cost, parent etc will be based on maximam node id.
-*/
-
-
-int BiDirDijkstra::bidir_dijkstra(edge_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-				path_element_t **path, int *path_count, char **err_msg)
-{
-	max_node_id = maxNode;
-	max_edge_id = -1;
-	
-	// Allocate memory for local storage like cost and parent holder
-    DBG("calling initall(maxNode=%d)\n", maxNode);
-	initall(maxNode);
-
-	// construct the graph from the edge list, i.e. populate node and edge data structures
-    DBG("Calling construct_graph\n");
-	construct_graph(edges, edge_count, maxNode);
-	
-
-	//int nodeCount = m_vecNodeVector.size();
-	DBG("Setting up std::priority_queue\n");
-	std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
-	std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
-	
-    DBG("calling m_vecPath.clear()\n");
-	m_vecPath.clear();
-
-	// Initialize the forward search
-	m_pFParent[start_vertex].par_Node = -1;
-	m_pFParent[start_vertex].par_Edge = -1;
-	m_pFCost[start_vertex] = 0.0;
-	fque.push(std::make_pair(0.0, start_vertex));
-
-	// Initialize the reverse search
-	m_pRParent[end_vertex].par_Node = -1;
-	m_pRParent[end_vertex].par_Edge = -1;
-	m_pRCost[end_vertex] = 0.0;
-	rque.push(std::make_pair(0.0, end_vertex));
-
-	int i;
-	// int new_node;
-	int cur_node;
-	// int dir;
-
-/*
-	The main loop. The algorithm is as follows:
-	1. IF the sum of the current minimum of both heap is greater than so far found path, we cannot get any better, so break the loop.
-	2. IF the reverse heap minimum is lower than the forward heap minimum, explore from reverse direction.
-	3. ELSE explore from the forward directtion.
-*/
-
-	while(!fque.empty() && !rque.empty())
-	{
-		PDI fTop = fque.top();
-		PDI rTop = rque.top();
-		if(fTop.first + rTop.first > m_MinCost) //We are done, there is no path with lower cost
-			break;
-
-		if(rTop.first < fTop.first) // Explore from reverse queue
-		{
-			cur_node = rTop.second;
-			int dir = -1;
-			rque.pop();
-			explore(cur_node, rTop.first, dir, rque);
-		}
-		else                        // Explore from forward queue
-		{
-			cur_node = fTop.second;
-			int dir = 1;
-			fque.pop();
-			explore(cur_node, fTop.first, dir, fque);
-		}
-	}
-
-/*
-	Path reconstruction part. m_MidNode is the joining point where two searches meet to make a shortest path. It is updated in explore.
-	If it contains -1, then no path is found. Other wise we have a shortest path and that is reconstructed in the m_vecPath.
-*/ 
-	if(m_MidNode == -1)
-	{
-		*err_msg = (char *)"Path Not Found";
-		deleteall();
-		return -1;
-	}
-	else
-	{
-		// reconstruct path from forward search
-		fconstruct_path(m_MidNode);
-		// reconstruct path from backward search
-		rconstruct_path(m_MidNode);
-
-		// insert the last row in the path trace (having edge_id = -1 and cost = 0.0)
-		path_element_t pelement;
-		pelement.vertex_id = end_vertex;
-		pelement.edge_id = -1;
-		pelement.cost = 0.0;
-		m_vecPath.push_back(pelement);
-
-		// Transfer data path to path_element_t format and allocate memory and populate the pointer
-
-        DBG("BiDirDijkstra::bidir_dijkstra: allocating path m_vecPath.size=%d\n", m_vecPath.size() + 1);
-		*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
-		*path_count = m_vecPath.size();
-        DBG("BiDirDijkstra::bidir_dijkstra: allocated path\n");
-
-		for(i = 0; i < *path_count; i++)
-		{
-			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
-			(*path)[i].edge_id = m_vecPath[i].edge_id;
-			(*path)[i].cost = m_vecPath[i].cost;
-		}
-		
-	}
-    DBG("calling deleteall\n");
-	deleteall();
-    DBG("back from deleteall\n");
-	return 0;
-}
-
-/*
-	Populate the member variables of the class using the edge list. Basically there is a node list and an edge list. Each node contains the list of adjacent nodes and 
-	corresponding edge indices from edge list that connect this node with the adjacent nodes.
-*/
-
-bool BiDirDijkstra::construct_graph(edge_t* edges, int edge_count, int maxNode)
-{
-	int i;
-
-	/*
-	// Create a dummy node
-    DBG("Create a dummy node\n");
-	GraphNodeInfo nodeInfo;
-    DBG("calling nodeInfo.Connected_Edges_Index.clear\n");
-	nodeInfo.Connected_Edges_Index.clear();
-    DBG("calling nodeInfo.Connected_Nodes.clear\n");
-	nodeInfo.Connected_Nodes.clear();
-	*/
-
-	// Insert the dummy node into the node list. This acts as place holder. Also change the nodeId so that nodeId and node index in the vector are same.
-	// There may be some nodes here that does not appear in the edge list. The size of the list is upto maxNode which is equal to maximum node id.
-    DBG("m_vecNodeVector.push_back for 0 - %d\n", maxNode);
-	for(i = 0; i <= maxNode; i++)
-	{
-		// Create a dummy node
-		GraphNodeInfo* nodeInfo = new GraphNodeInfo();
-		nodeInfo->Connected_Edges_Index.clear();
-		nodeInfo->Connected_Nodes.clear();
-		
-		nodeInfo->NodeID = i;
-		m_vecNodeVector.push_back(nodeInfo);
-	}
-
-	// Process each edge from the edge list and update the member data structures accordingly.
-    DBG("reserving space for m_vecEdgeVector.reserve(%d)\n", edge_count);
-    m_vecEdgeVector.reserve(edge_count);
-    DBG("calling addEdge in a loop\n");
-	for(i = 0; i < edge_count; i++)
-	{
-		addEdge(edges[i]);
-	}
-
-	return true;
-}
-
-/*
-	Process the edge and populate the member nodelist and edgelist. The nodelist already contains upto maxNode dummy entries with nodeId same as index. Now the
-	connectivity information needs to be updated.
-*/
-
-bool BiDirDijkstra::addEdge(edge_t edgeIn)
-{
-	// long lTest;
-
-	// Check if the edge is already processed.
-	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
-	if(itMap != m_mapEdgeId2Index.end())	
-		return false;
-
-
-	// Create a GraphEdgeInfo using the information of the current edge
-	GraphEdgeInfo newEdge;
-	newEdge.EdgeID = edgeIn.id;
-	newEdge.EdgeIndex = m_vecEdgeVector.size();	
-	newEdge.StartNode = edgeIn.source;
-	newEdge.EndNode = edgeIn.target;
-	newEdge.Cost = edgeIn.cost;
-	newEdge.ReverseCost = edgeIn.reverse_cost;
-
-	// Set the direction. If both cost and reverse cost has positive value the edge is bidirectional and direction field is 0. If cost is positive and reverse cost
-	// negative then the edge is unidirectional with direction = 1 (goes from source to target) otherwise it is unidirectional with direction = -1 (goes from target
-	// to source). Another way of creating unidirectional edge is assigning big values in cost or reverse_cost. In that case the direction is still zero and this case
-	// is handled in the algorithm automatically.
-	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
-	{
-		newEdge.Direction = 0;
-	}
-	else if(newEdge.Cost >= 0.0)
-	{
-		newEdge.Direction = 1;
-	}
-	else
-	{
-		newEdge.Direction = -1;
-	}
-
-	// Update max_edge_id
-	if(edgeIn.id > max_edge_id)
-	{
-		max_edge_id = edgeIn.id;
-	}
-
-	//Update max_node_id
-	if(newEdge.StartNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.StartNode;
-	}
-	if(newEdge.EndNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.EdgeIndex;
-	}
-
-	// update connectivity information for the start node.
-	m_vecNodeVector[newEdge.StartNode]->Connected_Nodes.push_back(newEdge.EndNode);
-	m_vecNodeVector[newEdge.StartNode]->Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-	// update connectivity information for the start node.
-	m_vecNodeVector[newEdge.EndNode]->Connected_Nodes.push_back(newEdge.StartNode);
-	m_vecNodeVector[newEdge.EndNode]->Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-
-	
-	//Adding edge to the list
-	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
-	m_vecEdgeVector.push_back(newEdge);
-
-	//
-	return true;
-}
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-MIT*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "BiDirDijkstra.h"
+#include "../../common/src/memory_func.hpp"
+
+
+
+BiDirDijkstra::BiDirDijkstra(void)
+{
+}
+
+BiDirDijkstra::~BiDirDijkstra(void)
+{
+}
+
+void BiDirDijkstra::init()
+{
+	//max_edge_id = 0;
+	//max_node_id = 0;
+	
+}
+
+/*
+	Initialization and allocation of memories.
+*/
+void BiDirDijkstra::initall(int maxNode)
+{
+	int i;
+	m_vecPath.clear();
+    // DBG("BiDirDijkstra::initall: allocating m_pFParent, m_pRParent maxNode: %d\n", maxNode+1);
+	m_pFParent = new PARENT_PATH[maxNode + 1];
+	m_pRParent = new PARENT_PATH[maxNode + 1];
+    // DBG("BiDirDijkstra::initall: allocated m_pFParent, m_pRParent\n");
+
+    // DBG("BiDirDijkstra::initall: allocating m_pFCost, m_pRCost maxNode: %d\n", maxNode+1);
+	m_pFCost = new double[maxNode + 1];
+	m_pRCost = new double[maxNode + 1];
+    // DBG("BiDirDijkstra::initall: allocated m_pFCost, m_pRCost\n");
+
+	for(i = 0; i <= maxNode; i++)
+	{
+		m_pFParent[i].par_Node = -2;
+		m_pRParent[i].par_Node = -2;
+		m_pFCost[i] = INF;
+		m_pRCost[i] = INF;
+		
+	}
+	m_MinCost = INF;
+	m_MidNode = -1;
+
+    // DBG("BiDirDijkstra::initall: m_vecNodeVector.reserve(%d)\n", maxNode + 1);
+    // reserve space for nodes
+    m_vecNodeVector.reserve(maxNode + 1);
+    // DBG("           space reserved!\n");
+}
+
+/*
+	Delete the allocated memories to avoid memory leak.
+*/
+void BiDirDijkstra::deleteall()
+{
+	std::vector<GraphNodeInfo*>::iterator it;
+	for(it  = m_vecNodeVector.begin(); it != m_vecNodeVector.end(); it++){
+		delete *it;
+	}
+	m_vecNodeVector.clear();
+	delete [] m_pFParent;
+	delete [] m_pRParent;
+	delete [] m_pFCost;
+	delete [] m_pRCost;
+}
+
+/*
+	Get the current cost from source to the current node if direction is 1 else the cost to reach target from the current node.
+*/
+double BiDirDijkstra::getcost(int node_id, int dir)
+{
+	if(dir == 1)
+	{
+		return(m_pFCost[node_id]);
+	}
+	else
+	{
+		return(m_pRCost[node_id]);
+	}
+}
+/*
+	Set the forward or reverse cost list depending on dir (1 for forward search and -1 for reverse search.
+*/
+void BiDirDijkstra::setcost(int node_id, int dir, double c)
+{
+	if(dir == 1)
+	{
+		m_pFCost[node_id] = c;
+	}
+	else
+	{
+		m_pRCost[node_id] = c;
+	}
+}
+
+void BiDirDijkstra::setparent(int node_id, int dir, int parnode, int paredge)
+{
+	if(dir == 1)
+	{
+		m_pFParent[node_id].par_Node = parnode;
+		m_pFParent[node_id].par_Edge = paredge;
+	}
+	else
+	{
+		m_pRParent[node_id].par_Node = parnode;
+		m_pRParent[node_id].par_Edge = paredge;
+	}
+}
+
+/*
+	Reconstruct path for forward search. It is like normal dijkstra. The parent array contains the parent of the current node and there is a -1 in the source.
+	So one need to recurse upto the source and then add the current node and edge to the list.
+*/
+void BiDirDijkstra::fconstruct_path(int node_id)
+{
+	if(m_pFParent[node_id].par_Node == -1)
+		return;
+	fconstruct_path(m_pFParent[node_id].par_Node);
+	path_element_t pt;
+	pt.vertex_id = m_pFParent[node_id].par_Node;
+	pt.edge_id = m_pFParent[node_id].par_Edge;
+	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
+	m_vecPath.push_back(pt);
+}
+
+/*
+	Reconstruct path for the reverse search. In this case the subsequent node is stored in the parent and the target contains a -1. So one need to add the node
+	and edge to the list and then recurse through the parent upto hitting a -1.
+*/
+
+void BiDirDijkstra::rconstruct_path(int node_id)
+{
+	path_element_t pt;
+	if(m_pRParent[node_id].par_Node == -1)
+	{
+		pt.vertex_id = node_id;
+		pt.edge_id = -1;
+		pt.cost = 0.0;
+		return;
+	}
+	pt.vertex_id = node_id;
+	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
+	pt.edge_id = m_pRParent[node_id].par_Edge;
+	m_vecPath.push_back(pt);
+	rconstruct_path(m_pRParent[node_id].par_Node);
+}
+
+/*
+	This is the main exploration module. The parameter dir indicates whether the exploration will be in forward or reverser direction. The reference to the corresponding
+	que is also passed as parameter que. The current node and the current costs are also available as parameter.
+*/
+
+void BiDirDijkstra::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
+{
+	int i;
+	// Number of connected edges
+	int con_edge = m_vecNodeVector[cur_node]->Connected_Edges_Index.size();
+	double edge_cost;
+
+	for(i = 0; i < con_edge; i++)
+	{
+		int edge_index = m_vecNodeVector[cur_node]->Connected_Edges_Index[i];
+		// Get the edge from the edge list.
+		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
+		// Get the connected node
+		int new_node = m_vecNodeVector[cur_node]->Connected_Nodes[i];
+		
+		if(cur_node == edge.StartNode)
+		{
+			// Current node is the startnode of the edge. For forward search it should use forward cost, otherwise it should use the reverse cost,
+			// i.e. if the reverse direction is valid then this node may be visited from the end node.
+			if(dir > 0)
+				edge_cost = edge.Cost;
+			else
+				edge_cost = edge.ReverseCost;
+
+			// Check if the direction is valid for exploration
+			if(edge.Direction == 0 || edge_cost >= 0.0)
+			{			
+				// Check if the current edge gives better result
+				if(cur_cost + edge_cost < getcost(new_node, dir))
+				{
+					// explore the node, and push it in the queue
+					setcost(new_node, dir, cur_cost + edge_cost);
+					setparent(new_node, dir, cur_node, edge.EdgeID);
+					que.push(std::make_pair(cur_cost + edge_cost, new_node));
+
+					// Update the minimum cost found so far.
+					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
+					{
+						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
+						m_MidNode = new_node;
+					}
+				}
+			}
+		}
+		else
+		{
+			// Current node is the endnode of the edge. For forward search it should use reverse cost, otherwise it should use the forward cost,
+			// i.e. if the forward direction is valid then this node may be visited from the start node.
+			if(dir > 0)
+				edge_cost = edge.ReverseCost;
+			else
+				edge_cost = edge.Cost;
+
+			// Check if the direction is valid for exploration
+			if(edge.Direction == 0 || edge_cost >= 0.0)
+			{
+				// Check if the current edge gives better result
+				if(cur_cost + edge_cost < getcost(new_node, dir))
+				{
+					setcost(new_node, dir, cur_cost + edge_cost);
+					setparent(new_node, dir, cur_node, edge.EdgeID);
+					que.push(std::make_pair(cur_cost + edge_cost, new_node));
+
+					// Update the minimum cost found so far.
+					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
+					{
+						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
+						m_MidNode = new_node;
+					}
+				}
+			}
+		}
+	}
+}
+
+/* 
+	This is the entry function that the wrappers should call. Most of the parameters are trivial. maxNode refers to Maximum
+	node id. As we run node based exploration cost, parent etc will be based on maximam node id.
+*/
+
+
+int BiDirDijkstra::bidir_dijkstra(edge_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
+				path_element_t **path, int *path_count, char **err_msg)
+{
+	max_node_id = maxNode;
+	max_edge_id = -1;
+	
+	// Allocate memory for local storage like cost and parent holder
+    // DBG("calling initall(maxNode=%d)\n", maxNode);
+	initall(maxNode);
+
+	// construct the graph from the edge list, i.e. populate node and edge data structures
+    // DBG("Calling construct_graph\n");
+	construct_graph(edges, edge_count, maxNode);
+	
+
+	//int nodeCount = m_vecNodeVector.size();
+	// DBG("Setting up std::priority_queue\n");
+	std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
+	std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
+	
+    // DBG("calling m_vecPath.clear()\n");
+	m_vecPath.clear();
+
+	// Initialize the forward search
+	m_pFParent[start_vertex].par_Node = -1;
+	m_pFParent[start_vertex].par_Edge = -1;
+	m_pFCost[start_vertex] = 0.0;
+	fque.push(std::make_pair(0.0, start_vertex));
+
+	// Initialize the reverse search
+	m_pRParent[end_vertex].par_Node = -1;
+	m_pRParent[end_vertex].par_Edge = -1;
+	m_pRCost[end_vertex] = 0.0;
+	rque.push(std::make_pair(0.0, end_vertex));
+
+	int i;
+	// int new_node;
+	int cur_node;
+	// int dir;
+
+/*
+	The main loop. The algorithm is as follows:
+	1. IF the sum of the current minimum of both heap is greater than so far found path, we cannot get any better, so break the loop.
+	2. IF the reverse heap minimum is lower than the forward heap minimum, explore from reverse direction.
+	3. ELSE explore from the forward directtion.
+*/
+
+	while(!fque.empty() && !rque.empty())
+	{
+		PDI fTop = fque.top();
+		PDI rTop = rque.top();
+		if(fTop.first + rTop.first > m_MinCost) //We are done, there is no path with lower cost
+			break;
+
+		if(rTop.first < fTop.first) // Explore from reverse queue
+		{
+			cur_node = rTop.second;
+			int dir = -1;
+			rque.pop();
+			explore(cur_node, rTop.first, dir, rque);
+		}
+		else                        // Explore from forward queue
+		{
+			cur_node = fTop.second;
+			int dir = 1;
+			fque.pop();
+			explore(cur_node, fTop.first, dir, fque);
+		}
+	}
+
+/*
+	Path reconstruction part. m_MidNode is the joining point where two searches meet to make a shortest path. It is updated in explore.
+	If it contains -1, then no path is found. Other wise we have a shortest path and that is reconstructed in the m_vecPath.
+*/ 
+	if(m_MidNode == -1)
+	{
+		*err_msg = (char *)"Path Not Found";
+		deleteall();
+		return -1;
+	}
+	else
+	{
+		// reconstruct path from forward search
+		fconstruct_path(m_MidNode);
+		// reconstruct path from backward search
+		rconstruct_path(m_MidNode);
+
+		// insert the last row in the path trace (having edge_id = -1 and cost = 0.0)
+		path_element_t pelement;
+		pelement.vertex_id = end_vertex;
+		pelement.edge_id = -1;
+		pelement.cost = 0.0;
+		m_vecPath.push_back(pelement);
+
+		// Transfer data path to path_element_t format and allocate memory and populate the pointer
+
+        // DBG("BiDirDijkstra::bidir_dijkstra: allocating path m_vecPath.size=%d\n", m_vecPath.size() + 1);
+		//*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
+        *path=NULL;
+		*path = get_memory(m_vecPath.size(), (*path));
+		*path_count = m_vecPath.size();
+        // DBG("BiDirDijkstra::bidir_dijkstra: allocated path\n");
+
+		for(i = 0; i < *path_count; i++)
+		{
+			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
+			(*path)[i].edge_id = m_vecPath[i].edge_id;
+			(*path)[i].cost = m_vecPath[i].cost;
+		}
+		
+	}
+    // DBG("calling deleteall\n");
+	deleteall();
+    // DBG("back from deleteall\n");
+	return 0;
+}
+
+/*
+	Populate the member variables of the class using the edge list. Basically there is a node list and an edge list. Each node contains the list of adjacent nodes and 
+	corresponding edge indices from edge list that connect this node with the adjacent nodes.
+*/
+
+bool BiDirDijkstra::construct_graph(edge_t* edges, int edge_count, int maxNode)
+{
+	int i;
+
+	/*
+	// Create a dummy node
+    DBG("Create a dummy node\n");
+	GraphNodeInfo nodeInfo;
+    DBG("calling nodeInfo.Connected_Edges_Index.clear\n");
+	nodeInfo.Connected_Edges_Index.clear();
+    DBG("calling nodeInfo.Connected_Nodes.clear\n");
+	nodeInfo.Connected_Nodes.clear();
+	*/
+
+	// Insert the dummy node into the node list. This acts as place holder. Also change the nodeId so that nodeId and node index in the vector are same.
+	// There may be some nodes here that does not appear in the edge list. The size of the list is upto maxNode which is equal to maximum node id.
+    // DBG("m_vecNodeVector.push_back for 0 - %d\n", maxNode);
+	for(i = 0; i <= maxNode; i++)
+	{
+		// Create a dummy node
+		GraphNodeInfo* nodeInfo = new GraphNodeInfo();
+		nodeInfo->Connected_Edges_Index.clear();
+		nodeInfo->Connected_Nodes.clear();
+		
+		nodeInfo->NodeID = i;
+		m_vecNodeVector.push_back(nodeInfo);
+	}
+
+	// Process each edge from the edge list and update the member data structures accordingly.
+    // DBG("reserving space for m_vecEdgeVector.reserve(%d)\n", edge_count);
+    m_vecEdgeVector.reserve(edge_count);
+    // DBG("calling addEdge in a loop\n");
+	for(i = 0; i < edge_count; i++)
+	{
+		addEdge(edges[i]);
+	}
+
+	return true;
+}
+
+/*
+	Process the edge and populate the member nodelist and edgelist. The nodelist already contains upto maxNode dummy entries with nodeId same as index. Now the
+	connectivity information needs to be updated.
+*/
+
+bool BiDirDijkstra::addEdge(edge_t edgeIn)
+{
+	// long lTest;
+
+	// Check if the edge is already processed.
+	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
+	if(itMap != m_mapEdgeId2Index.end())	
+		return false;
+
+
+	// Create a GraphEdgeInfo using the information of the current edge
+	GraphEdgeInfo newEdge;
+	newEdge.EdgeID = edgeIn.id;
+	newEdge.EdgeIndex = m_vecEdgeVector.size();	
+	newEdge.StartNode = edgeIn.source;
+	newEdge.EndNode = edgeIn.target;
+	newEdge.Cost = edgeIn.cost;
+	newEdge.ReverseCost = edgeIn.reverse_cost;
+
+	// Set the direction. If both cost and reverse cost has positive value the edge is bidirectional and direction field is 0. If cost is positive and reverse cost
+	// negative then the edge is unidirectional with direction = 1 (goes from source to target) otherwise it is unidirectional with direction = -1 (goes from target
+	// to source). Another way of creating unidirectional edge is assigning big values in cost or reverse_cost. In that case the direction is still zero and this case
+	// is handled in the algorithm automatically.
+	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
+	{
+		newEdge.Direction = 0;
+	}
+	else if(newEdge.Cost >= 0.0)
+	{
+		newEdge.Direction = 1;
+	}
+	else
+	{
+		newEdge.Direction = -1;
+	}
+
+	// Update max_edge_id
+	if(edgeIn.id > max_edge_id)
+	{
+		max_edge_id = edgeIn.id;
+	}
+
+	//Update max_node_id
+	if(newEdge.StartNode > max_node_id)
+	{
+		return false;//max_node_id = newEdge.StartNode;
+	}
+	if(newEdge.EndNode > max_node_id)
+	{
+		return false;//max_node_id = newEdge.EdgeIndex;
+	}
+
+	// update connectivity information for the start node.
+	m_vecNodeVector[newEdge.StartNode]->Connected_Nodes.push_back(newEdge.EndNode);
+	m_vecNodeVector[newEdge.StartNode]->Connected_Edges_Index.push_back(newEdge.EdgeIndex);
+
+	// update connectivity information for the start node.
+	m_vecNodeVector[newEdge.EndNode]->Connected_Nodes.push_back(newEdge.StartNode);
+	m_vecNodeVector[newEdge.EndNode]->Connected_Edges_Index.push_back(newEdge.EdgeIndex);
+
+
+	
+	//Adding edge to the list
+	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
+	m_vecEdgeVector.push_back(newEdge);
+
+	//
+	return true;
+}
diff --git a/src/bd_dijkstra/src/BiDirDijkstra.h b/src/bd_dijkstra/src/BiDirDijkstra.h
index 7c2d33c..3650dca 100644
--- a/src/bd_dijkstra/src/BiDirDijkstra.h
+++ b/src/bd_dijkstra/src/BiDirDijkstra.h
@@ -1,143 +1,121 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef BIDIRDIJKSTRA_H
-#define BIDIRDIJKSTRA_H
-
-#include <vector>
-#include <map>
-#include <queue>
-#include <string>
-#include <stdlib.h>
-#include <iostream>
-#include <stdio.h>
-#include <string.h>
-
-#include "bdsp.h"
-
-#define INF 1e15
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<LongVector> VectorOfLongVector;
-//typedef std::pair<int, bool> PIB;
-typedef std::pair<double, int> PDI;
-//typedef std::pair<double, std::vector<int> > PDVI;
-/*
-typedef struct edge 
-{
-	int id;
-	int source;
-	int target;
-	double cost;
-	double reverse_cost;
-} edge_t;
-
-typedef struct path_element 
-{
-	int vertex_id;
-	int edge_id;
-	double cost;
-}path_element_t;
-*/
-
-typedef struct{
-	int par_Node;
-	int par_Edge;
-}PARENT_PATH;
-
-typedef struct{
-	int NodeID;
-	std::vector<int> Connected_Nodes;
-	std::vector<int> Connected_Edges_Index;
-}GraphNodeInfo;
-
-struct GraphEdgeInfo
-{
-public:
-	int EdgeID;
-	int EdgeIndex;
-	int Direction;
-	double Cost;
-	double ReverseCost;
-	int StartNode;
-	int EndNode;
-};
-
-typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
-typedef std::map<long,LongVector> Long2LongVectorMap;
-typedef std::map<long,long> Long2LongMap;
-typedef std::vector<GraphNodeInfo*> GraphNodeVector;
-
-
-class BiDirDijkstra
-{
-public:
-	BiDirDijkstra(void);
-	~BiDirDijkstra(void);
-	
-	int bidir_dijkstra(edge_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-		path_element_t **path, int *path_count, char **err_msg);
-	
-
-private:
-	bool construct_graph(edge_t *edges, int edge_count, int maxNode);
-	void fconstruct_path(int node_id);
-	void rconstruct_path(int node_id);
-	bool addEdge(edge edgeIn);
-	bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
-	void init();
-	void initall(int maxNode);
-	void deleteall();
-	void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
-	double getcost(int node_id, int dir);
-	void setcost(int node_id, int dir, double c);
-	void setparent(int node_id, int dir, int parnode, int paredge);
-
-private:
-	GraphEdgeVector m_vecEdgeVector;
-	Long2LongMap m_mapEdgeId2Index;
-	Long2LongVectorMap m_mapNodeId2Edge;
-	GraphNodeVector m_vecNodeVector;
-	int max_node_id;
-	int max_edge_id;
-	int m_lStartNodeId;
-	int m_lEndNodeId;
-
-	double m_MinCost;
-	int m_MidNode;
-	std::vector <path_element_t> m_vecPath;
-	PARENT_PATH *m_pFParent;
-	PARENT_PATH *m_pRParent;
-	double *m_pFCost;
-	double *m_pRCost;
-};
-
-#endif
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-MIT*/
+
+#ifndef BIDIRDIJKSTRA_H
+#define BIDIRDIJKSTRA_H
+
+#include <vector>
+#include <map>
+#include <queue>
+#include <utility>
+#include <functional>
+
+#include "../../common/src/pgr_types.h"
+#include "bdsp.h"
+
+#define INF 1e15
+
+
+
+typedef std::vector<long> LongVector;
+typedef std::vector<LongVector> VectorOfLongVector;
+typedef std::pair<double, int> PDI;
+
+typedef struct{
+    int par_Node;
+    int par_Edge;
+}PARENT_PATH;
+
+typedef struct{
+    int NodeID;
+    std::vector<int> Connected_Nodes;
+    std::vector<int> Connected_Edges_Index;
+}GraphNodeInfo;
+
+struct GraphEdgeInfo
+{
+public:
+    int EdgeID;
+    int EdgeIndex;
+    int Direction;
+    double Cost;
+    double ReverseCost;
+    int StartNode;
+    int EndNode;
+};
+
+typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
+typedef std::map<long,LongVector> Long2LongVectorMap;
+typedef std::map<long,long> Long2LongMap;
+typedef std::vector<GraphNodeInfo*> GraphNodeVector;
+
+
+class BiDirDijkstra
+{
+public:
+    BiDirDijkstra(void);
+    ~BiDirDijkstra(void);
+    
+    int bidir_dijkstra(edge_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
+        path_element_t **path, int *path_count, char **err_msg);
+    
+
+private:
+    bool construct_graph(edge_t *edges, int edge_count, int maxNode);
+    void fconstruct_path(int node_id);
+    void rconstruct_path(int node_id);
+    bool addEdge(edge_t edgeIn);
+    bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
+    void init();
+    void initall(int maxNode);
+    void deleteall();
+    void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
+    double getcost(int node_id, int dir);
+    void setcost(int node_id, int dir, double c);
+    void setparent(int node_id, int dir, int parnode, int paredge);
+
+private:
+    GraphEdgeVector m_vecEdgeVector;
+    Long2LongMap m_mapEdgeId2Index;
+    Long2LongVectorMap m_mapNodeId2Edge;
+    GraphNodeVector m_vecNodeVector;
+    int max_node_id;
+    int max_edge_id;
+    int m_lStartNodeId;
+    int m_lEndNodeId;
+
+    double m_MinCost;
+    int m_MidNode;
+    std::vector <path_element_t> m_vecPath;
+    PARENT_PATH *m_pFParent;
+    PARENT_PATH *m_pRParent;
+    double *m_pFCost;
+    double *m_pRCost;
+};
+
+#endif
diff --git a/src/bd_dijkstra/src/CMakeLists.txt b/src/bd_dijkstra/src/CMakeLists.txt
index 6b8ef55..1c161c1 100644
--- a/src/bd_dijkstra/src/CMakeLists.txt
+++ b/src/bd_dijkstra/src/CMakeLists.txt
@@ -1,2 +1,5 @@
-ADD_LIBRARY(bd_dijkstra OBJECT bdsp.h bdsp.c utils.h BiDirDijkstra.h bdsp_core.cpp BiDirDijkstra.cpp)
+ADD_LIBRARY(bd_dijkstra OBJECT 
+    bdsp.c 
+    bdsp_core.cpp 
+    BiDirDijkstra.cpp)
 
diff --git a/src/bd_dijkstra/src/bdsp.c b/src/bd_dijkstra/src/bdsp.c
index 5667e29..60679b2 100644
--- a/src/bd_dijkstra/src/bdsp.c
+++ b/src/bd_dijkstra/src/bdsp.c
@@ -1,31 +1,31 @@
-/******************************************************************************
+/*PGR-MIT*****************************************************************
+
 * $Id$
 *
 * Project:  pgRouting bdsp and bdastar algorithms
 * Purpose:
 * Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
+Copyright (c) 2015 pgRouting developers
 
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-*****************************************************************************/
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-MIT*/
+
+#include "bdsp.h"
 
 #include "postgres.h"
 #include "executor/spi.h"
@@ -36,27 +36,27 @@
 #endif
 
 #include "fmgr.h"
-#include "bdsp.h"
 
-Datum bidir_dijkstra_shortest_path(PG_FUNCTION_ARGS);
+PG_FUNCTION_INFO_V1(bidir_dijkstra_shortest_path);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+bidir_dijkstra_shortest_path(PG_FUNCTION_ARGS);
+
+
 
 
 #undef DEBUG
-//#define DEBUG 1
+#include "../../common/src/debug_macro.h"
+#include "../../common/src/pgr_types.h"
+#include "../../common/src/postgres_connection.h"
 
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
 
 // The number of tuples to fetch from the SPI cursor at each iteration
 #define TUPLIMIT 1000
 
-//#ifdef PG_MODULE_MAGIC
-//PG_MODULE_MAGIC;
-//#endif
 
 typedef struct edge_columns
 {
@@ -68,27 +68,6 @@ typedef struct edge_columns
 } edge_columns_t;
 
 
-static char *
-text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-static int
-finish(int code, int ret)
-{
-  DBG("In finish, trying to disconnect from spi %d",ret);
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH ) {
-    elog(ERROR,"couldn't disconnect from SPI");
-    return -1 ;
-  }            
-  return ret;
-}
 
 /*
  * This function fetches the edge columns from the SPITupleTable.
@@ -121,7 +100,7 @@ fetch_edge_columns(SPITupleTable *tuptable, edge_columns_t *edge_columns,
       return -1;
   }
 
-  DBG("columns: id %i source %i target %i cost %i", 
+  PGR_DBG("columns: id %i source %i target %i cost %i", 
       edge_columns->id, edge_columns->source, 
       edge_columns->target, edge_columns->cost);
 
@@ -141,7 +120,7 @@ fetch_edge_columns(SPITupleTable *tuptable, edge_columns_t *edge_columns,
           return -1;
       }
 
-      DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
+      PGR_DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
   }
 
   return 0;
@@ -188,7 +167,6 @@ static int compute_bidirsp(char* sql, int start_vertex,
                                  bool has_reverse_cost, 
                                  path_element_t **path, int *path_count) 
 {
-  int SPIcode;
   void *SPIplan;
   Portal SPIportal;
   bool moredata = TRUE;
@@ -207,32 +185,21 @@ static int compute_bidirsp(char* sql, int start_vertex,
   int ret = -1;
   register int z;
 
-  DBG("start shortest_path\n");
-
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT) {
-      elog(ERROR, "shortest_path: couldn't open a connection to SPI");
-      return -1;
-  }
-
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL) {
-      elog(ERROR, "shortest_path: couldn't create query plan via SPI");
-      return -1;
-  }
+  PGR_DBG("start shortest_path\n");
 
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-      elog(ERROR, "shortest_path: SPI_cursor_open('%s') returns NULL", sql);
-      return -1;
-  }
+  pgr_SPI_connect();
+  SPIplan = pgr_SPI_prepare(sql);
+  SPIportal = pgr_SPI_cursor_open(SPIplan);
 
   while (moredata == TRUE) {
       SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
 
       if (edge_columns.id == -1) {
           if (fetch_edge_columns(SPI_tuptable, &edge_columns, 
-                                 has_reverse_cost) == -1)
-            return finish(SPIcode, ret);
+                                 has_reverse_cost) == -1) {
+            pgr_SPI_finish();
+            return -1;
+          }
       }
 
       ntuples = SPI_processed;
@@ -244,7 +211,8 @@ static int compute_bidirsp(char* sql, int start_vertex,
 
       if (edges == NULL) {
           elog(ERROR, "Out of memory");
-          return finish(SPIcode, ret);      
+            pgr_SPI_finish();
+            return -1;
       }
 
       if (ntuples > 0) {
@@ -266,14 +234,14 @@ static int compute_bidirsp(char* sql, int start_vertex,
 
   //defining min and max vertex id
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   for(z=0; z<total_tuples; z++) {
     if(edges[z].source<v_min_id) v_min_id=edges[z].source;
     if(edges[z].source>v_max_id) v_max_id=edges[z].source;
     if(edges[z].target<v_min_id) v_min_id=edges[z].target;
     if(edges[z].target>v_max_id) v_max_id=edges[z].target; 
-    //DBG("%i <-> %i", v_min_id, v_max_id);
+    //PGR_DBG("%i <-> %i", v_min_id, v_max_id);
   }
 
   //::::::::::::::::::::::::::::::::::::  
@@ -288,10 +256,10 @@ static int compute_bidirsp(char* sql, int start_vertex,
 
     edges[z].source -= v_min_id;
     edges[z].target -= v_min_id;
-    //DBG("%i - %i", edges[z].source, edges[z].target);      
+    //PGR_DBG("%i - %i", edges[z].source, edges[z].target);      
   }
 
-  DBG("Total %i tuples", total_tuples);
+  PGR_DBG("Total %i tuples", total_tuples);
 
   if(s_count == 0) {
     elog(ERROR, "Start vertex was not found.");
@@ -308,7 +276,7 @@ static int compute_bidirsp(char* sql, int start_vertex,
 
   //v_max_id -= v_min_id;
 
-  DBG("Calling bidirsp_wrapper(edges, %d, %d, %d, %d, %d, %d, ...)\n",
+  PGR_DBG("Calling bidirsp_wrapper(edges, %d, %d, %d, %d, %d, %d, ...)\n",
         total_tuples, v_max_id + 2, start_vertex, end_vertex,
         directed, has_reverse_cost);
 
@@ -316,29 +284,33 @@ static int compute_bidirsp(char* sql, int start_vertex,
                        directed, has_reverse_cost,
                        path, path_count, &err_msg);
 
-  DBG("Back from bidirsp_wrapper() ret: %d", ret);
+  PGR_DBG("Back from bidirsp_wrapper() ret: %d", ret);
   if (ret < 0) {
       elog(ERROR, "Error computing path: %s", err_msg);
   } 
 
-  DBG("*path_count = %i\n", *path_count);
+  PGR_DBG("*path_count = %i\n", *path_count);
 
   //::::::::::::::::::::::::::::::::
   //:: restoring original vertex id
   //::::::::::::::::::::::::::::::::
   for(z=0; z<*path_count; z++) {
-    //DBG("vetex %i\n",(*path)[z].vertex_id);
+    //PGR_DBG("vetex %i\n",(*path)[z].vertex_id);
     (*path)[z].vertex_id+=v_min_id;
   }
 
-  DBG("ret = %i\n", ret);
+  PGR_DBG("ret = %i\n", ret);
 
-  return finish(SPIcode, ret);
+  pgr_SPI_finish();
+  return 0;
 }
 
 
-PG_FUNCTION_INFO_V1(bidir_dijkstra_shortest_path);
+#ifndef _MSC_VER
 Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
 bidir_dijkstra_shortest_path(PG_FUNCTION_ARGS)
 {
 
@@ -371,12 +343,12 @@ bidir_dijkstra_shortest_path(PG_FUNCTION_ARGS)
             elog(ERROR, "bidir_dijkstra_shortest_path(): Argument %i may not be NULL", i+1);
         }
 
-      DBG("Calling compute_bidirsp");
+      PGR_DBG("Calling compute_bidirsp");
 
 #ifdef DEBUG
       ret =
 #endif
-        compute_bidirsp(text2char(PG_GETARG_TEXT_P(0)),
+        compute_bidirsp(pgr_text2char(PG_GETARG_TEXT_P(0)),
                                    PG_GETARG_INT32(1),
                                    PG_GETARG_INT32(2),
                                    PG_GETARG_BOOL(3),
@@ -384,17 +356,17 @@ bidir_dijkstra_shortest_path(PG_FUNCTION_ARGS)
                                    &path, &path_count);
 #ifdef DEBUG
     double total_cost = 0;
-      DBG("Ret is %i", ret);
+      PGR_DBG("Ret is %i", ret);
       if (ret >= 0) {
           int i;
           for (i = 0; i < path_count; i++) {
-             // DBG("Step %i vertex_id  %i ", i, path[i].vertex_id);
-             // DBG("        edge_id    %i ", path[i].edge_id);
-             // DBG("        cost       %f ", path[i].cost);
+             // PGR_DBG("Step %i vertex_id  %i ", i, path[i].vertex_id);
+             // PGR_DBG("        edge_id    %i ", path[i].edge_id);
+             // PGR_DBG("        cost       %f ", path[i].cost);
               total_cost+=path[i].cost;
             }
         }
-        DBG("Total cost is: %f",total_cost);
+        PGR_DBG("Total cost is: %f",total_cost);
 #endif
 
       // total number of tuples to be returned 
@@ -445,7 +417,7 @@ bidir_dijkstra_shortest_path(PG_FUNCTION_ARGS)
       SRF_RETURN_NEXT(funcctx, result);
   }
   else {   // do when there is no more left 
-      DBG("Going to free path");
+      PGR_DBG("Going to free path");
       if (path) free(path);
       SRF_RETURN_DONE(funcctx);
   }
diff --git a/src/bd_dijkstra/src/bdsp.h b/src/bd_dijkstra/src/bdsp.h
index 05e2503..3bbac82 100644
--- a/src/bd_dijkstra/src/bdsp.h
+++ b/src/bd_dijkstra/src/bdsp.h
@@ -1,45 +1,36 @@
- /*
+/*PGR-GNU*****************************************************************
+
  * Bi Directional Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2005 Sylvain Pasche
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #ifndef _BDSP_H
 #define _BDSP_H
 
 
 #include "postgres.h"
+#include "../../common/src/pgr_types.h"
 
-typedef struct edge
-{
-    int id;
-    int source;
-    int target;
-    float8 cost;
-    float8 reverse_cost;
-} edge_t;
-
-
-typedef struct 
-{
-    int vertex_id;
-    int edge_id;
-    float8 cost;
-} path_element_t;
+typedef pgr_edge_t edge_t;
 
 #ifdef __cplusplus
 extern "C"
diff --git a/src/bd_dijkstra/src/bdsp_core.cpp b/src/bd_dijkstra/src/bdsp_core.cpp
index 2ed8eb6..4170cf9 100644
--- a/src/bd_dijkstra/src/bdsp_core.cpp
+++ b/src/bd_dijkstra/src/bdsp_core.cpp
@@ -1,94 +1,81 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-#include <exception>
-#include "BiDirDijkstra.h"
-#include "bdsp.h"
-#include "utils.h"
-
-#undef DEBUG
-//#define DEBUG
-
-#ifdef DEBUG
-#include <stdio.h>
-static FILE *dbg;
-#define DBG(format, arg...) \
-    dbg = fopen("/tmp/sew-debug", "a"); \
-    if (dbg) { \
-        fprintf(dbg, format,  ## arg); \
-        fclose(dbg); \
-    }
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-
-int bidirsp_wrapper(
-    edge_t *edges,
-    unsigned int edge_count,
-    int maxNode,
-    int start_vertex,
-    int end_vertex,
-    bool directed,
-    bool has_reverse_cost,
-    path_element_t **path,
-    int *path_count,
-    char **err_msg
-    )
-{
-    int res;
-
-    try {
-        DBG("Calling BiDirDijkstra initializer.\n");
-        BiDirDijkstra bddijkstra;
-        DBG("BiDirDijkstra initialized\n");
-        res = bddijkstra.bidir_dijkstra(edges, edge_count, maxNode, start_vertex, end_vertex, path, path_count, err_msg);
-    }
-    catch(std::exception& e) {
-        DBG("catch(std::exception e.what: %s\n", e.what());
-        *err_msg = (char *) e.what();
-        return -1;
-    }
-    catch(...) {
-        DBG("catch(...\n");
-        *err_msg = (char *) "Caught unknown exception!";
-        return -1;
-    }
-
-    DBG("Back from bddijkstra.bidir_dijkstra()\n");
-    if (res < 0)
-        return res;
-    else
-	    return EXIT_SUCCESS;
-}
-
+/*PGR-MIT*****************************************************************
+
+* $Id$
+*
+* Project:  pgRouting bdsp and bdastar algorithms
+* Purpose:
+* Author:   Razequl Islam <ziboncsedu at gmail.com>
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-MIT*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include <exception>
+#include "BiDirDijkstra.h"
+#include "bdsp.h"
+
+
+
+int bidirsp_wrapper(
+    edge_t *edges,
+    unsigned int edge_count,
+    int maxNode,
+    int start_vertex,
+    int end_vertex,
+    bool directed,
+    bool has_reverse_cost,
+    path_element_t **path,
+    int *path_count,
+    char **err_msg
+    )
+{
+    int res;
+
+    try {
+        // DBG("Calling BiDirDijkstra initializer.\n");
+        BiDirDijkstra bddijkstra;
+        // DBG("BiDirDijkstra initialized\n");
+        res = bddijkstra.bidir_dijkstra(edges, edge_count, maxNode, start_vertex, end_vertex, path, path_count, err_msg);
+        // TODO  this are an unused parameters have to be used
+        if (has_reverse_cost) {};
+        if (directed) {};
+
+    }
+    catch(std::exception& e) {
+        // DBG("catch(std::exception e.what: %s\n", e.what());
+        *err_msg = (char *) e.what();
+        return -1;
+    }
+    catch(...) {
+        // DBG("catch(...\n");
+        *err_msg = (char *) "Caught unknown exception!";
+        return -1;
+    }
+
+    // DBG("Back from bddijkstra.bidir_dijkstra()\n");
+    if (res < 0)
+        return res;
+    return 0;
+}
+
diff --git a/src/bd_dijkstra/src/utils.h b/src/bd_dijkstra/src/utils.h
deleted file mode 100644
index 57ad2c4..0000000
--- a/src/bd_dijkstra/src/utils.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <string>
-#include <map>
-#include <vector>
-#include <queue>
-#include <iostream>
-
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<int> IntVector;
-typedef std::vector<double> DoubleVector;
-typedef std::vector<std::string> StringVector;
-
-
-class StringOperation
-{
-	
-public:
-	
-	static std::string TRIMWHITESPACE(std::string strInput)
-	{
-		std::string strOut = strInput;
-		std::string strWht = " \f\n\r\t\v";	
-
-		strOut.erase(0,strOut.find_first_not_of(strWht));
-		strOut.erase(strOut.find_last_not_of(strWht) + 1);
-		return strOut;
-	};
-};
-
-class StringTokenizer
-{
-public:
-	StringTokenizer()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		vecTokens.clear();
-		strInput = "";
-	}
-
-	bool parse(std::string strInput, std::string chDelim)
-	{
-		size_t iStartPos = 0;
-		while(true)	
-		{
-			size_t iPos = strInput.find(chDelim[0],iStartPos);
-			if(iPos != std::string::npos)
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos,iPos - iStartPos);
-				vecTokens.push_back(strToken);
-				iStartPos = iPos + 1;
-			}
-			else if(iPos == std::string::npos && strInput.length() > 0 )
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos, strInput.length() - iStartPos);
-				if(strToken.length() > 0)
-					vecTokens.push_back(strToken);
-				break;
-			}		
-			else 
-				break;
-
-		}		
-		return true;
-	}
-
-	size_t getTokenCount() 
-	{
-		return vecTokens.size();
-	}
-
-	bool getToken(std::string& strToken, long iTokenIndex)
-	{
-		long lTokenCount = vecTokens.size();
-		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
-		{
-			strToken = vecTokens[iTokenIndex];
-			return true;
-		}
-		return false;
-	}
-
-	bool getTokens(StringVector& vecTokensRef)
-	{
-		vecTokensRef = vecTokens;
-		return true;
-	}
-
-private:
-	std::string strInput;
-	StringVector vecTokens;
-	
-};
-
-#endif
diff --git a/src/bd_dijkstra/test/bd_dijkstra-any-01.test.sql b/src/bd_dijkstra/test/bd_dijkstra-any-01.test.sql
index d26994d..b284356 100644
--- a/src/bd_dijkstra/test/bd_dijkstra-any-01.test.sql
+++ b/src/bd_dijkstra/test/bd_dijkstra-any-01.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bddijkstra('select * from bdd_ways'::text, 5700, 6733, true, true) as r ) as foo;
diff --git a/src/bd_dijkstra/test/bd_dijkstra-any-02.test.sql b/src/bd_dijkstra/test/bd_dijkstra-any-02.test.sql
index ef0ff62..d2ea42e 100644
--- a/src/bd_dijkstra/test/bd_dijkstra-any-02.test.sql
+++ b/src/bd_dijkstra/test/bd_dijkstra-any-02.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bddijkstra('select * from bdd_ways'::text, 6585, 8247, true, true) as r ) as foo;
diff --git a/src/bd_dijkstra/test/bd_dijkstra-any-03.test.sql b/src/bd_dijkstra/test/bd_dijkstra-any-03.test.sql
index d4eb618..601724d 100644
--- a/src/bd_dijkstra/test/bd_dijkstra-any-03.test.sql
+++ b/src/bd_dijkstra/test/bd_dijkstra-any-03.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id2, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bddijkstra('select * from bdd_ways'::text, 9426, 3606, true, true) as r ) as foo;
diff --git a/src/bd_dijkstra/test/bd_dijkstra-any-04.test.sql b/src/bd_dijkstra/test/bd_dijkstra-any-04.test.sql
index 939d665..2bca691 100644
--- a/src/bd_dijkstra/test/bd_dijkstra-any-04.test.sql
+++ b/src/bd_dijkstra/test/bd_dijkstra-any-04.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bddijkstra('select * from bdd_ways'::text, 3606, 9426, true, true) as r ) as foo;
diff --git a/src/bd_dijkstra/test/bd_dijkstra-any-05.test.sql b/src/bd_dijkstra/test/bd_dijkstra-any-05.test.sql
index 672dcaf..85104bb 100644
--- a/src/bd_dijkstra/test/bd_dijkstra-any-05.test.sql
+++ b/src/bd_dijkstra/test/bd_dijkstra-any-05.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bddijkstra('select * from bdd_ways'::text, 6733, 5700, true, true) as r ) as foo;
diff --git a/src/bd_dijkstra/test/bd_dijkstra-any-06.test.sql b/src/bd_dijkstra/test/bd_dijkstra-any-06.test.sql
index 6eef305..eb4bc4c 100644
--- a/src/bd_dijkstra/test/bd_dijkstra-any-06.test.sql
+++ b/src/bd_dijkstra/test/bd_dijkstra-any-06.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select (r).seq, (r).id1, (r).id2, round((r).cost::numeric, 6) from ( select pgr_bddijkstra('select * from bdd_ways'::text, 8247, 6585, true, true) as r ) as foo;
diff --git a/src/bd_dijkstra/test/doc-bdDijkstra.result b/src/bd_dijkstra/test/doc-bdDijkstra.result
new file mode 100644
index 0000000..1c4acd8
--- /dev/null
+++ b/src/bd_dijkstra/test/doc-bdDijkstra.result
@@ -0,0 +1,13 @@
+--q1
+0|4|3|0
+1|3|2|0
+2|2|4|1
+3|5|10|1
+4|10|-1|0
+--q2
+0|4|3|1
+1|3|2|1
+2|2|4|1
+3|5|10|1
+4|10|-1|0
+--q3
diff --git a/src/bd_dijkstra/test/doc-bdDijkstra.test.sql b/src/bd_dijkstra/test/doc-bdDijkstra.test.sql
new file mode 100644
index 0000000..ca6abb5
--- /dev/null
+++ b/src/bd_dijkstra/test/doc-bdDijkstra.test.sql
@@ -0,0 +1,17 @@
+BEGIN;
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_bdDijkstra
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+
+\echo --q1
+SELECT * FROM pgr_bdDijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+    4, 10, false, false);
+\echo --q2
+SELECT * FROM pgr_bdDijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    4, 10, true, true);
+\echo --q3
+ROLLBACK;
diff --git a/src/bd_dijkstra/test/pgtap/bdDijkstra-types-check.sql b/src/bd_dijkstra/test/pgtap/bdDijkstra-types-check.sql
new file mode 100644
index 0000000..cab18ba
--- /dev/null
+++ b/src/bd_dijkstra/test/pgtap/bdDijkstra-types-check.sql
@@ -0,0 +1,110 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(17);
+
+-- RECEIVES 5 PARAMETERS
+
+SELECT has_function('pgr_bddijkstra',ARRAY['text', 'integer', 'integer', 'boolean', 'boolean']);
+SELECT function_returns('pgr_bddijkstra', 'setof pgr_costresult','Returns set of costResult[]');
+
+
+-- CHECKING THE INNER QUERY
+
+
+
+PREPARE q1 AS
+SELECT * FROM pgr_bddijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT  FROM edge_table',
+    2, 3, true, true);
+SELECT lives_ok('q1', 'edges query accepts INTEGER & FLOAT');
+
+
+
+SELECT todo_start('issue #140 must accept ANY-INTEGER and ANY-NUMERICAL');
+-- some test pass because the code is not checking
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT  FROM edge_table'',
+        2, 3, true, true)',
+        'id accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'id accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'source accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'source accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'target accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'target accepts SMALLINT');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL, reverse_cost::FLOAT FROM edge_table'',
+        2, 3, true, true)',
+        'cost accepts REAL');
+
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::BIGINT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts BIGINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::INTEGER FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts INTEGER');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::SMALLINT FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts SMALLINT');
+SELECT lives_ok(
+    'SELECT * FROM pgr_bddijkstra(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::REAL FROM edge_table'',
+        2, 3, true, true)',
+        'reverse_cost accepts REAL');
+
+
+SELECT todo_end();
+
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/bd_dijkstra/test/test.conf b/src/bd_dijkstra/test/test.conf
index a120551..bd9032a 100644
--- a/src/bd_dijkstra/test/test.conf
+++ b/src/bd_dijkstra/test/test.conf
@@ -4,7 +4,16 @@
     'any' => {
         'comment' => 'Bi-directional Dijkstra test for any versions.',
         'data' => ['bd_dijkstra-any-00.data'],
-        'tests' => [qw(bd_dijkstra-any-01 bd_dijkstra-any-02 bd_dijkstra-any-03 bd_dijkstra-any-04 bd_dijkstra-any-05 bd_dijkstra-any-06)]
+        'tests' => [qw(
+            bd_dijkstra-any-01
+            bd_dijkstra-any-02
+            bd_dijkstra-any-03
+            bd_dijkstra-any-04
+            bd_dijkstra-any-05
+            bd_dijkstra-any-06)],
+        'documentation' => [qw(
+            doc-bdDijkstra
+            )]
         },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/bd_dijkstra/tester/BDDTester.cpp b/src/bd_dijkstra/tester/BDDTester.cpp
deleted file mode 100644
index 7ed348c..0000000
--- a/src/bd_dijkstra/tester/BDDTester.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#include "BiDirDijkstra.h"
-#include "utils.h"
-#include <math.h>
-#include <time.h>
-
-#define EPS 1e-8
-
-
-std::vector<edge_t> vecEdges;
-edge_t *edges;
-int edge_count, maxNode;
-char buff[1024];
-path_element_t *path;
-char *err_msg;
-int path_count;
-int kase;
-
-/*
-	This method load the edge information from a csv file and put them in the edge_t array that can be passed to the algorithm to find route
-*/
-
-void loadGraph(std::string edgeFile)
-{
-	// Open file for reading
-	//freopen(edgeFile.c_str(), "rt", stdin);
-	FILE *fpgraph = fopen(edgeFile.c_str(), "rt");
-
-	edge_count = 0;
-	vecEdges.clear();
-	maxNode = -1;
-
-	// Read line by line edge info
-	while(fgets(buff, 1000, fpgraph))
-	{
-		if(strlen(buff) == 0)
-			break;
-		edge_count++;
-
-		StringTokenizer token;
-		// tokenize using comma
-		token.parse(buff, ",");
-		std::vector<std::string> vecToken; 
-		token.getTokens(vecToken);
-
-		// There should be exactly 5 values: edge_id, start_node_id, end_node_id, cost, reverse_cost
-		if(vecToken.size() < 5)
-			fprintf(stderr, "Error in %d edge\n", edge_count);
-
-		// Populate Edge_t structure
-		edge_t tempEdge;
-		tempEdge.id = atoi(vecToken[0].c_str());
-		tempEdge.source = atoi(vecToken[1].c_str());
-		tempEdge.target = atoi(vecToken[2].c_str());
-		tempEdge.cost = atof(vecToken[3].c_str());
-		tempEdge.reverse_cost = atof(vecToken[4].c_str());
-
-		// Update max_node_id
-		if(tempEdge.source > maxNode)
-			maxNode = tempEdge.source;
-		if(tempEdge.target > maxNode)
-			maxNode = tempEdge.target;
-		vecEdges.push_back(tempEdge);
-	}
-
-	edges = new edge_t[edge_count];
-	int i;
-
-	for(i = 0; i < edge_count; i++)
-	{
-		edges[i] = vecEdges[i];
-	}
-	fclose(fpgraph);
-}
-/*
-	Write the route in the path file
-*/
-void write_result(std::string fileName, int res)
-{
-	int i;
-	
-	FILE *fppath = fopen(fileName.c_str(), "wt");
-	
-	if(res < 0)
-		fprintf(fppath, "%s\n", err_msg);
-	else
-	{
-		for(i = 0; i < path_count; i++)
-		{
-			fprintf(fppath, "%d\t|%d\t|%.6lf\n", path[i].vertex_id, path[i].edge_id, path[i].cost);
-		}
-	}
-	fclose(fppath);
-}
-
-/*
-	Match output with answer file and write result in the result file
-*/
-
-void match(std::string fileName1, std::string fileName2, std::string outFile, double ttime)
-{
-	// Open the first file
-	
-	FILE *fpfirst = fopen(fileName1.c_str(), "rt");
-	
-	// Initialization
-	std::vector<int> nodeList1;
-	nodeList1.clear();
-	double totCost1, totCost2;
-	int nid, eid;
-	double cost;
-	totCost1 = 0.0;
-	
-	// Read paths push node_id, edge_id in the vector and update total cost
-	while(fgets(buff, 1000, fpfirst))
-	{
-		if(sscanf(buff, "%d |%d |%lf", &nid, &eid, &cost) != 3)
-		{
-			totCost1 = -1;
-			break;
-		}
-		nodeList1.push_back(nid);
-		nodeList1.push_back(eid);
-		totCost1 += cost;
-	}
-	
-	fclose(fpfirst);
-	bool flag = true;
-	// Open the second file
-	
-	FILE *fpsecond = fopen(fileName2.c_str(), "rt");
-	
-	
-	totCost2 = 0.0;
-	int pos = 0;
-
-	// Read paths compare with previously constructed vector of node-id, edge_id and updte total cost
-	while(fgets(buff, 1000, fpsecond))
-	{
-		if(sscanf(buff, "%d |%d |%lf", &nid, &eid, &cost) != 3)
-		{
-			totCost2 = -1;
-			break;
-		}
-		if(pos >= nodeList1.size() || nodeList1[pos] != nid)
-		{
-			flag = false;
-		}
-		pos++;
-		if(pos >= nodeList1.size() || nodeList1[pos] != eid)
-		{
-			flag = false;
-		}
-		pos++;
-		totCost2 += cost;
-	}
-	
-	fclose(fpsecond);
-
-	// Open output file to write
-	//freopen(outFile.c_str(), "a+", stdout);
-	FILE *fpout = fopen(outFile.c_str(), "a+");
-	fprintf(fpout, "Case %d: ", kase);
-
-	// Both costs matches
-	if(fabs(totCost1 - totCost2) < EPS)
-	{
-		// Path also matches
-		if(flag == true)
-		{
-			fprintf(fpout, "Perfect Match!!!\n");
-		}
-		else	// path mismatch
-		{
-			fprintf(fpout, "Cost same, but path differs!!!\n");
-		}
-	}
-	else // Cost mispatch
-	{
-		fprintf(fpout, "Cost differs, %s costs %lf and %s costs %lf\n", fileName1.c_str(), totCost1, fileName2.c_str(), totCost2);
-	}
-	fprintf(fpout, "Query time: %lf sec\n\n", ttime);
-	fclose(fpout);
-}
-
-int main()
-{
-	int i;
-	double cl;
-	kase = 1;
-	
-	// The final output will be written in the outFile and the initial input will be read from inFile
-	std::string outFile = "output.txt";
-	std::string inFile = "input.txt";
-
-	// Create the output file
-	FILE *fpout = fopen(outFile.c_str(), "wt");
-	fclose(fpout);
-
-	// Open the input file
-	FILE *fpin = fopen(inFile.c_str(), "rt");
-
-	// Reading each of the cases, There may be two types of cases, with 4 parameters, with 5 parameters
-	// There may also be comments that starts with #
-	
-	if(fpin == NULL)
-		fprintf(stderr, "could not read file\n");	
-	while(fgets(buff, 1000, fpin))
-	{
-		// No data
-		if(strlen(buff) == 0)
-			continue;
-		// Comment
-		if(buff[0] == '#')
-			continue;
-		StringTokenizer token;
-
-		// tokeniize using space
-		token.parse(buff, " \n\r");
-		std::vector<std::string> vecToken; 
-		token.getTokens(vecToken);
-
-		int totParam = vecToken.size();
-		
-		// Not enough parameters
-		if(totParam < 4)
-			continue;
-
-		// First token is the graph file name
-		std::string graphFile = vecToken[0];
-
-		// 2nd and 3rd tokens are start and end node id respectively
-		int startNode = atoi(vecToken[1].c_str());
-		int endNode = atoi(vecToken[2].c_str());
-
-		// 4th Token is the result file for this query
-		
-		std::string pathFile = vecToken[3];
-		int ind = pathFile.length() - 1;
-		while(pathFile[ind] < 32)
-		{
-			pathFile[ind] = '\0';
-			ind--;
-		}
-
-		// Load edge information from graph file
-		loadGraph(graphFile);
-
-        fprintf(stderr, "edge_count: %d. maxNode: %d, startNode: %d, endNode: %d\n", edge_count, maxNode, startNode, endNode);
-		
-		// Use bidirectional dijkstra to get the route
-		BiDirDijkstra gdef;
-		cl = clock();
-		int res = gdef.bidir_dijkstra(edges, edge_count, maxNode, startNode, endNode, &path, &path_count, &err_msg);
-		cl = clock() - cl;
-		
-		// Write the route in the result file
-		
-		write_result(pathFile, res);
-		
-		
-		// There is an answer file
-		if(totParam > 4)
-		{
-			std::string ansFile = vecToken[4];
-			int ind = ansFile.length() - 1;
-			while(ansFile[ind] < 32)
-			{
-				ansFile[ind] = '\0';
-				ind--;
-			}
-			// Match and write result in the final output file
-			match(pathFile, ansFile, outFile, cl / CLOCKS_PER_SEC);
-		}
-		else
-		{
-			// Provide information that the route is generated in path file.
-			fpout = fopen(outFile.c_str(), "a+");
-			fprintf(fpout, "Case %d: Path Written to file %s\n", kase, pathFile.c_str());
-			fprintf(fpout, "Query Time: %lf sec\n\n", cl / CLOCKS_PER_SEC);
-			fclose(fpout);
-		}
-		kase++;
-		free(path);
-		delete [] edges;
-	}
-	fclose(fpin);
-	return 0;
-}
diff --git a/src/bd_dijkstra/tester/BiDirDijkstra.cpp b/src/bd_dijkstra/tester/BiDirDijkstra.cpp
deleted file mode 100644
index f7fa985..0000000
--- a/src/bd_dijkstra/tester/BiDirDijkstra.cpp
+++ /dev/null
@@ -1,377 +0,0 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#include "BiDirDijkstra.h"
-
-BiDirDijkstra::BiDirDijkstra(void)
-{
-}
-
-BiDirDijkstra::~BiDirDijkstra(void)
-{
-}
-
-void BiDirDijkstra::init()
-{
-	//max_edge_id = 0;
-	//max_node_id = 0;
-	
-}
-
-void BiDirDijkstra::initall(int maxNode)
-{
-	int i;
-	m_pFParent = new PARENT_PATH[maxNode + 1];
-	m_pRParent = new PARENT_PATH[maxNode + 1];
-
-	m_pFCost = new double[maxNode + 1];
-	m_pRCost = new double[maxNode + 1];
-
-	for(i = 0; i <= maxNode; i++)
-	{
-		m_pFParent[i].par_Node = -2;
-		m_pRParent[i].par_Node = -2;
-		m_pFCost[i] = INF;
-		m_pRCost[i] = INF;
-		
-	}
-	m_MinCost = INF;
-	m_MidNode = -1;
-}
-
-void BiDirDijkstra::deleteall()
-{
-	delete [] m_pFParent;
-	delete [] m_pRParent;
-	delete [] m_pFCost;
-	delete [] m_pRCost;
-}
-
-double BiDirDijkstra::getcost(int node_id, int dir)
-{
-	if(dir == 1)
-	{
-		return(m_pFCost[node_id]);
-	}
-	else
-	{
-		return(m_pRCost[node_id]);
-	}
-}
-
-void BiDirDijkstra::setcost(int node_id, int dir, double c)
-{
-	if(dir == 1)
-	{
-		m_pFCost[node_id] = c;
-	}
-	else
-	{
-		m_pRCost[node_id] = c;
-	}
-}
-
-void BiDirDijkstra::setparent(int node_id, int dir, int parnode, int paredge)
-{
-	if(dir == 1)
-	{
-		m_pFParent[node_id].par_Node = parnode;
-		m_pFParent[node_id].par_Edge = paredge;
-	}
-	else
-	{
-		m_pRParent[node_id].par_Node = parnode;
-		m_pRParent[node_id].par_Edge = paredge;
-	}
-}
-
-void BiDirDijkstra::fconstruct_path(int node_id)
-{
-	if(m_pFParent[node_id].par_Node == -1)
-		return;
-	fconstruct_path(m_pFParent[node_id].par_Node);
-	path_element_t pt;
-	pt.vertex_id = m_pFParent[node_id].par_Node;
-	pt.edge_id = m_pFParent[node_id].par_Edge;
-	pt.cost = m_pFCost[node_id] - m_pFCost[m_pFParent[node_id].par_Node];
-	m_vecPath.push_back(pt);
-}
-
-void BiDirDijkstra::rconstruct_path(int node_id)
-{
-	path_element_t pt;
-	if(m_pRParent[node_id].par_Node == -1)
-	{
-		pt.vertex_id = node_id;
-		pt.edge_id = -1;
-		pt.cost = 0.0;
-		return;
-	}
-	pt.vertex_id = node_id;
-	pt.cost = m_pRCost[node_id] - m_pRCost[m_pRParent[node_id].par_Node];
-	pt.edge_id = m_pRParent[node_id].par_Edge;
-	m_vecPath.push_back(pt);
-	rconstruct_path(m_pRParent[node_id].par_Node);
-}
-
-void BiDirDijkstra::explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que)
-{
-	int i;
-	int con_edge = m_vecNodeVector[cur_node].Connected_Edges_Index.size();
-	double edge_cost;
-	for(i = 0; i < con_edge; i++)
-	{
-		int edge_index = m_vecNodeVector[cur_node].Connected_Edges_Index[i];
-		GraphEdgeInfo edge = m_vecEdgeVector[edge_index];
-		int new_node = m_vecNodeVector[cur_node].Connected_Nodes[i];
-		int mult;
-		
-		if(edge.Direction == 0)
-			mult = 1;
-		else
-			mult = dir;
-		if(cur_node == edge.StartNode)
-		{
-			if(dir > 0)
-				edge_cost = edge.Cost;
-			else
-				edge_cost = edge.ReverseCost;
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				//edge_cost = edge.Cost * mult;
-				
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost, new_node));
-
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-		else
-		{
-			if(dir > 0)
-				edge_cost = edge.ReverseCost;
-			else
-				edge_cost = edge.Cost;
-			if(edge.Direction == 0 || edge_cost >= 0.0)
-			{
-				//edge_cost = edge.ReverseCost * mult;
-
-				if(cur_cost + edge_cost < getcost(new_node, dir))
-				{
-					setcost(new_node, dir, cur_cost + edge_cost);
-					setparent(new_node, dir, cur_node, edge.EdgeID);
-					que.push(std::make_pair(cur_cost + edge_cost, new_node));
-
-					if(getcost(new_node, dir) + getcost(new_node, dir * -1) < m_MinCost)
-					{
-						m_MinCost = getcost(new_node, dir) + getcost(new_node, dir * -1);
-						m_MidNode = new_node;
-					}
-				}
-			}
-		}
-	}
-}
-
-int BiDirDijkstra:: bidir_dijkstra(edge_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-				path_element_t **path, int *path_count, char **err_msg)
-{
-	max_node_id = maxNode;
-	max_edge_id = -1;
-	init();
-	construct_graph(edges, edge_count, maxNode);
-	
-
-	int nodeCount = m_vecNodeVector.size();
-		
-	std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > fque;
-	std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > rque;
-	
-	m_vecPath.clear();
-
-	int i;
-	initall(maxNode);
-
-	m_pFParent[start_vertex].par_Node = -1;
-	m_pFParent[start_vertex].par_Edge = -1;
-	m_pFCost[start_vertex] = 0.0;
-	fque.push(std::make_pair(0.0, start_vertex));
-
-	m_pRParent[end_vertex].par_Node = -1;
-	m_pRParent[end_vertex].par_Edge = -1;
-	m_pRCost[end_vertex] = 0.0;
-	rque.push(std::make_pair(0.0, end_vertex));
-
-
-	int new_node;
-	int cur_node;
-	int dir;
-
-	while(!fque.empty() && !rque.empty())
-	{
-		PDI fTop = fque.top();
-		PDI rTop = rque.top();
-		if(fTop.first + rTop.first > m_MinCost) //We are done, there is no path with lower cost
-			break;
-
-		if(rTop.first < fTop.first) // Explore from reverse queue
-		{
-			cur_node = rTop.second;
-			int dir = -1;
-			rque.pop();
-			explore(cur_node, rTop.first, dir, rque);
-		}
-		else                        // Explore from forward queue
-		{
-			cur_node = fTop.second;
-			int dir = 1;
-			fque.pop();
-			explore(cur_node, fTop.first, dir, fque);
-		}
-	}
-
-	if(m_MidNode == -1)
-	{
-		*err_msg = (char *)"Path Not Found";
-		deleteall();
-		return -1;
-	}
-	else
-	{
-		fconstruct_path(m_MidNode);
-		rconstruct_path(m_MidNode);
-		path_element_t pelement;
-		pelement.vertex_id = end_vertex;
-		pelement.edge_id = -1;
-		pelement.cost = 0.0;
-		m_vecPath.push_back(pelement);
-
-		*path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
-		*path_count = m_vecPath.size();
-
-		for(i = 0; i < *path_count; i++)
-		{
-			(*path)[i].vertex_id = m_vecPath[i].vertex_id;
-			(*path)[i].edge_id = m_vecPath[i].edge_id;
-			(*path)[i].cost = m_vecPath[i].cost;
-		}
-		
-	}
-	deleteall();
-	return 0;
-}
-
-
-bool BiDirDijkstra::construct_graph(edge_t* edges, int edge_count, int maxNode)
-{
-	int i;
-	GraphNodeInfo nodeInfo;
-	nodeInfo.Connected_Edges_Index.clear();
-	nodeInfo.Connected_Nodes.clear();
-
-	for(i = 0; i <= maxNode; i++)
-	{
-		nodeInfo.NodeID = i;
-		m_vecNodeVector.push_back(nodeInfo);
-	}
-
-	for(i = 0; i < edge_count; i++)
-	{
-		addEdge(edges[i]);
-	}
-
-	return true;
-}
-
-
-bool BiDirDijkstra::addEdge(edge_t edgeIn)
-{
-	long lTest;
-	Long2LongMap::iterator itMap = m_mapEdgeId2Index.find(edgeIn.id);
-	if(itMap != m_mapEdgeId2Index.end())	
-		return false;
-
-	
-	GraphEdgeInfo newEdge;
-	newEdge.EdgeID = edgeIn.id;
-	newEdge.EdgeIndex = m_vecEdgeVector.size();	
-	newEdge.StartNode = edgeIn.source;
-	newEdge.EndNode = edgeIn.target;
-	newEdge.Cost = edgeIn.cost;
-	newEdge.ReverseCost = edgeIn.reverse_cost;
-	if(newEdge.Cost >= 0.0 && newEdge.ReverseCost >= 0)
-	{
-		newEdge.Direction = 0;
-	}
-	else if(newEdge.Cost >= 0.0)
-	{
-		newEdge.Direction = 1;
-	}
-	else
-	{
-		newEdge.Direction = -1;
-	}
-
-	if(edgeIn.id > max_edge_id)
-	{
-		max_edge_id = edgeIn.id;
-	}
-
-	if(newEdge.StartNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.StartNode;
-	}
-	if(newEdge.EndNode > max_node_id)
-	{
-		return false;//max_node_id = newEdge.EdgeIndex;
-	}
-
-	m_vecNodeVector[newEdge.StartNode].Connected_Nodes.push_back(newEdge.EndNode);
-	m_vecNodeVector[newEdge.StartNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-	m_vecNodeVector[newEdge.EndNode].Connected_Nodes.push_back(newEdge.StartNode);
-	m_vecNodeVector[newEdge.EndNode].Connected_Edges_Index.push_back(newEdge.EdgeIndex);
-
-
-	
-	//Adding edge to the list
-	m_mapEdgeId2Index.insert(std::make_pair(newEdge.EdgeID, m_vecEdgeVector.size()));
-	m_vecEdgeVector.push_back(newEdge);
-
-	//
-	return true;
-}
diff --git a/src/bd_dijkstra/tester/BiDirDijkstra.h b/src/bd_dijkstra/tester/BiDirDijkstra.h
deleted file mode 100644
index a9f5a8f..0000000
--- a/src/bd_dijkstra/tester/BiDirDijkstra.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef BIDIRDIJKSTRA_H
-#define BIDIRDIJKSTRA_H
-
-#include <vector>
-#include <map>
-#include <queue>
-#include <string>
-#include <stdlib.h>
-#include <iostream>
-#include <stdio.h>
-#include <string.h>
-
-
-//#include "bdsp.h"
-
-#define INF 1e15
-
-typedef std::vector<long> LongVector;
-typedef std::vector<LongVector> VectorOfLongVector;
-//typedef std::pair<int, bool> PIB;
-typedef std::pair<double, int> PDI;
-//typedef std::pair<double, std::vector<int> > PDVI;
-
-typedef struct edge 
-{
-	int id;
-	int source;
-	int target;
-	double cost;
-	double reverse_cost;
-} edge_t;
-
-typedef struct path_element 
-{
-	int vertex_id;
-	int edge_id;
-	double cost;
-}path_element_t;
-
-
-typedef struct{
-	int par_Node;
-	int par_Edge;
-}PARENT_PATH;
-
-typedef struct{
-	int NodeID;
-	std::vector<int> Connected_Nodes;
-	std::vector<int> Connected_Edges_Index;
-}GraphNodeInfo;
-
-struct GraphEdgeInfo
-{
-public:
-	int EdgeID;
-	int EdgeIndex;
-	int Direction;
-	double Cost;
-	double ReverseCost;
-	int StartNode;
-	int EndNode;
-};
-
-typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
-typedef std::map<long,LongVector> Long2LongVectorMap;
-typedef std::map<long,long> Long2LongMap;
-typedef std::vector<GraphNodeInfo> GraphNodeVector;
-
-
-class BiDirDijkstra
-{
-public:
-	BiDirDijkstra(void);
-	~BiDirDijkstra(void);
-	
-	int bidir_dijkstra(edge_t *edges, unsigned int edge_count, int maxNode, int start_vertex, int end_vertex,
-		path_element_t **path, int *path_count, char **err_msg);
-	
-
-private:
-	bool construct_graph(edge_t *edges, int edge_count, int maxNode);
-	void fconstruct_path(int node_id);
-	void rconstruct_path(int node_id);
-	bool addEdge(edge edgeIn);
-	bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
-	void init();
-	void initall(int maxNode);
-	void deleteall();
-	void explore(int cur_node, double cur_cost, int dir, std::priority_queue<PDI, std::vector<PDI>, std::greater<PDI> > &que);
-	double getcost(int node_id, int dir);
-	void setcost(int node_id, int dir, double c);
-	void setparent(int node_id, int dir, int parnode, int paredge);
-
-private:
-	GraphEdgeVector m_vecEdgeVector;
-	Long2LongMap m_mapEdgeId2Index;
-	Long2LongVectorMap m_mapNodeId2Edge;
-	GraphNodeVector m_vecNodeVector;
-	int max_node_id;
-	int max_edge_id;
-	int m_lStartNodeId;
-	int m_lEndNodeId;
-
-	double m_MinCost;
-	int m_MidNode;
-	std::vector <path_element_t> m_vecPath;
-	PARENT_PATH *m_pFParent;
-	PARENT_PATH *m_pRParent;
-	double *m_pFCost;
-	double *m_pRCost;
-};
-
-#endif
diff --git a/src/bd_dijkstra/tester/Makefile b/src/bd_dijkstra/tester/Makefile
deleted file mode 100644
index 1ef8091..0000000
--- a/src/bd_dijkstra/tester/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-all: BDDTester
-
-BDDTester: BDDTester.cpp BiDirDijkstra.cpp BiDirDijkstra.h  utils.h
-	g++ BDDTester.cpp BiDirDijkstra.cpp -o BDDTester
-
-clean:
-	rm -f BDDTester bdd?.txt output.txt
diff --git a/src/bd_dijkstra/tester/ans1.txt b/src/bd_dijkstra/tester/ans1.txt
deleted file mode 100644
index e914abb..0000000
--- a/src/bd_dijkstra/tester/ans1.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-5700	|20787	|0.006774
-10932	|20756	|0.040876
-10931	|20797	|0.002564
-7661	|20796	|0.002581
-10943	|20776	|0.040800
-10941	|20772	|0.005720
-3415	|20771	|0.007463
-10940	|20841	|0.187594
-10952	|20812	|0.005045
-7034	|20811	|0.004532
-10951	|20833	|0.177477
-10944	|20779	|0.008539
-8910	|20778	|0.006447
-10929	|20835	|0.071114
-10948	|20794	|0.013276
-8908	|12990	|0.013157
-8325	|13831	|0.009169
-3753	|13830	|0.196045
-6774	|13829	|0.032840
-8304	|13828	|0.117213
-9205	|13827	|0.010639
-8994	|13165	|0.012931
-8977	|13164	|0.008029
-8976	|13163	|0.069895
-8993	|13162	|0.009638
-8351	|13161	|0.099016
-8992	|13160	|0.187353
-8991	|13159	|0.018649
-2962	|13158	|0.071931
-1285	|13157	|0.118340
-8989	|13156	|0.006317
-8988	|13155	|0.079185
-21	|13154	|0.057101
-6436	|13153	|0.083288
-637	|13152	|0.099744
-8987	|13151	|0.057786
-398	|13150	|0.120005
-8496	|13149	|0.069498
-8986	|13148	|0.014323
-8985	|13167	|0.070884
-8451	|11869	|0.006925
-476	|11868	|0.196533
-529	|11867	|0.005677
-8450	|11871	|0.118857
-8452	|11878	|0.083250
-8455	|11880	|0.048821
-8456	|11883	|0.064572
-1807	|11882	|0.101185
-8457	|11894	|0.046805
-8465	|15481	|0.180992
-8522	|15480	|0.016198
-9621	|15479	|0.209882
-2808	|15478	|0.019312
-8311	|15477	|0.113487
-8583	|16981	|0.045667
-10046	|16982	|0.022635
-8467	|16983	|0.022924
-9624	|15487	|0.034042
-8468	|11899	|0.018103
-3170	|19357	|0.047698
-9949	|19358	|0.059093
-10479	|19359	|0.051651
-9948	|19360	|0.051709
-8509	|19374	|0.106794
-9595	|19375	|0.102428
-8634	|19376	|0.107643
-10174	|19377	|0.096140
-10482	|19378	|0.009782
-9194	|19379	|0.102702
-4397	|19380	|0.108243
-3002	|19381	|0.098919
-10484	|19382	|0.006171
-5962	|19383	|0.005429
-10485	|19384	|0.047276
-10459	|19385	|0.052864
-7579	|19386	|0.052378
-10455	|19387	|0.052414
-5805	|19388	|0.081956
-10462	|19389	|0.016974
-8768	|12598	|0.059630
-8767	|19290	|0.117748
-10470	|19289	|0.065769
-10469	|19288	|0.066230
-10468	|19287	|0.111281
-9967	|16642	|0.029056
-9956	|16621	|0.014614
-9938	|16626	|0.007036
-9960	|16649	|0.081206
-9968	|16650	|0.012230
-9969	|16647	|0.012368
-5457	|6266	|0.055134
-5458	|6267	|0.053860
-5459	|6268	|0.109859
-5460	|6269	|0.104952
-5461	|6270	|0.053766
-5462	|6271	|0.046800
-5463	|12897	|0.170300
-8880	|15060	|0.049014
-7101	|15059	|0.047811
-9313	|15058	|0.044674
-6733	|-1	|0.000000
diff --git a/src/bd_dijkstra/tester/ans2.txt b/src/bd_dijkstra/tester/ans2.txt
deleted file mode 100644
index 69839e0..0000000
--- a/src/bd_dijkstra/tester/ans2.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-6585	|17975	|0.200230
-5367	|17976	|0.155428
-7125	|17977	|0.178581
-613	|17978	|0.175712
-10025	|17979	|0.173776
-5802	|6758	|0.013489
-5803	|6759	|0.065176
-5804	|6760	|0.008679
-5805	|6761	|0.145097
-5806	|6762	|0.146807
-5807	|6763	|0.097186
-5808	|6764	|0.050569
-5809	|20663	|0.169650
-4620	|20662	|0.023243
-5774	|20661	|0.120390
-6482	|20660	|0.002769
-5957	|20659	|0.087952
-8289	|20658	|0.048701
-10884	|20657	|0.009212
-10883	|20656	|0.080500
-9954	|20655	|0.075280
-4390	|16876	|0.147691
-9203	|17805	|0.063931
-7892	|17804	|0.015429
-8417	|17803	|0.069119
-10171	|17802	|0.075825
-9953	|17801	|0.045079
-8859	|17800	|0.029389
-8536	|17799	|0.072658
-10180	|17798	|0.076558
-9592	|17797	|0.027637
-9318	|17796	|0.114755
-10179	|17795	|0.007150
-10178	|17794	|0.087467
-8402	|17793	|0.062258
-6179	|17792	|0.109483
-8508	|17791	|0.036248
-3305	|17790	|0.069816
-8512	|17789	|0.064158
-998	|17807	|0.471312
-2698	|2743	|0.102019
-2563	|9039	|0.341756
-2043	|9040	|0.587619
-4280	|9041	|0.145996
-2317	|9042	|0.268754
-7135	|9043	|0.121251
-4276	|9044	|0.145396
-6167	|9045	|0.583394
-7136	|9046	|0.043099
-7137	|19345	|0.053510
-10475	|19344	|0.015153
-10142	|19343	|0.064475
-10140	|17566	|0.135370
-8539	|17565	|0.057338
-10138	|17558	|0.064893
-6943	|17559	|0.201703
-8140	|17560	|0.469613
-10139	|20189	|0.060217
-10705	|20185	|0.055053
-8247	|-1	|0.000000
diff --git a/src/bd_dijkstra/tester/ans3.txt b/src/bd_dijkstra/tester/ans3.txt
deleted file mode 100644
index 0412f67..0000000
--- a/src/bd_dijkstra/tester/ans3.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-9426	|14822	|0.060319
-3606	|-1	|0.000000
diff --git a/src/bd_dijkstra/tester/ans4.txt b/src/bd_dijkstra/tester/ans4.txt
deleted file mode 100644
index d499d34..0000000
--- a/src/bd_dijkstra/tester/ans4.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-3606	|14822	|0.060319
-9426	|-1	|0.000000
diff --git a/src/bd_dijkstra/tester/ans5.txt b/src/bd_dijkstra/tester/ans5.txt
deleted file mode 100644
index 2ce61fa..0000000
--- a/src/bd_dijkstra/tester/ans5.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-6733	|15058	|0.044674
-9313	|15059	|0.047811
-7101	|15060	|0.049014
-8880	|12897	|0.170300
-5463	|6271	|0.046800
-5462	|6270	|0.053766
-5461	|6269	|0.104952
-5460	|6268	|0.109859
-5459	|6267	|0.053860
-5458	|6266	|0.055134
-5457	|16647	|0.012368
-9969	|16650	|0.012230
-9968	|16649	|0.081206
-9960	|16626	|0.007036
-9938	|16621	|0.014614
-9956	|16642	|0.029056
-9967	|19287	|0.111281
-10468	|19288	|0.066230
-10469	|19289	|0.065769
-10470	|19290	|0.117748
-8767	|12598	|0.059630
-8768	|19389	|0.016974
-10462	|19388	|0.081956
-5805	|19387	|0.052414
-10455	|19386	|0.052378
-7579	|19385	|0.052864
-10459	|19384	|0.047276
-10485	|19383	|0.005429
-5962	|19382	|0.006171
-10484	|19381	|0.098919
-3002	|19380	|0.108243
-4397	|19379	|0.102702
-9194	|19378	|0.009782
-10482	|19377	|0.096140
-10174	|19376	|0.107643
-8634	|19375	|0.102428
-9595	|19374	|0.106794
-8509	|19360	|0.051709
-9948	|19359	|0.051651
-10479	|19358	|0.059093
-9949	|19357	|0.047698
-3170	|11899	|0.018103
-8468	|15487	|0.034042
-9624	|16983	|0.022924
-8467	|16982	|0.022635
-10046	|16981	|0.045667
-8583	|15477	|0.113487
-8311	|15478	|0.019312
-2808	|15479	|0.209882
-9621	|15480	|0.016198
-8522	|15481	|0.180992
-8465	|11894	|0.046805
-8457	|11882	|0.101185
-1807	|11883	|0.064572
-8456	|11880	|0.048821
-8455	|11878	|0.083250
-8452	|11871	|0.118857
-8450	|11867	|0.005677
-529	|11868	|0.196533
-476	|11869	|0.006925
-8451	|13167	|0.070884
-8985	|13148	|0.014323
-8986	|13149	|0.069498
-8496	|13150	|0.120005
-398	|13151	|0.057786
-8987	|13152	|0.099744
-637	|13153	|0.083288
-6436	|13154	|0.057101
-21	|13155	|0.079185
-8988	|13156	|0.006317
-8989	|13157	|0.118340
-1285	|13158	|0.071931
-2962	|13159	|0.018649
-8991	|13160	|0.187353
-8992	|13161	|0.099016
-8351	|13162	|0.009638
-8993	|13163	|0.069895
-8976	|13164	|0.008029
-8977	|13165	|0.012931
-8994	|13827	|0.010639
-9205	|13828	|0.117213
-8304	|13829	|0.032840
-6774	|13830	|0.196045
-3753	|13831	|0.009169
-8325	|12990	|0.013157
-8908	|20794	|0.013276
-10948	|20835	|0.071114
-10929	|20778	|0.006447
-8910	|20779	|0.008539
-10944	|20833	|0.177477
-10951	|20811	|0.004532
-7034	|20812	|0.005045
-10952	|20841	|0.187594
-10940	|20771	|0.007463
-3415	|20772	|0.005720
-10941	|20776	|0.040800
-10943	|20796	|0.002581
-7661	|20797	|0.002564
-10931	|20756	|0.040876
-10932	|20787	|0.006774
-5700	|-1	|0.000000
diff --git a/src/bd_dijkstra/tester/ans6.txt b/src/bd_dijkstra/tester/ans6.txt
deleted file mode 100644
index 8f220c6..0000000
--- a/src/bd_dijkstra/tester/ans6.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-8247	|20185	|0.055053
-10705	|20189	|0.060217
-10139	|17560	|0.469613
-8140	|17559	|0.201703
-6943	|17558	|0.064893
-10138	|17565	|0.057338
-8539	|17566	|0.135370
-10140	|19343	|0.064475
-10142	|19344	|0.015153
-10475	|19345	|0.053510
-7137	|9046	|0.043099
-7136	|9045	|0.583394
-6167	|9044	|0.145396
-4276	|9043	|0.121251
-7135	|9042	|0.268754
-2317	|9041	|0.145996
-4280	|9040	|0.587619
-2043	|9039	|0.341756
-2563	|2743	|0.102019
-2698	|17807	|0.471312
-998	|17789	|0.064158
-8512	|17790	|0.069816
-3305	|17791	|0.036248
-8508	|17792	|0.109483
-6179	|17793	|0.062258
-8402	|17794	|0.087467
-10178	|17795	|0.007150
-10179	|17796	|0.114755
-9318	|17797	|0.027637
-9592	|17798	|0.076558
-10180	|17799	|0.072658
-8536	|17800	|0.029389
-8859	|17801	|0.045079
-9953	|17802	|0.075825
-10171	|17803	|0.069119
-8417	|17804	|0.015429
-7892	|17805	|0.063931
-9203	|16876	|0.147691
-4390	|20655	|0.075280
-9954	|20656	|0.080500
-10883	|20657	|0.009212
-10884	|20658	|0.048701
-8289	|20659	|0.087952
-5957	|20660	|0.002769
-6482	|20661	|0.120390
-5774	|20662	|0.023243
-4620	|20663	|0.169650
-5809	|6764	|0.050569
-5808	|6763	|0.097186
-5807	|6762	|0.146807
-5806	|6761	|0.145097
-5805	|6760	|0.008679
-5804	|6759	|0.065176
-5803	|6758	|0.013489
-5802	|17979	|0.173776
-10025	|17978	|0.175712
-613	|17977	|0.178581
-7125	|17976	|0.155428
-5367	|17975	|0.200230
-6585	|-1	|0.000000
diff --git a/src/bd_dijkstra/tester/input.txt b/src/bd_dijkstra/tester/input.txt
deleted file mode 100644
index 6541bf2..0000000
--- a/src/bd_dijkstra/tester/input.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-ways.txt 5700 6733 bdd1.txt ans1.txt
-ways.txt 6585 8247 bdd2.txt ans2.txt
-ways.txt 9426 3606 bdd3.txt ans3.txt
-ways.txt 3606 9426 bdd4.txt ans4.txt
-ways.txt 6733 5700 bdd5.txt ans5.txt
-ways.txt 8247 6585 bdd6.txt ans6.txt
-
diff --git a/src/bd_dijkstra/tester/utils.h b/src/bd_dijkstra/tester/utils.h
deleted file mode 100644
index 935cd96..0000000
--- a/src/bd_dijkstra/tester/utils.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/******************************************************************************
-* $Id$
-*
-* Project:  pgRouting bdsp and bdastar algorithms
-* Purpose:
-* Author:   Razequl Islam <ziboncsedu at gmail.com>
-*
-
-******************************************************************************
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies of this Software or works derived from this Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-
-*****************************************************************************/
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <string>
-#include <map>
-#include <vector>
-#include <queue>
-#include <iostream>
-
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<int> IntVector;
-typedef std::vector<double> DoubleVector;
-typedef std::vector<std::string> StringVector;
-
-
-class StringOperation
-{
-	
-public:
-	
-	static std::string TRIMWHITESPACE(std::string strInput)
-	{
-		std::string strOut = strInput;
-		std::string strWht = " \f\n\r\t\v";	
-
-		strOut.erase(0,strOut.find_first_not_of(strWht));
-		strOut.erase(strOut.find_last_not_of(strWht) + 1);
-		return strOut;
-	};
-};
-
-class StringTokenizer
-{
-public:
-	StringTokenizer()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		vecTokens.clear();
-		strInput = "";
-	}
-
-	bool parse(std::string strInput, std::string chDelim)
-	{
-		size_t iStartPos = 0;
-		while(true)	
-		{
-			size_t iPos = strInput.find(chDelim[0],iStartPos);
-			if(iPos != std::string::npos)
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos,iPos - iStartPos);
-				vecTokens.push_back(strToken);
-				iStartPos = iPos + 1;
-			}
-			else if(iPos == std::string::npos && strInput.length() > 0 )
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos, strInput.length() - iStartPos);
-				if(strToken.length() > 0)
-					vecTokens.push_back(strToken);
-				break;
-			}		
-			else 
-				break;
-
-		}		
-		return true;
-	}
-
-	size_t getTokenCount() 
-	{
-		return vecTokens.size();
-	}
-
-	bool getToken(std::string& strToken, size_t iTokenIndex)
-	{
-		long lTokenCount = vecTokens.size();
-		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
-		{
-			strToken = vecTokens[iTokenIndex];
-			return true;
-		}
-		return false;
-	}
-
-	bool getTokens(StringVector& vecTokensRef)
-	{
-		vecTokensRef = vecTokens;
-		return true;
-	}
-
-private:
-	std::string strInput;
-	StringVector vecTokens;
-	
-};
-
-#endif
diff --git a/src/bd_dijkstra/tester/ways.txt b/src/bd_dijkstra/tester/ways.txt
deleted file mode 100644
index 2ca6dea..0000000
--- a/src/bd_dijkstra/tester/ways.txt
+++ /dev/null
@@ -1,17268 +0,0 @@
-18129,10271,10265,0.407629542119694,0.407629542119694
-14822,9426,3606,0.0603186413824967,0.0603186413824967
-16176,5812,7719,0.198519002375015,0.198519002375015
-16177,7719,9841,1.21182332618964,1.21182332618964
-16178,137,1482,0.199034161669709,0.199034161669709
-16179,1482,3758,0.20606858724026,0.20606858724026
-16217,7903,7844,0.0651768093591436,0.0651768093591436
-16218,7844,6725,0.105799860394335,0.105799860394335
-15793,2298,2322,0.00529554982932783,0.00529554982932783
-14854,9432,9433,0.00987428384236239,0.00987428384236239
-19732,4490,10638,0.0159213769578026,0.0159213769578026
-19734,10639,10640,0.115517684408379,0.115517684408379
-19736,10643,5491,0.200611432022914,0.200611432022914
-19737,5491,9472,0.173586542348893,0.173586542348893
-16211,7730,9848,1.41098736584228,1.41098736584228
-19766,8868,3770,0.15451665559366,0.15451665559366
-19767,3770,10249,0.199225315153312,0.199225315153312
-19769,9471,4895,0.183643472400882,0.183643472400882
-19770,4895,9419,0.162738965694015,0.162738965694015
-16694,9991,9992,0.00824975577533471,0.00824975577533471
-16253,9862,7741,0.405750287416545,0.405750287416545
-16254,7741,5836,0.199719306282583,0.199719306282583
-16255,5836,9863,0.20307644815808,0.20307644815808
-445,449,450,0.199450473576153,0.199450473576153
-20724,9339,9399,0.00989025456720925,0.00989025456720925
-20725,9399,10912,0.0075300269970097,0.0075300269970097
-20727,10911,9342,0.00831469236711343,0.00831469236711343
-18403,7778,10286,0.0505898966958872,0.0505898966958872
-273,283,284,0.0964719650645454,0.0964719650645454
-275,285,286,0.0574345831683482,0.0574345831683482
-276,286,287,0.00381671595135443,0.00381671595135443
-277,288,286,0.0749798421316384,0.0749798421316384
-267,277,278,0.026080790494895,0.026080790494895
-19535,10550,10547,0.0727126892007364,0.0727126892007364
-240,247,248,0.0772679392991742,0.0772679392991742
-242,249,250,0.0969982430766615,0.0969982430766615
-19500,10527,10528,0.0180139213913488,0.0180139213913488
-16008,9778,9779,0.0944640625920965,0.0944640625920965
-15463,8882,1361,0.00984596954833585,0.00984596954833585
-11520,658,713,0.150268576052698,0.150268576052698
-270,280,281,0.0978981798906238,0.0978981798906238
-16247,7743,5838,0.199906773104335,0.199906773104335
-505,499,500,0.0224810261782308,0.0224810261782308
-19508,10448,10534,0.00643702567875165,0.00643702567875165
-16434,9896,3281,0.0340559329983669,0.0340559329983669
-19458,10492,10506,0.00750267115612711,0.00750267115612711
-16700,9995,9996,0.0459960991438913,0.0459960991438913
-17222,5174,8210,0.200775724104805,0.200775724104805
-17224,4240,7299,0.0119914556826953,0.0119914556826953
-345,346,347,0.130802492327731,0.130802492327731
-347,348,349,0.135557185972568,0.135557185972568
-348,349,350,0.136845365159024,0.136845365159024
-355,357,358,0.388256388951567,0.388256388951567
-356,358,359,0.410677079496879,0.410677079496879
-18458,10297,6395,0.0910083144293941,0.0910083144293941
-18424,8333,10290,0.150248967925867,0.150248967925867
-18426,8331,7848,0.20002866768649,0.20002866768649
-16185,9843,7721,1.49406009526399,1.49406009526399
-18230,2552,10281,0.408042509102773,0.408042509102773
-568,561,562,0.0238735645312088,0.0238735645312088
-509,503,504,0.0378269387886271,0.0378269387886271
-510,504,505,0.131422581642966,0.131422581642966
-511,505,506,0.13298824931129,0.13298824931129
-512,506,507,0.0469418788297666,0.0469418788297666
-513,507,508,0.00800396830514923,0.00800396830514923
-514,508,509,0.189986229051577,0.189986229051577
-521,516,517,0.0463139600038384,0.0463139600038384
-12956,1507,1599,0.174395269936236,0.174395269936236
-19854,9521,10661,0.207011877470032,0.207011877470032
-11687,773,774,0.0194846935551434,0.0194846935551434
-20577,10865,10866,0.00985918265048112,0.00985918265048112
-15197,3400,9212,0.0496967641825266,0.0496967641825266
-3594,3445,1174,0.142771364790872,0.142771364790872
-3595,1174,897,0.139794356108886,0.139794356108886
-19561,10564,10565,0.0196154846965349,0.0196154846965349
-16270,6159,9867,0.121531820960243,0.121531820960243
-11805,8417,8418,0.134805848745127,0.134805848745127
-18434,8357,10291,0.154597709113849,0.154597709113849
-15269,8698,8458,0.108561000163296,0.108561000163296
-16600,3169,9952,0.143650464740249,0.143650464740249
-971,982,983,0.153004941982632,0.153004941982632
-19467,10511,10512,0.0226507231527583,0.0226507231527583
-19468,10512,10513,0.0195038602641882,0.0195038602641882
-16605,9954,9955,0.0548421550272179,0.0548421550272179
-16733,5003,10004,0.0399314883998924,0.0399314883998924
-16677,9979,9980,0.023537846703909,0.023537846703909
-15811,9714,9715,0.0297752747528411,0.0297752747528411
-12949,1304,1330,0.0581647037716416,0.0581647037716416
-11964,5499,7073,0.148280923478534,0.148280923478534
-18453,9427,4296,0.104102993198957,0.104102993198957
-20603,10836,10820,0.0118777812250081,0.0118777812250081
-20604,10820,10827,0.0109415807816948,0.0109415807816948
-318,326,327,0.287313248528131,0.287313248528131
-919,933,934,0.0476774715690845,0.0476774715690845
-920,934,935,0.0499176342652801,0.0499176342652801
-921,935,936,0.0512339711733563,0.0512339711733563
-12002,6577,5507,0.29282736629382,0.29282736629382
-2397,2072,2388,0.0939943538292093,0.0939943538292093
-17363,7241,3255,0.194151227318962,0.194151227318962
-3612,954,3458,0.174654702147255,0.174654702147255
-3613,3458,3459,0.161855899930502,0.161855899930502
-3614,3459,3460,0.184505780617563,0.184505780617563
-3615,3460,3461,0.174076203888655,0.174076203888655
-12954,1477,1478,0.162422090556836,0.162422090556836
-16746,6830,10008,0.0662012224002346,0.0662012224002346
-19537,10551,4704,0.0179029738053875,0.0179029738053875
-16747,10008,3664,0.0562861796352498,0.0562861796352498
-12008,8513,4459,0.0575373844976813,0.0575373844976813
-12009,4459,5508,0.146438493557302,0.146438493557302
-11575,1594,1595,0.149695612752929,0.149695612752929
-18383,8920,8960,0.0494721849144557,0.0494721849144557
-19652,10605,10528,0.00763160148090486,0.00763160148090486
-1706,1727,204,0.0785826238386085,0.0785826238386085
-11578,1595,1767,0.0524448615311058,0.0524448615311058
-351,353,354,0.0783794642996216,0.0783794642996216
-16749,53,10005,0.150239248303575,0.150239248303575
-20036,7837,816,0.140917505829302,0.140917505829302
-20637,10876,10878,0.031770930566573,0.031770930566573
-16183,1702,133,0.201630131124766,0.201630131124766
-16753,6829,10009,0.0465845830870589,0.0465845830870589
-18737,2600,1858,0.180581857071932,0.180581857071932
-14686,1987,2318,0.198940266900504,0.198940266900504
-1928,1941,1942,0.123855031305308,0.123855031305308
-18741,8070,7651,0.262731372814963,0.262731372814963
-14685,1546,1987,0.20778014181537,0.20778014181537
-12334,8656,8657,0.0212762444700433,0.0212762444700433
-18873,7825,7987,0.015602795644656,0.015602795644656
-12352,8668,8669,0.00723037090372959,0.00723037090372959
-18669,9460,1818,0.156714358591483,0.156714358591483
-18185,5799,6059,0.199739960113703,0.199739960113703
-18862,9131,9178,0.0368320416365925,0.0368320416365925
-16606,9955,7890,0.148662937956551,0.148662937956551
-12197,424,2296,0.092590985158808,0.092590985158808
-328,329,330,0.0301965908229701,0.0301965908229701
-329,330,331,0.00308879550687601,0.00308879550687601
-15797,2324,2349,0.0197202421063636,0.0197202421063636
-16293,2377,2409,0.0804076908745063,0.0804076908745063
-17370,3254,7297,0.216186214827155,0.216186214827155
-18195,8107,9376,0.183361036437535,0.183361036437535
-17371,7297,40,0.193403542976089,0.193403542976089
-389,391,392,0.10291889633356,0.10291889633356
-18880,1927,7249,0.20098536077548,0.20098536077548
-12842,2658,461,0.235239531220745,0.235239531220745
-18457,7020,10297,0.095413640203737,0.095413640203737
-14684,1545,1546,0.195783826439231,0.195783826439231
-16302,2721,2722,0.0283898956128369,0.0283898956128369
-18674,1569,1570,0.17732367890712,0.17732367890712
-19651,10604,10605,0.00569731320684084,0.00569731320684084
-12365,8674,8675,0.00395306971093599,0.00395306971093599
-18885,80,7308,0.203338584644882,0.203338584644882
-18462,9528,9293,0.135413968590027,0.135413968590027
-17073,8133,10070,0.277242310734424,0.277242310734424
-18887,3267,7247,0.200784680682105,0.200784680682105
-16306,2851,2852,0.0109060813984903,0.0109060813984903
-18803,8953,10352,0.0713096059986916,0.0713096059986916
-12360,8670,8671,0.0527368404826503,0.0527368404826503
-19915,8054,8774,0.178101620538173,0.178101620538173
-19027,10418,8995,0.822032321709027,0.822032321709027
-16313,2929,2636,0.0522503580010493,0.0522503580010493
-18123,10266,7936,0.0422734852594549,0.0422734852594549
-11696,1005,1006,0.0249036708868205,0.0249036708868205
-19031,9820,9825,0.141867922710985,0.141867922710985
-17076,828,3568,0.137092229325187,0.137092229325187
-20641,10879,4802,0.0562973461233787,0.0562973461233787
-19035,9497,9495,0.0285635113459611,0.0285635113459611
-2071,2074,2075,0.135495947312548,0.135495947312548
-15936,9757,6254,0.229061306545615,0.229061306545615
-3229,3143,3144,0.198651066611581,0.198651066611581
-3231,3145,1186,0.167106782855451,0.167106782855451
-20275,10725,6473,0.00777253007071417,0.00777253007071417
-20276,6473,10726,0.00774087009692378,0.00774087009692378
-20277,10710,5573,0.00807679050419555,0.00807679050419555
-16287,1363,2160,0.150908240771596,0.150908240771596
-18901,10379,10378,0.00446883067059111,0.00446883067059111
-18181,6056,4071,0.17853957848987,0.17853957848987
-16288,2160,2273,0.031688963076218,0.031688963076218
-15792,2131,2298,0.0834787229201596,0.0834787229201596
-17362,1905,7241,0.196305657515643,0.196305657515643
-20796,10943,7661,0.00258138052005919,0.00258138052005919
-20797,7661,10931,0.00256438171506516,0.00256438171506516
-17367,3197,6112,0.203543642625323,0.203543642625323
-19564,10566,10567,0.0877791462313442,0.0877791462313442
-17839,9059,10189,0.106477983280495,0.106477983280495
-17124,42,4240,0.19030237977338,0.19030237977338
-15941,9758,9759,0.0631588158295344,0.0631588158295344
-17151,4781,4823,0.202239291799058,0.202239291799058
-14110,421,3623,0.253988429085779,0.253988429085779
-20309,10730,10731,0.0277808040232953,0.0277808040232953
-19606,10584,10500,0.00674103787689334,0.00674103787689334
-18677,2800,2801,0.105225983369234,0.105225983369234
-17096,3720,3721,0.196415457175175,0.196415457175175
-19914,6599,8054,0.176409123849899,0.176409123849899
-14113,3767,3768,0.109524379066099,0.109524379066099
-19575,10571,10572,0.0878577106463745,0.0878577106463745
-19578,7458,10573,0.00838425457343401,0.00838425457343401
-13363,6192,9050,0.200728781748151,0.200728781748151
-18684,3608,1316,0.176123680044276,0.176123680044276
-16406,9888,9885,0.103994018141439,0.103994018141439
-20348,10747,10734,0.124798183375822,0.124798183375822
-13367,487,9053,0.0916792010447841,0.0916792010447841
-17112,3776,3932,0.0318567386044335,0.0318567386044335
-18472,7703,9005,0.191779872148763,0.191779872148763
-13566,4,3088,0.053682748576131,0.053682748576131
-14690,2868,3129,0.152693011202245,0.152693011202245
-19632,10519,10594,0.0691883113691504,0.0691883113691504
-16442,9898,9900,0.0593229160576478,0.0593229160576478
-19557,10561,10562,0.0114115661676901,0.0114115661676901
-17140,3200,3089,0.200962427212495,0.200962427212495
-19588,10578,7459,0.00830641959761081,0.00830641959761081
-19590,10509,10579,0.0688000441577074,0.0688000441577074
-4371,4093,4094,0.0474398468296831,0.0474398468296831
-14821,4531,9426,0.131844452515128,0.131844452515128
-20313,10734,10735,0.135778003167023,0.135778003167023
-16512,8896,9922,0.103245634213484,0.103245634213484
-19627,10592,10501,0.0068017037739497,0.0068017037739497
-3432,3319,3320,0.201627360859163,0.201627360859163
-3631,1572,3475,0.135693159195378,0.135693159195378
-3632,3475,3476,0.119283891700122,0.119283891700122
-3634,3211,3477,0.201273972346718,0.201273972346718
-3635,3477,1922,0.201175175309244,0.201175175309244
-17122,4176,3542,0.20232729922556,0.20232729922556
-16444,9901,9902,0.179094898504736,0.179094898504736
-20287,9383,6472,0.201518688053588,0.201518688053588
-20014,8858,10180,0.0735203760297937,0.0735203760297937
-19233,10457,10420,0.0372086096742178,0.0372086096742178
-4657,4299,3840,0.0473685540434106,0.0473685540434106
-14125,3659,3925,0.129261803351535,0.129261803351535
-3623,3469,3470,0.140706278566204,0.140706278566204
-18908,10386,10387,0.0302347602157808,0.0302347602157808
-15943,9760,8085,0.0293664602336856,0.0293664602336856
-18142,10269,6300,0.0570177692907992,0.0570177692907992
-17020,10057,10058,0.15155359133236,0.15155359133236
-17158,5010,5011,0.0757362739800239,0.0757362739800239
-16649,9960,9968,0.0812055546813917,0.0812055546813917
-17022,10055,10058,0.0158274438461504,0.0158274438461504
-20617,10793,10829,0.0486626332146345,0.0486626332146345
-17292,7745,7192,0.403926945097788,0.403926945097788
-17953,8781,10225,0.0170107340919314,0.0170107340919314
-17142,4509,4616,0.202021015829292,0.202021015829292
-14706,5161,5162,0.0515278311632085,0.0515278311632085
-17293,7192,8754,0.202354446551741,0.202354446551741
-16653,9971,9972,0.0159150831985239,0.0159150831985239
-17955,10229,10228,0.0205875980561605,0.0205875980561605
-16775,9905,10011,0.0628512846047373,0.0628512846047373
-20430,10790,10791,0.0319464035455711,0.0319464035455711
-17144,4683,4684,0.183413882011105,0.183413882011105
-17482,367,368,0.0073956069596753,0.0073956069596753
-17483,368,4274,0.0740383655738795,0.0740383655738795
-18131,6045,4102,0.143663826029319,0.143663826029319
-17166,3547,48,0.197940166378652,0.197940166378652
-17957,10231,10232,0.0468160398694911,0.0468160398694911
-19584,10563,10576,0.0699872416467849,0.0699872416467849
-19587,10577,10578,0.0879343964012276,0.0879343964012276
-16540,7834,812,0.139228180638449,0.139228180638449
-20323,10742,10732,0.00891011779971553,0.00891011779971553
-14118,3946,4047,0.0370997345222532,0.0370997345222532
-20325,10743,10744,0.00292597509729593,0.00292597509729593
-17681,9050,9814,0.396292789359983,0.396292789359983
-17683,10165,9814,0.392184725428778,0.392184725428778
-17303,3516,4258,0.201418622589808,0.201418622589808
-17690,6173,6191,0.0979652724466413,0.0979652724466413
-17305,8744,8715,0.198903931890441,0.198903931890441
-19815,6602,8057,0.177734109816075,0.177734109816075
-20432,10754,10792,0.00161805170064806,0.00161805170064806
-5752,4838,5081,0.0155515271366432,0.0155515271366432
-14703,5104,5105,0.188886837572701,0.188886837572701
-19833,10653,10654,0.205572346227123,0.205572346227123
-4807,4413,4414,0.0998668735468864,0.0998668735468864
-3650,3488,3106,0.174737901377497,0.174737901377497
-3651,3106,3491,0.194747174928978,0.194747174928978
-17379,5746,5747,0.00818765310677506,0.00818765310677506
-20468,10818,10755,0.173765546097308,0.173765546097308
-17164,1802,4242,0.207580745712203,0.207580745712203
-6015,5267,5268,0.103281094663511,0.103281094663511
-18137,10263,10272,0.406284221439373,0.406284221439373
-17291,10085,7745,0.543012306463268,0.543012306463268
-14709,5330,4870,0.190973371939833,0.190973371939833
-18138,4093,6038,0.184675507720467,0.184675507720467
-16651,9969,9970,0.100708681464822,0.100708681464822
-14710,4870,2220,0.162414391352976,0.162414391352976
-18505,6386,17,0.132879414135856,0.132879414135856
-14727,6220,6303,0.0511187399227223,0.0511187399227223
-17176,5390,5408,0.208329703574267,0.208329703574267
-20791,8358,10898,0.00761490800516594,0.00761490800516594
-17146,1801,4241,0.206257539278646,0.206257539278646
-14731,6303,5467,0.125799145673022,0.125799145673022
-18536,5557,10309,0.366989977501724,0.366989977501724
-14723,6016,5469,0.171433952660857,0.171433952660857
-18516,2412,10295,0.0120882825664803,0.0120882825664803
-17153,1911,4839,0.199025256937054,0.199025256937054
-17154,4839,3202,0.202009935716231,0.202009935716231
-18288,6762,6873,0.146634632629247,0.146634632629247
-20338,10735,10738,0.035049164748108,0.035049164748108
-18690,5770,5771,0.102556159708994,0.102556159708994
-20424,10785,10786,0.0731561229415083,0.0731561229415083
-5740,1710,5071,0.202613094112382,0.202613094112382
-14744,2216,4866,0.159742631617364,0.159742631617364
-18148,6033,4087,0.198416361234407,0.198416361234407
-17476,4654,473,0.0704097319033273,0.0704097319033273
-18150,4100,6044,0.175955927487578,0.175955927487578
-6851,5860,5861,0.109631940187014,0.109631940187014
-14841,7164,7777,0.0983349446501409,0.0983349446501409
-18242,6768,3993,0.201258062688176,0.201258062688176
-18273,6645,6666,0.202152498738845,0.202152498738845
-20386,10770,10771,0.0535943445752728,0.0535943445752728
-6983,5958,5959,0.149650557500517,0.149650557500517
-18306,3982,7041,0.200503190670894,0.200503190670894
-20438,10796,10797,0.0670860233753639,0.0670860233753639
-20500,10838,10824,0.0121125751150814,0.0121125751150814
-14725,977,5162,0.0458445478179373,0.0458445478179373
-6627,5707,1851,0.181903999460801,0.181903999460801
-3671,3508,3509,0.00436333612190551,0.00436333612190551
-3672,3509,3510,0.046781667512879,0.046781667512879
-7657,3346,6356,0.257422789129267,0.257422789129267
-14872,3240,5733,0.139141273161543,0.139141273161543
-18469,9138,10300,0.19595637710121,0.19595637710121
-18266,1691,6545,0.203809181046432,0.203809181046432
-18272,6629,6645,0.186774688365716,0.186774688365716
-8163,6669,2301,0.106319016804013,0.106319016804013
-14130,9280,9279,0.186364690747119,0.186364690747119
-14771,2209,923,0.186974313150198,0.186974313150198
-18247,9377,8108,0.184107753412847,0.184107753412847
-18704,7871,4059,0.176577842625336,0.176577842625336
-15923,9752,9072,0.0836347230210634,0.0836347230210634
-18541,7538,8363,0.0639425794382817,0.0639425794382817
-14134,509,9280,0.0291273215905741,0.0291273215905741
-15926,498,9102,0.0623752088587868,0.0623752088587868
-11651,8350,4542,0.134464503460642,0.134464503460642
-18291,6752,3975,0.201306126180051,0.201306126180051
-14752,5933,6903,0.0776419963986988,0.0776419963986988
-15930,9755,8063,0.0157417186886108,0.0157417186886108
-8622,3936,5625,0.097083190357132,0.097083190357132
-14891,9021,8103,0.0999072642817978,0.0999072642817978
-11386,8241,8242,0.105664996309114,0.105664996309114
-11647,7709,8347,0.0834163322393992,0.0834163322393992
-12254,8618,8619,0.0216515691565663,0.0216515691565663
-20225,8757,10713,0.181625832679021,0.181625832679021
-11373,437,8225,0.0125774855889878,0.0125774855889878
-20018,6572,4453,0.146908325275574,0.146908325275574
-20512,10063,10060,0.007549583111055,0.007549583111055
-12048,8527,8528,0.0740401240439702,0.0740401240439702
-14785,7957,5458,0.175576789379919,0.175576789379919
-12271,8518,8628,0.0787132719056346,0.0787132719056346
-11383,8239,8240,0.0842941433278933,0.0842941433278933
-11370,7971,7972,0.0117965527041302,0.0117965527041302
-11414,7984,7985,0.287379755335746,0.287379755335746
-11432,415,8254,0.452015989776023,0.452015989776023
-20350,10730,2968,0.0120941619304981,0.0120941619304981
-8748,5336,6979,0.175571360985687,0.175571360985687
-3691,3527,3528,0.0472108481996503,0.0472108481996503
-3692,3528,2737,0.0483230367668469,0.0483230367668469
-3697,3532,3533,0.0559788343200402,0.0559788343200402
-15221,3833,8055,0.052921136155694,0.052921136155694
-12311,8645,8476,0.144977480276504,0.144977480276504
-12312,8476,8646,0.198472144343311,0.198472144343311
-12314,8643,8559,0.0228329493898265,0.0228329493898265
-20367,10748,10749,0.0037547184046713,0.0037547184046713
-9843,7548,7549,0.124919366653633,0.124919366653633
-12301,4845,8524,0.0473127526043962,0.0473127526043962
-18331,7594,6751,0.14027973854483,0.14027973854483
-11791,8037,2687,0.147733787935878,0.147733787935878
-15865,8762,8763,0.0396940145175954,0.0396940145175954
-20529,10029,10846,0.0100359682174695,0.0100359682174695
-17959,6241,5194,0.169083036600962,0.169083036600962
-18370,6889,5250,0.0518724586298984,0.0518724586298984
-15225,8180,5297,0.041720314716376,0.041720314716376
-9071,2781,7147,0.103689348353689,0.103689348353689
-3710,3546,1524,0.0515313284334221,0.0515313284334221
-20305,10728,8110,0.168482747904973,0.168482747904973
-3711,1524,3547,0.0494425170647519,0.0494425170647519
-14739,6538,6607,0.183986331427456,0.183986331427456
-11372,290,437,0.0112130207438012,0.0112130207438012
-18381,8535,8919,0.0499954488007408,0.0499954488007408
-12246,8615,4817,0.146110905108578,0.146110905108578
-11425,8251,8078,0.7456254172446,0.7456254172446
-12247,4817,5788,0.143910603528138,0.143910603528138
-12818,299,8256,0.476082599329394,0.476082599329394
-20410,8976,9207,0.0123297683183119,0.0123297683183119
-12263,8621,8622,0.00671006625102598,0.00671006625102598
-11559,8319,7714,0.15000222129108,0.15000222129108
-15229,8334,8335,0.02937581800825,0.02937581800825
-18377,6069,2549,0.201785565265125,0.201785565265125
-11447,387,8258,0.356209179582772,0.356209179582772
-11812,1881,8316,0.0255940628377938,0.0255940628377938
-14781,921,2207,0.190721648601815,0.190721648601815
-20233,10711,10715,0.00692211182471866,0.00692211182471866
-20363,9209,8991,0.0223079019168015,0.0223079019168015
-18388,8990,9001,0.0110856339057274,0.0110856339057274
-20651,10033,10881,0.0461798387778834,0.0461798387778834
-13366,9052,487,0.0981014313599177,0.0981014313599177
-12303,8639,8640,0.0320591977276875,0.0320591977276875
-20243,10716,10713,0.0141769281388351,0.0141769281388351
-14749,4864,2214,0.160302668775638,0.160302668775638
-13468,309,9094,0.0506545738820493,0.0506545738820493
-18336,1689,7624,0.203108569942922,0.203108569942922
-12937,1303,1970,0.0130832107015757,0.0130832107015757
-20525,10839,1286,0.00844906120646156,0.00844906120646156
-10918,8035,5970,0.0219813767800627,0.0219813767800627
-14913,7600,2016,0.104505986927597,0.104505986927597
-20351,2968,10750,0.0147633294839236,0.0147633294839236
-15880,8763,8762,0.0396940145175954,0.0396940145175954
-20353,9401,9336,0.00949287140929792,0.00949287140929792
-12244,8613,8614,0.00356038865266788,0.00356038865266788
-11216,8164,8165,0.0796169077304663,0.0796169077304663
-14132,9279,507,0.0225847659450503,0.0225847659450503
-15875,8940,8978,0.0300860996423522,0.0300860996423522
-11429,8253,319,0.299890155674121,0.299890155674121
-20371,2707,10756,0.00655605333712087,0.00655605333712087
-14677,3794,9330,0.199283554137764,0.199283554137764
-18476,4295,2411,0.100910451832155,0.100910451832155
-18478,5542,9039,0.101169435731023,0.101169435731023
-11770,3014,8406,0.0500338703103734,0.0500338703103734
-11823,8421,8424,0.377719915283211,0.377719915283211
-10669,7915,6847,0.0947158385157811,0.0947158385157811
-3731,3565,3566,0.0486546976993217,0.0486546976993217
-3732,3566,3567,0.109486664803565,0.109486664803565
-3733,3567,1037,0.105564006595596,0.105564006595596
-11897,8466,8467,0.103343928827087,0.103343928827087
-11947,397,8496,0.0965081758273934,0.0965081758273934
-18380,8494,8535,0.0492964457876769,0.0492964457876769
-20364,8991,10755,0.00786332111355482,0.00786332111355482
-12162,8315,8569,0.02262255215678,0.02262255215678
-12218,8594,2290,0.0213925904868369,0.0213925904868369
-14931,3354,2767,0.0942765011393086,0.0942765011393086
-18498,9212,9220,0.133514882064815,0.133514882064815
-20706,9190,10885,0.00984120017613085,0.00984120017613085
-12373,8677,8678,0.0486250060422128,0.0486250060422128
-14967,7610,7264,0.0940136459475559,0.0940136459475559
-15895,9441,5377,0.102059140746775,0.102059140746775
-13974,9251,9129,0.169864606266652,0.169864606266652
-20368,10749,10733,0.00357512667889407,0.00357512667889407
-14674,2227,943,0.182649781226047,0.182649781226047
-14178,3784,8864,0.153337805989006,0.153337805989006
-19290,10470,8767,0.117748080941626,0.117748080941626
-12575,8759,8760,0.0168627139608601,0.0168627139608601
-14983,8789,8796,0.105952161931752,0.105952161931752
-14984,8796,8878,0.106413855851218,0.106413855851218
-20419,10774,3587,0.00984290685312232,0.00984290685312232
-15867,8770,8771,0.0147638851882813,0.0147638851882813
-11263,8195,8196,0.0967030898556648,0.0967030898556648
-16192,5817,7723,0.19660431304726,0.19660431304726
-20360,8992,10754,0.00404589397436802,0.00404589397436802
-19297,10471,1942,0.0559273520312209,0.0559273520312209
-15868,8833,5588,0.0188635032964949,0.0188635032964949
-19299,9959,564,0.00433589917958362,0.00433589917958362
-20814,10936,7168,0.0050166121287054,0.0050166121287054
-20823,10780,9337,0.0124085195369407,0.0124085195369407
-19301,1942,10467,0.0736734316331574,0.0736734316331574
-12854,4133,6696,0.093947304456844,0.093947304456844
-15004,6269,9466,0.0522837092305697,0.0522837092305697
-19305,10464,10461,0.0144782338635936,0.0144782338635936
-19307,10467,611,0.103622552493386,0.103622552493386
-11685,8366,1032,0.0209886592874132,0.0209886592874132
-20820,10919,8330,0.00776069150921458,0.00776069150921458
-11643,8347,4658,0.0580128250256257,0.0580128250256257
-12924,8890,8891,0.0884309215437497,0.0884309215437497
-15230,8360,8248,0.0379210675749848,0.0379210675749848
-13013,8916,2892,0.160989403082392,0.160989403082392
-12051,8531,8529,0.0116601753914343,0.0116601753914343
-20828,9205,8443,0.0104227726118747,0.0104227726118747
-18615,7410,5865,0.176922387553379,0.176922387553379
-14852,8621,9432,0.00675320800603643,0.00675320800603643
-18616,5865,9447,0.157075160700523,0.157075160700523
-18618,1314,9447,0.0196279343381406,0.0196279343381406
-11994,8505,8048,0.149802391835517,0.149802391835517
-18621,2586,5181,0.176412393215512,0.176412393215512
-18622,5181,5649,0.1069372720504,0.1069372720504
-19473,7476,10517,0.0101658403815209,0.0101658403815209
-19474,10517,10518,0.00993077177126307,0.00993077177126307
-18480,9040,9120,0.135103567036488,0.135103567036488
-20833,10944,10951,0.17747662532422,0.17747662532422
-19475,10518,10519,0.0191608413173093,0.0191608413173093
-19512,10537,10447,0.00647615513057594,0.00647615513057594
-2,2,3,0.283463280100036,0.283463280100036
-3,3,4,0.0333775918694363,0.0333775918694363
-18628,1310,9484,0.175555113641419,0.175555113641419
-12242,8611,8612,0.0998376585619669,0.0998376585619669
-5,5,6,0.348594358341424,0.348594358341424
-15909,9104,9105,0.0387441124726526,0.0387441124726526
-15903,6134,8603,0.0260893170771595,0.0260893170771595
-15878,8833,8770,0.0398025148628561,0.0398025148628561
-13625,7013,2274,0.0942922296438968,0.0942922296438968
-15024,4136,2663,0.0946854927112821,0.0946854927112821
-13651,9159,1177,0.0568269678125187,0.0568269678125187
-6,6,7,0.250747670173169,0.250747670173169
-20837,10949,10945,0.0947762411619158,0.0947762411619158
-15887,8842,9619,0.0119243513569086,0.0119243513569086
-19481,10511,10486,0.0687637700371023,0.0687637700371023
-13777,9191,292,0.0113408171424215,0.0113408171424215
-19493,10463,10523,0.0181472136448415,0.0181472136448415
-13799,9195,5081,0.0314508853846434,0.0314508853846434
-19487,10426,10427,0.0081618196829418,0.0081618196829418
-18570,10325,10322,0.0277653060168724,0.0277653060168724
-15042,6787,4718,0.0916704601824836,0.0916704601824836
-15043,4718,9414,0.0490846601218478,0.0490846601218478
-19494,10523,7469,0.0159566577035026,0.0159566577035026
-13814,4934,9200,0.0155640797101011,0.0155640797101011
-13008,8914,2891,0.0117402105605065,0.0117402105605065
-17570,10143,10144,0.0307556488479174,0.0307556488479174
-20841,10952,10940,0.18759449218266,0.18759449218266
-15726,7317,9449,0.0375532628709029,0.0375532628709029
-15904,8603,9697,0.00690416936559141,0.00690416936559141
-13877,4478,2804,0.135897648680331,0.135897648680331
-18633,4044,4045,0.00275409212275412,0.00275409212275412
-15057,9477,6733,0.054468335249091,0.054468335249091
-15058,6733,9313,0.0446744870999848,0.0446744870999848
-13910,9228,3317,0.0850892170141282,0.0850892170141282
-12689,2057,8805,0.133235184271089,0.133235184271089
-18656,6223,7657,0.27620827404325,0.27620827404325
-15858,9732,9739,0.0147062242308904,0.0147062242308904
-20843,10954,10751,0.181296524715589,0.181296524715589
-16082,366,255,0.573997033805984,0.573997033805984
-16084,9817,9818,0.0154245817929875,0.0154245817929875
-16127,4555,9122,0.0381695434595099,0.0381695434595099
-14675,943,5941,0.178224321703034,0.178224321703034
-15285,8799,3187,0.00972670306222712,0.00972670306222712
-15873,8879,8889,0.108518344615814,0.108518344615814
-15405,9585,9582,0.0323190665796029,0.0323190665796029
-16246,9859,7743,0.402195232762633,0.402195232762633
-13026,1537,4265,0.200987668621859,0.200987668621859
-3749,3578,3579,0.097584814173116,0.097584814173116
-3750,3579,848,0.0994883860112991,0.0994883860112991
-3752,3580,3581,0.0190511917089631,0.0190511917089631
-19488,10427,4703,0.0206936304458077,0.0206936304458077
-20829,8443,10954,0.0118059106132393,0.0118059106132393
-16351,7009,2285,0.0978474396198024,0.0978474396198024
-16382,9879,9771,0.00992783408407401,0.00992783408407401
-16432,9894,9895,0.0235353492080929,0.0235353492080929
-14329,9328,602,0.0664699646577648,0.0664699646577648
-20848,10950,10953,0.0184888911494772,0.0184888911494772
-13445,9078,9079,0.200451693111106,0.200451693111106
-16391,3033,9847,0.0236566168850551,0.0236566168850551
-15437,9602,9603,0.109740104543279,0.109740104543279
-18475,9005,4295,0.117455212214086,0.117455212214086
-19609,10585,10503,0.00693839845805758,0.00693839845805758
-16644,564,565,0.0167681949380125,0.0167681949380125
-18641,5875,7416,0.178910174745805,0.178910174745805
-16758,7565,10010,0.0537198584701325,0.0537198584701325
-13557,9032,9033,0.185435393968361,0.185435393968361
-19028,8995,7690,0.0430021373921601,0.0430021373921601
-17062,10068,2247,0.0643618782275657,0.0643618782275657
-16833,593,9915,0.00807834974542274,0.00807834974542274
-18614,4049,7410,0.176200842798068,0.176200842798068
-16902,74,7306,0.205595181095446,0.205595181095446
-17068,10069,675,0.181147813198563,0.181147813198563
-17009,4847,10051,0.0109841519151342,0.0109841519151342
-13581,9133,9134,0.0795179133195768,0.0795179133195768
-17207,9891,234,0.00951110757861507,0.00951110757861507
-19644,10601,10602,0.00459389199037625,0.00459389199037625
-14887,7456,5693,0.103533596199028,0.103533596199028
-15073,9480,8706,0.0156808972883418,0.0156808972883418
-18617,9447,1314,0.0196279343381406,0.0196279343381406
-19477,10520,10521,0.0112440070511006,0.0112440070511006
-19479,1872,10522,0.0183337010143588,0.0183337010143588
-18629,9484,5862,0.00360275623818702,0.00360275623818702
-17406,3210,6122,0.199774981063921,0.199774981063921
-15450,9609,9610,0.118608570416781,0.118608570416781
-14988,9309,9464,0.101172548296122,0.101172548296122
-15965,1443,7623,0.202446963416806,0.202446963416806
-13793,4819,8514,0.148483674564771,0.148483674564771
-3766,2339,3595,0.17591583054365,0.17591583054365
-3767,3595,3596,0.243702533330372,0.243702533330372
-15851,5596,9735,0.0497175089074512,0.0497175089074512
-15124,6515,226,0.0653425651240956,0.0653425651240956
-15449,9608,9609,0.0645563810419252,0.0645563810419252
-13914,4840,9230,0.275162192340763,0.275162192340763
-13922,9137,9233,0.0899935621999505,0.0899935621999505
-3788,1148,1821,0.103455086525091,0.103455086525091
-18632,7408,4044,0.178025429971464,0.178025429971464
-15247,9542,8177,0.0166658349694615,0.0166658349694615
-15460,9613,9614,0.039786363249444,0.039786363249444
-15461,8882,9615,0.0277165465497567,0.0277165465497567
-15546,9646,9647,0.0122997635777285,0.0122997635777285
-15889,8978,1101,0.0278428503732722,0.0278428503732722
-236,30,31,0.0623462807475453,0.0623462807475453
-239,246,247,0.10870569104286,0.10870569104286
-19602,10483,10583,0.0688347644552014,0.0688347644552014
-19497,7457,10525,0.0182919034833847,0.0182919034833847
-15292,9561,9562,0.0285639174620334,0.0285639174620334
-16011,9781,9782,0.0666625832869129,0.0666625832869129
-204,216,217,0.0495486567174314,0.0495486567174314
-16105,9825,9826,0.769429574289864,0.769429574289864
-19504,10531,10532,0.00490376342058079,0.00490376342058079
-19505,10532,10533,0.0113536336982688,0.0113536336982688
-15983,4420,7372,0.10794760335784,0.10794760335784
-16336,6683,8026,0.0934572989494279,0.0934572989494279
-15146,8245,9501,0.259647287125597,0.259647287125597
-16378,2678,4127,0.105747053096561,0.105747053096561
-15168,9509,3381,0.0515085102071127,0.0515085102071127
-14670,9413,5473,0.178785252044424,0.178785252044424
-15438,9603,2287,0.0101078833454114,0.0101078833454114
-16618,7974,3673,0.0581937370992888,0.0581937370992888
-16393,9876,3281,0.0515999951055545,0.0515999951055545
-11613,742,743,0.188831137780044,0.188831137780044
-16792,6964,10013,0.15953431348719,0.15953431348719
-16830,9911,10017,0.00322492509560211,0.00322492509560211
-17016,10055,10056,0.150978646033743,0.150978646033743
-17201,10074,6392,0.100421160552702,0.100421160552702
-19702,10621,10622,0.0560876276790842,0.0560876276790842
-17391,10095,8785,0.114852910416621,0.114852910416621
-18648,4053,10111,0.195636353938149,0.195636353938149
-17545,8264,8929,0.192238762103777,0.192238762103777
-19596,10507,10581,0.0688892384795374,0.0688892384795374
-18652,8072,7653,0.262512305989993,0.262512305989993
-18119,4085,6030,0.181292795599691,0.181292795599691
-17647,8242,223,0.0953499590487046,0.0953499590487046
-17960,5194,10233,0.0515871143302905,0.0515871143302905
-17964,10236,10232,0.0350820368831285,0.0350820368831285
-17785,8986,8497,0.0646311177616063,0.0646311177616063
-17753,10173,8485,0.0489434224402369,0.0489434224402369
-11535,1543,1544,0.137939265537406,0.137939265537406
-17819,8676,10186,0.0370735665978641,0.0370735665978641
-17777,6508,6993,0.160336610713707,0.160336610713707
-3801,3083,3195,0.200442064419022,0.200442064419022
-3802,3195,3622,0.204398520601987,0.204398520601987
-3803,3622,1902,0.199020966616341,0.199020966616341
-3804,1902,3624,0.19721596773449,0.19721596773449
-17851,10193,10194,0.0260169590696429,0.0260169590696429
-12958,1630,1631,0.127437048321071,0.127437048321071
-18661,10206,7647,0.17872352996795,0.17872352996795
-19942,10671,4953,0.0511372085610231,0.0511372085610231
-12964,1770,1771,0.0893785434926153,0.0893785434926153
-18602,7656,6222,0.275287629645573,0.275287629645573
-18232,2550,6070,0.201831098039417,0.201831098039417
-18761,10339,10340,0.0412859123428405,0.0412859123428405
-4425,950,4134,0.165887036500793,0.165887036500793
-4426,4134,4135,0.171020798065652,0.171020798065652
-4427,4135,4136,0.184950521487565,0.184950521487565
-18817,10355,8431,0.088262856016995,0.088262856016995
-4447,4149,4150,0.111495530172709,0.111495530172709
-4448,4150,4151,0.101644653962629,0.101644653962629
-19603,10583,10496,0.00675773327585877,0.00675773327585877
-19855,10661,10662,0.203042057763788,0.203042057763788
-20643,10879,10877,0.0314570447479651,0.0314570447479651
-19158,8423,8388,0.0601966609853944,0.0601966609853944
-19615,10587,10502,0.00686995556939521,0.00686995556939521
-12339,8656,2501,0.0156699758852849,0.0156699758852849
-19328,9895,10473,0.0277673159561869,0.0277673159561869
-19490,10441,10447,0.0184697170100914,0.0184697170100914
-19492,10448,10463,0.00504831489789659,0.00504831489789659
-19428,10489,7287,0.156514421452779,0.156514421452779
-19286,563,9967,0.0537140867907163,0.0537140867907163
-19621,10589,10590,0.0274773310120508,0.0274773310120508
-19441,10492,10493,0.0201930874558464,0.0201930874558464
-19789,9476,4873,0.191586478139089,0.191586478139089
-19805,2619,10411,0.177645225629424,0.177645225629424
-18409,10287,10288,0.0734556316276251,0.0734556316276251
-20191,462,10707,0.132640175005266,0.132640175005266
-14823,3606,9335,0.071748078170483,0.071748078170483
-14824,9335,9402,0.00997675672475066,0.00997675672475066
-14825,9402,8301,0.0653806855821323,0.0653806855821323
-14830,4022,8322,0.0483334251113916,0.0483334251113916
-14832,5668,7026,0.0386007852757077,0.0386007852757077
-4468,4163,4164,0.0480674059146442,0.0480674059146442
-4469,4164,991,0.0502312521862823,0.0502312521862823
-14857,8907,9435,0.0508107102861791,0.0508107102861791
-14859,9436,9437,0.0520105887104481,0.0520105887104481
-15729,9448,9449,0.154385795199696,0.154385795199696
-18619,9447,9452,0.260663192513491,0.260663192513491
-14936,5495,8700,0.014007087915999,0.014007087915999
-20590,2705,10795,0.0154885940353102,0.0154885940353102
-14972,2754,7005,0.0961416158900631,0.0961416158900631
-15045,5118,4946,0.0490898990370342,0.0490898990370342
-15046,4946,7151,0.0490351349560296,0.0490351349560296
-15963,6397,4362,0.0791794536243071,0.0791794536243071
-15989,9452,4506,0.0512507321563124,0.0512507321563124
-16056,308,4648,0.208884022844132,0.208884022844132
-15158,9504,7749,0.203686953618576,0.203686953618576
-16076,8934,9417,0.0908088237702457,0.0908088237702457
-16106,9826,214,0.019707054216564,0.019707054216564
-19536,10547,10551,0.00289118198627037,0.00289118198627037
-16257,8751,9267,0.200818549492747,0.200818549492747
-16332,5124,7146,0.105923351259383,0.105923351259383
-3817,3633,3634,0.395318196729382,0.395318196729382
-16359,2326,5997,0.152345269926906,0.152345269926906
-5101,4522,4624,0.135948680255943,0.135948680255943
-18688,2602,1859,0.181461056809498,0.181461056809498
-16455,9910,8957,0.00642990572974513,0.00642990572974513
-16456,8957,9911,0.00773671564019088,0.00773671564019088
-16715,132,1701,0.201952446468105,0.201952446468105
-17236,31,134,0.108163538194537,0.108163538194537
-17237,134,246,0.0735610173824186,0.0735610173824186
-17521,3940,6651,0.0163911525787958,0.0163911525787958
-18097,10256,2169,0.0491222602233141,0.0491222602233141
-18207,8329,7847,0.200166859157176,0.200166859157176
-18394,5586,2554,0.157693803770027,0.157693803770027
-18972,7756,3621,0.0947044796448553,0.0947044796448553
-19237,10458,10457,0.00406582159548868,0.00406582159548868
-19229,10453,10454,0.0676096530689986,0.0676096530689986
-3858,3667,3668,0.0415319443079903,0.0415319443079903
-3859,3668,3669,0.0482985746708946,0.0482985746708946
-19322,2203,916,0.200210598103272,0.200210598103272
-15203,7160,9528,0.0514241954874698,0.0514241954874698
-19690,10616,10397,0.0495068144600769,0.0495068144600769
-19692,10617,10398,0.0503641661598134,0.0503641661598134
-19879,5198,10672,0.124230342536198,0.124230342536198
-19967,10686,9720,0.110372440140764,0.110372440140764
-19969,9505,1931,0.205435822074821,0.205435822074821
-19971,9711,1933,0.17400772229687,0.17400772229687
-19972,1933,10306,0.208946577187585,0.208946577187585
-3875,3685,3686,0.109844105363612,0.109844105363612
-17510,10120,10119,0.158859506306984,0.158859506306984
-676,669,670,0.102292085856109,0.102292085856109
-3893,3696,3697,0.200080946502272,0.200080946502272
-3894,3697,3698,0.204567969900071,0.204567969900071
-3896,3699,3700,0.197370997762066,0.197370997762066
-20255,5749,10704,0.00800649085379587,0.00800649085379587
-20320,10739,10740,0.00883881362478868,0.00883881362478868
-15207,1113,9529,0.0508930389416975,0.0508930389416975
-15251,9544,9536,0.0327374869648338,0.0327374869648338
-15379,8806,2642,0.105298522418053,0.105298522418053
-18635,7865,1846,0.175356787311383,0.175356787311383
-15485,9612,9616,0.0684703360070514,0.0684703360070514
-15516,9635,3736,0.0550573183727317,0.0550573183727317
-19480,10522,10511,0.00442285695753415,0.00442285695753415
-15574,9660,9464,0.175338544663329,0.175338544663329
-15598,7585,2003,0.0946559616738872,0.0946559616738872
-15618,9679,9680,0.101799223111765,0.101799223111765
-15640,9666,9667,0.00676039634627663,0.00676039634627663
-15683,8023,7680,0.104281288426574,0.104281288426574
-15704,7666,2329,0.100028756753634,0.100028756753634
-15755,3356,2760,0.0982705119459115,0.0982705119459115
-1110,1126,1127,0.154576986104079,0.154576986104079
-2347,2338,2265,0.095819812257735,0.095819812257735
-12348,8664,8665,0.0099818469883938,0.0099818469883938
-20799,10928,6772,0.00617692305613739,0.00617692305613739
-1176,1191,1192,0.0992884317332444,0.0992884317332444
-20800,6772,10949,0.00765667567444528,0.00765667567444528
-441,439,440,0.131394781189403,0.131394781189403
-2798,2750,2752,0.210544806502819,0.210544806502819
-20666,10888,10889,0.0790962373353106,0.0790962373353106
-19518,6854,10540,0.00704975834948009,0.00704975834948009
-17074,10070,7842,0.137917824166884,0.137917824166884
-320,63,64,0.0374489603047296,0.0374489603047296
-62,68,69,0.0422209546479027,0.0422209546479027
-12003,5507,7080,0.146738996592278,0.146738996592278
-109,116,117,0.143188450690636,0.143188450690636
-18456,10296,7020,0.00773615182989558,0.00773615182989558
-134,142,143,0.102085903671524,0.102085903671524
-18414,7445,8376,0.0994737732965907,0.0994737732965907
-153,162,163,0.0752431334530451,0.0752431334530451
-18417,10289,8332,0.15046170994065,0.15046170994065
-323,206,207,0.0117249781899754,0.0117249781899754
-222,233,234,0.0133914034588106,0.0133914034588106
-269,279,280,0.111130387977042,0.111130387977042
-304,312,313,0.0760674046765663,0.0760674046765663
-378,380,381,0.042583144928967,0.042583144928967
-334,335,336,0.0838277836552233,0.0838277836552233
-18422,6881,8361,0.201914074104345,0.201914074104345
-367,368,369,0.0822344709508681,0.0822344709508681
-541,535,536,0.186883681615866,0.186883681615866
-11516,528,591,0.200155681159152,0.200155681159152
-15254,9538,9539,0.0173547475022314,0.0173547475022314
-659,649,650,0.011039314445329,0.011039314445329
-11464,701,5,0.465980985000995,0.465980985000995
-16702,9996,9629,0.03889405892702,0.03889405892702
-12966,1824,1825,0.0102076592436785,0.0102076592436785
-18427,7848,2983,0.204332357907837,0.204332357907837
-16420,3283,3331,0.0144926793767328,0.0144926793767328
-794,799,800,0.10010177351148,0.10010177351148
-11695,896,1005,0.0164907467236235,0.0164907467236235
-18433,6878,8357,0.204690873329425,0.204690873329425
-863,876,877,0.10476487069157,0.10476487069157
-883,898,899,0.104753841122432,0.104753841122432
-884,899,864,0.0807039229442354,0.0807039229442354
-927,941,942,0.0494985310502231,0.0494985310502231
-16705,9999,9629,0.0289087737479417,0.0289087737479417
-17026,3489,3490,0.0719959563000755,0.0719959563000755
-18682,3408,3539,0.176214327588196,0.176214327588196
-18442,8299,10294,0.012207810422513,0.012207810422513
-1076,1092,1093,0.17117547982738,0.17117547982738
-15790,2105,2106,0.167962867985551,0.167962867985551
-1100,1116,1117,0.101443140583253,0.101443140583253
-1122,1138,1139,0.131688298285365,0.131688298285365
-2171,2170,2171,0.00661609813602913,0.00661609813602913
-19434,10489,10109,0.051734430819511,0.051734430819511
-16849,9890,3358,0.0252874452199061,0.0252874452199061
-16171,7732,6631,0.170999473020786,0.170999473020786
-1145,1163,1164,0.10638131618854,0.10638131618854
-2233,2234,2235,0.107325767093377,0.107325767093377
-16734,10004,5726,0.044310348629928,0.044310348629928
-19574,7473,10571,0.0063271995041771,0.0063271995041771
-1286,1311,1312,0.0523154141859772,0.0523154141859772
-18191,5793,6053,0.200818759010255,0.200818759010255
-12198,2296,2417,0.0275462737865406,0.0275462737865406
-1335,1360,142,0.202746839209369,0.202746839209369
-1357,1386,1387,0.204107383179499,0.204107383179499
-1384,1411,1412,0.132938489820146,0.132938489820146
-1385,1412,1413,0.131234196689436,0.131234196689436
-16835,10018,10019,0.00449297276091322,0.00449297276091322
-1459,1481,1482,0.0508965659313026,0.0508965659313026
-533,397,398,0.176353791704941,0.176353791704941
-1483,1503,1504,0.10868886965133,0.10868886965133
-17373,3540,4236,0.201662628453229,0.201662628453229
-1505,47,1524,0.198761508803526,0.198761508803526
-16510,9930,8899,0.028599893322584,0.028599893322584
-19459,10506,10507,0.0718336837694179,0.0718336837694179
-16953,10037,10038,0.0209544596641532,0.0209544596641532
-1573,1601,1602,0.162785877407261,0.162785877407261
-1622,1650,1651,0.0538894092860146,0.0538894092860146
-1645,1672,1673,0.130835848827306,0.130835848827306
-1667,1692,1693,0.050088176287895,0.050088176287895
-1694,1718,1719,0.0873988319892153,0.0873988319892153
-1719,1738,1456,0.0837159374419676,0.0837159374419676
-1750,1769,1772,0.200154711336709,0.200154711336709
-1772,1790,1791,0.0243124544354895,0.0243124544354895
-12976,2866,2867,0.0166252705046511,0.0166252705046511
-1804,1817,1818,0.0911976784518576,0.0911976784518576
-11690,836,837,0.0102634119335747,0.0102634119335747
-1854,1868,1869,0.0969507802969199,0.0969507802969199
-18890,6123,3212,0.200920158955186,0.200920158955186
-13010,2892,2956,0.114118910643116,0.114118910643116
-1900,1913,1087,0.0825040978126541,0.0825040978126541
-11531,1232,1233,0.136649469135664,0.136649469135664
-3101,3032,3035,0.0672642720958143,0.0672642720958143
-16771,7290,7418,0.177711115784665,0.177711115784665
-2076,2079,2080,0.00320241388686281,0.00320241388686281
-20267,7552,10721,0.0076233085405271,0.0076233085405271
-2099,2101,2102,0.0617614998037007,0.0617614998037007
-2178,2178,2179,0.133414657501795,0.133414657501795
-20703,10902,10893,0.0137674602252582,0.0137674602252582
-18186,6059,4074,0.199239203137735,0.199239203137735
-2271,2271,2274,0.132133232701666,0.132133232701666
-2297,2295,2044,0.383761223862801,0.383761223862801
-2323,2315,2316,0.330214470935474,0.330214470935474
-12347,8663,8664,0.0257805479932851,0.0257805479932851
-2391,2374,2380,0.0606466728888714,0.0606466728888714
-17368,6112,1906,0.199361824625973,0.199361824625973
-2461,2451,2452,0.13645541326163,0.13645541326163
-2505,2485,2486,0.101289554682704,0.101289554682704
-2559,1939,371,0.224011572183979,0.224011572183979
-19236,5960,10458,0.00935537130778975,0.00935537130778975
-20487,10833,10834,0.0146368261080025,0.0146368261080025
-17152,4823,1911,0.202007841348173,0.202007841348173
-15939,9756,1179,0.0444859500137061,0.0444859500137061
-3746,3576,3577,0.10159835449875,0.10159835449875
-3791,2772,3612,0.203936793927218,0.203936793927218
-3792,3612,3613,0.107839344756473,0.107839344756473
-2787,2741,2742,0.198829139661659,0.198829139661659
-15945,9761,9759,0.0391671909462338,0.0391671909462338
-2831,2780,2781,0.0528298940705434,0.0528298940705434
-19569,10568,10569,0.0878244193957737,0.0878244193957737
-2880,2824,2825,0.0974259616864288,0.0974259616864288
-2902,2845,2846,0.808353421265405,0.808353421265405
-17512,10121,10120,0.0252089130538733,0.0252089130538733
-18124,7936,10267,0.178836603986638,0.178836603986638
-17213,3773,3774,0.00322537908461904,0.00322537908461904
-4010,3797,3798,0.0496772635509661,0.0496772635509661
-20618,10829,10811,0.00710063413803192,0.00710063413803192
-4056,3836,542,0.0542189434563804,0.0542189434563804
-16431,9893,9894,0.0272038809490012,0.0272038809490012
-4079,3854,3855,0.107248137237127,0.107248137237127
-4105,3874,1534,0.0983074346464974,0.0983074346464974
-4130,3892,3893,0.176077888960898,0.176077888960898
-3140,2139,3065,0.10712340392365,0.10712340392365
-14117,3945,3946,0.0482205385893945,0.0482205385893945
-19586,7471,10577,0.00638268050836497,0.00638268050836497
-18680,1852,3185,0.180570803347185,0.180570803347185
-4350,4077,4078,0.0772510249569655,0.0772510249569655
-4372,4094,4095,0.0479505811649138,0.0479505811649138
-19591,10579,10498,0.00651919101450697,0.00651919101450697
-3306,3214,3215,0.0471079000187924,0.0471079000187924
-3328,3230,3231,0.132391302135547,0.132391302135547
-19626,10513,10592,0.0688709903222838,0.0688709903222838
-3398,3295,3296,0.0155356242142858,0.0155356242142858
-19230,10454,10455,0.0118389292817843,0.0118389292817843
-20315,10736,10737,0.159656650881409,0.159656650881409
-18079,6355,10255,0.0661057533214939,0.0661057533214939
-3483,3361,3362,0.201966263198038,0.201966263198038
-4636,4280,4281,0.102934268159845,0.102934268159845
-16647,9969,5457,0.0123677166569097,0.0123677166569097
-16903,7306,3263,0.199172661453728,0.199172661453728
-19484,6853,10408,0.00698312522129821,0.00698312522129821
-19234,10420,10457,0.0372086096742178,0.0372086096742178
-19820,10648,3951,0.0619393226511354,0.0619393226511354
-20630,10847,10760,0.0141138073557462,0.0141138073557462
-4772,4383,4384,0.143358020264065,0.143358020264065
-4773,4384,2688,0.1475761156103,0.1475761156103
-19822,10648,9252,0.121899654224586,0.121899654224586
-17019,10054,10057,0.00913318334502991,0.00913318334502991
-19885,7405,10416,0.200852838610439,0.200852838610439
-18259,7775,9395,0.0553851197391209,0.0553851197391209
-4859,3019,4445,0.0478223869342914,0.0478223869342914
-20466,10753,10817,0.0682187434932547,0.0682187434932547
-19877,10671,6237,0.122419389056498,0.122419389056498
-19878,6237,5198,0.175009695046305,0.175009695046305
-18518,10303,10304,0.0239997630410034,0.0239997630410034
-4902,3446,4478,0.091694374773876,0.091694374773876
-19966,9509,10686,0.206010969949978,0.206010969949978
-19567,10565,7474,0.0766585847384353,0.0766585847384353
-14126,3925,419,0.00806156942685905,0.00806156942685905
-3723,3558,2895,0.0536764980359733,0.0536764980359733
-3795,3615,3616,0.170284963942666,0.170284963942666
-20220,9234,6625,0.292333005384616,0.292333005384616
-14111,3623,3659,0.11789221451213,0.11789221451213
-3861,3670,3671,0.0217628748782358,0.0217628748782358
-17030,3607,3490,0.0408681491476405,0.0408681491476405
-15948,9763,9764,0.10655007034609,0.10655007034609
-17086,504,3946,0.0996587778769702,0.0996587778769702
-20151,8263,8850,0.190160460059289,0.190160460059289
-17097,3721,2249,0.175979650666522,0.175979650666522
-3955,2834,3751,0.211238280484951,0.211238280484951
-4024,3809,3810,0.0544429181408591,0.0544429181408591
-20310,10731,10732,0.0936889543382987,0.0936889543382987
-4047,2945,3827,0.152861408667566,0.152861408667566
-20433,10792,10793,0.0378257433013547,0.0378257433013547
-4179,3929,3930,0.138165941069034,0.138165941069034
-18286,6824,3986,0.13302202745972,0.13302202745972
-20336,10747,10740,0.0348319951594156,0.0348319951594156
-5524,4925,4926,0.124694107926995,0.124694107926995
-4269,4013,4014,0.135510024687662,0.135510024687662
-20344,10743,10749,0.0091415179335324,0.0091415179335324
-17114,3959,582,0.020964645373322,0.020964645373322
-14696,4947,5018,0.17692836025714,0.17692836025714
-4361,4085,4086,0.0439979039927832,0.0439979039927832
-20443,10800,10797,0.0184411605361648,0.0184411605361648
-4436,1838,4143,0.106284873443858,0.106284873443858
-4437,4143,4144,0.0526768909687255,0.0526768909687255
-4456,4154,4155,0.103915690256788,0.103915690256788
-4457,4155,4156,0.103695542240372,0.103695542240372
-4476,4169,727,0.0512571810638195,0.0512571810638195
-4477,727,4170,0.0478531500173987,0.0478531500173987
-5818,5133,5134,0.102145042918239,0.102145042918239
-5912,5193,5194,0.024083404138801,0.024083404138801
-20491,10835,10836,0.00603667118796414,0.00603667118796414
-15862,9742,9737,0.126226895338302,0.126226895338302
-5931,5209,5210,0.693210396806986,0.693210396806986
-16531,9230,9133,0.0319382574203035,0.0319382574203035
-4627,1616,4276,0.105592921129571,0.105592921129571
-20628,10756,10873,0.0143552752086545,0.0143552752086545
-20696,10910,4524,0.00942218117840877,0.00942218117840877
-18136,6043,10263,0.201163508503498,0.201163508503498
-4695,4331,808,0.139418137507802,0.139418137507802
-4698,4332,4333,0.161361651356291,0.161361651356291
-6050,4013,5293,0.134925136075026,0.134925136075026
-18073,6354,6355,0.0448917156923931,0.0448917156923931
-4744,4362,4363,0.107836470275357,0.107836470275357
-4765,4378,4379,0.183602249353544,0.183602249353544
-20634,10876,10877,0.0283642470117633,0.0283642470117633
-18170,5801,6061,0.198751914750946,0.198751914750946
-4835,4430,4431,0.145138896688942,0.145138896688942
-4862,4446,4447,0.0474277072247471,0.0474277072247471
-18509,9355,10301,0.00184585558113331,0.00184585558113331
-6260,174,1704,0.202197382513594,0.202197382513594
-4958,4516,4517,0.0491656169358357,0.0491656169358357
-4983,4534,4535,0.0998419246339525,0.0998419246339525
-19921,10413,7869,0.176021720356684,0.176021720356684
-5064,4589,4590,0.0154062452430768,0.0154062452430768
-5086,4607,4608,0.119245405144689,0.119245405144689
-5111,4630,4631,0.139104857432868,0.139104857432868
-20788,5700,10925,0.00572872738726038,0.00572872738726038
-3915,2811,3713,0.0582509515897595,0.0582509515897595
-3917,3714,3715,0.0974014881112134,0.0974014881112134
-20790,10947,8358,0.00657767070033128,0.00657767070033128
-5221,4709,4710,0.122314419308335,0.122314419308335
-5243,875,4463,0.138237545752752,0.138237545752752
-18318,7366,7442,0.0771284931905011,0.0771284931905011
-5315,4770,4771,0.0488277782804066,0.0488277782804066
-5336,2332,4786,0.0940516760159238,0.0940516760159238
-5388,4825,97,0.199068637854245,0.199068637854245
-17092,4597,9466,0.17373336205738,0.17373336205738
-5437,4857,4858,0.0515825872815672,0.0515825872815672
-5483,4893,4894,0.046048954675788,0.046048954675788
-5531,4931,4932,0.018084718359645,0.018084718359645
-6850,4421,5860,0.102045619820979,0.102045619820979
-6892,5894,5697,0.0947186956045014,0.0947186956045014
-5585,1550,4269,0.196429076934968,0.196429076934968
-3934,3732,3733,0.121703755972038,0.121703755972038
-3936,3734,3735,0.176733819603511,0.176733819603511
-5609,4988,4989,0.201206746854351,0.201206746854351
-6912,5908,1999,0.0940717232862836,0.0940717232862836
-5705,932,2217,0.184097423724296,0.184097423724296
-5753,5081,5082,0.054538974474369,0.054538974474369
-5760,5088,1840,0.180073513278395,0.180073513278395
-5785,2782,5108,0.132016677253578,0.132016677253578
-18555,7706,2990,0.19846083928125,0.19846083928125
-18352,3981,7040,0.199881951179414,0.199881951179414
-5885,5176,130,0.21663995111842,0.21663995111842
-14774,5924,3807,0.151382817559166,0.151382817559166
-17792,8508,6179,0.109482524773714,0.109482524773714
-5955,5228,5229,0.0697529045378229,0.0697529045378229
-5977,1247,4556,0.132973381558885,0.132973381558885
-20546,10755,2961,0.0206004250178228,0.0206004250178228
-6055,3817,5296,0.100909929183789,0.100909929183789
-6076,172,1729,0.256606586411632,0.256606586411632
-6122,5349,4219,0.225702767955147,0.225702767955147
-6172,5388,1958,0.131227861001577,0.131227861001577
-20555,10853,10028,0.0104514157116194,0.0104514157116194
-6194,3028,5401,0.132618210317087,0.132618210317087
-18508,10301,9355,0.00184585558113331,0.00184585558113331
-6264,1941,5456,0.107892445399082,0.107892445399082
-6308,2067,5487,0.0160838439354733,0.0160838439354733
-6329,5502,5503,0.0544715490547718,0.0544715490547718
-20506,10834,10840,0.00711722931583218,0.00711722931583218
-7656,5012,3346,0.092992178848436,0.092992178848436
-20397,10758,10759,0.00383951895664098,0.00383951895664098
-19830,10649,10650,0.203375176962632,0.203375176962632
-18258,6760,7775,0.140758515508444,0.140758515508444
-6495,3928,5619,0.089155871041537,0.089155871041537
-6517,963,5279,0.100667730658223,0.100667730658223
-7856,6469,6470,0.161667024351427,0.161667024351427
-14751,929,5933,0.176747364710656,0.176747364710656
-6673,3933,5622,0.0990284128542063,0.0990284128542063
-14716,5687,933,0.176256990051995,0.176256990051995
-20475,10824,10825,0.0252031422821514,0.0252031422821514
-6694,5571,5749,0.0485856779635153,0.0485856779635153
-6695,5749,5750,0.0408085368300434,0.0408085368300434
-3964,1865,3758,0.048211663801055,0.048211663801055
-3965,3758,3759,0.0426076537269238,0.0426076537269238
-11217,443,444,0.0957304857475106,0.0957304857475106
-6741,5790,5791,0.0533877005590012,0.0533877005590012
-6764,5808,5809,0.0505689128275476,0.0505689128275476
-6788,5828,5829,0.0547714293876055,0.0547714293876055
-18151,6044,10264,0.200762745716695,0.200762745716695
-6809,365,4683,0.0475091694046952,0.0475091694046952
-6832,5852,1635,0.119748990570207,0.119748990570207
-18333,7291,3229,0.082496713136994,0.082496713136994
-6884,4667,1334,0.0975135676636165,0.0975135676636165
-6901,5900,2304,0.084800082911027,0.084800082911027
-6971,5951,5952,0.0992113626066069,0.0992113626066069
-14748,6733,4864,0.192735673325504,0.192735673325504
-18279,6738,6739,0.202843884763896,0.202843884763896
-7077,898,4479,0.137748361044457,0.137748361044457
-18284,6793,6794,0.0655358337845971,0.0655358337845971
-7099,5645,4359,0.0906469204279695,0.0906469204279695
-7124,6037,6038,0.0494419955897028,0.0494419955897028
-7168,6071,6072,0.0522594599242274,0.0522594599242274
-11649,8349,7711,0.138715670988872,0.138715670988872
-11989,8046,6574,0.143315424684023,0.143315424684023
-11652,4542,1283,0.131430485325992,0.131430485325992
-17217,1908,6114,0.200603968094547,0.200603968094547
-20549,10805,10854,0.0404087571222208,0.0404087571222208
-11385,8240,8241,0.317652248043028,0.317652248043028
-15924,9072,9753,0.0703936306326387,0.0703936306326387
-18551,9428,7705,0.2040983825575,0.2040983825575
-20556,10028,10805,0.0117396717425925,0.0117396717425925
-20452,10807,10808,0.0757678652544946,0.0757678652544946
-7529,6285,2831,0.200979085137746,0.200979085137746
-15928,9754,5382,0.011733427647939,0.011733427647939
-7553,4092,6302,0.0803403744103832,0.0803403744103832
-7580,6315,3820,0.130703255177956,0.130703255177956
-7677,1716,6365,0.197561364927668,0.197561364927668
-7751,5773,6410,0.160605281527339,0.160605281527339
-18359,7774,7775,0.0541753575171131,0.0541753575171131
-7777,6426,2486,0.134234515445665,0.134234515445665
-12252,122,8617,0.0393889261650165,0.0393889261650165
-7883,6494,6495,0.00940457999056201,0.00940457999056201
-7884,6495,5423,0.0969372989858353,0.0969372989858353
-3980,3771,3772,0.0481390459121498,0.0481390459121498
-3981,3772,3777,0.0470016129182315,0.0470016129182315
-7927,1795,6524,0.13760350708633,0.13760350708633
-8001,6561,6562,0.0546858550544455,0.0546858550544455
-11445,8257,385,0.474417191747682,0.474417191747682
-8048,6593,6594,0.0289242599655845,0.0289242599655845
-18526,9154,9352,0.0531084744773735,0.0531084744773735
-8069,6605,6606,1.2681000346061,1.2681000346061
-8092,4244,6622,0.082630423756929,0.082630423756929
-8093,6622,6623,0.0749027437652235,0.0749027437652235
-3996,3787,3788,0.0979026300528609,0.0979026300528609
-3997,3788,3789,0.0995935295086316,0.0995935295086316
-9386,7325,7326,0.0119980817003928,0.0119980817003928
-20477,10789,10826,0.0103983863250137,0.0103983863250137
-20507,10840,10823,0.00612377712997262,0.00612377712997262
-8262,841,6717,0.175943907281508,0.175943907281508
-9533,7395,7396,0.139422525474238,0.139422525474238
-20405,10779,8354,0.0261167106000956,0.0261167106000956
-8335,6764,6765,0.0503863905918892,0.0503863905918892
-8336,6765,6766,0.0491492877930629,0.0491492877930629
-4013,983,3800,0.100500044528257,0.100500044528257
-4014,3800,3801,0.0985249152645202,0.0985249152645202
-15231,8248,8334,0.0146425177596963,0.0146425177596963
-8409,3830,6807,0.0888447463890759,0.0888447463890759
-18321,6063,2543,0.201974991797574,0.201974991797574
-8457,6832,1495,0.201208565152389,0.201208565152389
-19836,2624,5204,0.178927982846839,0.178927982846839
-18379,8493,8494,0.0504160144523199,0.0504160144523199
-8503,6860,6861,0.0162922756173271,0.0162922756173271
-8527,3425,6874,0.0494311548712974,0.0494311548712974
-8599,1237,4811,0.0968243021950299,0.0968243021950299
-8699,1327,6954,0.11293333226081,0.11293333226081
-8743,6978,6843,0.0844431261667327,0.0844431261667327
-8770,6990,6991,0.0486520030390688,0.0486520030390688
-8791,7006,4358,0.202474203830337,0.202474203830337
-8792,4358,7007,0.00688683462760985,0.00688683462760985
-8840,7032,6092,0.0997655880788332,0.0997655880788332
-12243,8612,8613,0.138493887289201,0.138493887289201
-8862,2493,2840,0.128352303826166,0.128352303826166
-8889,7059,4436,0.0844445583973766,0.0844445583973766
-15879,8770,8763,0.0140298928163018,0.0140298928163018
-12248,5788,8274,0.146502988080446,0.146502988080446
-20224,10712,8757,0.0605456526720602,0.0605456526720602
-15789,9625,2105,0.0133775626084498,0.0133775626084498
-9093,4150,2344,0.174578433496429,0.174578433496429
-12934,8900,8688,0.0533584685274483,0.0533584685274483
-18558,10316,10317,0.318647498327865,0.318647498327865
-9165,7197,7198,0.272798906116362,0.272798906116362
-9189,7209,3616,0.0495666126691076,0.0495666126691076
-10453,3743,5856,0.10095556193443,0.10095556193443
-20231,10714,10715,0.0286157939247338,0.0286157939247338
-20392,10774,10770,0.00608971066273246,0.00608971066273246
-9337,4780,1523,0.0520500965787765,0.0520500965787765
-20017,8044,6572,0.144143863155146,0.144143863155146
-20561,10856,10798,0.00573758430075899,0.00573758430075899
-10672,7485,7454,0.0961864249467466,0.0961864249467466
-15863,9737,9743,0.0881669372882309,0.0881669372882309
-9436,7346,4173,0.192934476657366,0.192934476657366
-10721,7452,5690,0.129238470693044,0.129238470693044
-20510,638,10782,0.00926383363589588,0.00926383363589588
-18479,9039,9040,0.136726032574097,0.136726032574097
-9591,7412,5066,0.050234753132255,0.050234753132255
-9612,2128,5998,0.154063403679123,0.154063403679123
-16186,7721,5815,0.197248711738883,0.197248711738883
-9637,1423,7186,0.128478917444104,0.128478917444104
-11449,8259,8260,0.319737139262779,0.319737139262779
-9690,1895,7457,0.0666302144465139,0.0666302144465139
-9691,7457,7458,0.0198488245240688,0.0198488245240688
-19476,10519,10520,0.0516997558936505,0.0516997558936505
-9736,7494,5544,0.102560827713484,0.102560827713484
-16038,9802,9796,0.0179822727083053,0.0179822727083053
-11790,6564,8037,0.143771757250665,0.143771757250665
-9810,7528,7529,0.208257062216787,0.208257062216787
-9836,7542,7543,0.0265476903097887,0.0265476903097887
-18631,9484,7408,0.179068927816078,0.179068927816078
-15241,9537,9539,0.0227628365288052,0.0227628365288052
-20526,1286,10810,0.0112823826001832,0.0112823826001832
-9968,7619,7620,0.0778364486506147,0.0778364486506147
-9969,7620,7621,0.111522724623373,0.111522724623373
-9988,7625,1491,0.204666735578584,0.204666735578584
-10072,7660,2775,0.203041970554709,0.203041970554709
-10073,2775,6897,0.203220599619524,0.203220599619524
-10091,7671,690,0.200329217944331,0.200329217944331
-10115,2354,4156,0.173430880829093,0.173430880829093
-10138,3577,5644,0.141664156461633,0.141664156461633
-10164,7702,7703,0.0486413772868685,0.0486413772868685
-10187,7030,7715,0.0498024158316235,0.0498024158316235
-12249,8274,8295,0.153451254229228,0.153451254229228
-11642,1281,8347,0.0589263897659084,0.0589263897659084
-10281,7757,2638,0.20261361621015,0.20261361621015
-12251,8616,122,0.0306511482720316,0.0306511482720316
-10351,5524,6462,0.155650660428743,0.155650660428743
-11777,5360,8407,0.147060404896327,0.147060404896327
-20362,10734,9209,0.0303997458302742,0.0303997458302742
-10404,4224,7568,0.0462000499013743,0.0462000499013743
-10427,5696,6320,0.173275054190131,0.173275054190131
-16041,9802,9797,0.0106947269448384,0.0106947269448384
-10504,1036,7842,0.0544400914304572,0.0544400914304572
-12047,8526,8527,0.0840721683590618,0.0840721683590618
-10550,4923,5368,0.0856922507743825,0.0856922507743825
-16085,9818,9819,0.0412898984205639,0.0412898984205639
-10600,7873,7874,0.202540822887829,0.202540822887829
-10623,7886,1192,0.167316235534945,0.167316235534945
-20558,10845,2957,0.00878460299692283,0.00878460299692283
-10644,7563,7901,0.105394463133352,0.105394463133352
-12237,1599,8609,0.00546433627657245,0.00546433627657245
-20564,10825,1287,0.00477901915260098,0.00477901915260098
-10749,6942,7958,0.162394709841225,0.162394709841225
-10796,7983,947,0.174677658409185,0.174677658409185
-10817,6492,4607,0.147058520431446,0.147058520431446
-12476,5450,5427,0.050269770055972,0.050269770055972
-10839,6220,8004,0.052907543789053,0.052907543789053
-15731,7157,8801,0.0199400844261404,0.0199400844261404
-16956,10040,9425,0.0116537581995054,0.0116537581995054
-10942,4686,4956,0.099446723287275,0.099446723287275
-16188,7203,1784,0.197361998677517,0.197361998677517
-10964,6721,4791,0.136892276030183,0.136892276030183
-10986,5402,3133,0.105232928623448,0.105232928623448
-20369,10733,10746,0.00402873670536954,0.00402873670536954
-12735,8822,7751,0.202267643963295,0.202267643963295
-16205,7728,5823,0.195806305910918,0.195806305910918
-15885,9619,8879,0.0100154912435563,0.0100154912435563
-16189,1784,4247,0.203808666270494,0.203808666270494
-11109,8035,807,0.0159273560245565,0.0159273560245565
-11132,8133,6270,0.051417429454822,0.051417429454822
-11156,2087,2654,0.0953557861022671,0.0953557861022671
-11157,2654,4115,0.0506170186006763,0.0506170186006763
-11208,8161,8162,0.355822290917686,0.355822290917686
-11220,8169,106,0.241259609778708,0.241259609778708
-11240,8178,8182,0.0195790567337129,0.0195790567337129
-20821,8330,10923,0.00839528658401215,0.00839528658401215
-17791,3305,8508,0.0362477709828647,0.0362477709828647
-11322,8214,5950,0.203024250253409,0.203024250253409
-13061,8944,8945,0.0479106655937031,0.0479106655937031
-11349,1754,4801,0.0245317247967943,0.0245317247967943
-11390,8244,8245,0.0389791405679458,0.0389791405679458
-17817,9286,10185,0.00969626713044654,0.00969626713044654
-11462,8270,701,0.039999373678842,0.039999373678842
-11492,8281,8282,0.00503511807894305,0.00503511807894305
-11538,8302,8303,0.0107298944611382,0.0107298944611382
-11571,7713,8322,0.206137749537799,0.206137749537799
-11573,1766,7715,0.157141019260281,0.157141019260281
-13237,9010,4325,0.222509982407309,0.222509982407309
-11632,1278,4529,0.134276517370514,0.134276517370514
-11724,8374,8375,0.133513247237079,0.133513247237079
-11797,8414,4446,0.0913151320718964,0.0913151320718964
-11798,4446,6565,0.148651456771305,0.148651456771305
-11799,6565,8038,0.145022863674794,0.145022863674794
-13411,4426,9064,0.0342337858603608,0.0342337858603608
-11882,8457,1807,0.101184879886606,0.101184879886606
-13518,7635,7602,0.0983630321096794,0.0983630321096794
-11995,8048,6576,0.143165005086162,0.143165005086162
-12062,8532,3932,0.283100338690813,0.283100338690813
-12064,8532,3745,0.0315839509500456,0.0315839509500456
-12065,3745,8533,0.0402006397458181,0.0402006397458181
-16198,1788,6622,0.140253824514813,0.140253824514813
-12143,2334,7677,0.0942814693046897,0.0942814693046897
-13771,2561,9189,0.0689861433647756,0.0689861433647756
-18571,10322,10326,0.0103554459054315,0.0103554459054315
-15556,9654,9655,0.107168580692288,0.107168580692288
-12220,8596,8597,0.100597506592905,0.100597506592905
-12284,8235,7279,0.114584410389232,0.114584410389232
-12290,8634,8488,0.146216431524827,0.146216431524827
-15445,9605,9606,0.0107985098434616,0.0107985098434616
-12402,8686,2352,0.174110261708509,0.174110261708509
-12403,2352,4154,0.17319721774215,0.17319721774215
-12445,8705,902,0.277961591263562,0.277961591263562
-16201,7209,5822,0.204832695484964,0.204832695484964
-14071,3116,6673,0.099476803467174,0.099476803467174
-12563,729,7060,0.0981255480039199,0.0981255480039199
-12670,8793,5460,0.173942223750684,0.173942223750684
-12698,8808,8810,0.00713796130621387,0.00713796130621387
-12701,2643,8805,0.104981962462916,0.104981962462916
-12721,3633,3295,0.250204598549556,0.250204598549556
-16683,9985,9930,0.0816514509832002,0.0816514509832002
-12762,3506,8170,0.201022944642928,0.201022944642928
-15870,8842,8843,0.0221571458561984,0.0221571458561984
-15950,9765,9766,0.0194093177763062,0.0194093177763062
-12930,3167,8897,0.107237063498964,0.107237063498964
-14520,3985,7053,0.133213475028965,0.133213475028965
-15337,9564,9565,0.0333323202761363,0.0333323202761363
-15952,9765,9758,0.0491105082028732,0.0491105082028732
-13016,8918,8921,0.143291466888449,0.143291466888449
-13097,8917,8959,0.032086215385934,0.032086215385934
-13121,640,8968,0.045462010282231,0.045462010282231
-13175,4472,2794,0.133415072213096,0.133415072213096
-13447,9080,4647,0.227691913723815,0.227691913723815
-19029,7690,8144,0.0861073402797158,0.0861073402797158
-13280,4312,7812,0.197562058294396,0.197562058294396
-20373,10757,10758,0.0390214492856105,0.0390214492856105
-13466,9093,9091,0.0528525628364664,0.0528525628364664
-15458,1970,8766,0.0532545399938913,0.0532545399938913
-13600,2311,6580,0.108271978342533,0.108271978342533
-13622,3355,9148,0.0901126087179192,0.0901126087179192
-15127,8268,225,0.129419996314042,0.129419996314042
-15855,9737,9738,0.0422997339419691,0.0422997339419691
-15953,9758,9764,0.0382745737843307,0.0382745737843307
-13641,9152,327,0.371274069669657,0.371274069669657
-13690,6833,6976,0.085342873664165,0.085342873664165
-15860,9707,9741,0.0544957036472965,0.0544957036472965
-13709,6929,3818,0.116035215256342,0.116035215256342
-15411,7964,9590,0.052042549974644,0.052042549974644
-18495,15,6384,0.132622389900901,0.132622389900901
-18578,10319,10327,0.0490398009212077,0.0490398009212077
-13818,8483,6705,0.147706661087796,0.147706661087796
-13972,9250,9251,0.0609360549506678,0.0609360549506678
-20378,10761,10762,0.0703070927126279,0.0703070927126279
-14062,6351,2574,0.0264285559063396,0.0264285559063396
-4057,542,3837,0.0481841661951123,0.0481841661951123
-20619,10811,10850,0.0311826470096292,0.0311826470096292
-14143,9286,9287,0.00349243594701226,0.00349243594701226
-15782,2533,9708,0.0671466764878958,0.0671466764878958
-18700,1376,9773,0.0602159412724284,0.0602159412724284
-19501,10528,10529,0.0145223093781074,0.0145223093781074
-16094,9821,9496,0.0522797219291825,0.0522797219291825
-16682,9984,9985,0.111071610148866,0.111071610148866
-16220,9022,9008,0.10706671130041,0.10706671130041
-16222,9850,7740,0.404338691233817,0.404338691233817
-16223,7740,5835,0.200008410058821,0.200008410058821
-14438,6143,4017,0.133566629484228,0.133566629484228
-14458,9168,3834,0.0502958887489777,0.0502958887489777
-16499,8709,8890,0.00781309402153006,0.00781309402153006
-14504,9364,2172,0.0261972288759813,0.0261972288759813
-16631,9312,9964,0.536418418139307,0.536418418139307
-16632,9964,9965,0.081644512591407,0.081644512591407
-15472,8892,1971,0.0354218020701201,0.0354218020701201
-14617,9402,9350,0.13375643872535,0.13375643872535
-14954,7265,7584,0.0944614970989242,0.0944614970989242
-4076,3852,3853,0.00162344592902021,0.00162344592902021
-15099,7228,2370,0.054925658104601,0.054925658104601
-16381,9878,9879,0.0338421848775343,0.0338421848775343
-16508,9928,9929,0.0170279633676167,0.0170279633676167
-16525,5158,7669,0.0405110122092171,0.0405110122092171
-16594,9950,9951,0.140650325269802,0.140650325269802
-17419,10101,10102,0.0281887857345848,0.0281887857345848
-16852,9866,6519,0.0479747206312546,0.0479747206312546
-16968,10038,10045,0.00348952632939911,0.00348952632939911
-17638,10159,9498,0.0561256700305383,0.0561256700305383
-17642,8238,524,0.198799957504709,0.198799957504709
-17105,331,10064,0.12693044123038,0.12693044123038
-17422,10082,10083,0.0318734478115971,0.0318734478115971
-17268,4260,3518,0.200851927356296,0.200851927356296
-17398,7305,3261,0.198983160217956,0.198983160217956
-17400,3509,4251,0.199228485757107,0.199228485757107
-17911,4835,9197,0.134589353492833,0.134589353492833
-17544,8941,8264,0.168906883412351,0.168906883412351
-18155,10135,10136,0.408197365852498,0.408197365852498
-17572,10145,10146,0.0800519816931861,0.0800519816931861
-17628,2882,8136,0.162489310093733,0.162489310093733
-18601,10335,7656,0.178628836370645,0.178628836370645
-17816,9287,10184,0.0350560568035198,0.0350560568035198
-17966,6242,10236,0.0113656789072773,0.0113656789072773
-17886,9955,4390,0.0561034767074801,0.0561034767074801
-17918,5173,6867,0.199959252458115,0.199959252458115
-17919,6867,5276,0.0971272913038605,0.0971272913038605
-19066,5495,9469,0.177422724680083,0.177422724680083
-19037,9496,9494,0.0281063525870562,0.0281063525870562
-18774,9642,7121,0.176777734913143,0.176777734913143
-19101,10429,10049,0.0400790686743565,0.0400790686743565
-19617,10477,10588,0.0688805182452796,0.0688805182452796
-19314,6700,5030,0.15289416238876,0.15289416238876
-19425,36,3535,0.208182345564595,0.208182345564595
-19426,3535,4231,0.197905943796208,0.197905943796208
-19462,10478,10483,0.0205384885375563,0.0205384885375563
-19725,4489,10627,0.00886289645656064,0.00886289645656064
-19764,5140,5153,0.0242552277861381,0.0242552277861381
-20136,2752,6988,0.0528412012093399,0.0528412012093399
-19927,4579,8367,0.130318576605927,0.130318576605927
-20000,10690,8645,0.0319530891427096,0.0319530891427096
-4106,1534,3875,0.0874992877759652,0.0874992877759652
-20047,9078,9193,0.27590001979893,0.27590001979893
-397,400,401,0.186988741368815,0.186988741368815
-398,401,402,0.0834459188949902,0.0834459188949902
-400,403,313,0.0512719310633618,0.0512719310633618
-402,404,405,0.135745743044228,0.135745743044228
-404,406,407,0.304825723005793,0.304825723005793
-406,408,409,0.43926972528011,0.43926972528011
-408,410,411,0.386425449179561,0.386425449179561
-410,412,413,0.296429557961552,0.296429557961552
-411,413,414,0.0146716283322865,0.0146716283322865
-412,414,415,0.325808855480319,0.325808855480319
-414,416,328,0.121195048255912,0.121195048255912
-416,329,416,0.287289513548727,0.287289513548727
-417,416,417,0.245312696429149,0.245312696429149
-20053,1955,8185,0.122183214039011,0.122183214039011
-20198,8571,5783,0.145694845246542,0.145694845246542
-14833,7026,8320,0.0139341057083995,0.0139341057083995
-14834,8320,7029,0.0476978989477955,0.0476978989477955
-15442,9600,8606,0.035907314389173,0.035907314389173
-19656,10607,10531,0.00409092160847847,0.00409092160847847
-20737,10917,10886,0.0142612706482701,0.0142612706482701
-14870,9363,2450,0.140513945011527,0.140513945011527
-11514,269,270,0.151462432210479,0.151462432210479
-12364,8672,8674,0.0109017354569362,0.0109017354569362
-12,12,13,0.134681710739383,0.134681710739383
-14892,8103,9009,0.099173697837006,0.099173697837006
-14893,9009,8146,0.0976735888216106,0.0976735888216106
-33,36,37,0.0487053100188426,0.0487053100188426
-14912,7271,7600,0.0956539249415721,0.0956539249415721
-18874,7987,218,0.124810113553517,0.124810113553517
-18876,3520,84,0.204554290109371,0.204554290109371
-15454,8884,9611,0.0785818613777641,0.0785818613777641
-322,154,206,0.0287029588335131,0.0287029588335131
-18627,9483,1310,0.220178764490314,0.220178764490314
-18894,10375,10376,0.00936614397970835,0.00936614397970835
-15122,8269,9491,0.0542877044701678,0.0542877044701678
-18715,7650,8069,0.263314494448216,0.263314494448216
-15971,8998,4214,0.0961806119218467,0.0961806119218467
-551,544,545,0.0205710614294522,0.0205710614294522
-15166,7386,9508,0.0293624650986513,0.0293624650986513
-18679,2589,1852,0.179197761430995,0.179197761430995
-602,593,594,0.0187536593392831,0.0187536593392831
-16091,9818,526,0.0930965533879819,0.0930965533879819
-13959,448,9111,0.0841767201213853,0.0841767201213853
-16119,427,4010,0.113680084788302,0.113680084788302
-17947,10226,10227,0.0385043082181171,0.0385043082181171
-16175,7201,5812,0.201274753121947,0.201274753121947
-699,693,694,0.0993204992661042,0.0993204992661042
-16265,9865,7738,0.345896015945794,0.345896015945794
-16341,9873,8704,0.014474001055321,0.014474001055321
-11688,774,775,0.0224766779818413,0.0224766779818413
-16464,1081,9912,0.0130855777393443,0.0130855777393443
-18428,2983,10286,0.340223280394145,0.340223280394145
-16719,485,10003,0.0666623735199971,0.0666623735199971
-18212,2988,7850,0.201655156198778,0.201655156198778
-18213,7850,6382,0.201197176818258,0.201197176818258
-17132,1799,4238,0.205173852791716,0.205173852791716
-268,278,279,0.0669047721045728,0.0669047721045728
-18436,10287,10292,0.102997198003519,0.102997198003519
-17134,3543,44,0.198313047920784,0.198313047920784
-15194,7392,9524,0.0521516926212219,0.0521516926212219
-19559,10563,10553,0.0196751082256841,0.0196751082256841
-19864,10666,10667,0.12344950946071,0.12344950946071
-1022,827,1037,0.134288205933024,0.134288205933024
-19991,10682,10649,0.0504069045792634,0.0504069045792634
-327,328,329,0.206425005842362,0.206425005842362
-15245,9540,9541,0.00803794786000152,0.00803794786000152
-14681,446,727,0.207769052846247,0.207769052846247
-18636,1846,2580,0.177268272488638,0.177268272488638
-15883,9594,8842,0.0247081602797847,0.0247081602797847
-18445,1124,10289,0.0496295455281554,0.0496295455281554
-15483,9622,9623,0.0434553081653394,0.0434553081653394
-15784,9596,2105,0.0159980383240888,0.0159980383240888
-18450,7849,2986,0.202541671618508,0.202541671618508
-15540,1221,8429,0.105180771417586,0.105180771417586
-17095,3719,3720,0.174398206796096,0.174398206796096
-12950,1330,1331,0.0133918888831226,0.0133918888831226
-19570,10569,7462,0.00803939319633032,0.00803939319633032
-1312,1338,1339,0.0991205046552405,0.0991205046552405
-15958,9768,9769,0.0623405517746533,0.0623405517746533
-325,268,153,0.064083026712354,0.064083026712354
-386,388,389,0.0751873239589982,0.0751873239589982
-1392,1419,1420,0.399589215327938,0.399589215327938
-16282,9096,9098,0.0807475840805468,0.0807475840805468
-391,393,394,0.185819928048464,0.185819928048464
-15753,6671,2023,0.100119371100459,0.100119371100459
-18126,6042,10262,0.201564202628959,0.201564202628959
-17137,4425,1909,0.200241543203617,0.200241543203617
-16013,9783,9784,0.0337977814282775,0.0337977814282775
-12006,8049,6578,0.147083508160087,0.147083508160087
-2343,2334,2335,0.271393460830069,0.271393460830069
-19952,4670,7857,0.100774147000306,0.100774147000306
-20659,8289,5957,0.0879515292456205,0.0879515292456205
-12349,8665,8666,0.0489645255680358,0.0489645255680358
-1536,1559,1560,0.0937807122385258,0.0937807122385258
-2410,2115,2401,0.446933916798798,0.446933916798798
-19581,7470,10575,0.00667183269883622,0.00667183269883622
-1557,1582,1583,0.0811305260417956,0.0811305260417956
-469,472,473,0.100239678379349,0.100239678379349
-569,562,563,0.0844940522055572,0.0844940522055572
-12010,5508,7081,0.146350144860015,0.146350144860015
-2663,2621,2622,0.0420400210402162,0.0420400210402162
-16696,9597,7094,0.00600769898364912,0.00600769898364912
-18883,7310,84,0.202570183098447,0.202570183098447
-16736,7419,10004,0.204798388413466,0.204798388413466
-1623,1651,1652,0.0452674748546477,0.0452674748546477
-12948,1303,1304,0.066448544071591,0.066448544071591
-20711,10885,10914,0.126940460926274,0.126940460926274
-20712,10914,5881,0.00554916008288024,0.00554916008288024
-16509,9929,9930,0.0673766892433469,0.0673766892433469
-1643,1670,1671,0.136647738333876,0.136647738333876
-19534,6856,10550,0.00719456093421717,0.00719456093421717
-19538,4704,10552,0.0168576392161317,0.0168576392161317
-19539,10552,10553,0.00416995013524246,0.00416995013524246
-11689,775,836,0.0388095868373909,0.0388095868373909
-20,21,22,0.0174708821601448,0.0174708821601448
-16449,9906,9907,0.130469688472308,0.130469688472308
-41,44,45,0.0507831501846365,0.0507831501846365
-17298,7736,5829,0.204153885319898,0.204153885319898
-64,70,71,0.046163806906163,0.046163806906163
-18467,10299,10298,0.126605139952982,0.126605139952982
-18685,1316,1372,0.177012768030012,0.177012768030012
-1826,1842,1843,0.155652098486701,0.155652098486701
-19783,3732,10633,0.0548138207459151,0.0548138207459151
-1846,1861,1862,0.0495211888216282,0.0495211888216282
-177,186,187,0.102075274690852,0.102075274690852
-202,214,215,0.233063347854791,0.233063347854791
-271,281,282,0.0968799942510371,0.0968799942510371
-335,336,337,0.26926308578439,0.26926308578439
-14122,3945,503,0.0521094341958735,0.0521094341958735
-1949,1964,1965,0.100541047482359,0.100541047482359
-503,497,498,0.332501427216364,0.332501427216364
-508,502,503,0.0804669922754196,0.0804669922754196
-19271,10424,10425,0.0133101789702176,0.0133101789702176
-19460,10507,10477,0.0195042673008727,0.0195042673008727
-12962,1631,1599,0.105987129966341,0.105987129966341
-11814,2150,2151,0.12777055976042,0.12777055976042
-18730,7649,8066,0.263509830967107,0.263509830967107
-18671,2605,1538,0.176823430683456,0.176823430683456
-20037,816,3558,0.154160936652516,0.154160936652516
-20700,10894,10895,0.0022719801727208,0.0022719801727208
-17029,3606,3607,0.0180484124991241,0.0180484124991241
-850,863,864,0.0616242283467915,0.0616242283467915
-18683,3539,3608,0.177667253998454,0.177667253998454
-20825,9400,10954,0.0122123114573311,0.0122123114573311
-872,885,886,0.105399149486358,0.105399149486358
-19920,2621,10413,0.177079309456246,0.177079309456246
-892,906,907,0.104783494637697,0.104783494637697
-12344,8660,8661,0.0179171962919351,0.0179171962919351
-17141,3089,4509,0.200737491088575,0.200737491088575
-16291,2376,2377,0.00482087191216397,0.00482087191216397
-963,974,975,0.202802632214452,0.202802632214452
-17135,44,4412,0.404761668333185,0.404761668333185
-17088,10071,9940,0.138093381903903,0.138093381903903
-16845,10022,10018,0.0055152683612349,0.0055152683612349
-17952,10226,10230,0.0192923880160408,0.0192923880160408
-20322,10741,10742,0.00907488670500163,0.00907488670500163
-1113,1129,1130,0.204124873969403,0.204124873969403
-16607,7890,9325,0.145145340110648,0.145145340110648
-15260,9550,9551,0.0630135708366092,0.0630135708366092
-19433,10110,10489,0.0489242953920304,0.0489242953920304
-16954,10038,10039,0.0207511303582817,0.0207511303582817
-12357,8669,8668,0.00723037090372959,0.00723037090372959
-1183,1198,1199,0.0305943034250603,0.0305943034250603
-19442,10493,10494,0.0196148764551294,0.0196148764551294
-19443,10494,10495,0.0228284210093234,0.0228284210093234
-2633,2594,2595,0.0115937480855902,0.0115937480855902
-1205,1220,1221,0.0900481853791487,0.0900481853791487
-18180,5796,6056,0.200195877654712,0.200195877654712
-11707,1245,1246,0.0231530055304531,0.0231530055304531
-19444,10495,10496,0.0213401735101805,0.0213401735101805
-19445,10496,10497,0.0182367704590367,0.0182367704590367
-2703,2659,2660,0.155649282617483,0.155649282617483
-19446,10497,10498,0.0203055071588043,0.0203055071588043
-2724,107,2679,0.0450807290855188,0.0450807290855188
-1266,1286,1287,0.0202842890457172,0.0202842890457172
-18451,2986,7704,0.199650644692106,0.199650644692106
-16289,1363,2376,0.00344312944616261,0.00344312944616261
-19447,10498,10499,0.0196160459333464,0.0196160459333464
-14693,2225,4875,0.162113763012991,0.162113763012991
-1308,1334,1335,0.129255645714035,0.129255645714035
-14695,4946,4947,0.168905093573288,0.168905093573288
-1332,1357,1358,0.136424467862451,0.136424467862451
-19448,10499,10487,0.023296750596408,0.023296750596408
-2841,2789,2790,0.0523852002781698,0.0523852002781698
-15843,7795,9723,0.020416694003674,0.020416694003674
-18886,7308,3267,0.201549354300641,0.201549354300641
-19449,10487,10500,0.022940948763835,0.022940948763835
-17307,5827,7735,0.20365816745981,0.20365816745981
-2499,2480,2481,0.265342544498994,0.265342544498994
-19450,10500,10501,0.0189264900266028,0.0189264900266028
-18889,1923,6123,0.200475462008098,0.200475462008098
-1428,1451,1452,0.107578729884622,0.107578729884622
-18647,7412,4053,0.176566575042864,0.176566575042864
-1452,1471,1472,0.147622384612895,0.147622384612895
-19451,10501,10502,0.0200830353316625,0.0200830353316625
-2953,2897,2898,0.0472912053919854,0.0472912053919854
-16310,2439,2721,0.0812562615874829,0.0812562615874829
-12320,1302,1603,0.00893905362813633,0.00893905362813633
-19452,10502,10503,0.0197272337869401,0.0197272337869401
-19453,10503,7482,0.0181814350817939,0.0181814350817939
-19038,9494,229,0.0588468541295868,0.0588468541295868
-1498,1517,1518,0.199413272863754,0.199413272863754
-15846,9732,1098,0.0848710138660927,0.0848710138660927
-19454,7482,10504,0.0196839111368948,0.0196839111368948
-19455,10504,10505,0.017559948119168,0.017559948119168
-13365,9051,9052,0.103390283727961,0.103390283727961
-2998,1652,2935,0.112349122861115,0.112349122861115
-17375,1796,4235,0.206436210016501,0.206436210016501
-13963,9247,9102,0.0619095710643366,0.0619095710643366
-1534,1557,1558,0.0743776380849984,0.0743776380849984
-19916,8774,7640,0.176934657107496,0.176934657107496
-19917,7640,6233,0.179269287981755,0.179269287981755
-1556,1581,1582,0.0903340712116846,0.0903340712116846
-18461,9354,9528,0.135770728089025,0.135770728089025
-19456,10505,7464,0.0643341844968674,0.0643341844968674
-19919,5202,2621,0.177194532329155,0.177194532329155
-1603,1634,1635,0.0667169559865797,0.0667169559865797
-15911,9239,9240,0.00759910247117962,0.00759910247117962
-3133,2004,3061,0.0946875314878615,0.0946875314878615
-1648,1675,1676,0.0232219414191173,0.0232219414191173
-1649,1676,1677,0.104810655650978,0.104810655650978
-18412,7776,7163,0.0985154391997448,0.0985154391997448
-3153,3077,3078,0.0921654003892753,0.0921654003892753
-1666,1129,1692,0.0515669276869657,0.0515669276869657
-256,264,265,0.00881331069899833,0.00881331069899833
-19580,10574,7470,0.0064160385090956,0.0064160385090956
-1690,1714,1715,0.111918529606987,0.111918529606987
-12366,8674,8671,0.0118216471510326,0.0118216471510326
-18801,10352,9812,0.039652100920871,0.039652100920871
-379,381,382,0.0684082960066799,0.0684082960066799
-16308,2827,2851,0.00473328951361683,0.00473328951361683
-20640,10878,10879,0.0287629224507079,0.0287629224507079
-20278,5573,10727,0.00799925463089475,0.00799925463089475
-18122,2538,10266,0.180269607102109,0.180269607102109
-1907,1919,1920,0.101419584890654,0.101419584890654
-16419,3282,3283,0.0297579469637327,0.0297579469637327
-11533,1234,1235,0.136499599599558,0.136499599599558
-18135,4099,6043,0.191045620861521,0.191045620861521
-16763,4439,9868,0.0469300202486105,0.0469300202486105
-257,265,257,0.0618021904449226,0.0618021904449226
-3413,3306,3307,0.147259003832799,0.147259003832799
-1997,2009,2010,0.0436503011483876,0.0436503011483876
-381,383,384,0.174765079599045,0.174765079599045
-3437,3324,3325,0.13969071524798,0.13969071524798
-2020,2029,2030,0.0536884532048604,0.0536884532048604
-14708,5223,5330,0.173633760067415,0.173633760067415
-17179,5410,5449,0.194891408787823,0.194891408787823
-2041,2049,2050,0.203224924896292,0.203224924896292
-15894,9255,9441,0.0812248966226341,0.0812248966226341
-2068,2071,2072,0.108635365611271,0.108635365611271
-383,385,386,0.313694212518365,0.313694212518365
-15938,9757,9756,0.156652526688463,0.156652526688463
-2092,1220,2094,0.120498651922126,0.120498651922126
-16738,725,51,0.242028173240196,0.242028173240196
-19560,10553,10564,0.0204794292027182,0.0204794292027182
-2166,2165,2166,0.0846335919696035,0.0846335919696035
-19638,10597,10526,0.00694709641094844,0.00694709641094844
-3597,3446,2803,0.137873345883867,0.137873345883867
-16317,2510,3005,0.00592207877923616,0.00592207877923616
-17174,5326,5327,0.109586213492937,0.109586213492937
-16740,4437,10005,0.047793833799427,0.047793833799427
-3644,3483,3484,0.202897902969007,0.202897902969007
-2231,2232,2233,0.0942717670146639,0.0942717670146639
-2232,2233,2234,0.0947564865992517,0.0947564865992517
-16741,10005,4510,0.0465117651564764,0.0465117651564764
-2248,2251,2252,0.0515208780131149,0.0515208780131149
-16742,4510,10006,0.0392105126712721,0.0392105126712721
-3687,3523,3524,0.057537938641533,0.057537938641533
-2276,2276,2277,0.201064010739015,0.201064010739015
-18183,6051,5769,0.201340675613812,0.201340675613812
-18863,9178,2185,0.000908525082812035,0.000908525082812035
-14108,502,3544,0.223192299132,0.223192299132
-16417,3130,3281,0.0400386431725339,0.0400386431725339
-16286,1362,1363,0.0694355006798695,0.0694355006798695
-3729,3563,3564,0.1023601599905,0.1023601599905
-13961,9112,9247,0.133632751867418,0.133632751867418
-2325,1348,1614,0.104366499106977,0.104366499106977
-18909,10388,10381,0.014813120492833,0.014813120492833
-18903,10381,10380,0.00882005349877488,0.00882005349877488
-18454,4296,10295,0.0897566766881454,0.0897566766881454
-14692,941,2225,0.184174515609916,0.184174515609916
-19558,10562,10563,0.0196153093677919,0.0196153093677919
-16743,10006,7566,0.0419162617939555,0.0419162617939555
-19568,7474,10568,0.0062936328481519,0.0062936328481519
-18905,10382,10383,0.00831887899673018,0.00831887899673018
-17147,4241,3546,0.202185735299221,0.202185735299221
-14720,937,2221,0.184339220920538,0.184339220920538
-18637,2580,7383,0.244324669292135,0.244324669292135
-2484,2467,2468,0.0154146632189528,0.0154146632189528
-17183,5608,5658,0.149882473899379,0.149882473899379
-3908,3707,3708,0.138080579549583,0.138080579549583
-2555,2532,2533,0.191131540477931,0.191131540477931
-2556,2533,254,0.098486007419044,0.098486007419044
-19573,10570,7473,0.00674972719310255,0.00674972719310255
-2577,1090,2550,0.0509764502640852,0.0509764502640852
-17311,5685,5705,0.205154639659543,0.205154639659543
-20594,10852,10864,0.00559477666444464,0.00559477666444464
-2602,2568,2565,0.0838899757725962,0.0838899757725962
-13584,9079,9135,0.0736016285399027,0.0736016285399027
-3952,3748,3749,0.123087650580437,0.123087650580437
-2626,2587,2588,0.00484286584971978,0.00484286584971978
-2627,2588,2589,0.0472712028951763,0.0472712028951763
-18404,10286,7165,0.0480937532986949,0.0480937532986949
-18406,9349,8340,0.136218529796162,0.136218529796162
-13586,9135,9136,0.116423294527986,0.116423294527986
-14719,5893,937,0.0748599535472642,0.0748599535472642
-2721,2676,2677,0.00391406141859358,0.00391406141859358
-18735,4002,7603,0.202077020511888,0.202077020511888
-17677,6029,10165,0.522362145407342,0.522362145407342
-17480,344,5940,0.0510780896194201,0.0510780896194201
-2823,2771,2261,0.100546651913918,0.100546651913918
-18144,10275,10261,0.405650212701817,0.405650212701817
-12350,8663,8667,0.00958750951684791,0.00958750951684791
-4125,3888,3889,0.19728512260693,0.19728512260693
-2839,2788,1047,0.105687024742303,0.105687024742303
-2840,1047,2789,0.0528381886609336,0.0528381886609336
-12351,8667,8668,0.0176529909929813,0.0176529909929813
-19572,10564,10570,0.0698992084212194,0.0698992084212194
-16413,9458,9887,0.0468003057153474,0.0468003057153474
-2910,785,2854,0.0936375066158938,0.0936375066158938
-12361,8671,8672,0.0146217858658369,0.0146217858658369
-2955,2899,2900,0.139071498957734,0.139071498957734
-20621,10800,10799,0.0197706815366264,0.0197706815366264
-16441,5747,9898,0.0366397439833697,0.0366397439833697
-3003,2938,2939,0.343360355018568,0.343360355018568
-20697,4524,10911,0.0102002426471616,0.0102002426471616
-20441,10798,10799,0.0151893809033584,0.0151893809033584
-3052,2983,2984,0.049669116788992,0.049669116788992
-17130,4371,4372,0.0862019013563638,0.0862019013563638
-3072,3004,3006,0.148595619798792,0.148595619798792
-20009,9620,10046,0.0380951574175552,0.0380951574175552
-4390,4106,695,0.201687631399372,0.201687631399372
-18702,2606,1861,0.182749323037212,0.182749323037212
-3122,2901,3051,0.104668558602022,0.104668558602022
-20265,5574,10723,0.0117861788911356,0.0117861788911356
-20266,10724,7552,0.00870010659628447,0.00870010659628447
-19624,10591,10497,0.00644185269782912,0.00644185269782912
-19579,10573,10574,0.0879788736402366,0.0879788736402366
-18895,10376,10377,0.0641298068195797,0.0641298068195797
-20011,10694,10695,0.0242395353024572,0.0242395353024572
-17687,6171,6172,0.0391351463481426,0.0391351463481426
-3160,3084,3085,0.0490903700114876,0.0490903700114876
-19594,10580,10495,0.00720293691626167,0.00720293691626167
-3180,3100,3101,0.129889039932712,0.129889039932712
-17168,5241,5262,0.201125324676422,0.201125324676422
-17121,1798,4176,0.205688375484509,0.205688375484509
-3202,3118,3119,0.112364882779035,0.112364882779035
-14726,5162,6220,0.0504817306174529,0.0504817306174529
-3225,3140,3141,0.161478257380345,0.161478257380345
-13781,438,3176,0.297045355127737,0.297045355127737
-19813,5371,10633,0.121358837066421,0.121358837066421
-3298,3207,2047,0.106039987596014,0.106039987596014
-17169,5262,1912,0.201876443466571,0.201876443466571
-4605,3695,4261,0.0511463408235916,0.0511463408235916
-3320,3225,3226,0.12416264535459,0.12416264535459
-19269,10421,10423,0.00254934916501421,0.00254934916501421
-18686,1372,4116,0.0631464225691973,0.0631464225691973
-20456,10811,10791,0.0266421174352104,0.0266421174352104
-20624,10873,10804,0.10579809531994,0.10579809531994
-18140,10260,10273,0.404128367861769,0.404128367861769
-4673,4035,4316,0.0606123696093501,0.0606123696093501
-3387,3285,3286,0.00355897702027561,0.00355897702027561
-3388,3286,3287,0.0772193168955733,0.0772193168955733
-18146,10276,10258,0.404206655907194,0.404206655907194
-4696,808,3552,0.152717552993661,0.152717552993661
-3410,3303,3304,0.147141483236073,0.147141483236073
-20283,10722,10688,0.0815558763222832,0.0815558763222832
-20448,10804,10757,0.0136201124223367,0.0136201124223367
-20785,10292,10946,0.00447271282341959,0.00447271282341959
-19630,10593,10504,0.00657829834277663,0.00657829834277663
-3431,3318,3319,0.157091916454475,0.157091916454475
-20450,10805,10806,0.0327940652155406,0.0327940652155406
-4743,1385,4362,0.103327121803573,0.103327121803573
-18254,6754,8093,0.140439193425512,0.140439193425512
-18250,9369,6873,0.0520299718080319,0.0520299718080319
-20787,10932,5700,0.00677435562999442,0.00677435562999442
-3475,3354,3355,0.201619360833214,0.201619360833214
-14728,6303,5053,0.0505955795491821,0.0505955795491821
-3501,59,3374,0.0977645612190622,0.0977645612190622
-4808,4414,4415,0.102078381821333,0.102078381821333
-3525,3393,3394,0.0602077843108352,0.0602077843108352
-18251,6873,8493,0.0500003986375519,0.0500003986375519
-3545,656,1887,0.0518725917476049,0.0518725917476049
-14732,5467,6342,0.17284299485541,0.17284299485541
-3566,1664,1683,0.0314909646044893,0.0314909646044893
-17138,1909,4488,0.199449310001805,0.199449310001805
-18256,7043,3984,0.199449230757582,0.199449230757582
-4925,3762,2559,0.0885452473584724,0.0885452473584724
-18261,6496,2547,0.410253746717568,0.410253746717568
-3637,3478,3266,0.200452444377038,0.200452444377038
-3638,3266,3479,0.201663130575812,0.201663130575812
-20636,4518,10876,0.0502632727704227,0.0502632727704227
-3656,1794,3493,0.171297280470528,0.171297280470528
-18171,6061,4076,0.198476287736927,0.198476287736927
-20376,10759,10760,0.116931333825994,0.116931333825994
-3702,3537,3538,0.048566556365416,0.048566556365416
-20385,10293,10769,0.0538892457987372,0.0538892457987372
-18174,6420,6455,0.4094647827628,0.4094647827628
-5048,4577,4578,0.133343896044873,0.133343896044873
-3745,3575,3576,0.0911473636959273,0.0911473636959273
-3747,3577,3469,0.101252045857741,0.101252045857741
-20384,10767,10768,0.0160296914364663,0.0160296914364663
-17309,4261,5684,0.20074031502923,0.20074031502923
-18311,7054,7244,0.0289643230302344,0.0289643230302344
-20470,10819,10820,0.0323669425461701,0.0323669425461701
-14736,4161,4770,0.262098569801346,0.262098569801346
-5118,4637,4638,0.0862888373921514,0.0862888373921514
-18265,6532,1691,0.20439620202731,0.20439620202731
-20472,10821,10822,0.0473810496096361,0.0473810496096361
-5168,2615,4670,0.0537518017226415,0.0537518017226415
-18530,9153,9524,0.0561612407510351,0.0561612407510351
-17081,882,4467,0.138148999917071,0.138148999917071
-20012,10207,7896,0.145636470907972,0.145636470907972
-20423,10784,10785,0.00445123207828982,0.00445123207828982
-19137,10436,10430,0.0315234230528839,0.0315234230528839
-17145,4684,1801,0.196612355705575,0.196612355705575
-3889,3694,83,0.201794860941248,0.201794860941248
-18574,10316,10323,0.0808271649311999,0.0808271649311999
-17148,3546,46,0.198774198414449,0.198774198414449
-3912,3710,3711,0.148294717491307,0.148294717491307
-20615,10786,10857,0.0479734082124594,0.0479734082124594
-18267,6545,2438,0.164157220604829,0.164157220604829
-17099,332,3745,0.0956275481171213,0.0956275481171213
-14740,6607,3802,0.199799384709315,0.199799384709315
-18269,5736,5525,0.155855016610815,0.155855016610815
-5281,4748,4749,0.0137701294893219,0.0137701294893219
-3961,3755,3756,0.201785607236284,0.201785607236284
-3963,3757,1865,0.238183107088451,0.238183107088451
-18538,10309,10310,0.222695826046938,0.222695826046938
-4053,3833,3834,0.0227974048946719,0.0227974048946719
-18576,10324,10320,0.158325840757882,0.158325840757882
-5401,3070,4833,0.174791291148441,0.174791291148441
-20827,9001,9205,0.0113889892669974,0.0113889892669974
-16010,9780,9781,0.00910284197008254,0.00910284197008254
-18606,8065,6592,0.262343816062173,0.262343816062173
-18608,2631,5208,0.201029440504885,0.201029440504885
-20328,10745,10742,0.0339039031846942,0.0339039031846942
-4098,1552,3870,0.130787042699874,0.130787042699874
-16079,9815,9284,0.0214365694827313,0.0214365694827313
-18703,1861,7871,0.177358977412927,0.177358977412927
-5445,4865,4866,0.0483753395839426,0.0483753395839426
-4124,2246,3888,0.176179418850458,0.176179418850458
-18692,1856,5978,0.157563244482301,0.157563244482301
-5513,4918,1222,0.0334183748575429,0.0334183748575429
-4193,3941,3942,0.10150841538758,0.10150841538758
-18280,6739,6757,0.185196443942793,0.185196443942793
-18287,3986,6762,0.199195011240905,0.199195011240905
-4211,3961,3962,0.203354581445588,0.203354581445588
-18282,6460,6792,0.289344591592559,0.289344591592559
-18709,7654,7506,0.191266971634704,0.191266971634704
-4258,4004,4005,0.0557864946968893,0.0557864946968893
-18293,6900,6901,0.125065642459057,0.125065642459057
-4279,4022,4023,0.136471513645059,0.136471513645059
-18285,6794,6824,0.0676234540262284,0.0676234540262284
-20412,10780,10737,0.00327519593576582,0.00327519593576582
-5639,1165,885,0.138504687840451,0.138504687840451
-18705,4059,9745,0.17218742858343,0.17218742858343
-5680,5036,5037,0.13925145495263,0.13925145495263
-4340,4070,4006,0.0527657969561626,0.0527657969561626
-4341,4006,4071,0.045563339939639,0.045563339939639
-18706,9745,3863,0.0360430655172132,0.0360430655172132
-4363,4087,1214,0.050228703045046,0.050228703045046
-18708,6218,7654,0.273874816557472,0.273874816557472
-14701,5065,986,0.133961657579708,0.133961657579708
-4385,4078,4080,0.499220390775423,0.499220390775423
-17161,5086,5087,0.0305453434226413,0.0305453434226413
-4410,4124,3048,0.142041157035339,0.142041157035339
-18547,10315,7542,0.326789019301198,0.326789019301198
-5780,4917,5106,0.0912724900005868,0.0912724900005868
-4431,4139,2389,0.109327413388579,0.109327413388579
-5754,5082,5083,0.0244848814587712,0.0244848814587712
-18548,7542,5567,0.0788647232749776,0.0788647232749776
-5829,5144,5145,0.0718528722690416,0.0718528722690416
-4478,4170,4171,0.114300734663783,0.114300734663783
-14104,421,3767,0.239382300921688,0.239382300921688
-5849,1966,5160,0.213373795201997,0.213373795201997
-4498,1369,4184,0.105991036166523,0.105991036166523
-17123,3542,42,0.197838013671145,0.197838013671145
-18295,1428,6901,0.00619376962359973,0.00619376962359973
-18296,6901,6968,0.214788257098635,0.214788257098635
-5920,5198,5199,0.0509206897939403,0.0509206897939403
-4576,4176,1777,0.0501165848501884,0.0501165848501884
-20629,10873,10847,0.0359844691550279,0.0359844691550279
-18356,7764,7765,0.203486837058476,0.203486837058476
-18353,7040,3427,0.201724758100166,0.201724758100166
-6017,3447,5269,0.0916999906376171,0.0916999906376171
-4669,4312,4313,0.0844811623232087,0.0844811623232087
-18355,7763,7764,0.18255985476615,0.18255985476615
-20388,10772,10773,0.00806462172146812,0.00806462172146812
-4690,1574,4327,0.172428634063548,0.172428634063548
-14761,7128,660,0.183084210873309,0.183084210873309
-18307,7041,3428,0.200871545358079,0.200871545358079
-4768,2038,4380,0.146902820961905,0.146902820961905
-18357,7765,7253,0.0959812077322034,0.0959812077322034
-17178,5409,5410,0.041431272963648,0.041431272963648
-4841,4434,4435,0.0243817622036277,0.0243817622036277
-19636,10595,10596,0.0236895488952709,0.0236895488952709
-20494,10814,10837,0.00453902687683386,0.00453902687683386
-12316,8640,8559,0.0170391288088959,0.0170391288088959
-4864,4448,4449,0.051463626660104,0.051463626660104
-14105,3767,490,0.17231974049998,0.17231974049998
-18310,7244,7054,0.0289643230302344,0.0289643230302344
-4906,3886,865,0.080856531304005,0.080856531304005
-14762,660,7162,0.177556995744578,0.177556995744578
-14106,490,492,0.200841500024827,0.200841500024827
-6278,5468,5223,0.0507325637005759,0.0507325637005759
-20498,2955,10783,0.00926966063781334,0.00926966063781334
-18511,9529,10302,0.134870017545438,0.134870017545438
-18559,10317,10318,0.0818849597364774,0.0818849597364774
-5006,4551,4552,0.0605833275140723,0.0605833275140723
-20497,10805,2955,0.011923850145444,0.011923850145444
-6365,1258,377,0.0777271141684953,0.0777271141684953
-5032,3218,4567,0.203476554448063,0.203476554448063
-18309,3989,7244,0.103816807067418,0.103816807067418
-6389,5536,5537,0.0941709460297732,0.0941709460297732
-5052,4580,4581,0.0994044886957745,0.0994044886957745
-19827,9253,7642,0.176656738058614,0.176656738058614
-18315,7190,1430,0.126827993445383,0.126827993445383
-18691,2597,1856,0.178902858758576,0.178902858758576
-6529,1038,5638,0.106710156184621,0.106710156184621
-5211,4703,4704,0.0593965930317325,0.0593965930317325
-18320,7455,6063,0.193748278871749,0.193748278871749
-5307,4763,4764,0.0623737801227747,0.0623737801227747
-20402,10771,10761,0.045832556045337,0.045832556045337
-6659,5732,716,0.0227471694550216,0.0227471694550216
-5331,3596,4783,0.0944705655668644,0.0944705655668644
-14107,492,502,0.277229511676695,0.277229511676695
-6732,5783,5784,0.103949862025848,0.103949862025848
-14767,7420,4860,0.190666070334235,0.190666070334235
-20406,8354,10772,0.00730920335045724,0.00730920335045724
-6754,5799,5800,0.0473962648551068,0.0473962648551068
-14769,7430,4858,0.18998910813567,0.18998910813567
-5443,4863,4864,0.0452091651037792,0.0452091651037792
-19834,10654,9725,0.196434640947063,0.196434640947063
-6799,2741,5836,0.0500630331544159,0.0500630331544159
-20523,2708,10752,0.00659207654644855,0.00659207654644855
-18323,7479,7480,0.203575671880267,0.203575671880267
-18329,6073,7593,0.194237102947714,0.194237102947714
-5506,4912,2121,0.0993922299820147,0.0993922299820147
-19837,5204,5602,0.169326060361496,0.169326060361496
-6868,3299,5873,0.0385426751655708,0.0385426751655708
-5529,4929,4930,0.0186787878300106,0.0186787878300106
-5530,4930,4931,0.150638241291928,0.150638241291928
-20519,10815,10845,0.0426977620157165,0.0426977620157165
-6909,5905,5906,0.0925705753401188,0.0925705753401188
-5581,4968,4969,0.19364655602673,0.19364655602673
-20802,10942,606,0.00932539286509621,0.00932539286509621
-20522,10808,2708,0.0062556157491122,0.0062556157491122
-5631,3571,5004,0.140817256140417,0.140817256140417
-18338,2435,7632,0.201752260263955,0.201752260263955
-20016,2696,8044,0.148197142125826,0.148197142125826
-5653,2345,4151,0.175358365382788,0.175358365382788
-18327,1432,7191,0.123062885737589,0.123062885737589
-6998,2684,5970,0.144359466732262,0.144359466732262
-5670,679,5028,0.00422540721209624,0.00422540721209624
-5671,5028,5029,0.199984733552555,0.199984733552555
-20382,10765,10766,0.0345648031474255,0.0345648031474255
-18350,7716,6756,0.141149359906032,0.141149359906032
-5748,5078,5079,0.20268033504505,0.20268033504505
-18163,10259,6036,0.2014076606309,0.2014076606309
-14704,5105,3799,0.199599075644316,0.199599075644316
-18162,2170,10259,0.118558518008842,0.118558518008842
-20019,4453,5501,0.145746885757253,0.145746885757253
-5830,5145,2118,0.0459910302398271,0.0459910302398271
-20020,5501,7075,0.147873409818305,0.147873409818305
-14776,5927,3806,0.151596310173331,0.151596310173331
-5853,4622,5163,0.10255879316328,0.10255879316328
-18343,7662,5247,0.110734380038432,0.110734380038432
-20022,8291,7898,0.145585163841291,0.145585163841291
-7192,6084,6085,0.188916282974339,0.188916282974339
-18345,6874,1684,0.205522453761373,0.205522453761373
-20542,2953,10853,0.0105529318413212,0.0105529318413212
-18348,2429,7700,0.202520445331427,0.202520445331427
-20024,8856,9319,0.148299248554164,0.148299248554164
-7238,4839,1519,0.0519761467059316,0.0519761467059316
-14772,923,5925,0.177924520685585,0.177924520685585
-20544,10831,10809,0.07258379165013,0.07258379165013
-5934,4646,3645,0.198637387669602,0.198637387669602
-20537,10850,10851,0.00393462806086889,0.00393462806086889
-7284,6141,11,0.135513694564746,0.135513694564746
-5958,5230,5231,0.202816769336327,0.202816769336327
-20538,10764,10852,0.00745697116010785,0.00745697116010785
-7311,5071,6157,0.164940273242935,0.164940273242935
-5976,4624,1247,0.13286062727511,0.13286062727511
-5978,4556,2725,0.132159028738313,0.132159028738313
-20539,10852,10833,0.00647861100893927,0.00647861100893927
-7339,6169,6170,0.0619567458929491,0.0619567458929491
-5998,5256,5257,0.103904946256075,0.103904946256075
-19289,10469,10470,0.0657689911002152,0.0657689911002152
-20550,10854,10842,0.00418096419493106,0.00418096419493106
-6016,5268,3447,0.109289564409357,0.109289564409357
-20541,10846,2953,0.0102415664506872,0.0102415664506872
-6042,2870,5284,0.0497761483323909,0.0497761483323909
-20446,10802,10794,0.010877497210246,0.010877497210246
-6066,1342,5306,0.205811743638723,0.205811743638723
-20547,2961,10838,0.0117661269256179,0.0117661269256179
-7483,6261,1188,0.16816674729097,0.16816674729097
-6138,3644,4554,0.0976185559336041,0.0976185559336041
-18364,7802,1660,0.0598129332818693,0.0598129332818693
-7554,6302,1356,0.0804502555219789,0.0804502555219789
-6209,5412,1185,0.167137462035015,0.167137462035015
-6210,1185,5413,0.0233182677092941,0.0233182677092941
-14730,6318,6303,0.0522173167652759,0.0522173167652759
-20234,10715,10714,0.0286157939247338,0.0286157939247338
-20565,1287,10855,0.00858462136960439,0.00858462136960439
-6251,5443,779,0.0160681132894306,0.0160681132894306
-14783,4856,7862,0.182896538603858,0.182896538603858
-6272,5463,5464,0.0498340640254978,0.0498340640254978
-20235,10714,8820,0.0168131405425372,0.0168131405425372
-6293,5477,3890,0.10549800375505,0.10549800375505
-16545,7835,9934,0.137971408959184,0.137971408959184
-6362,351,5522,0.0335008525021526,0.0335008525021526
-16018,9787,9788,0.0995758326234823,0.0995758326234823
-6387,5535,2028,0.107888528337289,0.107888528337289
-20242,10717,10716,0.029516495512001,0.029516495512001
-7774,5212,6424,0.109568567873903,0.109568567873903
-16546,9934,9935,0.139302196645357,0.139302196645357
-20562,10798,10807,0.0058401189840652,0.0058401189840652
-15113,3050,7229,0.0133472139691031,0.0133472139691031
-20245,8372,6959,0.0489264341729089,0.0489264341729089
-11422,8078,8079,0.0484137060021889,0.0484137060021889
-6473,5599,5600,0.108658521887425,0.108658521887425
-15115,7996,7997,0.209391166364433,0.209391166364433
-18367,7754,8093,0.0507390772270922,0.0507390772270922
-20352,10751,9401,0.00837355044160468,0.00837355044160468
-6492,5616,5617,0.0720767157725574,0.0720767157725574
-14721,2221,4871,0.160443069505019,0.160443069505019
-18368,8093,6894,0.0518148786998363,0.0518148786998363
-16020,9789,9788,0.073636854952175,0.073636854952175
-7896,6503,6504,0.201046575537805,0.201046575537805
-16547,9935,3668,0.222625726498778,0.222625726498778
-11416,8000,8034,0.303468507056762,0.303468507056762
-6579,5669,5670,0.150406237761818,0.150406237761818
-20845,10954,10937,0.131662909083966,0.131662909083966
-6604,5693,4324,0.222481680681729,0.222481680681729
-18371,5250,7594,0.0499247461563453,0.0499247461563453
-15222,8101,8102,0.077833708774634,0.077833708774634
-18372,7594,5883,0.083286408265142,0.083286408265142
-6714,5766,2843,0.181402526618843,0.181402526618843
-14742,5935,931,0.176525948040391,0.176525948040391
-20409,8971,8976,0.00824136098890487,0.00824136098890487
-17573,10146,4643,0.00925827675066928,0.00925827675066928
-8175,6672,3101,0.17546713620256,0.17546713620256
-11210,300,106,0.00724031766776508,0.00724031766776508
-8223,6696,951,0.177624298281023,0.177624298281023
-6856,4317,5865,0.0513037576080921,0.0513037576080921
-18335,7611,1689,0.102723820359578,0.102723820359578
-20356,10752,10753,0.178510491347886,0.178510491347886
-6873,5878,5879,0.686284794666677,0.686284794666677
-11609,3416,7035,0.200128365503357,0.200128365503357
-11610,7035,8338,0.189938999172283,0.189938999172283
-6895,5896,4960,0.0956843495121368,0.0956843495121368
-11335,8218,251,0.176906123725318,0.176906123725318
-17668,10162,10161,0.0392525789715303,0.0392525789715303
-8321,6751,5251,0.0499574491010493,0.0499574491010493
-17670,8260,9051,0.230562637224967,0.230562637224967
-8340,6769,5533,0.120999789974565,0.120999789974565
-11366,7971,1892,0.0488719799669425,0.0488719799669425
-6977,4442,5511,0.147695461409276,0.147695461409276
-14750,2214,929,0.185352492811126,0.185352492811126
-7030,4913,5988,0.198333075719104,0.198333075719104
-18693,5978,6025,0.00688297127309608,0.00688297127309608
-11612,3418,742,0.19996057055502,0.19996057055502
-20437,10795,10796,0.0230619881865373,0.0230619881865373
-11948,8496,8497,0.0216014239716138,0.0216014239716138
-7132,1290,6044,0.0502638300231986,0.0502638300231986
-11686,1032,773,0.0128283485920152,0.0128283485920152
-8554,4804,6890,0.135875328970406,0.135875328970406
-11767,2687,8406,0.0738017906986337,0.0738017906986337
-8601,2178,596,0.0528183519637533,0.0528183519637533
-7225,6106,6107,0.101643082422806,0.101643082422806
-11821,8422,8423,0.175711465733647,0.175711465733647
-8624,109,720,0.104166949267626,0.104166949267626
-18552,7705,2988,0.199131268231619,0.199131268231619
-14770,4858,2209,0.16101488662795,0.16101488662795
-7328,6165,6166,0.0995968460919669,0.0995968460919669
-12286,8526,8525,0.0214801658544325,0.0214801658544325
-7376,337,6196,0.0756391181616623,0.0756391181616623
-12217,8592,8593,0.114913209514243,0.114913209514243
-12317,8559,2500,0.0435792910401613,0.0435792910401613
-8839,528,7032,0.050727128416239,0.050727128416239
-7478,6259,1180,0.207751884347626,0.207751884347626
-18554,9429,7706,0.20403157089995,0.20403157089995
-15821,8564,8565,0.0641361466923926,0.0641361466923926
-8860,7045,7046,0.134234542647931,0.134234542647931
-7498,4598,3688,0.240872387579393,0.240872387579393
-7499,3688,6270,0.142331405185985,0.142331405185985
-20649,10880,1676,0.0578550543011222,0.0578550543011222
-12236,8586,1599,0.0967599085697604,0.0967599085697604
-7572,5861,1309,0.178473387298321,0.178473387298321
-18324,7480,7524,0.15130858595047,0.15130858595047
-7598,6323,6324,0.205483069278936,0.205483069278936
-17836,9362,1627,0.0523901213643909,0.0523901213643909
-14759,7101,5464,0.170276074046912,0.170276074046912
-14760,5464,7128,0.178804240685068,0.178804240685068
-7640,6024,3875,0.0993805589791004,0.0993805589791004
-16021,9788,9790,0.320911397883896,0.320911397883896
-9035,7131,7132,0.0496921831493493,0.0496921831493493
-18491,9168,9169,0.133423914370859,0.133423914370859
-17837,1627,5679,0.10292857902181,0.10292857902181
-9059,2896,5632,0.0842038197459281,0.0842038197459281
-20806,7427,10935,0.00559704943884798,0.00559704943884798
-12938,1970,8709,0.0935507240006809,0.0935507240006809
-11439,511,8252,0.25940626826434,0.25940626826434
-7695,5168,6377,0.177825109084943,0.177825109084943
-20708,7442,10913,0.0784445493600802,0.0784445493600802
-9099,6388,7159,0.131345505242465,0.131345505242465
-11441,8256,8255,0.0395721958074786,0.0395721958074786
-19809,5615,9635,0.105426130739244,0.105426130739244
-9145,5720,7186,0.100417695742859,0.100417695742859
-11443,8254,8257,0.03964069530807,0.03964069530807
-7788,6432,6433,0.0533345329573706,0.0533345329573706
-12939,8709,8766,0.0775671350558112,0.0775671350558112
-9187,7207,7208,0.0500116374722849,0.0500116374722849
-7811,838,6446,0.0830965282034823,0.0830965282034823
-7816,6449,2813,0.0739587262737054,0.0739587262737054
-12260,8617,8618,0.00726192949201925,0.00726192949201925
-20803,606,10913,0.0113017508087441,0.0113017508087441
-9235,7240,7241,0.0498075431237363,0.0498075431237363
-7861,6474,6475,0.692905896897531,0.692905896897531
-12942,8804,1331,0.0594619846778877,0.0594619846778877
-12264,8622,8616,0.0863852743591186,0.0863852743591186
-7908,6511,6512,0.107336468131195,0.107336468131195
-20811,10951,7034,0.00453220039269765,0.00453220039269765
-13006,8912,8913,0.031616887141609,0.031616887141609
-7929,4175,6525,0.0337195393803404,0.0337195393803404
-20394,10762,10775,0.00651572160316994,0.00651572160316994
-20400,3591,10771,0.0086403574168429,0.0086403574168429
-8000,6560,6561,0.05117078549911,0.05117078549911
-18914,10389,10392,0.00619620469246147,0.00619620469246147
-8024,6580,6581,0.135411748293681,0.135411748293681
-8047,5711,6593,0.0649690182450408,0.0649690182450408
-20509,10841,638,0.00591881170263726,0.00591881170263726
-12270,8627,8518,0.0752716608672627,0.0752716608672627
-15918,9104,9746,0.00764030702792677,0.00764030702792677
-8143,6654,1583,0.150966803397046,0.150966803397046
-18477,2411,5542,0.101313827089111,0.101313827089111
-15876,8978,9002,0.0205305754568531,0.0205305754568531
-8295,6735,6736,0.0734967400485445,0.0734967400485445
-12273,8629,8517,0.0368940227401467,0.0368940227401467
-8322,5251,6752,0.0513511942917184,0.0513511942917184
-17214,3774,8403,0.176505403414048,0.176505403414048
-11789,4445,6564,0.147259159007996,0.147259159007996
-8396,516,6411,0.245438474982929,0.245438474982929
-19810,9635,9643,0.17762409301406,0.17762409301406
-19811,9643,7122,0.176833292049994,0.176833292049994
-9834,7540,7541,0.0505839701248518,0.0505839701248518
-8443,1465,5441,0.103147915206822,0.103147915206822
-13470,9094,9095,0.186249123099868,0.186249123099868
-9909,7585,3060,0.206196737198557,0.206196737198557
-8516,6868,4142,0.0958725861464383,0.0958725861464383
-18481,9120,6391,0.130087180946324,0.130087180946324
-8559,1248,4557,0.13273864991069,0.13273864991069
-18488,9153,9154,0.0316379611455697,0.0316379611455697
-10040,7380,7647,0.073513516250253,0.073513516250253
-8638,6926,6927,0.0519431626477688,0.0519431626477688
-8640,6928,2302,0.107037203280329,0.107037203280329
-18492,9169,9170,0.136492159060533,0.136492159060533
-8683,1000,4222,0.0557449369548998,0.0557449369548998
-15905,8603,8604,0.0748338508215397,0.0748338508215397
-13757,8439,9181,0.0861617636196398,0.0861617636196398
-10162,2158,7701,0.118289099292956,0.118289099292956
-8752,6982,6983,0.20266520881126,0.20266520881126
-12326,8650,8651,0.106050821827968,0.106050821827968
-18298,6995,6996,0.187375849458261,0.187375849458261
-14103,418,421,0.212232135618177,0.212232135618177
-11436,8255,7984,0.498708139076575,0.498708139076575
-18497,9201,9212,0.134547599555241,0.134547599555241
-19881,2617,10410,0.177201589274352,0.177201589274352
-8821,13,7020,0.00925156011318802,0.00925156011318802
-14676,5941,3794,0.153141383772443,0.153141383772443
-8846,6085,742,0.0513498235273795,0.0513498235273795
-19287,9967,10468,0.111280897910296,0.111280897910296
-8898,267,7062,0.0377688740912094,0.0377688740912094
-20847,10946,10950,0.100177888201708,0.100177888201708
-18612,1850,9261,0.181237135841786,0.181237135841786
-18361,7374,7802,0.0447005696877022,0.0447005696877022
-8973,7099,900,0.0469763030340631,0.0469763030340631
-14047,4836,389,0.0490717904305928,0.0490717904305928
-12310,8644,8645,0.447909393812679,0.447909393812679
-8996,7110,7111,0.00729890302499032,0.00729890302499032
-8997,7111,7112,0.0821157489631964,0.0821157489631964
-19296,10470,10471,0.0561834077462884,0.0561834077462884
-9018,7120,3944,0.0625799505809278,0.0625799505809278
-20228,8758,8818,0.0478043651923457,0.0478043651923457
-14140,9284,9285,0.260183964007922,0.260183964007922
-10472,1612,7829,0.00870018444151776,0.00870018444151776
-9067,7146,1144,0.138617590256283,0.138617590256283
-9068,1144,873,0.140306927162159,0.140306927162159
-16081,9816,366,0.168828958006928,0.168828958006928
-19882,10410,7867,0.175655958248639,0.175655958248639
-9135,5185,5653,0.105406920017136,0.105406920017136
-19292,10469,10471,0.0669585268555214,0.0669585268555214
-14789,9417,9415,0.0546470920616291,0.0546470920616291
-14678,9330,9301,0.189092694124095,0.189092694124095
-16087,9493,9819,0.0602377998698223,0.0602377998698223
-9262,5135,5150,0.0243532262877801,0.0243532262877801
-14663,9300,6543,0.20364721866244,0.20364721866244
-9311,4256,7276,0.202152573812647,0.202152573812647
-20396,10777,10758,0.00300729649615889,0.00300729649615889
-16088,9819,9820,0.154328326827327,0.154328326827327
-9435,7345,7346,0.0190810494123846,0.0190810494123846
-18624,6136,9460,0.0524172265643075,0.0524172265643075
-20568,10857,10787,0.0362929048752591,0.0362929048752591
-18625,9460,2258,0.0501132934741927,0.0501132934741927
-15897,9441,9042,0.0240046794304529,0.0240046794304529
-16387,9458,9459,0.0276860712412084,0.0276860712412084
-11214,8163,391,0.128403364715461,0.128403364715461
-9803,6610,7523,0.196894261944695,0.196894261944695
-15456,9612,9605,0.0879146885908635,0.0879146885908635
-18630,5862,9484,0.00360275623818702,0.00360275623818702
-11351,4798,8227,0.0561921807720747,0.0561921807720747
-9936,4537,7602,0.2557209782077,0.2557209782077
-11457,8266,8267,0.4367852597313,0.4367852597313
-11491,6185,8281,0.106123839405449,0.106123839405449
-11244,8185,8162,0.0231522248365289,0.0231522248365289
-18634,4045,7865,0.17751242949901,0.17751242949901
-18698,5868,1320,0.176912291429695,0.176912291429695
-10141,6347,3032,0.0935494731718596,0.0935494731718596
-11771,8406,4385,0.0534654755495647,0.0534654755495647
-19883,7867,3716,0.104069204828323,0.104069204828323
-11834,8430,8431,0.087830432319228,0.087830432319228
-10212,7733,7734,0.0513578872611552,0.0513578872611552
-19884,3716,7405,0.200874185823139,0.200874185823139
-11852,8443,8444,0.0120541689820552,0.0120541689820552
-10235,2742,7741,0.0499109655825577,0.0499109655825577
-19913,10244,6599,0.17675930412674,0.17675930412674
-15270,8458,8459,0.0175633548114394,0.0175633548114394
-10253,1700,7749,0.00587012913148048,0.00587012913148048
-20002,10691,10692,0.0226226455892357,0.0226226455892357
-11911,8472,8473,0.00378078844043477,0.00378078844043477
-10274,3194,6110,0.20159656533977,0.20159656533977
-11953,8041,6568,0.145503350739709,0.145503350739709
-10298,6399,3614,0.133348580117153,0.133348580117153
-11992,5503,7077,0.147510556806948,0.147510556806948
-19496,10524,7457,0.0831219334199701,0.0831219334199701
-10398,7619,7807,0.0285985320629965,0.0285985320629965
-15922,1816,9751,0.110608853519784,0.110608853519784
-11917,8476,1302,0.0550753650708828,0.0550753650708828
-20647,10880,10034,0.0300539000602635,0.0300539000602635
-10474,6225,7658,0.277054905467397,0.277054905467397
-11996,6576,4457,0.148175074796056,0.148175074796056
-12215,8590,8591,0.0896761056675667,0.0896761056675667
-12240,1246,8611,0.0161729384224601,0.0161729384224601
-10602,7875,741,0.0900908109241702,0.0900908109241702
-16451,9903,9904,0.00638068663878895,0.00638068663878895
-12161,8568,8315,0.127606752812743,0.127606752812743
-16022,9791,9792,0.180221045869865,0.180221045869865
-12376,7853,4674,0.113693675785271,0.113693675785271
-12377,4674,8679,0.101029871301971,0.101029871301971
-19472,10516,7476,0.0110661304777454,0.0110661304777454
-16024,363,9793,0.0338194849383131,0.0338194849383131
-12518,5916,3788,0.153505057727295,0.153505057727295
-10815,3667,7993,0.06101955432425,0.06101955432425
-17063,2247,4880,0.17655557289719,0.17655557289719
-18644,1374,1318,0.176938793518256,0.176938793518256
-20668,1127,10890,0.00915451265400173,0.00915451265400173
-15804,1934,9711,0.166526724215667,0.166526724215667
-15805,9711,9506,0.0388070303408929,0.0388070303408929
-15809,9713,7112,0.0121509406944637,0.0121509406944637
-17109,4052,8135,0.162752784015343,0.162752784015343
-12609,7223,8772,0.0487324288024552,0.0487324288024552
-10935,6177,3306,0.106502895543558,0.106502895543558
-10936,3306,8049,0.0536769065211004,0.0536769065211004
-16203,7727,9845,1.20908168114497,1.20908168114497
-10955,8058,8059,0.079137340429329,0.079137340429329
-16612,9327,9942,0.147120185144049,0.147120185144049
-17066,5478,9963,0.164315977100666,0.164315977100666
-17067,9963,10069,0.0117569437064922,0.0117569437064922
-12661,6331,6548,0.107973460603441,0.107973460603441
-12679,3638,8797,0.0132415259966435,0.0132415259966435
-16962,10044,10040,0.011239967337662,0.011239967337662
-12708,6861,5165,0.179825321478717,0.179825321478717
-11020,1485,143,0.200555984903635,0.200555984903635
-11021,143,8087,0.297571119969413,0.297571119969413
-17011,9424,10052,0.0266755832635793,0.0266755832635793
-12731,8820,7196,0.0815503609966838,0.0815503609966838
-17038,10062,9210,0.00792923279445615,0.00792923279445615
-11062,3436,7764,0.0490279707439403,0.0490279707439403
-16025,9793,9792,0.141538634561804,0.141538634561804
-12773,8830,4166,0.0867031847297172,0.0867031847297172
-16209,6627,5825,0.203615270524375,0.203615270524375
-16207,7210,6624,0.114867174949551,0.114867174949551
-16210,5825,7730,0.194825716270604,0.194825716270604
-13015,8917,8918,0.0110325419879542,0.0110325419879542
-13019,8923,8924,0.0459300988872919,0.0459300988872919
-11247,8187,5274,0.160867422208887,0.160867422208887
-19514,10535,10538,0.0037920381346196,0.0037920381346196
-13024,6190,280,0.0860979970314494,0.0860979970314494
-11276,8174,8198,0.367460344283523,0.367460344283523
-18156,4088,6034,0.199039273787356,0.199039273787356
-13094,1749,8958,0.0802223716795591,0.0802223716795591
-11325,5154,2237,0.0295446835402977,0.0295446835402977
-18719,4048,7409,0.17730031135953,0.17730031135953
-13118,8967,1742,0.0145216501585431,0.0145216501585431
-18386,8971,8972,0.00871865668631088,0.00871865668631088
-13072,8913,8952,0.0749880743663527,0.0749880743663527
-17640,230,8241,0.144923812025645,0.144923812025645
-13560,9033,578,0.049912950240993,0.049912950240993
-11377,8237,4850,0.0778446846789704,0.0778446846789704
-18720,7409,5864,0.175843787012913,0.175843787012913
-11410,2864,7808,0.201887571458386,0.201887571458386
-11526,8300,809,0.0681077085457417,0.0681077085457417
-18653,7653,10176,0.157020875630107,0.157020875630107
-13241,7916,4418,0.196768399976565,0.196768399976565
-11566,7031,7379,0.100426092571383,0.100426092571383
-11568,7379,1594,0.158671241159827,0.158671241159827
-17820,10186,10187,0.0184687744290435,0.0184687744290435
-13263,4963,6826,0.0748897830948627,0.0748897830948627
-11599,7782,8332,0.0501574795892601,0.0501574795892601
-11600,8332,1125,0.0495676895406725,0.0495676895406725
-11644,4658,8348,0.011012895464713,0.011012895464713
-18918,10397,10398,0.0105062475981655,0.0105062475981655
-17913,6562,4748,0.176744370871331,0.176744370871331
-11715,8369,8370,0.101679025311835,0.101679025311835
-11747,8387,8388,0.0596706311453888,0.0596706311453888
-11775,8121,2683,0.119321215072029,0.119321215072029
-13389,8267,9048,0.0706232625221708,0.0706232625221708
-11997,4457,5505,0.144543593212435,0.144543593212435
-19642,10599,10600,0.00461558236551731,0.00461558236551731
-12058,153,3776,0.311946607437041,0.311946607437041
-13750,6895,9177,0.1538081352177,0.1538081352177
-12164,4818,7560,0.10615031357403,0.10615031357403
-15934,6257,9756,0.181030993335028,0.181030993335028
-18568,10324,10321,0.144976741381278,0.144976741381278
-20260,6471,10699,0.00720326005355295,0.00720326005355295
-12382,440,8680,0.0360714923590191,0.0360714923590191
-13919,482,483,0.00751372921095178,0.00751372921095178
-20414,3586,10773,0.00983155874827391,0.00983155874827391
-12480,8712,8713,0.0991407463070431,0.0991407463070431
-15455,9611,9612,0.086225314993736,0.086225314993736
-20417,8993,10775,0.0123681069665026,0.0123681069665026
-19623,10508,10591,0.0688242418092362,0.0688242418092362
-14087,6816,2943,0.102402811156445,0.102402811156445
-12571,8755,8756,0.0991408859101036,0.0991408859101036
-18658,9831,7643,0.17655772025733,0.17655772025733
-16026,9792,9793,0.141538634561804,0.141538634561804
-14200,5104,8831,0.0500819471783367,0.0500819471783367
-16028,9794,9795,0.0352990859554557,0.0352990859554557
-12690,8805,8806,0.0205962859747724,0.0205962859747724
-14297,1952,9317,0.0799385706307454,0.0799385706307454
-12747,5350,4220,0.0793424677909429,0.0793424677909429
-16029,9796,9797,0.0144472492683917,0.0144472492683917
-20288,6472,10687,0.0642398609947935,0.0642398609947935
-14311,8859,8501,0.0340924315859818,0.0340924315859818
-14330,602,8973,0.0577848630730138,0.0577848630730138
-16030,9797,9798,0.0484390320890552,0.0484390320890552
-16031,9798,9799,0.00754569346896809,0.00754569346896809
-14334,2420,8925,0.0583291679544673,0.0583291679544673
-12784,8834,5470,0.171286135301765,0.171286135301765
-12785,5470,8835,0.178924287864237,0.178924287864237
-16033,9799,9800,0.00706845342179734,0.00706845342179734
-14357,513,9331,0.0549879463430077,0.0549879463430077
-12804,3763,2560,0.0898130023336766,0.0898130023336766
-12820,8849,8848,0.188203677867594,0.188203677867594
-16035,9800,6871,0.0378217549395311,0.0378217549395311
-20159,6155,10163,0.0614761289722609,0.0614761289722609
-12915,967,5281,0.138474892352542,0.138474892352542
-16687,9988,8314,0.0384286340006129,0.0384286340006129
-12991,8908,306,0.0182421240862306,0.0182421240862306
-13032,8926,8928,0.185901221322606,0.185901221322606
-16689,1824,9989,0.0121513664645164,0.0121513664645164
-13107,8963,8964,0.0484369444463125,0.0484369444463125
-19516,10539,10536,0.00249155177103479,0.00249155177103479
-19470,10514,10515,0.0196261730033966,0.0196261730033966
-13156,8988,8989,0.00631722030409862,0.00631722030409862
-19649,10600,10601,0.0174353644977756,0.0174353644977756
-18928,10405,10396,0.00112670264684339,0.00112670264684339
-18410,10288,8327,0.00700530123739539,0.00700530123739539
-14672,9414,4877,0.190941051800692,0.190941051800692
-14673,4877,2227,0.162460717202061,0.162460717202061
-13231,4409,9009,0.223227137223831,0.223227137223831
-237,31,134,0.108163538194537,0.108163538194537
-14831,8322,5668,0.0494625040984646,0.0494625040984646
-18415,8376,3409,0.101754880454598,0.101754880454598
-15848,9733,9731,0.0169747446876837,0.0169747446876837
-13335,3971,7017,0.0998321056196178,0.0998321056196178
-18626,2258,9475,0.0453120140623152,0.0453120140623152
-13471,9095,9092,0.294331677800491,0.294331677800491
-13512,7797,9114,0.0647363210214912,0.0647363210214912
-15901,9499,9500,0.157325995690783,0.157325995690783
-13697,9167,7423,0.127782150083045,0.127782150083045
-20289,10687,10697,0.00276887237539732,0.00276887237539732
-13718,8097,9171,0.00881240787098174,0.00881240787098174
-13751,9178,9130,0.0262505906254233,0.0262505906254233
-15391,9259,9571,0.107861175514815,0.107861175514815
-15783,2106,9596,0.166115711722291,0.166115711722291
-13852,1774,4412,0.0465225826542141,0.0465225826542141
-20380,10763,10764,0.00723047037301379,0.00723047037301379
-15452,9609,9598,0.128875611115748,0.128875611115748
-14144,9287,4651,0.182099578171645,0.182099578171645
-15807,9712,7111,0.0179279183487844,0.0179279183487844
-14230,8860,4113,0.0915086936553939,0.0915086936553939
-15819,9705,8564,0.0112418070831931,0.0112418070831931
-14250,8157,7606,0.0899264482990573,0.0899264482990573
-19499,10526,10527,0.0418767441965843,0.0418767441965843
-16078,9814,9815,0.177867255933272,0.177867255933272
-14354,5520,6454,0.134959237439496,0.134959237439496
-16224,5835,9851,0.203722282298932,0.203722282298932
-14425,1233,6137,0.0491477874140339,0.0491477874140339
-16468,9914,9902,0.117059110726511,0.117059110726511
-16500,8890,8891,0.0884309215437497,0.0884309215437497
-16591,9948,8492,0.14561270804365,0.14561270804365
-16470,9915,3282,0.193717589764618,0.193717589764618
-14541,6915,9375,0.0102720812466755,0.0102720812466755
-16501,8891,3167,0.0148460110144783,0.0148460110144783
-16593,9949,9950,0.145366288858291,0.145366288858291
-14609,8990,8994,0.00979628795431279,0.00979628795431279
-14794,3335,7882,0.0961603685796077,0.0961603685796077
-17101,332,10014,0.240821045601335,0.240821045601335
-14816,9424,9425,0.0673114946358147,0.0673114946358147
-17065,9474,5478,0.175247470145414,0.175247470145414
-15103,3050,9489,0.102745543982247,0.102745543982247
-16898,8714,8743,0.201991786328297,0.201991786328297
-16402,9880,9878,0.04752967411177,0.04752967411177
-16959,10041,10042,0.0119234352124219,0.0119234352124219
-16556,9939,2889,0.0528287697048915,0.0528287697048915
-18646,5867,7412,0.177003576876814,0.177003576876814
-16623,9957,9958,0.00927766896119108,0.00927766896119108
-17017,10056,10054,0.00431206144532878,0.00431206144532878
-16635,9967,9937,0.0755376260933099,0.0755376260933099
-16636,9937,9968,0.0848568890148885,0.0848568890148885
-17507,8389,10114,0.0670519033214907,0.0670519033214907
-17069,675,9465,0.179146976203574,0.179146976203574
-17040,8988,10063,0.00586346085648923,0.00586346085648923
-18726,6207,7644,0.18227085937915,0.18227085937915
-18724,4060,7415,0.175525264809921,0.175525264809921
-16759,10010,55,0.0502605990705626,0.0502605990705626
-17565,10138,8539,0.0573375717149566,0.0573375717149566
-17283,8717,8746,0.200951019692623,0.200951019692623
-17285,76,3515,0.20373476556842,0.20373476556842
-17286,3515,4257,0.200873634983474,0.200873634983474
-17288,10023,5839,0.200541247802215,0.200541247802215
-18744,6227,5190,0.106449102002429,0.106449102002429
-17655,10140,480,0.0210901662616695,0.0210901662616695
-17657,8540,9827,0.194565529373187,0.194565529373187
-17427,10105,10106,0.0219929458534896,0.0219929458534896
-17857,10200,10197,0.0144828525731025,0.0144828525731025
-18236,7037,3424,0.201298115256081,0.201298115256081
-17786,8497,9214,0.0149001836759509,0.0149001836759509
-18667,5188,2601,0.176856921267491,0.176856921267491
-15257,8538,9547,0.0461864635130014,0.0461864635130014
-15834,9727,4582,0.339362052888466,0.339362052888466
-18239,6764,3988,0.20124356936137,0.20124356936137
-17648,223,227,0.245258634538467,0.245258634538467
-19708,10627,10621,0.090662464616454,0.090662464616454
-17961,10234,10235,0.0087318555012696,0.0087318555012696
-19710,10623,10628,0.0762458230270849,0.0762458230270849
-17727,3328,7879,0.104097845117031,0.104097845117031
-18725,7415,10336,0.0555461867275064,0.0555461867275064
-17748,10172,8285,0.147249823900369,0.147249823900369
-19600,10582,10478,0.00442384590255706,0.00442384590255706
-16294,2409,2439,0.0170153678743566,0.0170153678743566
-18663,2592,5184,0.178895247307371,0.178895247307371
-15835,4582,8370,0.135357878279395,0.135357878279395
-17987,10240,7225,0.133765909115813,0.133765909115813
-18776,10123,3737,0.13151506607382,0.13151506607382
-19243,10420,8480,0.0202782525837911,0.0202782525837911
-18831,10359,10360,0.0341232753962164,0.0341232753962164
-19553,6857,10560,0.00726201622420357,0.00726201622420357
-19940,9641,6649,0.164927985335569,0.164927985335569
-18941,4644,1269,0.146851000824624,0.146851000824624
-19118,10431,8430,0.136066207456442,0.136066207456442
-19278,10421,6707,0.0993066662474356,0.0993066662474356
-15836,8370,5297,0.134414346058358,0.134414346058358
-19047,901,9486,0.27949052314451,0.27949052314451
-19612,10586,10499,0.00658715235564877,0.00658715235564877
-15838,9728,7437,0.0439886907558265,0.0439886907558265
-19065,10422,5495,0.202007910819525,0.202007910819525
-15840,9729,9702,0.0777181684296862,0.0777181684296862
-15841,9702,9730,0.0351380099433058,0.0351380099433058
-19273,10425,10173,0.013664079145809,0.013664079145809
-19160,10429,10050,0.0518274489533285,0.0518274489533285
-20574,10861,10862,0.011368530817607,0.011368530817607
-19554,10560,10548,0.0725121719316359,0.0725121719316359
-19461,10477,10478,0.0230516224965269,0.0230516224965269
-19438,10491,6859,0.0113764020129076,0.0113764020129076
-19277,8487,10421,0.0474605500221532,0.0474605500221532
-19226,8479,10451,0.0120282782230604,0.0120282782230604
-19482,10486,10487,0.00666482250083992,0.00666482250083992
-19412,1903,7239,0.197394669243537,0.197394669243537
-19323,916,5917,0.178370202088171,0.178370202088171
-19329,10473,9894,0.0172442514416892,0.0172442514416892
-19662,10608,10609,0.151226661870126,0.151226661870126
-19357,3170,9949,0.0476976092634506,0.0476976092634506
-19703,10622,10623,0.11468932159706,0.11468932159706
-19379,9194,4397,0.102701543160846,0.102701543160846
-19846,10657,10658,0.207612047714745,0.207612047714745
-19735,10641,10642,0.0869223005082275,0.0869223005082275
-423,422,423,0.0170753331475834,0.0170753331475834
-18892,3649,3275,0.147518961348099,0.147518961348099
-20076,6318,8004,0.0509194903724274,0.0509194903724274
-20104,8546,2065,0.048454988097841,0.048454988097841
-20204,9321,10178,0.0841675532676054,0.0841675532676054
-20205,10178,8401,0.0611444527276629,0.0611444527276629
-259,266,267,0.0502803318432383,0.0502803318432383
-14829,6148,4022,0.133340280271954,0.133340280271954
-20293,10704,10700,0.011586826540776,0.011586826540776
-14835,7029,7396,0.0697085759052968,0.0697085759052968
-20259,10688,6471,0.00765068827927408,0.00765068827927408
-17971,10234,10239,0.0311817416438077,0.0311817416438077
-20294,10700,10709,0.0186270421112036,0.0186270421112036
-14868,8305,8308,0.0233992723150567,0.0233992723150567
-421,420,421,0.0887343803029098,0.0887343803029098
-424,254,424,0.214565868461505,0.214565868461505
-425,424,425,0.179345861037356,0.179345861037356
-18900,10380,10379,0.00404144992313864,0.00404144992313864
-312,320,321,0.234451594909332,0.234451594909332
-14897,6102,8202,0.215105101107824,0.215105101107824
-19648,10603,10600,0.0301818413703728,0.0301818413703728
-176,185,186,0.0998871295042773,0.0998871295042773
-20301,9381,10729,0.0209062182463086,0.0209062182463086
-196,205,208,0.198149371104724,0.198149371104724
-16280,9869,4511,0.0441265369006206,0.0441265369006206
-15850,9734,5596,0.0497405541513423,0.0497405541513423
-19563,7475,10566,0.00626126200522767,0.00626126200522767
-248,255,256,0.148914456277168,0.148914456277168
-14938,8158,7604,0.0947062136756459,0.0947062136756459
-305,313,314,0.0701186694040595,0.0701186694040595
-14691,3129,941,0.177390618833456,0.177390618833456
-371,263,372,0.159425481094297,0.159425481094297
-372,262,373,0.154271040601459,0.154271040601459
-373,374,375,0.0498842542371797,0.0498842542371797
-20302,6466,9378,0.155873782837014,0.155873782837014
-315,323,324,0.151711567725454,0.151711567725454
-554,548,549,0.0392699857827163,0.0392699857827163
-14993,7973,7142,0.0462138706300854,0.0462138706300854
-17218,6114,3199,0.202944002497817,0.202944002497817
-317,325,326,0.0648164274191724,0.0648164274191724
-17027,3490,3584,0.0598495371899439,0.0598495371899439
-652,642,643,0.0146721427737165,0.0146721427737165
-18423,8361,8333,0.20323919891824,0.20323919891824
-15011,9469,459,0.0480419410466021,0.0480419410466021
-15012,459,7107,0.043866666346984,0.043866666346984
-11803,8415,8416,0.145780714117446,0.145780714117446
-18731,8066,10337,0.199884513966678,0.199884513966678
-17082,4467,2789,0.134890565512634,0.134890565512634
-788,793,794,0.093857943582342,0.093857943582342
-15029,7883,3337,0.0968744267307773,0.0968744267307773
-18907,10384,10385,0.0177708173335528,0.0177708173335528
-11693,868,895,0.0109449511220029,0.0109449511220029
-16597,8570,5785,0.145695604703312,0.145695604703312
-17133,4238,3543,0.202299079539728,0.202299079539728
-18439,7914,2971,0.147770970542825,0.147770970542825
-16408,9882,9889,0.0253610023428754,0.0253610023428754
-16601,9952,7558,0.0955122170701592,0.0955122170701592
-15050,6016,979,0.0500664854607423,0.0500664854607423
-16409,9889,9879,0.0208518700779087,0.0208518700779087
-995,753,1009,0.150380388134057,0.150380388134057
-15070,9479,610,0.10571035032404,0.10571035032404
-16411,9459,9889,0.012002862934972,0.012002862934972
-1016,1028,1029,0.0655213058855568,0.0655213058855568
-15964,4362,1443,0.198880292667991,0.198880292667991
-16695,9599,9597,0.0527492023482324,0.0527492023482324
-19585,10576,7471,0.00669407122815783,0.00669407122815783
-1119,1135,1136,0.187278154980764,0.187278154980764
-15144,9498,6689,0.0114561417292809,0.0114561417292809
-15795,2323,2324,0.0158381890637799,0.0158381890637799
-20623,2706,10873,0.00650373799697247,0.00650373799697247
-1164,558,1182,0.0726820398635713,0.0726820398635713
-15984,7372,5328,0.126515384088506,0.126515384088506
-16002,9775,6870,0.0380746194857137,0.0380746194857137
-11807,8419,8395,0.147975384561768,0.147975384561768
-16009,9779,9780,0.0100019925159617,0.0100019925159617
-331,207,332,0.116329690490202,0.116329690490202
-20314,10735,10736,0.00660332250129021,0.00660332250129021
-1412,1265,1438,0.0988256135069692,0.0988256135069692
-15147,9501,1753,0.946728932771196,0.946728932771196
-542,536,537,0.223575651807191,0.223575651807191
-1437,1457,1458,0.00733898986406934,0.00733898986406934
-15845,9731,9732,0.0664836940914448,0.0664836940914448
-15172,9512,9513,0.0495248806719176,0.0495248806719176
-15173,9513,9514,0.0500036838355924,0.0500036838355924
-16841,10021,9876,0.0316463232135525,0.0316463232135525
-12011,7081,2030,0.145136996076302,0.145136996076302
-12961,1633,1631,0.0197483532588124,0.0197483532588124
-16037,9801,9802,0.187730927470077,0.187730927470077
-1680,1705,1706,0.200641448140145,0.200641448140145
-15255,9539,9533,0.0958097111651336,0.0958097111651336
-16278,9869,3639,0.110423900704732,0.110423900704732
-1701,1648,1723,0.062496099688971,0.062496099688971
-16118,8309,427,0.26882010834223,0.26882010834223
-250,257,258,0.156601202821138,0.156601202821138
-1726,1744,1745,1.09817431556355,1.09817431556355
-16141,9831,7016,0.0255913598249866,0.0255913598249866
-16142,7016,7028,0.027160195994677,0.027160195994677
-251,259,260,0.154968238345174,0.154968238345174
-1778,1796,1797,0.0510193327806952,0.0510193327806952
-15256,9533,9546,0.0701631467931239,0.0701631467931239
-4282,4025,4026,0.0836518662560613,0.0836518662560613
-4283,4026,2975,0.0536630317560949,0.0536630317560949
-252,261,262,0.0449524282619667,0.0449524282619667
-17948,10228,8780,0.031808150523084,0.031808150523084
-1803,1816,1817,0.0829077522721667,0.0829077522721667
-4294,2858,4032,0.190837980669502,0.190837980669502
-4296,4033,4034,0.0984313521955559,0.0984313521955559
-4297,4034,4035,0.124316100856361,0.124316100856361
-4299,1488,135,0.200939910778157,0.200939910778157
-4300,135,1703,0.200530915425065,0.200530915425065
-253,262,259,0.0587496721634218,0.0587496721634218
-1830,1846,1847,0.0521892409260155,0.0521892409260155
-4310,4043,1394,0.105949182025439,0.105949182025439
-4311,1394,4044,0.0525758001653233,0.0525758001653233
-4312,4044,4045,0.00275409212275412,0.00275409212275412
-4313,4045,4046,0.048684142933598,0.048684142933598
-4314,4046,4048,0.0522538202962548,0.0522538202962548
-11581,1889,1890,0.200726535096683,0.200726535096683
-254,259,263,0.0633181950748288,0.0633181950748288
-1901,1087,1914,0.0231926567105046,0.0231926567105046
-4323,4055,4056,0.0506868932206778,0.0506868932206778
-4324,4056,4057,0.0525415825536361,0.0525415825536361
-4325,4057,1106,0.049505238452812,0.049505238452812
-4326,1106,4058,0.103487473030962,0.103487473030962
-255,263,264,0.0528764032574804,0.0528764032574804
-1921,1933,1934,0.0492173865000396,0.0492173865000396
-1929,1942,1943,0.119118027307007,0.119118027307007
-4337,4067,4068,0.0478289627129219,0.0478289627129219
-4338,4068,4069,0.0505441496304245,0.0505441496304245
-4339,4069,4070,0.0498130318292156,0.0498130318292156
-4342,4071,4072,0.0561534117303384,0.0561534117303384
-4343,4072,4073,0.0484769480819301,0.0484769480819301
-18384,8960,8961,0.0519015690499355,0.0519015690499355
-544,538,539,0.0154777376492066,0.0154777376492066
-2042,2050,2051,0.199194779708592,0.199194779708592
-12337,8654,8655,0.0104809427005404,0.0104809427005404
-4355,3965,4081,0.411489005127648,0.411489005127648
-4356,4081,4082,0.106344190536588,0.106344190536588
-4358,4083,1074,0.0829286899836406,0.0829286899836406
-4359,1074,2497,0.0840300949352524,0.0840300949352524
-16773,3182,3277,0.192234323904948,0.192234323904948
-2067,2069,2070,0.202510221820354,0.202510221820354
-19432,8707,10110,0.0968673163006813,0.0968673163006813
-4370,4092,4093,0.0521723369054183,0.0521723369054183
-4373,4095,4096,0.0511584997280867,0.0511584997280867
-4374,4096,4097,0.0510055304226098,0.0510055304226098
-14753,6934,5930,0.0358835820845479,0.0358835820845479
-545,539,540,0.260599478311813,0.260599478311813
-2113,2114,2115,0.0866449228578761,0.0866449228578761
-12341,2501,8642,0.0589286767766051,0.0589286767766051
-4383,4104,2729,0.0487767884709024,0.0487767884709024
-4387,748,1566,0.142516569011717,0.142516569011717
-16443,9900,9901,0.201666693845683,0.201666693845683
-546,540,541,0.0326517480806501,0.0326517480806501
-547,541,542,0.0254047336234174,0.0254047336234174
-2158,2156,2157,0.218243127550759,0.218243127550759
-2160,2158,2159,0.0821511858388999,0.0821511858388999
-16173,4250,9840,0.39197341800201,0.39197341800201
-19464,10508,10509,0.0204161788330557,0.0204161788330557
-18178,5791,6050,0.202074681821779,0.202074681821779
-20702,10891,10902,0.0170035110425561,0.0170035110425561
-16216,8620,7903,0.142599898878985,0.142599898878985
-11816,2201,2202,0.15535054028393,0.15535054028393
-17089,9940,8134,0.138649146182337,0.138649146182337
-17090,8134,3689,0.141996254884573,0.141996254884573
-2222,2222,2223,0.0488100805647676,0.0488100805647676
-2223,2223,2224,0.0512642786009998,0.0512642786009998
-14639,2243,2244,0.0354564943031107,0.0354564943031107
-17091,3689,4597,0.241148863142693,0.241148863142693
-2264,2264,2265,0.176035436319457,0.176035436319457
-14641,2244,2272,0.0187003459565438,0.0187003459565438
-16312,2722,2929,0.0126176772334624,0.0126176772334624
-14127,419,417,0.0606641044076811,0.0606641044076811
-2285,2284,2285,0.184338950183701,0.184338950183701
-17024,10059,6431,0.0170040072643452,0.0170040072643452
-20326,10744,10738,0.00650370546328925,0.00650370546328925
-2307,2304,1995,0.0793159537973265,0.0793159537973265
-16363,7010,2769,0.112453696268037,0.112453696268037
-16364,2769,3365,0.103853901930967,0.103853901930967
-20334,2967,10745,0.0137335338280324,0.0137335338280324
-2375,2363,964,0.101155075878388,0.101155075878388
-16463,9886,1081,0.198408324686945,0.198408324686945
-16466,9913,9912,0.00925208668760351,0.00925208668760351
-17365,10091,3085,0.200980490545583,0.200980490545583
-17304,4258,8744,0.201266280518922,0.201266280518922
-2443,2434,2435,0.0498096064689081,0.0498096064689081
-18192,6053,4068,0.142529657997643,0.142529657997643
-16717,5546,10002,2.41636756690016,2.41636756690016
-14694,4875,4946,0.19209064576365,0.19209064576365
-2465,1228,2455,0.0986019921641189,0.0986019921641189
-17232,243,244,0.123936016070967,0.123936016070967
-17233,244,245,0.0423914167747626,0.0423914167747626
-17234,245,30,0.0421885133223055,0.0421885133223055
-17235,30,31,0.0623462807475453,0.0623462807475453
-20321,10740,10741,0.00961494122957245,0.00961494122957245
-20520,10845,10841,0.0515194041185215,0.0515194041185215
-19715,10630,10631,0.0208944523636977,0.0208944523636977
-14699,4164,4773,0.260608636385053,0.260608636385053
-2587,2559,2560,0.109781786773584,0.109781786773584
-18391,7038,3425,0.202488499072253,0.202488499072253
-18395,2554,3861,0.207477450927098,0.207477450927098
-20741,10913,7366,0.0901821833329384,0.0901821833329384
-2613,2576,2373,0.0436228403965834,0.0436228403965834
-19620,10524,10589,0.00570573305761744,0.00570573305761744
-18401,1425,7176,0.174145888646233,0.174145888646233
-20347,10745,10747,0.0185775892434006,0.0185775892434006
-2677,2638,2639,0.294941945704345,0.294941945704345
-19655,10606,10607,0.00514986150833142,0.00514986150833142
-18881,7249,3271,0.203031342103983,0.203031342103983
-20742,7366,10907,0.0328095866921768,0.0328095866921768
-2729,2684,2685,0.0539600310135124,0.0539600310135124
-17508,10114,10116,0.025112430125901,0.025112430125901
-17946,10225,10226,0.00737359034109891,0.00737359034109891
-14688,2393,2798,0.189312144234638,0.189312144234638
-18130,10265,6045,0.200929523136355,0.200929523136355
-2876,2499,2821,0.136005417598284,0.136005417598284
-12974,2797,2822,0.0772628603550689,0.0772628603550689
-19658,9394,8493,0.0491161384071996,0.0491161384071996
-19659,8493,6763,0.145715875084599,0.145715875084599
-14698,5033,4164,0.121872885708228,0.121872885708228
-17172,3092,5304,0.202230215982892,0.202230215982892
-3021,2953,2954,0.00990774005844554,0.00990774005844554
-19694,10618,8145,0.956513774549446,0.956513774549446
-19803,5200,10646,0.12476083696761,0.12476083696761
-14722,4871,6016,0.191389811056615,0.191389811056615
-20794,8908,10948,0.0132755925041989,0.0132755925041989
-19880,10672,2617,0.0529554442967168,0.0529554442967168
-19918,6233,5202,0.175854776488408,0.175854776488408
-18502,9278,9526,0.133752339971597,0.133752339971597
-3064,2995,2996,0.132712872312529,0.132712872312529
-19901,10663,10676,0.0513919786820835,0.0513919786820835
-19973,10306,619,0.00429215823862154,0.00429215823862154
-17075,7842,828,0.141317632530522,0.141317632530522
-17970,10238,10234,0.0188321983270746,0.0188321983270746
-18897,10377,10378,0.0131134839493858,0.0131134839493858
-17180,5449,5450,0.206640976814444,0.206640976814444
-17113,3932,3959,0.0402088808240704,0.0402088808240704
-19990,10684,10682,0.0498254818797545,0.0498254818797545
-18513,9294,10302,0.00151227516682341,0.00151227516682341
-3252,2365,3163,0.175456016528149,0.175456016528149
-19267,10446,8486,0.0130023858176566,0.0130023858176566
-15217,9530,539,0.0270882933911684,0.0270882933911684
-18503,9526,9353,0.135313261796309,0.135313261796309
-18902,10378,10381,0.0118745691698922,0.0118745691698922
-20282,10710,10722,0.0492625817369533,0.0492625817369533
-19437,10490,10491,0.0516785382045006,0.0516785382045006
-16422,3358,3034,0.0480216533576434,0.0480216533576434
-17185,5659,5660,0.024871407903781,0.024871407903781
-18512,10302,9294,0.00151227516682341,0.00151227516682341
-18681,3185,3408,0.173742073092489,0.173742073092489
-15235,9533,9534,0.025845258726166,0.025845258726166
-15243,9534,9535,0.0751513734309232,0.0751513734309232
-14715,5686,5687,0.105315223547906,0.105315223547906
-19826,10647,9253,0.122215184303521,0.122215184303521
-20299,10728,5578,0.0498927645754841,0.0498927645754841
-15281,9557,9556,0.01686832436596,0.01686832436596
-15283,9557,9558,0.0154433036380546,0.0154433036380546
-17312,5705,5706,0.401673875470838,0.401673875470838
-3564,3426,3427,0.0516847701108369,0.0516847701108369
-15400,9579,3315,0.0326402169295471,0.0326402169295471
-15402,9580,9581,0.331383974435327,0.331383974435327
-15403,9582,9583,0.0120173707764648,0.0120173707764648
-18689,1859,5770,0.176521953507317,0.176521953507317
-3659,3496,3497,0.100604510338319,0.100604510338319
-15426,8637,4935,0.0862034738049073,0.0862034738049073
-15429,9597,8608,0.0815311130388188,0.0815311130388188
-14717,933,5818,0.11375652775637,0.11375652775637
-3704,3540,3541,0.0487079158287504,0.0487079158287504
-20304,9382,10728,0.0315682813160642,0.0315682813160642
-15490,9618,8464,0.061043367869745,0.061043367869745
-15492,9627,9626,0.0311123551122936,0.0311123551122936
-17382,5814,2314,0.0781390219671105,0.0781390219671105
-20431,10791,10754,0.00545772790966665,0.00545772790966665
-3935,3733,3734,0.176323868665952,0.176323868665952
-20425,10786,10787,0.0471980291688183,0.0471980291688183
-16275,9868,3657,0.128315234485653,0.128315234485653
-17111,3775,3776,0.0186255054019669,0.0186255054019669
-20436,10794,10795,0.0773551964908624,0.0773551964908624
-4030,3814,3815,0.205898323776278,0.205898323776278
-14114,3768,3623,0.0676593021490157,0.0676593021490157
-20311,10732,10733,0.00871128803713245,0.00871128803713245
-17485,321,4992,0.0357053960194593,0.0357053960194593
-4135,1293,3896,0.0646203690871901,0.0646203690871901
-16181,9842,5547,0.812121023854291,0.812121023854291
-15562,9299,9657,0.183361943567776,0.183361943567776
-15563,9657,3803,0.198879262059456,0.198879262059456
-18244,9371,2433,0.198605382792158,0.198605382792158
-20442,10799,10800,0.0197706815366264,0.0197706815366264
-4153,2788,3908,0.132166336514103,0.132166336514103
-19582,10575,10562,0.0700205995742609,0.0700205995742609
-16266,7738,5831,0.20157737543677,0.20157737543677
-17685,6154,6155,0.459645187119716,0.459645187119716
-4242,3991,3227,0.0177155969329486,0.0177155969329486
-4243,3227,3992,0.0329982706824684,0.0329982706824684
-19465,10509,10510,0.0192818852758557,0.0192818852758557
-20445,10801,10802,0.0205768304881295,0.0205768304881295
-4285,658,1885,0.048605694225596,0.048605694225596
-14724,5469,977,0.135303141818757,0.135303141818757
-4308,4042,3999,0.107188720026654,0.107188720026654
-15626,9687,9688,0.091295408872665,0.091295408872665
-18437,10292,8442,0.00675422790693776,0.00675422790693776
-20447,10794,10803,0.118731077964576,0.118731077964576
-4347,4075,4076,0.0470687599943484,0.0470687599943484
-4349,1002,4077,0.216843974938131,0.216843974938131
-20454,10809,10810,0.100342747602662,0.100342747602662
-4420,4130,4131,0.121697779505431,0.121697779505431
-19593,10478,10580,0.068856662719705,0.068856662719705
-20625,10804,10874,0.0625386897444795,0.0625386897444795
-18253,3979,6754,0.201867515357413,0.201867515357413
-4514,4194,4195,0.10298973821829,0.10298973821829
-15674,9685,9686,0.0593326737516342,0.0593326737516342
-20460,10813,10814,0.0263810628539784,0.0263810628539784
-4540,1339,4214,0.206331927913881,0.206331927913881
-15694,7269,2024,0.188168800569156,0.188168800569156
-19466,10510,10511,0.0234630277187848,0.0234630277187848
-20626,10788,10875,0.12707186988651,0.12707186988651
-14733,6342,4868,0.191023303912105,0.191023303912105
-18638,7383,5180,0.100367385774354,0.100367385774354
-15713,1050,3913,0.111080496528689,0.111080496528689
-18173,6048,6420,0.20192046475531,0.20192046475531
-4662,1707,4301,0.203353286347824,0.203353286347824
-15737,3771,8867,0.1545281811215,0.1545281811215
-18694,6025,5978,0.00688297127309608,0.00688297127309608
-18468,10298,9138,0.0199498887128462,0.0199498887128462
-17131,4372,1799,0.197593407061799,0.197593407061799
-15759,3487,5346,0.100946337054167,0.100946337054167
-20632,8227,6090,0.135158757751447,0.135158757751447
-18263,6067,6514,0.193791754137247,0.193791754137247
-4805,4410,4411,0.102107994490615,0.102107994490615
-19823,9252,7641,0.177252004679102,0.177252004679102
-15778,9119,9707,0.0214606208419429,0.0214606208419429
-15780,9707,9703,0.181325566879256,0.181325566879256
-14737,4770,6526,0.178169149120729,0.178169149120729
-4824,534,475,0.0459278377034575,0.0459278377034575
-15830,7134,9724,0.00382519149625338,0.00382519149625338
-434,433,364,0.11596793090747,0.11596793090747
-17139,4488,3200,0.20282742100359,0.20282742100359
-20710,7365,10885,0.00202939174918317,0.00202939174918317
-20738,10886,10887,0.038658244493302,0.038658244493302
-4921,4492,4493,0.0619945774719425,0.0619945774719425
-18268,2438,5736,0.170878783790289,0.170878783790289
-4947,3640,4511,0.128546240241841,0.128546240241841
-2413,2403,2404,0.136554071110129,0.136554071110129
-11806,8418,8419,0.144478674207108,0.144478674207108
-470,473,474,0.189801845816516,0.189801845816516
-14741,3802,5935,0.15521301123556,0.15521301123556
-4998,4544,4545,0.135440573029242,0.135440573029242
-2670,2628,2629,0.199951181775354,0.199951181775354
-18532,10307,7540,0.709454997862857,0.709454997862857
-5075,4599,1025,0.0544629152641776,0.0544629152641776
-17143,4616,4617,0.200408905820063,0.200408905820063
-20669,10890,10891,0.0251214927041886,0.0251214927041886
-14743,931,2216,0.184594913416957,0.184594913416957
-5094,4615,4618,0.110635552941058,0.110635552941058
-19633,10594,10505,0.00660487490366482,0.00660487490366482
-20709,10913,7365,0.234512277592806,0.234512277592806
-20713,5881,10915,0.0114767201911695,0.0114767201911695
-18275,6667,1427,0.0124761175920816,0.0124761175920816
-18575,10323,10324,0.133190640971179,0.133190640971179
-19540,10553,10554,0.069921649249612,0.069921649249612
-19541,10554,7472,0.00672748885261455,0.00672748885261455
-19542,7472,10555,0.00636055689076091,0.00636055689076091
-20479,10827,10828,0.0321786032396296,0.0321786032396296
-5172,3232,4672,0.135963226577445,0.135963226577445
-17294,8754,10015,0.202671913712405,0.202671913712405
-23,24,25,0.131395177842502,0.131395177842502
-24,25,26,0.132981987743145,0.132981987743145
-18535,5555,10308,0.537923452261619,0.537923452261619
-5196,4693,4694,0.101324047402986,0.101324047402986
-17084,505,4047,0.193244409170512,0.193244409170512
-20013,7896,8858,0.144841565186615,0.144841565186615
-18281,6757,6460,0.11412288805936,0.11412288805936
-5239,4723,4724,0.173697663092072,0.173697663092072
-57,61,62,0.0954500024095661,0.0954500024095661
-18609,5208,6228,0.175202487961463,0.175202487961463
-18543,10313,5554,0.549870500653692,0.549870500653692
-5310,4766,3155,0.0172249530452766,0.0172249530452766
-78,84,85,0.0505639086324271,0.0505639086324271
-19778,10632,5380,0.0979518829901303,0.0979518829901303
-20481,10792,10829,0.0269599370404467,0.0269599370404467
-5457,4876,4877,0.0499120224253174,0.0499120224253174
-96,101,102,0.0321305027576107,0.0321305027576107
-97,102,103,0.0620448910426151,0.0620448910426151
-18782,10348,10344,0.0162360672802701,0.0162360672802701
-5478,4135,4890,0.0934025271750886,0.0934025271750886
-121,128,129,0.177008602394702,0.177008602394702
-244,251,252,0.175978023607631,0.175978023607631
-18294,6901,1428,0.00619376962359973,0.00619376962359973
-5500,4907,4908,0.100175479072509,0.100175479072509
-140,148,149,0.0975727004199176,0.0975727004199176
-393,395,396,0.169106051700542,0.169106051700542
-18784,10348,10349,0.00525970147109288,0.00525970147109288
-5522,4924,4677,0.103650586835971,0.103650586835971
-18546,7539,10314,0.65633531431652,0.65633531431652
-18297,6968,6995,0.202610377838011,0.202610377838011
-5676,3669,5032,0.215322761034264,0.215322761034264
-173,182,183,0.0984047094047537,0.0984047094047537
-174,183,184,0.100655002347226,0.100655002347226
-16515,5454,5455,0.104997960992542,0.104997960992542
-20485,10832,10763,0.0351600114003883,0.0351600114003883
-5779,2576,4917,0.032816005995912,0.032816005995912
-192,202,203,0.199740801936021,0.199740801936021
-193,203,169,0.402428218597258,0.402428218597258
-14755,5931,927,0.177893389603082,0.177893389603082
-5803,5121,5122,0.103540820168727,0.103540820168727
-225,49,236,0.00807621055546913,0.00807621055546913
-18672,1538,1539,0.106836085520251,0.106836085520251
-14756,927,2212,0.186014347432929,0.186014347432929
-5852,1967,4622,0.105142035615429,0.105142035615429
-282,292,293,0.038589084717098,0.038589084717098
-283,293,294,0.0763501630731075,0.0763501630731075
-285,295,296,0.17581051150028,0.17581051150028
-14758,4862,7101,0.190667289560019,0.190667289560019
-5875,4334,5174,0.0464101693595893,0.0464101693595893
-350,351,352,0.0901523030384508,0.0901523030384508
-353,355,356,0.108591561133878,0.108591561133878
-369,370,371,0.00989155289209397,0.00989155289209397
-18304,7116,6758,0.139614208847036,0.139614208847036
-517,511,512,0.231881303387922,0.231881303387922
-518,512,513,0.0504031171767775,0.0504031171767775
-12256,8620,8618,0.1042966231246,0.1042966231246
-6051,5293,5294,0.1322760806231,0.1322760806231
-18305,6758,3982,0.20021257935936,0.20021257935936
-574,248,567,0.654270176053915,0.654270176053915
-575,264,568,0.0404038185731676,0.0404038185731676
-19637,10596,10597,0.0126826750829723,0.0126826750829723
-20403,10761,10778,0.00417068578422797,0.00417068578422797
-6437,2444,5569,0.02055703905507,0.02055703905507
-614,605,606,0.0427456634033912,0.0427456634033912
-11697,1006,1032,0.0356944242966225,0.0356944242966225
-18485,7779,9146,0.0491523501803915,0.0491523501803915
-19922,7869,3723,0.102610678307364,0.102610678307364
-20528,10783,10029,0.0108754318867703,0.0108754318867703
-6839,2922,5305,0.104995892978265,0.104995892978265
-634,544,624,0.0671323040254876,0.0671323040254876
-635,624,625,0.00434381837571047,0.00434381837571047
-20428,10788,10789,0.0563042197472527,0.0563042197472527
-18340,7633,7634,0.201343863199868,0.201343863199868
-20531,2704,10847,0.00595682994262844,0.00595682994262844
-18337,7624,2435,0.20163475178063,0.20163475178063
-655,645,646,0.15124021105117,0.15124021105117
-11518,656,657,0.200075413530476,0.200075413530476
-18341,7634,7661,0.00671626059696149,0.00671626059696149
-18342,7661,7662,0.197150609042501,0.197150609042501
-6951,5687,5936,0.0500693590985736,0.0500693590985736
-6952,5936,5453,0.049749026364738,0.049749026364738
-18121,10257,2538,0.176222237628552,0.176222237628552
-18344,5247,6874,0.0949718672307841,0.0949718672307841
-20408,10778,8971,0.00240570116723256,0.00240570116723256
-7025,5987,5146,0.0839973170950687,0.0839973170950687
-687,680,681,0.00253308666004397,0.00253308666004397
-688,681,682,0.0177686502456197,0.0177686502456197
-20536,10790,10850,0.034182335159618,0.034182335159618
-18351,6756,3981,0.199906908242653,0.199906908242653
-7046,5996,5997,0.0183612294578931,0.0183612294578931
-7047,5997,5998,0.0939822022965603,0.0939822022965603
-16701,9996,9997,0.0529811614609842,0.0529811614609842
-20223,10711,10712,0.0485921897229188,0.0485921897229188
-7066,4209,6007,0.100592936440223,0.100592936440223
-719,715,716,0.14011322934495,0.14011322934495
-18164,6036,4091,0.184872985391224,0.184872985391224
-18360,7775,7374,0.049527285222362,0.049527285222362
-7242,1086,6117,0.0183572728116315,0.0183572728116315
-20444,10797,10801,0.0204844414155983,0.0204844414155983
-14778,5928,925,0.176931188736704,0.176931188736704
-7325,6163,6164,0.404282808510336,0.404282808510336
-757,756,757,0.0403523543057396,0.0403523543057396
-758,758,759,0.10406364243601,0.10406364243601
-20552,10810,10855,0.0274674933149076,0.0274674933149076
-7375,340,337,0.0516827997381363,0.0516827997381363
-778,783,784,0.143355100800641,0.143355100800641
-18365,1660,7716,0.0501099513590678,0.0501099513590678
-7418,5550,6228,0.0493634763375772,0.0493634763375772
-798,803,806,1.01502432527974,1.01502432527974
-20237,10712,8819,0.0494540965066323,0.0494540965066323
-7441,1600,1601,0.0713701116113288,0.0713701116113288
-814,825,826,0.10637782371988,0.10637782371988
-815,826,827,0.107195537700229,0.107195537700229
-20239,10716,10717,0.029516495512001,0.029516495512001
-7466,2930,5311,0.101596891275597,0.101596891275597
-836,849,850,0.0925483728292225,0.0925483728292225
-837,850,851,0.184151560988971,0.184151560988971
-20241,8817,10717,0.0237033604501814,0.0237033604501814
-7541,6292,65,0.186329349943054,0.186329349943054
-857,870,871,0.202831473953724,0.202831473953724
-14121,4084,3945,0.0818484712615532,0.0818484712615532
-18787,10347,10345,0.045081440573134,0.045081440573134
-7826,2505,6454,0.100016861256994,0.100016861256994
-876,889,890,0.105571186658179,0.105571186658179
-877,890,891,0.105688383652669,0.105688383652669
-11418,8067,8068,0.0483239948134963,0.0483239948134963
-7848,6464,6465,0.0519215197465546,0.0519215197465546
-894,908,909,0.110040792413973,0.110040792413973
-896,910,911,0.148938852784508,0.148938852784508
-11420,8068,8077,0.744996900508782,0.744996900508782
-7872,6484,6485,0.109350713693358,0.109350713693358
-914,928,929,0.0454506765778274,0.0454506765778274
-15223,8102,5299,0.0276921695746079,0.0276921695746079
-16761,10006,10010,0.188081556068426,0.188081556068426
-20354,9336,10730,0.00773852906846938,0.00773852906846938
-7965,6543,6544,0.0483732045653669,0.0483732045653669
-954,966,967,0.0990431305437434,0.0990431305437434
-19650,10601,10604,0.0245600833310456,0.0245600833310456
-18271,6463,6629,0.159535181156963,0.159535181156963
-20358,10736,9208,0.00987870578899212,0.00987870578899212
-11333,3953,8218,0.0887906096153549,0.0887906096153549
-976,987,988,0.0367128135573791,0.0367128135573791
-18911,10389,10390,0.0499832893351177,0.0499832893351177
-8132,6646,6647,0.176189320777164,0.176189320777164
-20359,9208,8992,0.00952006614931064,0.00952006614931064
-18533,7540,5565,0.0799101067174197,0.0799101067174197
-15227,8248,1474,0.0211145699437457,0.0211145699437457
-11427,8252,8251,0.0497577863871374,0.0497577863871374
-8228,5488,6699,0.203871251538877,0.203871251538877
-1013,1025,1026,0.240326237485559,0.240326237485559
-1014,1026,1027,0.140197604091005,0.140197604091005
-11524,8299,6771,0.0679188084680006,0.0679188084680006
-8280,6724,1837,0.0673898837011532,0.0673898837011532
-16769,3180,3279,0.131366088579917,0.131366088579917
-11560,7714,8320,0.204692599225755,0.204692599225755
-18785,10349,3941,0.0399279993421446,0.0399279993421446
-1055,1071,1072,0.193562714729093,0.193562714729093
-18374,2425,6794,0.0832162654729584,0.0832162654729584
-8378,6787,5475,0.176557126416642,0.176557126416642
-1079,1095,1096,0.106445830238736,0.106445830238736
-1081,1097,1098,0.0486277340974482,0.0486277340974482
-18378,2549,8381,0.409599255943821,0.409599255943821
-8425,4370,2496,0.102227972652095,0.102227972652095
-1101,1117,1118,0.104134759343337,0.104134759343337
-19670,9361,9367,0.104968988119014,0.104968988119014
-11768,8406,8391,0.072368398733761,0.072368398733761
-11405,6191,577,0.346853696348124,0.346853696348124
-11711,2125,2126,0.0693722119224359,0.0693722119224359
-1121,1137,1138,0.209246619241212,0.209246619241212
-11896,1345,8466,0.0539854948645785,0.0539854948645785
-8519,3823,6870,0.0122276886226055,0.0122276886226055
-1142,1161,1045,0.106182749069371,0.106182749069371
-1143,1045,1162,0.0572035723632033,0.0572035723632033
-11949,8497,8498,0.0157235898061176,0.0157235898061176
-8563,6893,6894,0.0563604312984052,0.0563604312984052
-1161,1180,1181,0.108807320753836,0.108807320753836
-1162,1181,555,0.0264412731929892,0.0264412731929892
-11990,6574,4455,0.147936408791814,0.147936408791814
-8587,6905,6906,0.00825706398143248,0.00825706398143248
-1181,1196,1197,0.0308045840002764,0.0308045840002764
-16676,9978,9979,0.0911222888155273,0.0911222888155273
-12046,8525,8526,0.0214801658544325,0.0214801658544325
-8609,4639,1260,0.0990232299326886,0.0990232299326886
-20366,10746,10748,0.00389959559054649,0.00389959559054649
-8754,6984,6985,0.142274771709776,0.142274771709776
-15273,8632,8698,0.0321488809830426,0.0321488809830426
-12327,8651,8462,0.0863896937468126,0.0863896937468126
-8825,7022,7023,0.132397309217195,0.132397309217195
-15906,8604,1831,0.0312706435771371,0.0312706435771371
-8982,704,420,0.200616718436647,0.200616718436647
-1261,1282,24,0.134590345997008,0.134590345997008
-18452,7704,9427,0.203142152499049,0.203142152499049
-12940,8766,1971,0.0880952038111177,0.0880952038111177
-12050,8529,8530,0.0322062217802774,0.0322062217802774
-1281,1306,1307,0.102064457561207,0.102064457561207
-12052,8529,8412,0.0524928623134227,0.0524928623134227
-20805,10934,7427,0.00626540347624637,0.00626540347624637
-9106,7163,7164,0.0532969377049032,0.0532969377049032
-1301,1326,1327,0.0908036524111016,0.0908036524111016
-1302,1327,1328,0.187321516717609,0.187321516717609
-20389,10773,10765,0.00486729953892219,0.00486729953892219
-20812,7034,10952,0.00504516380305115,0.00504516380305115
-12945,8883,8884,0.0693524767029838,0.0693524767029838
-9177,1813,7200,0.0899820045120437,0.0899820045120437
-12258,8619,8617,0.025123815719297,0.025123815719297
-9178,132,7201,0.0532452299195118,0.0532452299195118
-13064,8946,8947,0.0850173355126965,0.0850173355126965
-9301,7274,6989,0.145898107890786,0.145898107890786
-1340,1368,1369,0.19896343011117,0.19896343011117
-20815,7168,10919,0.00784309361436635,0.00784309361436635
-9323,7286,7287,0.0531798537803958,0.0531798537803958
-18312,7244,7291,0.112193704343122,0.112193704343122
-20817,10953,10288,0.00348743524444471,0.00348743524444471
-20818,10288,10921,0.00283999263123215,0.00283999263123215
-9345,7305,6323,0.0511693918815177,0.0511693918815177
-20831,10939,10947,0.189387199061175,0.189387199061175
-20504,10061,10815,0.00579629159172248,0.00579629159172248
-12268,8625,8626,0.00924470302738606,0.00924470302738606
-18317,7365,7366,0.190091232151663,0.190091232151663
-18915,10393,10394,0.0257178211457629,0.0257178211457629
-9548,5843,7400,0.197969196756037,0.197969196756037
-1402,1428,1429,0.0514192906451236,0.0514192906451236
-19551,10559,10558,0.0350073244923259,0.0350073244923259
-20372,10756,10757,0.119877702556756,0.119877702556756
-18474,9006,9005,0.01365486811001,0.01365486811001
-9618,6255,7423,0.201105238361345,0.201105238361345
-1423,1446,1447,0.102065186535373,0.102065186535373
-12355,8667,8662,0.00824054620763183,0.00824054620763183
-13473,9096,9097,0.0791788196488147,0.0791788196488147
-13558,9033,9033,0.000550802138422688,0.000550802138422688
-9720,5436,7485,0.210597915191446,0.210597915191446
-1445,1465,778,0.201931327083159,0.201931327083159
-16745,10007,6830,0.0463356709963923,0.0463356709963923
-18484,9139,9145,0.0170083591694009,0.0170083591694009
-18486,9146,1121,0.0502889247784144,0.0502889247784144
-13588,9137,9132,0.0916872062208973,0.0916872062208973
-18564,10320,10321,0.148893183386122,0.148893183386122
-1470,1490,1454,0.0984270848036789,0.0984270848036789
-11793,8412,1301,0.0102820603565046,0.0102820603565046
-13649,9157,9158,0.11057157733623,0.11057157733623
-9923,7595,5945,0.197471792675123,0.197471792675123
-1492,1512,1513,0.240760864140441,0.240760864140441
-1493,1513,1514,0.0903356876724302,0.0903356876724302
-18489,9154,9164,0.0526957444463644,0.0526957444463644
-9949,7606,7607,0.0349507847949759,0.0349507847949759
-1512,1531,1532,0.421840818868262,0.421840818868262
-1514,1533,1534,0.0990053945754622,0.0990053945754622
-18920,10391,10399,0.0111591670236662,0.0111591670236662
-10025,6642,3954,0.137704462550789,0.137704462550789
-1533,1556,1557,0.0904418216599082,0.0904418216599082
-1535,1558,1559,0.0987505899129773,0.0987505899129773
-19486,10409,10426,0.0202821728904968,0.0202821728904968
-10050,7651,7652,0.0462326431468639,0.0462326431468639
-1552,1577,1578,0.0904564264247089,0.0904564264247089
-1554,1579,1580,0.0903173650147356,0.0903173650147356
-18611,2585,1850,0.178619647699559,0.178619647699559
-19139,479,10436,0.0608772998887891,0.0608772998887891
-10147,7693,7694,0.00731957097451548,0.00731957097451548
-1571,1598,1600,0.0527554061663716,0.0527554061663716
-18460,6389,9354,0.131365686337894,0.131365686337894
-13942,9095,9242,0.111189675764469,0.111189675764469
-10218,6638,5410,0.0525082825873588,0.0525082825873588
-11529,809,810,0.133518358438394,0.133518358438394
-16258,9267,3529,0.187765741537081,0.187765741537081
-10288,7759,7760,0.0990614933501691,0.0990614933501691
-1610,1640,1641,0.0829769157452624,0.0829769157452624
-1611,1641,1642,0.0110107206173314,0.0110107206173314
-14142,478,9286,0.110440686979957,0.110440686979957
-10359,6835,4056,0.176947127899101,0.176947127899101
-10360,4056,7791,0.153314942388554,0.153314942388554
-16039,9796,9803,0.17034831343451,0.17034831343451
-20229,8818,8827,0.0165504595782256,0.0165504595782256
-15466,9616,9605,0.0511543414269977,0.0511543414269977
-10664,7914,2973,0.0665734173113744,0.0665734173113744
-1646,1673,1674,0.136622102626379,0.136622102626379
-1647,1674,1675,0.135851990536989,0.135851990536989
-15467,9605,7963,0.0172079120084978,0.0172079120084978
-1668,1693,1694,0.101380870701686,0.101380870701686
-11218,3630,8166,0.0456744230751041,0.0456744230751041
-15788,9639,9625,0.0212057259943503,0.0212057259943503
-11369,8219,7971,0.0335395055556045,0.0335395055556045
-16195,7725,5820,0.195527635044049,0.195527635044049
-16196,5820,7207,0.20506620423787,0.20506620423787
-11659,7036,3421,0.201375612760589,0.201375612760589
-11773,2681,5358,0.147201059924865,0.147201059924865
-17216,8420,1908,0.199697066538748,0.199697066538748
-16157,9835,9836,0.024879986991164,0.024879986991164
-18699,1320,1376,0.177502821070015,0.177502821070015
-12115,8553,8554,0.175311002200187,0.175311002200187
-19503,10530,10531,0.0385295444601748,0.0385295444601748
-16538,9932,9933,0.139509514048293,0.139509514048293
-1717,1736,1737,0.0422973816408655,0.0422973816408655
-17220,3087,9830,0.198791677003679,0.198791677003679
-12205,8587,7095,0.0103763001462627,0.0103763001462627
-1748,1765,1768,0.20159496635188,0.20159496635188
-12332,8654,8655,0.0104809427005404,0.0104809427005404
-19506,10533,7232,0.00927443019901883,0.00927443019901883
-12444,8704,8705,0.0186821732215156,0.0186821732215156
-1767,1785,1786,0.049264963521636,0.049264963521636
-16454,9909,9910,0.124306713488191,0.124306713488191
-12491,8717,8718,0.055230353030641,0.055230353030641
-12493,8719,8720,0.118556931073074,0.118556931073074
-16535,4328,8117,0.102336137979151,0.102336137979151
-1810,1826,1827,0.198453556780362,0.198453556780362
-18642,7416,4062,0.177070510498962,0.177070510498962
-12605,384,4685,0.0512286127934627,0.0512286127934627
-1838,1854,1855,0.0513002538457751,0.0513002538457751
-1839,1855,1856,0.0505552484656801,0.0505552484656801
-16789,8649,10013,0.223567773525098,0.223567773525098
-12632,2360,3710,0.110712951608372,0.110712951608372
-1858,1870,1871,0.100377935012122,0.100377935012122
-17014,10053,10054,0.0101091220768254,0.0101091220768254
-12810,8258,8846,0.197578956532281,0.197578956532281
-12812,8846,6028,0.064250785290107,0.064250785290107
-12814,8847,8848,0.169735694825716,0.169735694825716
-12816,8848,297,0.081779930762806,0.081779930762806
-16613,9942,2685,0.29520243699611,0.29520243699611
-12926,8892,8893,0.0723033727126927,0.0723033727126927
-13020,8924,8925,0.0102645296363106,0.0102645296363106
-13048,8934,8935,0.109609070074496,0.109609070074496
-14679,9301,445,0.205255827063182,0.205255827063182
-17965,10232,10237,0.0287772787854116,0.0287772787854116
-18916,10395,10396,0.0665707610088623,0.0665707610088623
-17673,8930,8847,0.0672232407607821,0.0672232407607821
-19611,10510,10586,0.0687878070750461,0.0687878070750461
-1895,1909,1910,0.0533681732492523,0.0533681732492523
-18738,1858,7870,0.177701929540755,0.177701929540755
-18722,1312,9772,0.242272496904356,0.242272496904356
-13294,4282,4326,0.048552671008238,0.048552671008238
-1916,1928,1929,0.105818779358726,0.105818779358726
-18739,7870,4057,0.175799763463846,0.175799763463846
-18654,6221,7655,0.275174189153955,0.275174189153955
-1942,1956,1957,0.0270768788779568,0.0270768788779568
-13392,311,9059,0.0124055357740245,0.0124055357740245
-18659,7643,6205,0.176055293755678,0.176055293755678
-13405,8942,9061,0.112337222040467,0.112337222040467
-19275,10446,10424,0.0353155595120025,0.0353155595120025
-1960,1977,1978,0.0139641936224905,0.0139641936224905
-13485,9102,308,0.0118340647108347,0.0118340647108347
-20374,10758,3588,0.00620515380678302,0.00620515380678302
-18262,2547,6067,0.202075066970098,0.202075066970098
-13520,9073,117,0.110830423506594,0.110830423506594
-13529,5647,9088,0.177768687230353,0.177768687230353
-19599,1871,10582,0.0185256932684462,0.0185256932684462
-13548,447,2999,0.0894668373271695,0.0894668373271695
-13553,9126,579,0.319404247396224,0.319404247396224
-18657,7657,10331,0.158775443026926,0.158775443026926
-13716,6715,4211,0.0895901111539728,0.0895901111539728
-2012,2021,2022,0.202353267688237,0.202353267688237
-18846,10364,10366,0.0360011605118072,0.0360011605118072
-13805,9197,6639,0.199762828560815,0.199762828560815
-18572,10317,10318,0.0818849597364774,0.0818849597364774
-2037,2046,2047,0.202843850092204,0.202843850092204
-2038,2047,2048,0.202089258953368,0.202089258953368
-19239,8480,10459,0.145581432505511,0.145581432505511
-13871,2282,3603,0.0995034643784278,0.0995034643784278
-2058,746,1564,0.142548749521321,0.142548749521321
-12345,8661,8662,0.0184782413605156,0.0184782413605156
-13933,9117,9237,0.0487812750222334,0.0487812750222334
-13946,9243,9109,0.0432001724914345,0.0432001724914345
-20415,10773,10767,0.0164543942872072,0.0164543942872072
-15289,7065,9559,0.00979064512162057,0.00979064512162057
-15406,9582,9586,0.261696459707034,0.261696459707034
-14374,512,3439,0.0820413167433817,0.0820413167433817
-15291,9560,9561,0.0474312472960203,0.0474312472960203
-20033,3666,9939,0.222490979962601,0.222490979962601
-14436,9351,6743,0.133828356760244,0.133828356760244
-2083,2084,2085,0.132628008561016,0.132628008561016
-20269,10721,10704,0.0408769490843711,0.0408769490843711
-20257,7553,10687,0.047722995184739,0.047722995184739
-14596,9395,7373,0.0500503806511319,0.0500503806511319
-2107,1822,2109,0.0984259671843471,0.0984259671843471
-18860,10369,10362,0.0840816587742034,0.0840816587742034
-20253,10719,5572,0.00788824170654016,0.00788824170654016
-16690,9989,9990,0.0859897279747206,0.0859897279747206
-2125,1981,1966,0.0405441466490896,0.0405441466490896
-16692,8314,8651,0.0716207548906764,0.0716207548906764
-16847,3130,9896,0.0388183147420438,0.0388183147420438
-12343,8658,8659,0.0326641917954917,0.0326641917954917
-16277,4438,9869,0.0429816129844846,0.0429816129844846
-2254,2256,2257,0.179026041725141,0.179026041725141
-18714,6214,7650,0.274890248386652,0.274890248386652
-2282,2281,2282,0.208433952181449,0.208433952181449
-18413,7163,7445,0.101226183618457,0.101226183618457
-2309,1585,1646,0.0852956059582778,0.0852956059582778
-17366,3085,3197,0.201028238760753,0.201028238760753
-16424,3406,3407,0.0260120249027955,0.0260120249027955
-487,487,488,0.0915902876023465,0.0915902876023465
-2504,2153,2485,0.135805715389887,0.135805715389887
-15259,9549,9550,0.0733424963845631,0.0733424963845631
-17078,8074,9872,0.138360291064547,0.138360291064547
-604,595,596,0.135530584935403,0.135530584935403
-2561,2534,2535,0.131236307359374,0.131236307359374
-11701,1064,1065,0.0735266946881119,0.0735266946881119
-11702,1065,1066,0.144526540080904,0.144526540080904
-2641,1094,1110,0.0327560682713917,0.0327560682713917
-12965,1823,1824,0.115786401746133,0.115786401746133
-2716,2671,2672,0.137037719250731,0.137037719250731
-16268,9866,8748,0.200740333998757,0.200740333998757
-2739,2694,2695,0.0520216844496084,0.0520216844496084
-18678,2801,2589,0.177457369167133,0.177457369167133
-11691,837,867,0.00774513207370433,0.00774513207370433
-11692,867,868,0.00951825440201693,0.00951825440201693
-2894,2838,2839,0.0194790124967281,0.0194790124967281
-16704,9998,9999,0.0072772776659045,0.0072772776659045
-16598,5785,8280,0.146209128325821,0.146209128325821
-2965,1143,2908,0.0621246078682317,0.0621246078682317
-16603,7894,9953,0.113998968091224,0.113998968091224
-3043,2974,2975,0.149630303255577,0.149630303255577
-18440,2971,10293,0.0852727734364054,0.0852727734364054
-3066,2997,2998,0.0208518874255557,0.0208518874255557
-18441,10293,8299,0.0364176386342536,0.0364176386342536
-3086,3018,3019,0.14545556926134,0.14545556926134
-18443,7498,10290,0.0505394400731725,0.0505394400731725
-3112,3044,3045,0.100624292928738,0.100624292928738
-18471,2985,7703,0.198649870528673,0.198649870528673
-16707,9623,9998,0.0621574034637008,0.0621574034637008
-3136,3062,2284,0.0981125078289405,0.0981125078289405
-19669,10610,9361,0.0491952199145155,0.0491952199145155
-3158,3082,3083,0.0983700193882712,0.0983700193882712
-11703,1066,1158,0.148869854474817,0.148869854474817
-3181,3101,3102,0.0962927982103224,0.0962927982103224
-18133,4095,6040,0.192431028537818,0.192431028537818
-18446,10289,7781,0.0503825451517732,0.0503825451517732
-3230,3144,3145,0.203548069983679,0.203548069983679
-18448,9292,9527,0.134072690600401,0.134072690600401
-11705,1159,1244,0.147081474347396,0.147081474347396
-3281,3193,3194,0.106476946636896,0.106476946636896
-16416,3034,3130,0.0869691229324941,0.0869691229324941
-3302,3210,3211,0.0503243467464606,0.0503243467464606
-18899,10379,10380,0.00404144992313864,0.00404144992313864
-11709,1301,1302,0.0358989065327031,0.0358989065327031
-3325,3227,3228,0.131949141660574,0.131949141660574
-12952,1330,1361,0.0263074187615997,0.0263074187615997
-3400,3297,3298,0.0238019064284447,0.0238019064284447
-3489,1140,907,0.140863651036277,0.140863651036277
-16744,7566,10007,0.0424762897679241,0.0424762897679241
-18732,9833,7646,0.178089933314901,0.178089933314901
-3516,3387,3388,0.0211650011658898,0.0211650011658898
-12955,1478,1507,0.126108135430878,0.126108135430878
-3561,3424,3425,0.0612760168169184,0.0612760168169184
-16837,10019,9847,0.0370069651425935,0.0370069651425935
-3583,3438,1421,0.115878563365398,0.115878563365398
-12960,1632,1633,0.128348569926215,0.128348569926215
-3684,3520,3521,0.0506146313810284,0.0506146313810284
-18464,10298,9139,0.0193791784570559,0.0193791784570559
-3734,1037,3568,0.052776292073227,0.052776292073227
-19333,2826,10473,0.01148052310696,0.01148052310696
-18465,9139,541,0.0794672162259436,0.0794672162259436
-3755,3585,3586,0.0186262558199583,0.0186262558199583
-17071,4599,3687,0.240616539690475,0.240616539690475
-3805,3624,3250,0.195616461429944,0.195616461429944
-11577,1766,1595,0.0489656343684566,0.0489656343684566
-3825,3641,3642,0.0193156490955763,0.0193156490955763
-17299,5829,8716,0.20447937601548,0.20447937601548
-3847,3658,3639,0.0475522464454704,0.0475522464454704
-18869,10144,10372,0.0637708443692985,0.0637708443692985
-16541,812,3553,0.152482276035164,0.152482276035164
-20222,7195,10711,0.0935594253631277,0.0935594253631277
-19431,10003,8707,0.100281643377189,0.100281643377189
-3891,3519,3695,0.200167523328644,0.200167523328644
-16751,6829,10008,0.0961527504424716,0.0961527504424716
-3916,3713,3714,0.1010804805974,0.1010804805974
-15272,8538,8632,0.0716756500086966,0.0716756500086966
-3938,3736,3737,0.112607595972795,0.112607595972795
-18125,4097,6042,0.191481087124581,0.191481087124581
-19576,10572,7461,0.00811745051204977,0.00811745051204977
-12969,1970,1971,0.103498330022734,0.103498330022734
-4039,3819,3820,0.147623529549067,0.147623529549067
-18745,5190,2608,0.176866790100876,0.176866790100876
-4127,3890,3891,0.179468370845182,0.179468370845182
-12335,8652,8653,0.0109021010822668,0.0109021010822668
-4149,3906,1161,0.136761513456038,0.136761513456038
-17950,6559,10229,0.0124761805379247,0.0124761805379247
-4173,1891,706,0.0588353275400914,0.0588353275400914
-14115,3623,3925,0.0987645160792797,0.0987645160792797
-16843,10020,10021,0.00337377443816097,0.00337377443816097
-4194,3942,3943,0.176445012103913,0.176445012103913
-18245,2433,9358,0.201879495148218,0.201879495148218
-18189,6055,5795,0.200795798534704,0.200795798534704
-4450,3345,4152,0.10312101394972,0.10312101394972
-18872,9232,7825,0.160805002055775,0.160805002055775
-4529,4204,4205,0.278098742346476,0.278098742346476
-18399,2541,10285,0.412599954612644,0.412599954612644
-4637,4281,913,0.111497113872301,0.111497113872301
-16900,4255,3513,0.200996147699506,0.200996147699506
-15919,9746,7414,0.0221971015175522,0.0221971015175522
-4682,4322,4323,0.0558862625971893,0.0558862625971893
-16298,2636,2637,0.0033759355903552,0.0033759355903552
-18879,6125,1927,0.199518260048308,0.199518260048308
-4761,1489,145,0.199750566224671,0.199750566224671
-18696,4055,6400,0.176933507030136,0.176933507030136
-16300,2637,2160,0.00247295077408309,0.00247295077408309
-4832,1268,4428,0.206285087175769,0.206285087175769
-18888,7247,1923,0.201674729042946,0.201674729042946
-4997,4543,4544,0.132688906239847,0.132688906239847
-16650,9968,9969,0.0122299544992289,0.0122299544992289
-13009,2891,2892,0.172319187220424,0.172319187220424
-5024,4562,4563,0.200718931282707,0.200718931282707
-16315,3005,1362,0.00318470714397005,0.00318470714397005
-5188,4685,4686,0.177776490265982,0.177776490265982
-17297,10086,7736,0.198049290500642,0.198049290500642
-20272,10721,10703,0.0411977345042915,0.0411977345042915
-5368,3223,4808,0.133968729582188,0.133968729582188
-18898,10378,10379,0.00446883067059111,0.00446883067059111
-5393,4828,4829,0.40282604477454,0.40282604477454
-20273,10703,10725,0.144609051598102,0.144609051598102
-5414,4842,1486,0.202708226253938,0.202708226253938
-5490,458,4898,0.0468723555946229,0.0468723555946229
-19112,8424,10118,0.19768851226159,0.19768851226159
-5515,1212,4920,0.232222389672051,0.232222389672051
-19281,10466,8768,0.124416605605605,0.124416605605605
-5542,2537,4941,0.438197641658083,0.438197641658083
-20340,10739,10748,0.00884971981393432,0.00884971981393432
-19231,10455,10456,0.1184623603546,0.1184623603546
-5626,3284,1058,0.0983991410952824,0.0983991410952824
-18347,7686,2429,0.200029751476084,0.200029751476084
-17080,1162,882,0.139677295386473,0.139677295386473
-6004,5259,5260,0.066486526131314,0.066486526131314
-14136,9281,509,0.032133360210872,0.032133360210872
-17116,4052,3775,0.00847774353709404,0.00847774353709404
-6616,5699,5700,0.00800603928165774,0.00800603928165774
-19812,7122,5371,0.176755455393693,0.176755455393693
-6777,5820,5821,0.0499181980722273,0.0499181980722273
-4400,4114,4115,0.202509931844666,0.202509931844666
-11451,8258,8261,0.200629988067775,0.200629988067775
-19818,10647,5606,0.0519771701713562,0.0519771701713562
-6974,2119,5953,0.0979282440578051,0.0979282440578051
-4402,4117,2874,0.134125988252719,0.134125988252719
-4403,2874,4118,0.140174877049639,0.140174877049639
-17149,46,4780,0.204228808601968,0.204228808601968
-7674,1498,187,0.203419998803368,0.203419998803368
-7719,6393,6394,0.135380647167761,0.135380647167761
-20324,10732,10743,0.016217938211146,0.016217938211146
-7749,6408,6409,0.240033624288878,0.240033624288878
-20330,10744,10736,0.0345659354386547,0.0345659354386547
-7835,4630,1259,0.131787660470127,0.131787660470127
-5519,4922,2815,0.0131824278657025,0.0131824278657025
-7914,3652,89,0.238216692287668,0.238216692287668
-17155,3202,3091,0.199774901839453,0.199774901839453
-7937,6530,6531,0.246221323543984,0.246221323543984
-20342,2965,10747,0.0130500853290149,0.0130500853290149
-7957,3453,6015,0.103911955569673,0.103911955569673
-17306,8715,5827,0.20364289358169,0.20364289358169
-7981,6550,6526,0.0499792827976588,0.0499792827976588
-18128,10269,10270,0.123006178444702,0.123006178444702
-8007,6565,6566,0.0461778743400118,0.0461778743400118
-12262,8500,8621,0.00391508697358849,0.00391508697358849
-20346,10731,10745,0.0882403942542692,0.0882403942542692
-8080,6611,6612,0.10285099566632,0.10285099566632
-20503,10831,10061,0.00544027190297384,0.00544027190297384
-17159,5011,5064,0.204989668883762,0.204989668883762
-14700,4773,5065,0.177184173799166,0.177184173799166
-8102,6628,6630,0.0733305516170216,0.0733305516170216
-14712,935,5453,0.176927806170623,0.176927806170623
-8148,6658,1326,0.126702346827637,0.126702346827637
-14707,5162,5223,0.123984475685155,0.123984475685155
-8332,6761,6762,0.0544299595372282,0.0544299595372282
-17167,48,5241,0.405295346029575,0.405295346029575
-8384,6791,4603,0.174075741649446,0.174075741649446
-20516,6731,10843,0.0163123315737135,0.0163123315737135
-17171,5280,3092,0.401948502237413,0.401948502237413
-8434,6821,1593,0.0969711334947841,0.0969711334947841
-14711,2220,935,0.183060496140458,0.183060496140458
-8536,6880,1128,0.0335501177019022,0.0335501177019022
-19635,10525,10595,0.00694156278564008,0.00694156278564008
-18504,9353,6386,0.133800859600802,0.133800859600802
-8556,6891,6418,0.133199850282798,0.133199850282798
-8557,6418,4625,0.132396793169127,0.132396793169127
-17175,5327,5390,0.196700288812187,0.196700288812187
-18507,8379,10301,0.115242670596916,0.115242670596916
-8578,6280,6899,0.103595480205117,0.103595480205117
-4404,4118,4119,0.131974592337134,0.131974592337134
-18510,10301,9529,0.136169474903607,0.136169474903607
-4406,4120,4121,0.394524879292727,0.394524879292727
-19640,10596,10598,0.0045286617175965,0.0045286617175965
-8728,3385,6959,0.0627894298641218,0.0627894298641218
-18496,6384,9201,0.134997571408585,0.134997571408585
-18514,10302,5543,0.103400383164669,0.103400383164669
-8779,6999,7000,0.178967474513147,0.178967474513147
-18515,5543,2412,0.101763704229338,0.101763704229338
-8803,5141,2236,0.0248346840292332,0.0248346840292332
-19831,10650,10651,0.138361801446117,0.138361801446117
-8887,3285,1059,0.0976623415502941,0.0976623415502941
-17182,5607,5608,0.205054564403698,0.205054564403698
-8909,3021,7068,0.0519035642154067,0.0519035642154067
-4407,3574,4122,0.137780007377075,0.137780007377075
-14713,5453,5664,0.115365301333729,0.115365301333729
-9019,3944,7121,0.0616182757003265,0.0616182757003265
-18655,7655,10305,0.198541985736116,0.198541985736116
-9043,7135,4276,0.121250513345306,0.121250513345306
-18147,10258,6033,0.201162874084808,0.201162874084808
-9226,7232,7233,0.0701236279353194,0.0701236279353194
-18152,10264,10277,0.407566866193853,0.407566866193853
-9304,6121,1920,0.204110733126185,0.204110733126185
-18153,4104,6047,0.112519690969595,0.112519690969595
-11446,385,387,0.611916175000286,0.611916175000286
-17478,5886,323,0.0446797516163588,0.0446797516163588
-9352,6077,7309,0.0481617931874556,0.0481617931874556
-20395,10775,10776,0.00739420688081638,0.00739420688081638
-18154,6047,10135,0.201285870335585,0.201285870335585
-20429,10789,10790,0.0478990795077935,0.0478990795077935
-9375,7320,1193,0.16722266002845,0.16722266002845
-18274,6666,6667,0.19713796716552,0.19713796716552
-9396,4346,6344,0.137277828740194,0.137277828740194
-7038,2477,5911,0.20568880939919,0.20568880939919
-9526,7390,6591,0.199950723674749,0.199950723674749
-9527,6591,7113,0.204992725577621,0.204992725577621
-4408,4122,4123,0.139283771950412,0.139283771950412
-20440,8230,10798,0.00724995456680097,0.00724995456680097
-9657,7441,7443,0.137227628583058,0.137227628583058
-17487,4652,4653,0.0539741907357585,0.0539741907357585
-9708,7472,7473,0.0204539718039878,0.0204539718039878
-18246,9358,9377,0.403042223701425,0.403042223701425
-9812,7530,3064,0.202502418308833,0.202502418308833
-17689,6172,6173,0.109301053367223,0.109301053367223
-9839,7545,7546,0.200378656030458,0.200378656030458
-17691,6191,6192,0.114641917935369,0.114641917935369
-9862,7563,7564,0.144864127295822,0.144864127295822
-18248,8108,10283,0.203688042743378,0.203688042743378
-9912,7587,7588,0.0177693522294632,0.0177693522294632
-12245,8614,8615,0.00283454394049719,0.00283454394049719
-20023,7898,8856,0.145457290364043,0.145457290364043
-20462,10063,10815,0.0787418608501839,0.0787418608501839
-10159,5268,6906,0.123203894056526,0.123203894056526
-20464,10816,10812,0.0195704583026571,0.0195704583026571
-11511,8294,8295,0.0520431495126935,0.0520431495126935
-18214,6382,6383,0.202997553277811,0.202997553277811
-10231,6520,7739,0.0500835268559568,0.0500835268559568
-18257,3984,6760,0.19949668413334,0.19949668413334
-10280,7447,7757,0.470575008371913,0.470575008371913
-11783,8122,8036,0.0779413781888185,0.0779413781888185
-14738,6526,6538,0.170206219459847,0.170206219459847
-10497,4733,6800,0.110360790137427,0.110360790137427
-20473,10823,10777,0.00660874071248581,0.00660874071248581
-10520,7847,7425,0.0489570822105033,0.0489570822105033
-18522,4015,10297,0.0710067813209419,0.0710067813209419
-10541,7855,7856,0.177133627375528,0.177133627375528
-10542,7856,2614,0.178768427477815,0.178768427477815
-18524,1880,9146,0.0581549975210073,0.0581549975210073
-10589,7869,6640,0.0423030177562977,0.0423030177562977
-18270,5525,6463,0.15576453739372,0.15576453739372
-10616,7882,4885,0.155749664880603,0.155749664880603
-18528,9272,9525,0.133068770502091,0.133068770502091
-10639,7897,7898,0.052238135352395,0.052238135352395
-10663,7913,7914,0.0662287183378057,0.0662287183378057
-18276,1427,6667,0.0124761175920816,0.0124761175920816
-14745,4866,6690,0.193273433165028,0.193273433165028
-12385,1624,3930,0.0974730336125312,0.0974730336125312
-18277,6667,6720,0.144754021853131,0.144754021853131
-10816,7993,6492,0.0854037034050773,0.0854037034050773
-14747,6732,6733,0.0789150394398201,0.0789150394398201
-12453,3191,6107,0.202925463206431,0.202925463206431
-16202,5822,7727,0.19552660887524,0.19552660887524
-18539,5559,10311,0.589298128069539,0.589298128069539
-10890,3025,8025,0.123630898552104,0.123630898552104
-15899,9255,7490,0.0311439652684609,0.0311439652684609
-18550,4298,9428,0.104368579037722,0.104368579037722
-11283,8190,8201,0.0778576783996018,0.0778576783996018
-4409,4123,4124,0.135738728632571,0.135738728632571
-13171,7691,8995,0.0242708657605628,0.0242708657605628
-11527,809,8301,0.0665080068102908,0.0665080068102908
-15908,9084,9085,0.0343875506043555,0.0343875506043555
-14757,2212,4862,0.162593070375603,0.162593070375603
-11742,8382,8383,0.00390317600089655,0.00390317600089655
-18302,5737,2440,0.171112285574699,0.171112285574699
-11766,8404,8405,0.0591205771532174,0.0591205771532174
-11998,5505,7079,0.147126356992669,0.147126356992669
-12060,332,268,0.0944572536860071,0.0944572536860071
-4411,3048,4125,0.136438064344983,0.136438064344983
-20391,10766,10774,0.00648510043864555,0.00648510043864555
-4412,4125,4126,0.00355827872013668,0.00355827872013668
-19845,9516,10657,0.207937764412144,0.207937764412144
-16200,1790,7209,0.198939694041251,0.198939694041251
-20399,10763,3591,0.00757376863172981,0.00757376863172981
-12520,8729,1189,0.0214820993457698,0.0214820993457698
-20644,10877,4517,0.0511435578342218,0.0511435578342218
-12620,8775,4920,0.0124622300083447,0.0124622300083447
-20646,10035,10880,0.0235473019855852,0.0235473019855852
-12646,5921,920,0.178961176893159,0.178961176893159
-12691,8806,8807,0.0113998193117656,0.0113998193117656
-12822,8261,493,0.226877195561116,0.226877195561116
-13034,8927,585,0.0555278029535648,0.0555278029535648
-14668,6327,4166,0.169217141640748,0.169217141640748
-14856,9434,8907,0.112945329265115,0.112945329265115
-20835,10948,10929,0.0711141044607233,0.0711141044607233
-13572,2184,9130,0.046228028674551,0.046228028674551
-4413,4126,4127,0.123682116907034,0.123682116907034
-4414,4127,4128,0.0151340374611755,0.0151340374611755
-14780,5922,921,0.178257163080484,0.178257163080484
-13824,9203,7891,0.0449920400202888,0.0449920400202888
-13970,9249,9250,0.0321739674064664,0.0321739674064664
-20559,2957,10784,0.0120134443189883,0.0120134443189883
-14029,9262,6653,0.100609617198747,0.100609617198747
-15915,9746,9747,0.0832769023011374,0.0832769023011374
-11415,7985,8000,0.0154063290418794,0.0154063290418794
-14233,8687,6694,0.0247755996269239,0.0247755996269239
-20569,10787,10858,0.0193290169195346,0.0193290169195346
-14464,6149,3994,0.0989127437299345,0.0989127437299345
-14635,9387,9388,0.0403809617749613,0.0403809617749613
-11212,391,392,0.10291889633356,0.10291889633356
-14604,9397,9398,0.123826706008273,0.123826706008273
-14637,9406,2243,0.00956376056529555,0.00956376056529555
-15410,9588,9589,0.0190893984820006,0.0190893984820006
-15440,9601,1507,0.00768187987530518,0.00768187987530518
-16383,9771,9880,0.0381827012246672,0.0381827012246672
-16620,9937,9938,0.0704692374785171,0.0704692374785171
-11802,8392,8415,0.148179257170155,0.148179257170155
-16809,4996,728,0.102190274976312,0.102190274976312
-11640,8346,4530,0.131615785848543,0.131615785848543
-16853,6519,9854,0.0497714413737895,0.0497714413737895
-4415,4128,1171,0.138086753058786,0.138086753058786
-17269,3518,82,0.205066129886621,0.205066129886621
-11951,8499,8500,0.0607548345173342,0.0607548345173342
-17324,6799,7351,0.103019517606604,0.103019517606604
-11991,4455,5503,0.144667643977852,0.144667643977852
-17388,5920,3810,0.153093198888871,0.153093198888871
-17389,3810,10095,0.199017480070308,0.199017480070308
-17407,6122,1921,0.202694690919031,0.202694690919031
-17408,1921,7246,0.200797963530598,0.200797963530598
-12044,8523,8524,0.0621486337289915,0.0621486337289915
-17448,3247,10109,0.0544983800214201,0.0544983800214201
-4416,1171,891,0.137903948024362,0.137903948024362
-12113,8552,672,0.00266902064060136,0.00266902064060136
-17549,10132,10133,2.25328864155446,2.25328864155446
-17666,8928,10162,0.0972564668123919,0.0972564668123919
-12288,8528,8526,0.152174217990106,0.152174217990106
-17729,7332,2080,0.104548139781884,0.104548139781884
-12329,8641,8652,0.00987690479251785,0.00987690479251785
-12331,8653,8654,0.00928748638267964,0.00928748638267964
-17751,8575,6706,0.145927899456713,0.145927899456713
-12936,8688,8689,0.0364958929125483,0.0364958929125483
-17774,7679,5984,0.100495969018847,0.100495969018847
-17787,9214,536,0.151808926625465,0.151808926625465
-17822,10188,10186,0.041401555151972,0.041401555151972
-17852,10195,5678,0.0176253194989635,0.0176253194989635
-17170,1912,5280,0.200459610115248,0.200459610115248
-4417,891,4129,0.140986849802137,0.140986849802137
-12947,1304,1303,0.066448544071591,0.066448544071591
-18995,3958,5601,0.119729821294068,0.119729821294068
-18382,8919,8920,0.0492932118239397,0.0492932118239397
-19080,4746,4159,0.17797879706873,0.17797879706873
-13065,8947,8948,0.014693528299895,0.014693528299895
-19135,3168,8470,0.0222426676149063,0.0222426676149063
-20824,9337,9400,0.0122401419030242,0.0122401419030242
-19172,6804,7956,0.0915174498096421,0.0915174498096421
-19618,10588,10494,0.00731369728944242,0.00731369728944242
-19331,9893,10473,0.0200896227314349,0.0200896227314349
-15874,8889,8940,0.103516223202584,0.103516223202584
-19358,9949,10479,0.0590930811213136,0.0590930811213136
-19413,7239,3251,0.195270640148282,0.195270640148282
-19962,10674,10685,0.14613727594919,0.14613727594919
-18473,9005,9006,0.01365486811001,0.01365486811001
-20041,9172,140,0.204724385208342,0.204724385208342
-18917,10396,10397,0.0952180129620757,0.0952180129620757
-20063,2998,4930,0.100928455718765,0.100928455718765
-20587,10865,10840,0.00838601883021894,0.00838601883021894
-4418,4129,2776,0.133433939347385,0.133433939347385
-14836,7396,7377,0.030817448743492,0.030817448743492
-14837,7377,3410,0.100816825455254,0.100816825455254
-15447,9607,9608,0.0162401698909022,0.0162401698909022
-309,317,318,0.0119735018205437,0.0119735018205437
-13531,5648,3387,0.0436500601039895,0.0436500601039895
-14946,8215,8212,0.101284367879663,0.101284367879663
-13555,408,9127,0.613912488305853,0.613912488305853
-14981,9463,7091,0.107883940343108,0.107883940343108
-14982,7091,8789,0.108748219147477,0.108748219147477
-13650,9158,9159,0.0150152429008076,0.0150152429008076
-15063,8874,7430,0.0504536590179092,0.0504536590179092
-17072,3687,8133,0.141298637785039,0.141298637785039
-18493,9170,5545,0.102571946583037,0.102571946583037
-15171,9511,9512,0.0502858420296349,0.0502858420296349
-15174,9514,9515,0.0498070291463972,0.0498070291463972
-18566,10322,10323,0.186113882409967,0.186113882409967
-16100,9824,9817,0.0308009946802063,0.0308009946802063
-16101,9817,8245,0.0866075022072335,0.0866075022072335
-15444,8607,9604,0.0180426861021608,0.0180426861021608
-16161,3728,722,0.106535324504203,0.106535324504203
-16174,9840,7201,0.0108095014749508,0.0108095014749508
-16239,9856,7742,0.4032601166124,0.4032601166124
-16240,7742,5837,0.199863858168715,0.199863858168715
-15881,8762,9238,0.022425928034548,0.022425928034548
-16327,3906,3134,0.109247651866168,0.109247651866168
-16328,3134,5403,0.105230091275359,0.105230091275359
-17203,10075,10076,0.206234100938924,0.206234100938924
-17253,5918,917,0.179236073493399,0.179236073493399
-18223,1695,6884,0.201956855870188,0.201956855870188
-15286,3187,9268,0.0103389762120735,0.0103389762120735
-19421,34,3533,0.2073108703911,0.2073108703911
-19436,6852,10490,0.151686039209942,0.151686039209942
-19663,10609,9366,0.0532084205099813,0.0532084205099813
-19847,10658,7133,0.20071321213787,0.20071321213787
-19953,7857,10414,0.0579007631193554,0.0579007631193554
-19293,10471,8765,0.117981892754207,0.117981892754207
-19987,9727,10653,0.0514452608394938,0.0514452608394938
-19988,10653,1103,0.0505009558673589,0.0505009558673589
-15432,9598,7965,0.00918826645895189,0.00918826645895189
-15465,9615,9616,0.0488173542586425,0.0488173542586425
-15505,2286,4494,0.207036482148074,0.207036482148074
-18430,7784,10291,0.0493825781706533,0.0493825781706533
-15468,7963,9610,0.0129310975383002,0.0129310975383002
-15643,9669,8703,0.0154036792176203,0.0154036792176203
-15293,9561,9563,0.0354006218838869,0.0354006218838869
-15662,5995,7675,0.101107003151938,0.101107003151938
-15469,9610,9613,0.00340267268464027,0.00340267268464027
-15685,3450,6014,0.102083800598865,0.102083800598865
-18613,9261,4049,0.17355432372221,0.17355432372221
-15707,8686,8810,0.0279306326987703,0.0279306326987703
-15471,9606,8892,0.117003908235376,0.117003908235376
-15762,2940,6814,0.0992967316903301,0.0992967316903301
-15764,6595,9701,0.0232598991470647,0.0232598991470647
-14656,9410,9411,0.19733052173904,0.19733052173904
-20261,10720,5750,0.00799491979378441,0.00799491979378441
-2336,1153,2328,0.201597448584961,0.201597448584961
-17300,8716,8745,0.199099643459498,0.199099643459498
-19471,10515,10516,0.00520398584376517,0.00520398584376517
-20611,10819,10828,0.0109320789190355,0.0109320789190355
-20612,10828,10821,0.0197366861798755,0.0197366861798755
-20613,10821,10870,0.0252155503065758,0.0252155503065758
-478,480,212,0.0356029775534751,0.0356029775534751
-15859,9740,9707,0.0569780852958723,0.0569780852958723
-515,509,510,0.286655598001641,0.286655598001641
-520,514,515,0.226862534758366,0.226862534758366
-15253,9545,9538,0.0260796874031177,0.0260796874031177
-624,614,615,0.101063162513791,0.101063162513791
-19463,10483,10508,0.019159575222575,0.019159575222575
-17219,3199,3087,0.202098851695834,0.202098851695834
-702,696,697,0.1055651557861,0.1055651557861
-15544,9645,9646,0.00692347068679982,0.00692347068679982
-776,778,779,0.103928492069641,0.103928492069641
-15955,6396,500,0.195346208359328,0.195346208359328
-913,927,928,0.0495542499145439,0.0495542499145439
-915,929,930,0.0493548663548942,0.0493548663548942
-15957,9767,9768,0.0474477023795114,0.0474477023795114
-932,947,948,0.100759864187185,0.100759864187185
-15960,9770,7450,0.0160716244910599,0.0160716244910599
-955,967,968,0.0165679791310418,0.0165679791310418
-957,969,970,0.197449816642368,0.197449816642368
-15913,9240,9745,0.0339191222144473,0.0339191222144473
-980,991,992,0.138684932577873,0.138684932577873
-15891,9002,7513,0.0667178592447727,0.0667178592447727
-1003,1016,1017,0.039629871856248,0.039629871856248
-1004,1017,1018,0.176155002789907,0.176155002789907
-19469,10513,10514,0.0200709923319022,0.0200709923319022
-16388,9459,9771,0.0286077698371324,0.0286077698371324
-1087,1103,1104,0.338644304966299,0.338644304966299
-17156,3091,4971,0.202252452796884,0.202252452796884
-16103,255,8239,0.267325536990832,0.267325536990832
-1170,1186,1187,0.0990780990020656,0.0990780990020656
-16337,8026,3444,0.219522804846043,0.219522804846043
-1298,1323,1324,0.104021267127805,0.104021267127805
-1299,1324,1325,0.0988550932780109,0.0988550932780109
-16392,9847,9876,0.0466572032639634,0.0466572032639634
-1322,1347,1348,0.145300158256776,0.145300158256776
-387,389,390,0.101909828504342,0.101909828504342
-19511,10536,10537,0.0367294544686212,0.0367294544686212
-1469,1489,1490,0.0976691429125615,0.0976691429125615
-12005,8512,8049,0.105397118565585,0.105397118565585
-18733,7646,6209,0.175022021354251,0.175022021354251
-16766,5003,7290,0.0493746723595829,0.0493746723595829
-1495,1515,1473,0.1629816039782,0.1629816039782
-1497,1516,1517,0.202642438735294,0.202642438735294
-16788,10012,8649,0.310114997807766,0.310114997807766
-1549,1574,1575,0.0819858846366358,0.0819858846366358
-1550,1575,1576,0.0787364050378914,0.0787364050378914
-12359,8664,8670,0.00994780391809775,0.00994780391809775
-16806,9858,3171,0.0510524682713306,0.0510524682713306
-1570,1597,1598,0.101896558922667,0.101896558922667
-2686,2646,2647,0.164307180037452,0.164307180037452
-17103,9923,330,0.250512453112542,0.250512453112542
-1650,1677,1678,0.13227170643909,0.13227170643909
-11530,810,811,0.199368445906152,0.199368445906152
-16952,10036,10037,0.00823596195269871,0.00823596195269871
-1704,1725,1726,0.0532102629650272,0.0532102629650272
-17039,9210,8988,0.00924605732532601,0.00924605732532601
-1762,1487,1782,0.108567137541803,0.108567137541803
-14689,2798,2868,0.199650986040528,0.199650986040528
-17136,4412,4425,0.202602949014775,0.202602949014775
-17489,472,4654,0.0574342005254488,0.0574342005254488
-1935,1949,1223,0.041131087786823,0.041131087786823
-1937,1950,1951,0.0773266220673917,0.0773266220673917
-16304,2826,2827,0.0584380832256012,0.0584380832256012
-17962,10235,5193,0.0148018460000789,0.0148018460000789
-2187,2187,2188,0.0698088769426891,0.0698088769426891
-17834,10187,10188,0.0373456729353608,0.0373456729353608
-17023,10058,10059,0.043764797810192,0.043764797810192
-2261,2261,2262,0.20174624930555,0.20174624930555
-20285,10701,10709,0.0172154433985116,0.0172154433985116
-16421,3331,3358,0.0229870189622456,0.0229870189622456
-20297,5579,7524,0.0531120067375217,0.0531120067375217
-12353,8669,8661,0.00857375962495721,0.00857375962495721
-16657,3462,3464,0.173665424327281,0.173665424327281
-19565,10567,7463,0.00795043725476521,0.00795043725476521
-17162,5087,5107,0.202243070877092,0.202243070877092
-19034,10159,9497,0.0427022948506461,0.0427022948506461
-20744,9001,10918,0.332184959452437,0.332184959452437
-20748,10921,10922,0.0509227801768603,0.0509227801768603
-20749,10923,10924,0.18669804780169,0.18669804780169
-20750,10925,10926,0.0392592111051346,0.0392592111051346
-20752,10927,10928,0.00711510327217607,0.00711510327217607
-20754,10929,10930,0.0834966641757845,0.0834966641757845
-20756,10931,10932,0.0408755067283247,0.0408755067283247
-20758,10933,10934,0.0399346912680156,0.0399346912680156
-20760,10935,10936,0.0903151185359097,0.0903151185359097
-20762,10937,8302,0.00392992290489043,0.00392992290489043
-20763,8302,10927,0.00412640673301695,0.00412640673301695
-20765,10918,3754,0.00609979968071289,0.00609979968071289
-20766,3754,10938,0.00661123306657495,0.00661123306657495
-20768,10920,7783,0.00949225948867298,0.00949225948867298
-20769,7783,10939,0.00900064827794335,0.00900064827794335
-20771,10940,3415,0.00746326017722055,0.00746326017722055
-20772,3415,10941,0.00571991053425525,0.00571991053425525
-20774,10938,10942,0.117980886182769,0.117980886182769
-20776,10941,10943,0.040800141538403,0.040800141538403
-20778,10929,8910,0.00644678344686978,0.00644678344686978
-20779,8910,10944,0.00853909895805364,0.00853909895805364
-20781,10926,10280,0.00413065470277064,0.00413065470277064
-20782,10280,10933,0.00507364819278473,0.00507364819278473
-16513,9922,1630,0.0152212141119797,0.0152212141119797
-16537,3671,9932,0.221180884679333,0.221180884679333
-16539,9933,7834,0.139783679739911,0.139783679739911
-16790,10013,7828,0.227723092786938,0.227723092786938
-18645,1318,5867,0.177222990129465,0.177222990129465
-16960,10042,10043,0.0112267703364208,0.0112267703364208
-17266,3520,4261,0.200318193124263,0.200318193124263
-18444,10290,1124,0.0512555936349529,0.0512555936349529
-17645,7,9825,0.783906819132393,0.783906819132393
-18721,5864,1312,0.178403401011926,0.178403401011926
-18408,6096,10287,0.0607868213781131,0.0607868213781131
-17821,10187,10188,0.0373456729353608,0.0373456729353608
-17849,2817,1418,0.198773063708036,0.198773063708036
-17914,4748,4144,0.180736428235498,0.180736428235498
-17915,4144,2362,0.17239723292509,0.17239723292509
-18664,5184,5652,0.105551381348891,0.105551381348891
-18600,10333,10334,0.176228489643034,0.176228489643034
-18763,10341,10340,0.0478284118767837,0.0478284118767837
-18822,10356,10117,0.120644655146847,0.120644655146847
-12967,1825,1881,0.094094502294363,0.094094502294363
-19280,10465,10466,0.126391742395325,0.126391742395325
-19156,8422,10431,0.296704595839795,0.296704595839795
-19440,7907,10492,0.0345487307061229,0.0345487307061229
-20295,10709,10710,0.0460287189373458,0.0460287189373458
-3578,3435,3436,0.0484142710611121,0.0484142710611121
-3579,3436,2495,0.0837858518069818,0.0837858518069818
-3580,2495,3437,0.120116992356444,0.120116992356444
-3581,3437,2842,0.00242442592962248,0.00242442592962248
-14124,506,3659,0.275685944218073,0.275685944218073
-16901,3513,74,0.203700975919817,0.203700975919817
-18139,6038,10260,0.200840451178757,0.200840451178757
-19824,7641,5603,0.172193293465978,0.172193293465978
-19832,10652,10653,0.149094174776889,0.149094174776889
-16543,3555,814,0.153171011691858,0.153171011691858
-20427,10755,10788,0.051994279761698,0.051994279761698
-11503,6094,2973,0.264851184287827,0.264851184287827
-11438,8034,511,0.21998121248842,0.21998121248842
-16767,7290,3183,0.0591297362625136,0.0591297362625136
-20517,10806,10844,0.0093521291785604,0.0093521291785604
-18290,6889,6752,0.139920838374264,0.139920838374264
-11434,8077,8253,0.0508611139110148,0.0508611139110148
-20513,10060,10809,0.00760770059759869,0.00760770059759869
-18366,7716,7754,0.0519727898310098,0.0519727898310098
-11784,8036,2685,0.144743408596787,0.144743408596787
-11570,8321,7713,0.150502362587478,0.150502362587478
-18376,8353,6069,0.193914067776721,0.193914067776721
-12066,8533,8534,0.0445577347958965,0.0445577347958965
-16678,9979,9981,0.0909471727810372,0.0909471727810372
-20808,10948,8326,0.017351380837649,0.017351380837649
-13031,590,8926,0.147745966959296,0.147745966959296
-18483,9138,9139,0.0109683239632665,0.0109683239632665
-16502,3167,9925,0.137835608828632,0.137835608828632
-16961,10043,10044,0.075399787572802,0.075399787572802
-17393,67,3508,0.205321571793414,0.205321571793414
-17395,68,7304,0.202979892499458,0.202979892499458
-17650,303,395,0.11664951410225,0.11664951410225
-18596,10330,1845,0.0286669821878414,0.0286669821878414
-18996,5601,9265,0.00587624613864547,0.00587624613864547
-19117,402,10431,0.249198506812358,0.249198506812358
-19489,4703,10441,0.0209493756701814,0.0209493756701814
-19929,9514,10680,0.206733607617385,0.206733607617385
-20583,10849,9338,0.00790665036605531,0.00790665036605531
-20193,10707,9813,0.31051590829715,0.31051590829715
-19738,9472,4893,0.184563607099297,0.184563607099297
-19739,4893,9418,0.161581410791365,0.161581410791365
-19740,9418,955,0.17512104217346,0.17512104217346
-19741,955,8865,0.17730267158364,0.17730267158364
-19745,4908,6614,0.202025102521769,0.202025102521769
-19746,6614,9456,0.193906231686937,0.193906231686937
-19747,9456,10644,0.207835763228408,0.207835763228408
-19748,10644,647,0.139231068042996,0.139231068042996
-19807,7868,3718,0.103509284327612,0.103509284327612
-19756,9305,1209,0.168197350020426,0.168197350020426
-19906,9507,10678,0.206369047895258,0.206369047895258
-17115,582,4052,0.0200066549889732,0.0200066549889732
-20290,10700,10701,0.0224013855081139,0.0224013855081139
-15856,9738,9733,0.00602831355714784,0.00602831355714784
-16390,9811,3033,0.00758642111179705,0.00758642111179705
-17208,234,10075,0.0065072113132931,0.0065072113132931
-18209,3991,6766,0.202297976338321,0.202297976338321
-314,322,323,0.0362830323344,0.0362830323344
-17944,10224,7938,0.0484797623817722,0.0484797623817722
-11519,657,658,0.200633396770054,0.200633396770054
-18400,7187,1425,0.131517435591527,0.131517435591527
-16448,9905,9906,0.00998689980616885,0.00998689980616885
-1705,1726,1727,0.0778502303245676,0.0778502303245676
-19817,3729,10647,0.0543545423636727,0.0543545423636727
-20793,10938,8908,0.0180004191395181,0.0180004191395181
-19241,8221,10460,0.0833729876311698,0.0833729876311698
-18639,5180,2582,0.17723417320802,0.17723417320802
-20291,10701,10703,0.028889965052559,0.028889965052559
-19963,4945,7404,0.157747728004848,0.157747728004848
-5109,4628,4629,0.132844583260552,0.132844583260552
-13926,8916,8922,0.136369708465648,0.136369708465648
-19964,7404,10415,0.200029723937468,0.200029723937468
-12274,8517,8518,0.0318537260898596,0.0318537260898596
-302,310,311,0.0714603355500818,0.0714603355500818
-307,315,316,0.0430385391585726,0.0430385391585726
-333,333,334,0.130005791781119,0.130005791781119
-501,338,339,0.0809671757461818,0.0809671757461818
-337,340,336,0.244398847800565,0.244398847800565
-339,341,342,0.368758396632831,0.368758396632831
-341,343,344,0.267836247641829,0.267836247641829
-1553,1578,1579,0.0969614959298273,0.0969614959298273
-360,362,363,0.19757055700413,0.19757055700413
-361,363,358,0.235481235248911,0.235481235248911
-365,366,367,0.102920688901431,0.102920688901431
-374,376,377,0.135433574317766,0.135433574317766
-376,378,379,0.134391053348824,0.134391053348824
-485,478,486,0.209563350313202,0.209563350313202
-489,489,490,0.0633762863456435,0.0633762863456435
-491,491,492,0.0663732872105415,0.0663732872105415
-493,493,494,0.169203096380544,0.169203096380544
-495,5,495,0.258130691528307,0.258130691528307
-496,495,496,0.152370734557831,0.152370734557831
-523,518,519,0.337507977198885,0.337507977198885
-525,520,521,0.106662672722042,0.106662672722042
-527,522,523,0.0555974633225448,0.0555974633225448
-529,524,525,0.0282350762510443,0.0282350762510443
-530,525,526,0.0218806529722405,0.0218806529722405
-532,527,397,0.320431501428441,0.320431501428441
-11515,270,528,0.19992365959325,0.19992365959325
-535,529,530,0.455513641378482,0.455513641378482
-537,531,532,0.375956762810707,0.375956762810707
-11371,7972,290,0.0119699038475456,0.0119699038475456
-14734,4868,2218,0.161837248854237,0.161837248854237
-6872,5877,5878,0.0844725820315708,0.0844725820315708
-16249,9860,8753,0.202765718025687,0.202765718025687
-16250,8753,9861,0.201364638358659,0.201364638358659
-16251,9861,3662,0.165177264018871,0.165177264018871
-20720,9398,9340,0.00984702702877527,0.00984702702877527
-16256,9863,8751,0.202603541868936,0.202603541868936
-16260,3650,88,0.266027674120579,0.266027674120579
-16261,88,3524,0.203075294530693,0.203075294530693
-16262,3524,9864,0.20046430405241,0.20046430405241
-16263,9864,6517,0.135079896017257,0.135079896017257
-19523,6855,10544,0.00712022213135496,0.00712022213135496
-19524,10544,10545,0.0729342151704198,0.0729342151704198
-19526,10427,10546,0.0076995400840501,0.0076995400840501
-19527,10546,10545,0.0321755552809886,0.0321755552809886
-19528,10545,10547,0.0194542890583841,0.0194542890583841
-19529,10547,10548,0.0207030648178635,0.0207030648178635
-19530,10548,10543,0.0190435691175833,0.0190435691175833
-19531,10543,10549,0.0747704686946873,0.0747704686946873
-19532,10549,6859,0.00739470505760699,0.00739470505760699
-19543,10555,10556,0.0878912692065361,0.0878912692065361
-19544,10556,7460,0.0082175900444136,0.0082175900444136
-11808,8395,2692,0.146729521611774,0.146729521611774
-19546,6852,10557,0.00689466829919516,0.00689466829919516
-19547,10557,10558,0.00988642805887056,0.00988642805887056
-19548,10558,10559,0.0350073244923259,0.0350073244923259
-19550,10409,10559,0.0205641181514586,0.0205641181514586
-343,345,346,0.0953881878570937,0.0953881878570937
-357,359,360,0.0408490640041322,0.0408490640041322
-359,361,362,0.026041104546106,0.026041104546106
-19800,8772,7638,0.176309543452907,0.176309543452907
-19802,6235,5200,0.174765267300994,0.174765267300994
-14862,8517,9439,0.0489472304938478,0.0489472304938478
-14864,9387,9440,0.0279990514780242,0.0279990514780242
-206,104,218,0.105140809305177,0.105140809305177
-207,218,219,0.425726992195474,0.425726992195474
-208,219,220,0.341194420964085,0.341194420964085
-564,250,558,0.137167107757782,0.137167107757782
-566,559,560,0.116737480647973,0.116737480647973
-570,563,564,0.00248176882120935,0.00248176882120935
-571,564,565,0.0167681949380125,0.0167681949380125
-573,566,248,0.898480310845601,0.898480310845601
-577,569,570,0.20355346310439,0.20355346310439
-578,570,571,0.196730394721169,0.196730394721169
-579,571,572,0.203615183123948,0.203615183123948
-580,572,573,0.198181200751108,0.198181200751108
-14119,4047,3768,0.167133877022618,0.167133877022618
-16964,10030,10041,0.01368783886441,0.01368783886441
-17397,72,7305,0.205159206156883,0.205159206156883
-18238,8494,6764,0.145768349374275,0.145768349374275
-19608,10515,10585,0.0689638415978994,0.0689638415978994
-18764,10340,10339,0.0412859123428405,0.0412859123428405
-18823,10117,10113,0.0135016334010227,0.0135016334010227
-19106,10358,10371,0.165108727109845,0.165108727109845
-19491,10447,10448,0.0188144168916081,0.0188144168916081
-20034,9939,10087,0.139116164222915,0.139116164222915
-20585,10868,10860,0.0191301130167572,0.0191301130167572
-16225,9851,8750,0.201618763717288,0.201618763717288
-16226,8750,9852,0.201631838787549,0.201631838787549
-16227,9852,3528,0.200735525849656,0.200735525849656
-16228,3528,92,0.203732802229698,0.203732802229698
-16230,9853,7739,0.398547510805713,0.398547510805713
-16231,7739,5833,0.201507956367007,0.201507956367007
-16232,5833,9854,0.202599224942483,0.202599224942483
-16233,9854,8749,0.200829688485991,0.200829688485991
-16234,8749,9855,0.20199683583572,0.20199683583572
-16235,9855,3526,0.201154889365918,0.201154889365918
-16236,3526,90,0.202910490655376,0.202910490655376
-16237,90,3653,0.220628466219896,0.220628466219896
-16241,5837,9857,0.2019855844315,0.2019855844315
-16242,9857,8752,0.20368896268505,0.20368896268505
-16243,8752,9858,0.200451227373991,0.200451227373991
-16244,9858,3660,0.230907711206458,0.230907711206458
-16248,5838,9860,0.202297457689378,0.202297457689378
-19645,10602,7824,0.0258612340137364,0.0258612340137364
-363,364,365,0.559719374351914,0.559719374351914
-19907,10678,9721,0.0996291174385701,0.0996291174385701
-506,500,501,0.0135415609654236,0.0135415609654236
-561,555,249,0.135203722470136,0.135203722470136
-11580,1888,1889,0.200666363671928,0.200666363671928
-15798,2349,2131,0.0298025813439396,0.0298025813439396
-539,533,534,0.0326127113197712,0.0326127113197712
-19790,4873,2223,0.160309891999679,0.160309891999679
-19791,2223,939,0.184480311036498,0.184480311036498
-19793,6601,8056,0.176023947078255,0.176023947078255
-18090,1076,4197,0.0860162512015724,0.0860162512015724
-19867,5588,10668,0.0462472353637014,0.0462472353637014
-19868,10668,3867,0.0484404910203503,0.0484404910203503
-16756,10007,10009,0.110124788745591,0.110124788745591
-20270,10704,10719,0.0406376536123098,0.0406376536123098
-20705,10912,9190,0.00712573261129369,0.00712573261129369
-18194,10279,8107,0.203288621260674,0.203288621260674
-20434,10793,8352,0.0594105399024928,0.0594105399024928
-458,461,462,0.198429530791892,0.198429530791892
-460,463,464,0.0462542784573108,0.0462542784573108
-462,465,466,0.144675049024067,0.144675049024067
-17120,4175,1798,0.171169073462998,0.171169073462998
-464,265,467,0.159364568867095,0.159364568867095
-18157,6034,6309,0.201831068920315,0.201831068920315
-4816,4421,3998,0.17545447475176,0.17545447475176
-4922,4493,4494,0.0159365819430951,0.0159365819430951
-5210,4702,4703,0.066548442936564,0.066548442936564
-7813,6447,2400,0.0150551554736642,0.0150551554736642
-16544,814,7835,0.140306546265127,0.140306546265127
-12308,8643,8644,0.0690537561530006,0.0690537561530006
-17649,227,303,0.195568266331611,0.195568266331611
-7918,6517,6518,0.0762261509888863,0.0762261509888863
-17937,10218,10222,0.0404413602972235,0.0404413602972235
-17938,10222,10219,0.0368645715567014,0.0368645715567014
-8128,6642,6643,0.177723704306915,0.177723704306915
-17941,10223,10220,0.00249551892827132,0.00249551892827132
-17943,10222,10224,0.00241172243246435,0.00241172243246435
-8312,6745,6746,0.136482587401898,0.136482587401898
-18754,7413,5870,0.17727401445854,0.17727401445854
-18755,5870,1322,0.17769011554913,0.17769011554913
-19718,10634,10631,0.0223829659698328,0.0223829659698328
-19728,5372,10636,0.0113147577104563,0.0113147577104563
-11655,8352,8354,0.0940321887930874,0.0940321887930874
-12943,1331,8882,0.0183910567310257,0.0183910567310257
-13038,8921,8931,0.0826069320981336,0.0826069320981336
-15877,9002,8833,0.267177283911404,0.267177283911404
-13924,219,9234,0.1533276461132,0.1533276461132
-14664,6543,4752,0.198706695176553,0.198706695176553
-14064,5103,7930,0.0939071679637344,0.0939071679637344
-15409,9587,9588,0.102439715732603,0.102439715732603
-17271,7309,3269,0.20118551117184,0.20118551117184
-19597,10581,10493,0.00740818165509206,0.00740818165509206
-17856,10198,10199,0.0985751913110846,0.0985751913110846
-17916,2362,5630,0.113519118424065,0.113519118424065
-17920,5276,3075,0.102745112375949,0.102745112375949
-19227,10451,10452,0.0446144989444803,0.0446144989444803
-20035,10087,7837,0.13791526067504,0.13791526067504
-418,417,418,0.0816052997413777,0.0816052997413777
-20262,5750,10721,0.00796157509542264,0.00796157509542264
-3789,1821,3611,0.0958389453890581,0.0958389453890581
-3790,3611,2772,0.203476606019223,0.203476606019223
-3793,3613,3614,0.132946325644283,0.132946325644283
-3796,3616,3617,0.204716112848492,0.204716112848492
-3797,3617,3618,0.195623928497501,0.195623928497501
-427,426,427,0.387676950856037,0.387676950856037
-429,428,429,0.0146752084107322,0.0146752084107322
-430,429,430,0.036859949213086,0.036859949213086
-431,430,431,0.0704161362424121,0.0704161362424121
-432,431,432,0.590519007108071,0.590519007108071
-4284,2975,658,0.052473064124837,0.052473064124837
-4286,1885,270,0.0500105419976734,0.0500105419976734
-4287,270,4027,0.0498040073250557,0.0498040073250557
-4288,4027,4028,0.0589001114271481,0.0589001114271481
-4289,4028,4029,0.0431017175700998,0.0431017175700998
-4360,2497,4085,0.0418616206629569,0.0418616206629569
-4362,4086,4087,0.0498519055829618,0.0498519055829618
-4375,4097,4098,0.0489802870312836,0.0489802870312836
-4376,4098,4099,0.0495757400917575,0.0495757400917575
-4377,4099,1289,0.0496665540814756,0.0496665540814756
-4388,1566,4105,0.137573017409453,0.137573017409453
-4391,695,4107,0.201385149795677,0.201385149795677
-4393,4108,4109,0.0199664273987825,0.0199664273987825
-14838,3410,8377,0.101986580237,0.101986580237
-14839,8377,7446,0.0983251649921582,0.0983251649921582
-14840,7446,7164,0.102406305295689,0.102406305295689
-14842,7777,9006,0.0511080596626327,0.0511080596626327
-14843,9006,1118,0.0498086503332092,0.0498086503332092
-14844,1118,9427,0.0503946729534928,0.0503946729534928
-14845,9427,7495,0.0500441160343634,0.0500441160343634
-14846,7495,9428,0.0499148481472719,0.0499148481472719
-16340,8082,9873,0.204288977647072,0.204288977647072
-16284,2160,2852,0.333640243849923,0.333640243849923
-16319,7334,9870,0.105486497466828,0.105486497466828
-16320,9870,3330,0.104529154175209,0.104529154175209
-16321,3330,5008,0.105000246042652,0.105000246042652
-16322,5008,9871,0.101110660676404,0.101110660676404
-16323,9871,6279,0.105691817248501,0.105691817248501
-16324,6279,9872,0.052158145666091,0.052158145666091
-16325,9872,1044,0.0524997416021315,0.0524997416021315
-16326,1044,3906,0.105460879039182,0.105460879039182
-16329,5403,7356,0.10569318364656,0.10569318364656
-16330,7356,6784,0.104889107310835,0.104889107310835
-16331,6784,5124,0.210810768544514,0.210810768544514
-20721,9340,10905,0.00789820611305507,0.00789820611305507
-20723,10753,9339,0.007875732855517,0.007875732855517
-20728,9342,9396,0.0106743790650573,0.0106743790650573
-20729,9396,10915,0.00762676803615786,0.00762676803615786
-20731,10886,10916,0.00379288018005415,0.00379288018005415
-20732,10916,10888,0.0491926355480291,0.0491926355480291
-20733,10888,10897,0.0175392611655491,0.0175392611655491
-20735,5884,5882,0.0407543500383345,0.0407543500383345
-20739,10916,10896,0.0428179717864665,0.0428179717864665
-19515,10538,10539,0.0270370607457707,0.0270370607457707
-19519,10540,10541,0.0721562499053708,0.0721562499053708
-19520,6858,10542,0.00731747119062453,0.00731747119062453
-19521,10542,10543,0.072308027249243,0.072308027249243
-19641,10598,10599,0.0410277962156296,0.0410277962156296
-19647,10527,10603,0.00759964014854772,0.00759964014854772
-8,8,9,0.136291899256532,0.136291899256532
-9,9,10,0.137589063327607,0.137589063327607
-10,10,11,0.132825874246234,0.132825874246234
-18420,9372,1692,0.204432374496239,0.204432374496239
-18421,1692,6881,0.204488584881531,0.204488584881531
-279,289,290,0.0346246156131069,0.0346246156131069
-280,290,291,0.0090342150661118,0.0090342150661118
-287,297,298,0.583705095697001,0.583705095697001
-288,298,299,0.306214311798175,0.306214311798175
-290,300,106,0.00724031766776508,0.00724031766776508
-16839,9888,10020,0.0079899169832474,0.0079899169832474
-292,301,302,0.137922345506014,0.137922345506014
-293,302,303,0.195856797695859,0.195856797695859
-295,304,305,0.071509984134022,0.071509984134022
-296,305,291,0.00958395052624692,0.00958395052624692
-298,306,307,0.132706668323714,0.132706668323714
-300,308,309,0.180558406302622,0.180558406302622
-13564,3088,497,0.0577004807279618,0.0577004807279618
-549,543,426,0.352446625998258,0.352446625998258
-552,546,547,0.162031197296959,0.162031197296959
-555,549,550,0.0907371722674166,0.0907371722674166
-16080,9284,9816,0.896094060874208,0.896094060874208
-922,936,937,0.0492564901299232,0.0492564901299232
-923,937,938,0.0472982580528762,0.0472982580528762
-924,938,939,0.0491354084196454,0.0491354084196454
-925,939,940,0.0508720309451131,0.0508720309451131
-926,940,941,0.0492045261244582,0.0492045261244582
-928,942,943,0.0497647165539241,0.0497647165539241
-929,943,944,0.0490705088651407,0.0490705088651407
-930,944,945,0.0603455693296164,0.0603455693296164
-931,946,947,0.0401316151990327,0.0401316151990327
-933,948,949,0.0998226264147839,0.0998226264147839
-934,949,950,0.0983576522120727,0.0983576522120727
-15935,9756,9757,0.156652526688463,0.156652526688463
-2725,2680,2681,0.0108684198063562,0.0108684198063562
-2726,2681,2682,0.048953084737917,0.048953084737917
-2727,2682,2683,0.0539629704453868,0.0539629704453868
-2728,2683,2684,0.0523967582185389,0.0523967582185389
-2730,2685,2686,0.0561874543205358,0.0561874543205358
-2731,2686,2687,0.0505746825733151,0.0505746825733151
-2732,2687,2688,0.0532702991765301,0.0532702991765301
-2733,2688,2689,0.0520434204860384,0.0520434204860384
-2734,2689,2690,0.0469426670134342,0.0469426670134342
-2735,2690,2691,0.0055983554055492,0.0055983554055492
-2736,2691,2692,0.0527791994653692,0.0527791994653692
-2737,2692,2693,0.0530982869497539,0.0530982869497539
-2738,2693,2694,0.0517656440902012,0.0517656440902012
-2740,2695,2696,0.0564222695417846,0.0564222695417846
-2741,2696,2697,0.0491123681137852,0.0491123681137852
-2743,2698,2563,0.102019026624601,0.102019026624601
-2745,2699,2700,0.132875620799413,0.132875620799413
-2746,2700,2701,0.135383174760531,0.135383174760531
-2747,2701,2702,0.142428760025563,0.142428760025563
-2749,2703,2704,0.0110418183352839,0.0110418183352839
-3232,1186,3146,0.0222724242580952,0.0222724242580952
-3233,3146,3147,0.199414112058729,0.199414112058729
-3235,3148,3149,0.202164772668483,0.202164772668483
-3236,3149,3150,0.200873635711822,0.200873635711822
-3238,1549,3151,0.20099284178908,0.20099284178908
-3239,3151,284,0.102708547785912,0.102708547785912
-3241,3152,3153,0.190699299195112,0.190699299195112
-3242,3153,3154,0.20682256355895,0.20682256355895
-3244,3155,3156,0.180582058742099,0.180582058742099
-3245,3156,3157,0.169576673169674,0.169576673169674
-3246,3157,3158,0.182296097160239,0.182296097160239
-3247,3158,3159,0.198872141197801,0.198872141197801
-3248,3159,3160,0.150969541792736,0.150969541792736
-3250,3161,3162,0.20389937284006,0.20389937284006
-14826,8301,6748,0.0667725814392886,0.0667725814392886
-14827,6748,7911,0.0672145953526644,0.0672145953526644
-14828,7911,6148,0.0663282745787247,0.0663282745787247
-258,257,266,0.0587628088830451,0.0587628088830451
-19749,647,7274,0.134298165118703,0.134298165118703
-19750,7274,1989,0.0916188684792704,0.0916188684792704
-19751,1989,1973,0.0380843237979454,0.0380843237979454
-19752,1973,4593,0.133556226393108,0.133556226393108
-19753,4593,6480,0.132288869732613,0.132288869732613
-19754,6480,2468,0.142585895231316,0.142585895231316
-19758,9421,959,0.172665861332853,0.172665861332853
-19759,959,10645,0.13147788241291,0.13147788241291
-19760,1208,9304,0.168127340065809,0.168127340065809
-20582,10869,10849,0.0156424449925145,0.0156424449925145
-19762,9148,5948,0.203948884455816,0.203948884455816
-19763,5948,5140,0.230511938313211,0.230511938313211
-19771,9419,957,0.173152824232778,0.173152824232778
-19772,957,8866,0.177567389214567,0.177567389214567
-19773,8866,3772,0.153916736097948,0.153916736097948
-19774,3772,10250,0.199306990270457,0.199306990270457
-19776,5481,9962,0.172319939483889,0.172319939483889
-19784,10633,5611,0.0523352586472612,0.0523352586472612
-19785,5611,10632,0.0574818788883128,0.0574818788883128
-19786,10632,3948,0.0628606527024246,0.0628606527024246
-19788,5471,9476,0.170862748175182,0.170862748175182
-19795,10242,7118,0.176747024157438,0.176747024157438
-19797,10241,6597,0.176287163937986,0.176287163937986
-19798,6597,8052,0.177501084527478,0.177501084527478
-19799,8052,8772,0.17769668863416,0.17769668863416
-20115,7697,7687,0.0337511699796145,0.0337511699796145
-19903,5589,10662,0.0571161687994488,0.0571161687994488
-19904,10662,7532,0.0504117571952022,0.0504117571952022
-19905,7532,10677,0.0997820208770486,0.0997820208770486
-19909,2313,6581,0.0799825399923036,0.0799825399923036
-19911,9640,7119,0.178268282456568,0.178268282456568
-19912,7119,10244,0.176467674531692,0.176467674531692
-19924,625,10679,0.208701850480872,0.208701850480872
-3596,897,3446,0.139044776802754,0.139044776802754
-3598,2803,3447,0.126707874592684,0.126707874592684
-3599,3447,3448,0.123301295397385,0.123301295397385
-3601,3449,3450,0.173676950071542,0.173676950071542
-3602,3450,2355,0.178205364659248,0.178205364659248
-3603,2355,3451,0.173197360497638,0.173197360497638
-19562,10565,7475,0.0791516149409225,0.0791516149409225
-3604,3451,3452,0.173541943088937,0.173541943088937
-17079,9872,1162,0.139149030623918,0.139149030623918
-3605,3452,3453,0.1769778659128,0.1769778659128
-3606,3453,3454,0.165627970000561,0.165627970000561
-3607,3454,1205,0.168543363105219,0.168543363105219
-3608,1205,3455,0.0221544930319224,0.0221544930319224
-3609,3455,3456,0.199430319568372,0.199430319568372
-3610,3456,3457,0.153671457388635,0.153671457388635
-3611,3457,954,0.177011997745418,0.177011997745418
-3616,3461,3023,0.066721008314693,0.066721008314693
-3617,3023,609,0.0626815132610695,0.0626815132610695
-3618,609,3465,0.0706324711687883,0.0706324711687883
-3620,3466,3467,0.0872559719077514,0.0872559719077514
-3621,3467,3468,0.0185752884131515,0.0185752884131515
-3624,3470,3471,0.137381540377109,0.137381540377109
-3625,3471,3472,0.139227388345715,0.139227388345715
-3627,3473,2394,0.0888475437763938,0.0888475437763938
-3628,2394,3474,0.138668820339117,0.138668820339117
-3630,752,1572,0.142095074047717,0.142095074047717
-3636,1922,3478,0.201186325897418,0.201186325897418
-3639,3479,78,0.204132972246117,0.204132972246117
-3640,78,3480,0.203867249894849,0.203867249894849
-3641,3480,3481,0.201309535256297,0.201309535256297
-3642,3481,3482,0.20059690465602,0.20059690465602
-3643,3482,3483,0.19983968701354,0.19983968701354
-3645,3484,3485,0.206291326448342,0.206291326448342
-17801,8859,9953,0.0450786858997054,0.0450786858997054
-3647,1956,3486,0.372627158727207,0.372627158727207
-3649,3487,3488,0.176001514646942,0.176001514646942
-3652,3491,3492,0.0183360753269697,0.0183360753269697
-3653,3492,1957,0.294352299971408,0.294352299971408
-3655,1514,1794,0.180158106731211,0.180158106731211
-3657,3493,3494,0.410250831833552,0.410250831833552
-3658,3494,3495,0.80930180387284,0.80930180387284
-3660,3497,3498,0.0969369694749486,0.0969369694749486
-3661,3498,3499,0.0991356893770485,0.0991356893770485
-3662,3499,3500,0.0998795294298673,0.0998795294298673
-3663,3500,3501,0.0512305304785401,0.0512305304785401
-3664,3501,3502,0.04790242821524,0.04790242821524
-3665,3502,3503,0.0976724268185372,0.0976724268185372
-3666,3503,3504,0.099556042023676,0.099556042023676
-3667,3504,3505,0.0928685437479174,0.0928685437479174
-3668,3505,3506,0.0161263903021828,0.0161263903021828
-3670,3507,3508,0.0452502277318962,0.0452502277318962
-3673,3510,3511,0.00276384344441178,0.00276384344441178
-3674,3511,3512,0.10075109326777,0.10075109326777
-3675,3512,3513,0.0463453549611142,0.0463453549611142
-3676,3513,3514,0.0488777906121745,0.0488777906121745
-3677,3514,3515,0.0517011274556552,0.0517011274556552
-3678,3515,3480,0.0495708012211316,0.0495708012211316
-3679,3480,3516,0.0493402083699287,0.0493402083699287
-3680,3516,3517,0.0507690156276584,0.0507690156276584
-3681,3517,3518,0.0480408906902884,0.0480408906902884
-3682,3518,3519,0.0499402493817724,0.0499402493817724
-3683,3519,3520,0.0491944164243011,0.0491944164243011
-3685,3521,3522,0.048707440700188,0.048707440700188
-3686,3522,3523,0.0553123927733894,0.0553123927733894
-3688,3524,3525,0.0491959341758901,0.0491959341758901
-3689,3525,3526,0.0471666433723512,0.0471666433723512
-3690,3526,3527,0.0512305206815533,0.0512305206815533
-3693,2737,3529,0.051933950168584,0.051933950168584
-3694,3529,3530,0.02212553176718,0.02212553176718
-3695,3530,3531,0.0926927616463166,0.0926927616463166
-3698,3533,3534,0.0505032949697016,0.0505032949697016
-3699,3534,3535,0.0486395723695605,0.0486395723695605
-3700,3535,3536,0.0490245580059416,0.0490245580059416
-3701,3536,3537,0.0505772192147856,0.0505772192147856
-3703,3538,3540,0.0504276967004131,0.0504276967004131
-3705,3541,3542,0.0472106572615262,0.0472106572615262
-3706,3542,1776,0.0526607102662498,0.0526607102662498
-3707,1776,3543,0.0501355164587406,0.0501355164587406
-3708,3543,3545,0.0479683302933595,0.0479683302933595
-3709,3545,3546,0.0512089379810606,0.0512089379810606
-3712,3547,3548,0.0501783172118128,0.0501783172118128
-3714,3549,3550,0.0951894457465396,0.0951894457465396
-3716,3374,3551,0.137804864391147,0.137804864391147
-3717,3552,3553,0.0519171995444708,0.0519171995444708
-3718,3553,3554,0.0504125238991067,0.0504125238991067
-3719,3554,3555,0.0509345511135035,0.0509345511135035
-3720,3555,3556,0.0352813695033733,0.0352813695033733
-3721,3556,3557,0.0165592866582096,0.0165592866582096
-3722,3557,3558,0.0492318634139881,0.0492318634139881
-3724,2895,3559,0.10435477566087,0.10435477566087
-3725,3559,3560,0.106943183049813,0.106943183049813
-3726,3560,3561,0.104660660979737,0.104660660979737
-3727,3561,3562,0.110121719044693,0.110121719044693
-3728,3562,3563,0.102966459525542,0.102966459525542
-3730,3564,3565,0.0562722873891167,0.0562722873891167
-3735,3568,3569,0.0531044201649232,0.0531044201649232
-3736,3569,3570,0.106391147104451,0.106391147104451
-3737,3570,3571,0.101252017782574,0.101252017782574
-3738,3571,3323,0.106405710576167,0.106405710576167
-3739,3323,3572,0.102008288172629,0.102008288172629
-3740,3572,3573,0.10165616841443,0.10165616841443
-3741,3573,2074,0.102582871487582,0.102582871487582
-3742,2074,2671,0.108231570849142,0.108231570849142
-3743,2671,3574,0.10456159833902,0.10456159833902
-5002,115,4548,0.0219059413647985,0.0219059413647985
-3744,3574,3575,0.112649473969198,0.112649473969198
-3748,3469,3578,0.102738780677217,0.102738780677217
-3751,848,3580,0.194594151891157,0.194594151891157
-3780,799,3582,0.202016106794537,0.202016106794537
-3753,3581,3583,0.0933177632696428,0.0933177632696428
-3756,3586,3587,0.0427524561216555,0.0427524561216555
-20307,3851,3852,0.0199150113624835,0.0199150113624835
-3757,3587,3588,0.00652614157776479,0.00652614157776479
-3758,3588,3589,0.0165416326790114,0.0165416326790114
-3759,3589,3590,0.0292914453635219,0.0292914453635219
-3760,3590,3591,0.012398142936734,0.012398142936734
-3761,3591,3592,0.00808918004643223,0.00808918004643223
-3762,3592,3593,0.0105968786869326,0.0105968786869326
-3764,3487,3594,0.175200690864457,0.175200690864457
-17310,5684,5685,0.200644913348264,0.200644913348264
-3765,3594,2339,0.174981229925885,0.174981229925885
-3768,3596,3597,0.239259126523314,0.239259126523314
-3770,1985,1969,0.0388238770836811,0.0388238770836811
-3771,1969,3598,0.103685036459381,0.103685036459381
-3772,3598,3599,0.103278210249803,0.103278210249803
-3774,3600,685,0.204822140654993,0.204822140654993
-3775,685,1984,0.157051714392723,0.157051714392723
-3777,2473,3601,0.204732098938096,0.204732098938096
-3778,3601,3602,0.203258463693205,0.203258463693205
-3779,3602,799,0.197950165384785,0.197950165384785
-3781,3582,3603,0.209363914186111,0.209363914186111
-3782,3603,3604,0.202974468009462,0.202974468009462
-3783,3604,3063,0.201030651985273,0.201030651985273
-3784,3063,3605,0.183452467298283,0.183452467298283
-3785,3605,3609,0.0173247613422977,0.0173247613422977
-3786,3609,3610,0.100167424900963,0.100167424900963
-3787,3610,1148,0.0998182719974527,0.0998182719974527
-3798,3618,3619,1.41244277904247,1.41244277904247
-3799,3620,3621,0.200419085699923,0.200419085699923
-3800,3621,3083,0.197049820413636,0.197049820413636
-3806,3250,3625,0.214852973763206,0.214852973763206
-3807,3625,37,0.19341482884534,0.19341482884534
-3808,37,3536,0.207817408343139,0.207817408343139
-3809,3536,3626,0.197537787183869,0.197537787183869
-3810,3626,3627,0.0725803332096263,0.0725803332096263
-3812,3628,3629,0.0377891893344826,0.0377891893344826
-3814,3630,108,0.222508950073657,0.222508950073657
-3815,108,3631,0.48374336677931,0.48374336677931
-3816,3631,3632,1.29923590650812,1.29923590650812
-17118,3959,510,0.232935824119298,0.232935824119298
-4428,4136,4137,0.173313517100692,0.173313517100692
-4429,4137,4138,0.202530185785573,0.202530185785573
-18158,6309,10170,0.40356001102466,0.40356001102466
-4432,2389,4140,0.139183902890425,0.139183902890425
-4434,4141,4142,0.197054107936505,0.197054107936505
-4438,4144,4145,0.0537117632250494,0.0537117632250494
-4439,4145,965,0.101471161400112,0.101471161400112
-4440,965,4146,0.104100628512796,0.104100628512796
-4441,4146,3163,0.0969051144320847,0.0969051144320847
-4442,3163,4147,0.101372524256092,0.101372524256092
-4443,4147,4148,0.0308326213261154,0.0308326213261154
-4445,3914,1051,0.113795014444698,0.113795014444698
-4446,1051,4149,0.10964029932362,0.10964029932362
-4449,4151,3345,0.104243278330047,0.104243278330047
-4451,4152,4153,0.102419695022811,0.102419695022811
-4452,4153,2058,0.103354746635848,0.103354746635848
-4453,2058,2644,0.104156201229462,0.104156201229462
-4454,2644,4110,0.102077109293643,0.102077109293643
-5804,5122,5123,0.00520045876973269,0.00520045876973269
-4455,4110,4154,0.102551400025576,0.102551400025576
-4458,4156,3451,0.102085683319337,0.102085683319337
-4459,3451,4157,0.103915702611829,0.103915702611829
-4460,4157,3881,0.104147627332173,0.104147627332173
-4461,3881,844,0.102547271473588,0.102547271473588
-4462,844,4158,0.103915708789956,0.103915708789956
-4463,4158,4159,0.0473715373473714,0.0473715373473714
-4465,4160,4161,0.0487952389865543,0.0487952389865543
-4466,4161,4162,0.0503092120983125,0.0503092120983125
-4467,4162,4163,0.0998399649224705,0.0998399649224705
-4470,991,4165,0.0616573964011522,0.0616573964011522
-4471,4165,4166,0.0374515064164708,0.0374515064164708
-4472,4166,4167,0.0500586202169859,0.0500586202169859
-4473,4167,4168,0.0490747432154895,0.0490747432154895
-4474,4168,1546,0.0500170304502106,0.0500170304502106
-4475,1546,4169,0.0485801531295538,0.0485801531295538
-5773,5098,5099,0.136491222225544,0.136491222225544
-4479,4171,4172,0.0171013114970861,0.0171013114970861
-4480,4172,4173,0.100095278405447,0.100095278405447
-4481,4173,4174,0.0193707742575379,0.0193707742575379
-4482,4174,3125,0.0983746933912928,0.0983746933912928
-4483,3125,3149,0.017633000291927,0.017633000291927
-4485,3759,1483,0.205504619788951,0.205504619788951
-4486,1483,139,0.199306955290764,0.199306955290764
-3818,3634,3635,0.193271661183235,0.193271661183235
-3844,50,2744,0.0297683374213274,0.0297683374213274
-3819,3635,3636,0.259071020170312,0.259071020170312
-3820,3636,3637,0.220352934884474,0.220352934884474
-3821,3637,3638,0.0146799692899151,0.0146799692899151
-3822,3638,3629,0.546064092681382,0.546064092681382
-3823,3629,3628,0.0377891893344826,0.0377891893344826
-3848,3639,3640,0.0377019004254023,0.0377019004254023
-3824,3628,3641,0.274746435577415,0.274746435577415
-3827,3643,3630,0.145379834812045,0.145379834812045
-3829,3644,3645,0.10937380292523,0.10937380292523
-3831,3646,3647,0.118367900276814,0.118367900276814
-3833,3648,3649,0.0133410304783532,0.0133410304783532
-3834,3649,3650,0.0429585103622675,0.0429585103622675
-3835,3650,3651,0.0204151163658954,0.0204151163658954
-3836,3651,3652,0.035861428044368,0.035861428044368
-3837,3652,3653,0.0519097060940613,0.0519097060940613
-3838,3653,2733,0.0215181506261361,0.0215181506261361
-3839,2733,3184,0.0284884125498342,0.0284884125498342
-3840,3184,3654,0.0523000942930375,0.0523000942930375
-3841,3654,3655,0.0449577371290542,0.0449577371290542
-3842,3655,3656,0.0854917295991763,0.0854917295991763
-3843,3656,50,0.0260531877334927,0.0260531877334927
-3845,2744,3657,0.0566089274642789,0.0566089274642789
-3846,3657,3658,0.0492739020617726,0.0492739020617726
-3849,3640,3660,0.0409815373213546,0.0409815373213546
-3850,3660,3661,0.0430567519340905,0.0430567519340905
-3851,3661,3662,0.0468129367556475,0.0468129367556475
-3852,3662,3663,0.0487340718514498,0.0487340718514498
-3853,3663,3664,0.0766168893066023,0.0766168893066023
-3854,3664,3665,0.0775543535398568,0.0775543535398568
-3856,2887,3666,0.0966953683989245,0.0966953683989245
-3857,3666,3667,0.0610272459393337,0.0610272459393337
-3860,3669,3670,0.0315853053568594,0.0315853053568594
-3862,3671,3672,0.0504610774094253,0.0504610774094253
-3863,3672,3673,0.0499084817958282,0.0499084817958282
-3864,3673,3674,0.0598581313257637,0.0598581313257637
-3865,3674,3675,0.0415918035714469,0.0415918035714469
-3866,3675,3676,0.0971838117715375,0.0971838117715375
-3867,3676,3677,0.0757910145140814,0.0757910145140814
-3868,3677,3678,0.0241351496511796,0.0241351496511796
-3869,3678,3679,0.10921148844503,0.10921148844503
-3870,3679,3680,0.0604791133362521,0.0604791133362521
-3871,3680,3681,0.0497662614550786,0.0497662614550786
-3872,3681,3682,0.0284371260175335,0.0284371260175335
-3873,3682,3683,0.0775136719631998,0.0775136719631998
-3874,3683,3684,0.0986272672973807,0.0986272672973807
-3876,3686,1026,0.103637164673652,0.103637164673652
-5148,4657,4658,0.0518173498658282,0.0518173498658282
-3877,1026,3687,0.0559565437232701,0.0559565437232701
-3878,3687,3688,0.0511859173489266,0.0511859173489266
-3879,3688,3689,0.0520066703615513,0.0520066703615513
-3880,3689,3690,0.049253728288425,0.049253728288425
-3882,2886,3691,0.113429848834015,0.113429848834015
-3884,3215,3692,0.202752541360657,0.202752541360657
-3885,3692,1926,0.199353224720545,0.199353224720545
-3886,1926,3693,0.200351682125873,0.200351682125873
-3887,3693,3270,0.203854022504707,0.203854022504707
-3888,3270,3694,0.200935067748901,0.200935067748901
-3890,83,3519,0.205087956532059,0.205087956532059
-3892,3695,3696,0.201007421421966,0.201007421421966
-3897,3217,3701,0.1352188342505,0.1352188342505
-3898,131,1718,0.251512260994622,0.251512260994622
-15946,9759,9762,0.240661719520644,0.240661719520644
-3900,3702,3703,0.0933150678138448,0.0933150678138448
-3901,3703,3704,0.137025546490973,0.137025546490973
-3902,3704,3705,0.132801372713675,0.132801372713675
-3903,3705,1668,0.132757296812598,0.132757296812598
-3904,1668,3706,0.138337667643286,0.138337667643286
-3905,3706,2449,0.137198901653783,0.137198901653783
-3906,2449,3239,0.137027047572602,0.137027047572602
-3909,3708,3709,0.0594114493059888,0.0594114493059888
-3910,3709,109,0.057220909251565,0.057220909251565
-3913,3711,3712,0.139485170169946,0.139485170169946
-3914,3712,2811,0.114534953425458,0.114534953425458
-3918,3715,3716,0.0528065388297546,0.0528065388297546
-3919,3716,3717,0.0498986148500866,0.0498986148500866
-3920,3717,3718,0.0501983896755627,0.0501983896755627
-3921,3718,3722,0.0513311819624353,0.0513311819624353
-3922,3722,3723,0.0447895916462849,0.0447895916462849
-3923,3723,3724,0.0431436061631746,0.0431436061631746
-3924,3724,3725,0.0306469500311329,0.0306469500311329
-3926,3726,3727,0.194057523355391,0.194057523355391
-3927,3727,723,0.155998303022368,0.155998303022368
-3928,723,3728,0.0204200466887832,0.0204200466887832
-3929,3728,3729,0.122760919468851,0.122760919468851
-3930,3729,3730,0.0554195837686694,0.0554195837686694
-3931,3730,520,0.0841868989778494,0.0841868989778494
-3932,520,3731,0.0926590200371809,0.0926590200371809
-3933,3731,3732,0.0560537701957185,0.0560537701957185
-3937,3735,3736,0.177568883213635,0.177568883213635
-3939,3737,3738,0.0596027628340358,0.0596027628340358
-3940,3738,2286,0.015731383207611,0.015731383207611
-3942,191,3739,0.20409229769904,0.20409229769904
-3943,3739,3740,0.196754914184827,0.196754914184827
-3945,3741,3742,0.0963531048469524,0.0963531048469524
-3947,3743,1867,0.211893481628119,0.211893481628119
-3948,1867,3744,0.190309691295086,0.190309691295086
-3949,3744,3369,0.156379911113779,0.156379911113779
-3951,3746,3747,0.0084501441528746,0.0084501441528746
-3953,3749,3750,0.291896586304336,0.291896586304336
-3957,3752,3753,0.00678737857974005,0.00678737857974005
-3958,3753,3754,0.00811546596932882,0.00811546596932882
-3959,3754,605,0.11345488105994,0.11345488105994
-3966,3759,3760,0.0543424988109601,0.0543424988109601
-3967,3760,3761,0.0124828328696103,0.0124828328696103
-3969,3762,3763,0.109035140401267,0.109035140401267
-3970,3763,3764,0.13451246019454,0.13451246019454
-3971,3764,1077,0.0751290727356026,0.0751290727356026
-3972,1077,2521,0.125841042831383,0.125841042831383
-3974,3765,3766,0.0155018141702848,0.0155018141702848
-3975,3766,3769,0.0925922303926536,0.0925922303926536
-3976,3769,450,0.0446743427321934,0.0446743427321934
-3977,450,855,0.0454696499518695,0.0454696499518695
-3978,855,3770,0.0458292249661059,0.0458292249661059
-5269,4111,4741,0.0999126780220414,0.0999126780220414
-3979,3770,3771,0.0463680305523856,0.0463680305523856
-3982,3777,3778,0.0472655889206378,0.0472655889206378
-3983,3778,3456,0.0457775618734605,0.0457775618734605
-3984,3456,3779,0.0949352444381587,0.0949352444381587
-3985,3779,3780,0.0949175907228116,0.0949175907228116
-3986,3780,3781,0.0934360991992659,0.0934360991992659
-3987,3781,3782,0.0927263272279538,0.0927263272279538
-3988,3782,2659,0.0984051754942233,0.0984051754942233
-3989,2659,2053,0.0987467204032972,0.0987467204032972
-3990,2053,3783,0.0990728400130522,0.0990728400130522
-3991,3783,3784,0.0514218472521816,0.0514218472521816
-3992,3784,3785,0.0779176889813446,0.0779176889813446
-3993,3785,3786,0.0982592928032825,0.0982592928032825
-3994,3786,3344,0.100047583059044,0.100047583059044
-3995,3344,3787,0.0997075658602957,0.0997075658602957
-3998,3789,1013,0.0991145515008367,0.0991145515008367
-3999,1013,3790,0.0988154439008836,0.0988154439008836
-4000,3790,3147,0.100818484811759,0.100818484811759
-4001,3147,3128,0.0882379333310365,0.0882379333310365
-4002,3128,3791,0.10924064572907,0.10924064572907
-4003,3791,3792,0.0990892368110052,0.0990892368110052
-4004,3792,3793,0.0983279071551189,0.0983279071551189
-4005,3793,3794,0.0488397000978433,0.0488397000978433
-4006,3794,3795,0.0500279563406491,0.0500279563406491
-4007,3795,2868,0.0499678370514067,0.0499678370514067
-4008,2868,3796,0.048583428681526,0.048583428681526
-4009,3796,3797,0.0504566053315115,0.0504566053315115
-4011,3798,3799,0.0451531325504455,0.0451531325504455
-4012,3799,983,0.0519296915637561,0.0519296915637561
-4015,3801,3802,0.0483738114958222,0.0483738114958222
-4016,3802,3803,0.0519812355103751,0.0519812355103751
-4017,3803,3804,0.101642680761132,0.101642680761132
-4018,3804,3805,0.100202026962745,0.100202026962745
-4019,3805,3806,0.0490200510242293,0.0490200510242293
-4020,3806,3159,0.0527906095396228,0.0527906095396228
-4021,3159,3807,0.0508058777981011,0.0508058777981011
-4022,3807,3808,0.0547154240766913,0.0547154240766913
-4023,3808,3809,0.105580069148102,0.105580069148102
-4025,3810,3811,0.0543737037127348,0.0543737037127348
-16058,9242,237,0.236847878323095,0.236847878323095
-4026,3811,3812,0.108778018122892,0.108778018122892
-4027,3812,1620,0.10920973774803,0.10920973774803
-4029,3813,3814,0.083969278056869,0.083969278056869
-4031,3815,3816,0.139162136479248,0.139162136479248
-4032,3816,3817,0.128842029582485,0.128842029582485
-4034,3818,2303,0.104861015321702,0.104861015321702
-4035,2303,130,0.0947837852263858,0.0947837852263858
-4036,130,155,0.2039982188818,0.2039982188818
-4037,155,1719,0.251031715971117,0.251031715971117
-4040,3820,3821,0.253858034970465,0.253858034970465
-4041,3821,765,0.158798770965753,0.158798770965753
-4042,765,3822,0.38766252452626,0.38766252452626
-4044,3823,3824,0.6423341602363,0.6423341602363
-4045,3825,3826,0.0763938085811643,0.0763938085811643
-5338,4787,4788,0.201919584850824,0.201919584850824
-4049,3828,3829,0.0709013283805701,0.0709013283805701
-4051,3830,3831,0.161299122027925,0.161299122027925
-4052,3832,3833,0.0520709463921909,0.0520709463921909
-4054,3834,3835,0.133913000116738,0.133913000116738
-4055,3835,3836,0.135958385150602,0.135958385150602
-4059,3838,3839,0.195689058153451,0.195689058153451
-4061,3840,3841,0.104161008191779,0.104161008191779
-4062,3841,3842,0.204332097790775,0.204332097790775
-4063,3842,2989,0.198305038809848,0.198305038809848
-4064,2989,3843,0.202007841321225,0.202007841321225
-4065,3843,3844,0.201085745402869,0.201085745402869
-4066,3844,3845,0.203153756914823,0.203153756914823
-4067,3845,3846,0.201463782012409,0.201463782012409
-4068,3846,1694,0.201944163047273,0.201944163047273
-4069,1694,3847,0.201007884572681,0.201007884572681
-4070,3847,2442,0.173966646957408,0.173966646957408
-4071,2442,3848,0.171462594138623,0.171462594138623
-5362,4804,4805,0.138916058502817,0.138916058502817
-4072,3848,3849,0.15641185610528,0.15641185610528
-4073,3849,3850,0.155873108146064,0.155873108146064
-4074,3850,3851,0.11951230715733,0.11951230715733
-4075,3851,3852,0.0199150113624835,0.0199150113624835
-4078,2606,3854,0.176099789319583,0.176099789319583
-4081,3856,3857,0.204451648584923,0.204451648584923
-4082,3857,3858,0.27633741171005,0.27633741171005
-4084,3859,3860,0.194935828897222,0.194935828897222
-4085,3860,2553,0.201807589121279,0.201807589121279
-4086,2553,3861,0.201183796555208,0.201183796555208
-4087,3861,3862,0.206144933368939,0.206144933368939
-4088,3863,3864,0.174004040356707,0.174004040356707
-4089,3864,3865,0.176177241775495,0.176177241775495
-4090,3865,3866,0.0719661295510201,0.0719661295510201
-4091,3866,1862,0.105391351050826,0.105391351050826
-4092,1862,2607,0.183084733810089,0.183084733810089
-4094,3867,3868,0.135844661693153,0.135844661693153
-4096,1431,3869,0.122681533981215,0.122681533981215
-4099,3870,3871,0.0814181379314414,0.0814181379314414
-4101,3038,3872,0.194090812408951,0.194090812408951
-4103,3579,3873,0.140995166985651,0.140995166985651
-4104,3873,3874,0.0908684940539539,0.0908684940539539
-4108,2397,3876,0.142303739641396,0.142303739641396
-4110,3877,702,0.203534713775632,0.203534713775632
-4111,702,3878,0.201204188260029,0.201204188260029
-4113,3879,3880,0.176189861258557,0.176189861258557
-4114,3880,2357,0.178601291381029,0.178601291381029
-4115,2357,3881,0.172977248757485,0.172977248757485
-4116,3881,3882,0.173963704924205,0.173963704924205
-4117,3882,3883,0.177248873598787,0.177248873598787
-4118,3883,3884,0.165174683174039,0.165174683174039
-4120,3885,899,0.068233075024198,0.068233075024198
-4121,899,3886,0.136382558439915,0.136382558439915
-4123,3887,2246,0.064586200340924,0.064586200340924
-4126,3889,3890,0.173108811078515,0.173108811078515
-4128,3891,673,0.180805922237936,0.180805922237936
-4129,673,3892,0.00347134617206091,0.00347134617206091
-4131,3893,3894,0.173412160606882,0.173412160606882
-4132,3894,3686,0.239804659108201,0.239804659108201
-4133,3686,3895,0.139339505088047,0.139339505088047
-4134,3895,1293,0.0712429362693845,0.0712429362693845
-4136,3896,3897,0.00461464942878269,0.00461464942878269
-4137,3897,3898,0.00296969221564957,0.00296969221564957
-4138,3898,3899,0.135099018741423,0.135099018741423
-4139,3899,3900,0.133736401013675,0.133736401013675
-4140,3900,826,0.1432668721319,0.1432668721319
-4141,826,3567,0.140539270126583,0.140539270126583
-4142,3567,3901,0.141736858580205,0.141736858580205
-4143,3901,3902,0.138513379846183,0.138513379846183
-4144,3902,3903,0.137738276341516,0.137738276341516
-4145,3903,3041,0.133834213982,0.133834213982
-4146,3041,3904,0.143195912483998,0.143195912483998
-4147,3904,3905,0.00371612313723013,0.00371612313723013
-4148,3905,3906,0.138485181869722,0.138485181869722
-4150,1161,880,0.143460648556329,0.143460648556329
-4151,880,3907,0.137181190587279,0.137181190587279
-4152,3907,2788,0.133979203320047,0.133979203320047
-4154,3908,3909,0.11929025073176,0.11929025073176
-4155,3909,3910,0.092551367353814,0.092551367353814
-4157,734,1555,0.128698646905998,0.128698646905998
-4158,1555,3911,0.10223670466325,0.10223670466325
-4159,3911,3912,0.0209102658501846,0.0209102658501846
-4160,3913,3914,0.290781445277807,0.290781445277807
-4161,3914,3915,0.112536676265492,0.112536676265492
-4162,3915,3916,0.199777886092506,0.199777886092506
-4163,3916,3917,0.0912727874005277,0.0912727874005277
-4164,3917,3918,0.112620851967747,0.112620851967747
-4166,3919,1187,0.167283340526576,0.167283340526576
-4167,1187,3920,0.0212753866211399,0.0212753866211399
-4168,3920,3790,0.200229524215252,0.200229524215252
-4169,3790,3921,0.153151160013799,0.153151160013799
-4170,3921,3922,0.0549370836226997,0.0549370836226997
-4171,3923,3924,0.0360721076371334,0.0360721076371334
-4174,706,3926,0.117999308023824,0.117999308023824
-4175,3926,3702,0.0450373928319521,0.0450373928319521
-4176,3702,3927,0.114850773809758,0.114850773809758
-4177,3927,3928,0.0608860897951607,0.0608860897951607
-4178,3928,3929,0.107271550927247,0.107271550927247
-4180,3930,1666,0.1330788885459,0.1330788885459
-4181,1666,3931,0.137468360449037,0.137468360449037
-4182,3931,2447,0.134834989989903,0.134834989989903
-4183,2447,3237,0.140199730422516,0.140199730422516
-4184,3237,3933,0.138639782785987,0.138639782785987
-4185,3933,3934,0.138811739329711,0.138811739329711
-4186,3934,3935,0.134204059449961,0.134204059449961
-4187,3935,3936,0.123276584845079,0.123276584845079
-4189,3937,3938,0.126045478045544,0.126045478045544
-4190,3938,3939,0.0651492893105391,0.0651492893105391
-4191,3939,3940,0.0221401135391512,0.0221401135391512
-4192,3940,3941,0.0717318471783874,0.0717318471783874
-4195,3943,3944,0.176615684469352,0.176615684469352
-4196,3944,3947,0.176604135108539,0.176604135108539
-4197,3947,3948,0.122323573259462,0.122323573259462
-4198,3948,3949,0.0559214984515419,0.0559214984515419
-5481,4892,3459,0.0941890822437752,0.0941890822437752
-4199,3949,3950,0.176269184745743,0.176269184745743
-4200,3950,3951,0.05590117541301,0.05590117541301
-4201,3951,3952,0.122088386939327,0.122088386939327
-4202,3952,3953,0.0603148497739477,0.0603148497739477
-4203,3953,3954,0.117311769773874,0.117311769773874
-4204,3954,3955,0.0719490460324168,0.0719490460324168
-4205,3955,3956,0.106538056002006,0.106538056002006
-4206,3956,3957,0.177243078500478,0.177243078500478
-4207,3957,2623,0.176288453506598,0.176288453506598
-4208,2623,3958,0.177546592271005,0.177546592271005
-4209,3958,3960,0.168966442415293,0.168966442415293
-4210,3960,3961,0.111586533238696,0.111586533238696
-4213,3963,3964,0.265623714493738,0.265623714493738
-4214,3965,3966,0.511616430940774,0.511616430940774
-4216,1726,3967,0.0896760315303362,0.0896760315303362
-4217,3967,3968,0.0558858522230369,0.0558858522230369
-4218,3968,3969,0.109150490871186,0.109150490871186
-4219,3970,3971,0.202576252334461,0.202576252334461
-4220,3971,3972,0.199655908563659,0.199655908563659
-4221,3972,3973,0.201550568367269,0.201550568367269
-4223,3974,3975,0.0432784618651284,0.0432784618651284
-4224,3975,3976,0.0119312921672435,0.0119312921672435
-4225,3976,3977,0.0412856988441699,0.0412856988441699
-4226,3977,3978,0.00523979822286268,0.00523979822286268
-4227,3978,3979,0.0456580481243959,0.0456580481243959
-4228,3979,3980,0.0491163050630244,0.0491163050630244
-4229,3980,3981,0.0519851803283443,0.0519851803283443
-4230,3981,1662,0.0500503143032265,0.0500503143032265
-4231,1662,3982,0.0526516968240738,0.0526516968240738
-4232,3982,3983,0.0511950181994891,0.0511950181994891
-4233,3983,3984,0.0508169123465841,0.0508169123465841
-16267,5831,9866,0.203286686616951,0.203286686616951
-4234,3984,3985,0.0684638947838088,0.0684638947838088
-4235,3985,3986,0.0523508233196537,0.0523508233196537
-4236,3986,3987,0.0497154897229056,0.0497154897229056
-4237,3987,2423,0.0326188031399601,0.0326188031399601
-4238,2423,3988,0.017392306107988,0.017392306107988
-4239,3988,3989,0.0330055324383025,0.0330055324383025
-4240,3989,3990,0.0159023099545875,0.0159023099545875
-4241,3990,3991,0.049454634736183,0.049454634736183
-4244,3992,3993,0.049036974566433,0.049036974566433
-4245,3993,3994,0.0522504960301449,0.0522504960301449
-4246,3994,3995,0.113779671004445,0.113779671004445
-4247,3995,3996,0.292866933952659,0.292866933952659
-4248,3996,3997,0.135719788812757,0.135719788812757
-4249,3997,2492,0.131298969381918,0.131298969381918
-4250,2492,2838,0.134023703042734,0.134023703042734
-4252,3998,3999,0.177673273882055,0.177673273882055
-4253,3999,4000,0.178724202369687,0.178724202369687
-4254,4000,4001,0.0914256352612055,0.0914256352612055
-4255,1820,4002,0.0854127756728086,0.0854127756728086
-4256,4002,4003,0.0734940058422204,0.0734940058422204
-4257,4003,4004,0.122094789640982,0.122094789640982
-4260,4006,4007,0.167588698662527,0.167588698662527
-4261,4007,4008,0.199884724997956,0.199884724997956
-4262,4008,4009,0.0119868161378673,0.0119868161378673
-4263,371,1930,0.0503613323391642,0.0503613323391642
-4264,1930,1940,0.0838300296248713,0.0838300296248713
-4265,1940,4010,0.121947021037263,0.121947021037263
-4266,4010,4011,0.132309346356631,0.132309346356631
-4267,4011,4012,0.135165905730987,0.135165905730987
-4268,4012,4013,0.133333876014397,0.133333876014397
-4270,4014,12,0.13580168948729,0.13580168948729
-4271,12,4015,0.00286884184731271,0.00286884184731271
-4272,4015,4016,0.132033234839576,0.132033234839576
-4273,4016,4017,0.133567851795101,0.133567851795101
-4274,4017,4018,0.134726706981619,0.134726706981619
-4275,4018,4019,0.130892412762661,0.130892412762661
-4276,4019,4020,0.134212591203429,0.134212591203429
-4277,4020,4021,0.133433911973159,0.133433911973159
-4278,4021,4022,0.137281795417315,0.137281795417315
-4280,4023,4024,0.0689781307016059,0.0689781307016059
-4281,4024,4025,0.0667654814327236,0.0667654814327236
-5576,4965,4966,0.209377126181678,0.209377126181678
-4290,4029,1890,0.0489976212541555,0.0489976212541555
-4291,1890,4030,0.050071397214541,0.050071397214541
-4293,4031,2858,0.24990384929118,0.24990384929118
-4301,1703,4036,0.19686036595886,0.19686036595886
-4302,4036,4037,2.41616418836648,2.41616418836648
-4303,4038,4039,0.0356847858191414,0.0356847858191414
-4305,4040,4041,0.105425319125276,0.105425319125276
-4306,4041,2256,0.104244973047941,0.104244973047941
-4307,2256,4042,0.103519804078257,0.103519804078257
-4309,3999,4043,0.105003607246795,0.105003607246795
-17679,10164,8262,0.207810693253635,0.207810693253635
-4315,4048,3390,0.0527412463264476,0.0527412463264476
-4316,3390,4049,0.0507539981345734,0.0507539981345734
-4317,4049,4050,0.0520284075919789,0.0520284075919789
-4318,4050,3408,0.0512087059000605,0.0512087059000605
-4319,3408,4051,0.0486341315555791,0.0486341315555791
-4320,4051,4053,0.052533034496925,0.052533034496925
-4321,4053,4054,0.0524475036704537,0.0524475036704537
-4322,4054,4055,0.0498829272923159,0.0498829272923159
-4327,4058,4059,0.051190260382352,0.051190260382352
-4328,4059,3864,0.0501467689985101,0.0501467689985101
-4329,3864,4060,0.0537746384669306,0.0537746384669306
-4330,4060,4061,0.0463502740457097,0.0463502740457097
-4331,4061,4062,0.0561959746447094,0.0561959746447094
-4357,4082,4083,0.157884781724872,0.157884781724872
-4332,4062,4063,0.69866413721226,0.69866413721226
-4333,1273,4064,0.135036752261437,0.135036752261437
-4334,4064,4065,0.129590074598046,0.129590074598046
-4335,4065,4066,0.132616575444838,0.132616575444838
-4344,4073,1390,0.0502435222683857,0.0502435222683857
-4345,1390,4074,0.0493046140403362,0.0493046140403362
-4346,4074,4075,0.0491422603337744,0.0491422603337744
-4351,4078,4079,0.241190031557862,0.241190031557862
-4352,4079,4080,0.258242852029617,0.258242852029617
-4353,4080,1629,0.215143938153131,0.215143938153131
-4354,1629,3965,0.0839336295727996,0.0839336295727996
-4364,1214,4088,0.0489795542886091,0.0489795542886091
-4365,4088,4089,0.0498843047924572,0.0498843047924572
-4366,4089,4090,0.0487540785114809,0.0487540785114809
-4367,4090,2167,0.0506698655714413,0.0506698655714413
-4368,2167,4091,0.0491950203791528,0.0491950203791528
-4369,4091,4092,0.0488189222411035,0.0488189222411035
-4378,1289,4100,0.0495624053047352,0.0495624053047352
-4379,4100,4101,0.0531970268279652,0.0531970268279652
-4380,4101,4102,0.0527877658733148,0.0527877658733148
-4381,4102,4103,0.0491029186922276,0.0491029186922276
-4382,4103,4104,0.053313065445571,0.053313065445571
-18127,10262,10268,0.40641745688608,0.40641745688608
-4394,4109,2351,0.147790101003017,0.147790101003017
-4395,2351,4110,0.174343137234229,0.174343137234229
-4396,4110,4111,0.175176728788125,0.175176728788125
-4397,4111,4112,0.174887842567366,0.174887842567366
-4398,4112,4113,0.163616410243985,0.163616410243985
-14847,9428,3841,0.049872105512027,0.049872105512027
-14848,3841,9429,0.0507867978829422,0.0507867978829422
-14849,9429,5551,0.0504705023896622,0.0504705023896622
-14850,5551,9430,0.0160626819091423,0.0160626819091423
-324,207,268,0.0408317858918375,0.0408317858918375
-14851,9430,9431,0.771810690268124,0.771810690268124
-14860,2500,9438,0.0367185859571526,0.0367185859571526
-14866,8307,6350,0.0205009601935279,0.0205009601935279
-14871,2450,3240,0.14088111565627,0.14088111565627
-14873,5733,5517,0.138655367104914,0.138655367104914
-14874,5517,9442,0.136397019838813,0.136397019838813
-14875,9442,6920,0.112250527906817,0.112250527906817
-14877,6505,9443,0.246198454475103,0.246198454475103
-14878,9443,9444,0.0254384620147021,0.0254384620147021
-14879,9444,6994,0.4499142851013,0.4499142851013
-14880,6994,9445,0.29050322706034,0.29050322706034
-14881,9445,2104,0.111341186723118,0.111341186723118
-14882,2104,9446,1.81122771510753,1.81122771510753
-14883,5328,6848,0.0996617587695029,0.0996617587695029
-14884,6848,9012,0.0991299503198925,0.0991299503198925
-14886,7486,7456,0.0976540916227753,0.0976540916227753
-14888,5693,9010,0.102057355365657,0.102057355365657
-14889,9010,4967,0.099866873546368,0.099866873546368
-14890,4967,9021,0.10207838306375,0.10207838306375
-14894,8146,9004,0.111615935651551,0.111615935651551
-14896,8691,6102,0.204110733056615,0.204110733056615
-14898,8202,8814,0.0690569326601991,0.0690569326601991
-14900,8175,8161,0.034748414576393,0.034748414576393
-14901,8161,9450,0.0195282497941032,0.0195282497941032
-14902,9450,9315,0.339258874320837,0.339258874320837
-14904,8694,8155,0.0907837492404858,0.0907837492404858
-14905,8155,7617,0.0954335805182596,0.0954335805182596
-14906,7617,7270,0.0932816974435063,0.0932816974435063
-14908,4159,8695,0.0152616593160753,0.0152616593160753
-14909,8695,8156,0.0918092963851245,0.0918092963851245
-14910,8156,7618,0.0923894575376538,0.0923894575376538
-14911,7618,7271,0.0946959525813305,0.0946959525813305
-14914,2016,353,0.0344076794786212,0.0344076794786212
-14915,353,9451,0.0583270070041971,0.0583270070041971
-14916,9451,2762,0.099099248852826,0.099099248852826
-14917,2762,7003,0.098484917717332,0.098484917717332
-14918,7003,2266,0.0978645165955224,0.0978645165955224
-14919,2266,3595,0.100545762919748,0.100545762919748
-14920,3595,7518,0.100532638471033,0.100532638471033
-14921,7518,2095,0.100840428744565,0.100840428744565
-14922,2095,5977,0.100495257348787,0.100495257348787
-14923,5977,7667,0.098120652849283,0.098120652849283
-14924,7667,2331,0.102096265330692,0.102096265330692
-14925,2331,9453,0.0789173504157379,0.0789173504157379
-14926,8149,7608,0.0961605881004872,0.0961605881004872
-14927,7608,7261,0.102411721946463,0.102411721946463
-14928,7261,7598,0.095880146438169,0.095880146438169
-14929,7598,2021,0.09187670783236,0.09187670783236
-14930,2021,3354,0.0948528618506519,0.0948528618506519
-14932,2767,7012,0.0931566808998339,0.0931566808998339
-14934,9454,9455,0.0975625637539845,0.0975625637539845
-14937,8700,8158,0.0941289748217691,0.0941289748217691
-14939,7604,7255,0.0976568291897231,0.0976568291897231
-14940,7255,7591,0.0955299991432501,0.0955299991432501
-14941,7591,9173,0.0963387600574313,0.0963387600574313
-14942,9173,9456,0.0980688321229376,0.0980688321229376
-14943,9456,2750,0.102866303298183,0.102866303298183
-14944,2750,7014,0.0961030844605866,0.0961030844605866
-14945,7014,8215,0.0956816865795296,0.0956816865795296
-14947,8212,7523,0.100548507087909,0.100548507087909
-14948,7523,2123,0.0946806328213609,0.0946806328213609
-14949,2123,5989,0.102767406722396,0.102767406722396
-14950,5989,7670,0.0976490581696009,0.0976490581696009
-15962,9768,6397,0.0094036846623539,0.0094036846623539
-14968,7264,7583,0.0956208531243363,0.0956208531243363
-14969,7583,2000,0.0924757762963627,0.0924757762963627
-14970,2000,3360,0.0937229366395869,0.0937229366395869
-14971,3360,2754,0.0967493265415074,0.0967493265415074
-14973,7005,2280,0.0993735606220099,0.0993735606220099
-14974,2280,3602,0.103462577447113,0.103462577447113
-14975,3602,7527,0.0995273521026476,0.0995273521026476
-14976,7527,2135,0.0983330050282197,0.0983330050282197
-14977,2135,5992,0.103459989161242,0.103459989161242
-14978,5992,7672,0.100271460506145,0.100271460506145
-14979,7672,9462,3.03786386467958,3.03786386467958
-14980,5809,9463,0.110364660453643,0.110364660453643
-14989,9464,5043,0.119299198506528,0.119299198506528
-14990,5043,7994,0.118519999914902,0.118519999914902
-14991,7994,9236,0.117759209590851,0.117759209590851
-14992,9236,7973,0.0614780310106107,0.0614780310106107
-14994,7142,5131,0.10575888699282,0.10575888699282
-14995,5131,4724,0.10504840556341,0.10504840556341
-14996,4724,6791,0.107330054626072,0.107330054626072
-14997,6791,7363,0.103200510788566,0.103200510788566
-14998,7363,5422,0.104113985923971,0.104113985923971
-14999,5422,8554,0.105490524385859,0.105490524385859
-15000,8554,3893,0.111457422157238,0.111457422157238
-15001,3893,1024,0.103888468957379,0.103888468957379
-15002,1024,9465,0.0550364598534795,0.0550364598534795
-15003,9465,6269,0.0513684711391166,0.0513684711391166
-15006,9467,9468,0.0801572222360596,0.0801572222360596
-15007,9468,5030,0.106840142374901,0.106840142374901
-18579,3437,7765,0.0485278339531173,0.0485278339531173
-15009,6619,8699,0.0954507670467869,0.0954507670467869
-15010,8699,9469,0.014222614535116,0.014222614535116
-15013,7107,455,0.0456695914542558,0.0456695914542558
-15015,860,9470,0.0919474974486486,0.0919474974486486
-15016,9470,9471,0.0500014374448159,0.0500014374448159
-15017,9471,6021,0.0453621576916579,0.0453621576916579
-15018,6021,9472,0.0470758089061738,0.0470758089061738
-15019,9472,3460,0.0470036762545936,0.0470036762545936
-15020,3460,7685,0.0954954207572325,0.0954954207572325
-15021,7685,8021,0.0933841388460347,0.0933841388460347
-15022,8021,6698,0.0960778131259482,0.0960778131259482
-15023,6698,4136,0.0911259816816344,0.0911259816816344
-15025,2663,8548,0.0930424439627818,0.0930424439627818
-15026,8548,8547,0.100542623889621,0.100542623889621
-15027,8547,7338,0.099089032401214,0.099089032401214
-15028,7338,7883,0.0990804723784167,0.0990804723784167
-15030,3337,5025,0.101286501750056,0.101286501750056
-15031,5025,9473,0.0504081121726349,0.0504081121726349
-15032,9473,8728,0.0508783896228212,0.0508783896228212
-15033,8728,3720,0.054613750451979,0.054613750451979
-16212,9849,7734,1.41107486941703,1.41107486941703
-15034,3720,6265,0.0510651820396187,0.0510651820396187
-15035,6265,9474,0.0526179865653065,0.0526179865653065
-15036,9474,1019,0.0530796783692756,0.0530796783692756
-15037,1019,3889,0.105690016076173,0.105690016076173
-15038,3889,8550,0.11082035773048,0.11082035773048
-15039,8550,5418,0.102756492849076,0.102756492849076
-15040,5418,7359,0.109377907466232,0.109377907466232
-15041,7359,6787,0.102485488457906,0.102485488457906
-15044,9414,5118,0.0507526262754685,0.0507526262754685
-15047,7151,9476,0.0506273642355044,0.0506273642355044
-15048,9476,8834,0.0494473424354765,0.0494473424354765
-15049,8834,6016,0.046054397015081,0.046054397015081
-15051,979,5330,0.0485530564436786,0.0485530564436786
-15052,5330,8003,0.0503217691422663,0.0503217691422663
-15053,8003,6342,0.0507584862620106,0.0507584862620106
-15054,6342,5051,0.0488177307212986,0.0488177307212986
-15055,5051,6690,0.0488248354973201,0.0488248354973201
-15056,6690,9477,0.0468154058850837,0.0468154058850837
-15059,9313,7101,0.0478106623792446,0.0478106623792446
-15060,7101,8880,0.0490142389962295,0.0490142389962295
-15061,8880,7420,0.0493429457759385,0.0493429457759385
-15062,7420,8874,0.0545354482418663,0.0545354482418663
-15064,7430,8793,0.0542698797022772,0.0542698797022772
-15065,8793,7862,0.0521693260437922,0.0521693260437922
-395,399,5,0.209508946543956,0.209508946543956
-15066,7862,8787,0.05844527692302,0.05844527692302
-15067,8787,7957,0.0531372993824669,0.0531372993824669
-15068,7957,9478,0.0541270300244316,0.0541270300244316
-15069,9478,9479,0.108902531529915,0.108902531529915
-15072,4481,9480,0.0910756678915429,0.0910756678915429
-15074,8706,9481,0.10111000413597,0.10111000413597
-15075,9481,9175,0.105113918003998,0.105113918003998
-15076,9175,7259,0.105567381342615,0.105567381342615
-15077,7259,7589,0.103856965848258,0.103856965848258
-15079,3366,2770,0.104765166628809,0.104765166628809
-15080,2770,9176,0.11373488606323,0.11373488606323
-15081,9176,2260,0.11073804654165,0.11073804654165
-15082,2260,3611,0.0999509846289259,0.0999509846289259
-15083,3611,7516,0.100649754002954,0.100649754002954
-15084,7516,2109,0.103508831759163,0.103508831759163
-15085,2109,5999,0.10202033489304,0.10202033489304
-15086,5999,7660,0.0994984857017093,0.0994984857017093
-15087,7660,2328,0.04986487628669,0.04986487628669
-15118,9482,9225,0.0953635356752473,0.0953635356752473
-15120,9455,301,0.129823177853557,0.129823177853557
-15116,9490,8276,0.218414071885788,0.218414071885788
-15121,301,8269,0.152583336977896,0.152583336977896
-15126,226,8268,0.0760384791094216,0.0760384791094216
-15128,225,9482,0.128957275100235,0.128957275100235
-15130,9491,460,0.0667391949721685,0.0667391949721685
-15132,460,575,0.113707068563865,0.113707068563865
-15133,575,6199,0.0290617477448439,0.0290617477448439
-15135,9492,8244,0.032549465488295,0.032549465488295
-15136,8244,9493,0.0198582826309584,0.0198582826309584
-15138,6689,228,0.0134361080204136,0.0134361080204136
-15139,228,9494,0.0329072670561094,0.0329072670561094
-15140,9494,9495,0.0242107567854742,0.0242107567854742
-15142,9496,9497,0.0238335404645399,0.0238335404645399
-15143,9497,9498,0.0343814713189183,0.0343814713189183
-15966,7623,6935,0.205023089639109,0.205023089639109
-15967,6935,5889,0.201769701232267,0.201769701232267
-15968,5889,7449,0.284161489263658,0.284161489263658
-15969,7449,1636,0.117888722564013,0.117888722564013
-15970,1636,8998,0.102786876242831,0.102786876242831
-15972,4214,8094,0.0961834163674376,0.0961834163674376
-15973,8094,194,0.104992906429488,0.104992906429488
-15974,194,2923,0.0991259111035959,0.0991259111035959
-15975,2923,5306,0.0991964539292107,0.0991964539292107
-15976,5306,1461,0.0983899476582488,0.0983899476582488
-15977,1461,5434,0.104614166406686,0.104614166406686
-15978,5434,5973,0.107640436770916,0.107640436770916
-15979,5973,9014,0.00660364948230504,0.00660364948230504
-15980,9014,7915,0.0975740293794765,0.0975740293794765
-15981,7915,6437,0.105749746230322,0.105749746230322
-16016,9786,9159,0.00790012825467591,0.00790012825467591
-15982,6437,4420,0.102051245715481,0.102051245715481
-15985,5328,7056,0.0812625038007973,0.0812625038007973
-15986,7056,9772,0.0538313043287529,0.0538313043287529
-15987,9772,4318,0.0518980074233638,0.0518980074233638
-15988,4318,9452,0.0516277273460522,0.0516277273460522
-15990,4506,4116,0.0518058126204102,0.0518058126204102
-15991,4116,7809,0.0517374039809394,0.0517374039809394
-15992,7809,5068,0.0991665346425536,0.0991665346425536
-15993,5068,9773,0.0531370753578357,0.0531370753578357
-15994,9773,6836,0.0533167080983746,0.0533167080983746
-15995,6836,6978,0.101324072393449,0.101324072393449
-15996,6978,7941,0.102826343168107,0.102826343168107
-15997,7941,9015,0.0975512129036908,0.0975512129036908
-15998,9015,6780,0.448938989090037,0.448938989090037
-15999,6780,9774,0.408854845876832,0.408854845876832
-16000,9076,9768,0.0663101767153915,0.0663101767153915
-16004,9776,1455,0.0526013194004238,0.0526013194004238
-16006,9777,1736,0.0786842572590025,0.0786842572590025
-16092,526,9805,0.0239836164906123,0.0239836164906123
-16044,9806,9807,0.10708389115039,0.10708389115039
-16046,9808,9779,0.598201231733375,0.598201231733375
-16048,9809,8448,0.00611949423172489,0.00611949423172489
-16050,497,315,0.38487204905166,0.38487204905166
-16051,315,9125,0.309277404563432,0.309277404563432
-16053,9092,238,0.378305028269765,0.378305028269765
-14687,2318,2393,0.204381692629994,0.204381692629994
-16054,238,599,0.20185675523074,0.20185675523074
-16055,599,9810,1.85367980178975,1.85367980178975
-16057,4648,9242,0.316343707887743,0.316343707887743
-16530,9931,9230,0.37930803087461,0.37930803087461
-16060,8979,9416,0.148643981954463,0.148643981954463
-16062,9129,442,0.133338694466943,0.133338694466943
-16063,442,341,0.15400049730887,0.15400049730887
-16064,341,8432,0.0419891636299648,0.0419891636299648
-16066,8912,8951,0.033170976893888,0.033170976893888
-16068,9812,8911,0.0471463735469582,0.0471463735469582
-16070,8259,6154,0.322113932922047,0.322113932922047
-16072,8262,9813,0.347409770060633,0.347409770060633
-16073,9813,8849,0.384076686987265,0.384076686987265
-16075,8850,8934,0.249988221702048,0.249988221702048
-15149,1055,2652,0.0975577285651678,0.0975577285651678
-15178,9518,9519,0.0502534780761684,0.0502534780761684
-15150,2652,6953,0.198623612037648,0.198623612037648
-15152,9492,9502,0.376572648781266,0.376572648781266
-15156,3293,102,0.41551161582069,0.41551161582069
-15160,4010,9505,0.052772682936521,0.052772682936521
-15161,9505,7047,0.0525680538450832,0.0525680538450832
-15162,7047,7019,0.0303888581356532,0.0303888581356532
-15163,7019,9506,0.0673030688563473,0.0673030688563473
-15164,9506,9507,0.0483154741652978,0.0483154741652978
-15165,9507,7386,0.0202051235057141,0.0202051235057141
-16629,9962,9963,0.200783522780218,0.200783522780218
-15167,9508,9509,0.0505081496090435,0.0505081496090435
-15169,3381,9510,0.054679375210741,0.054679375210741
-15170,9510,9511,0.0487967465713328,0.0487967465713328
-15175,9515,9516,0.0511072604930319,0.0511072604930319
-15176,9516,9517,0.199298430530572,0.199298430530572
-15177,9517,9518,0.0506626460359665,0.0506626460359665
-15179,9519,9520,0.0992839733792875,0.0992839733792875
-2659,2617,2618,0.0492730897550554,0.0492730897550554
-15180,9520,5591,0.0515928611698618,0.0515928611698618
-15181,5591,9521,0.0485416940170638,0.0485416940170638
-15182,9521,7534,0.0495967074681937,0.0495967074681937
-15183,7534,9522,0.687013260502188,0.687013260502188
-15184,4010,253,0.115254186613677,0.115254186613677
-15185,253,9523,0.265666797076755,0.265666797076755
-16090,9493,9818,0.0359382002911722,0.0359382002911722
-16093,9805,9821,0.0110994776170347,0.0110994776170347
-16096,9495,9822,0.0517988653877033,0.0517988653877033
-16097,9822,9823,0.0110663007110829,0.0110663007110829
-16098,9823,525,0.0383908840803154,0.0383908840803154
-16099,525,9824,0.0469464980296333,0.0469464980296333
-16107,214,9827,0.778079889437356,0.778079889437356
-16108,9827,8266,0.110384878461573,0.110384878461573
-16109,8266,8259,0.22035773346297,0.22035773346297
-16111,426,5290,0.135279903383581,0.135279903383581
-16112,5290,6969,0.13394711160262,0.13394711160262
-16113,6969,9,0.133723176212026,0.133723176212026
-12362,8672,8673,0.0280927507040958,0.0280927507040958
-16114,9,6393,0.135759876984547,0.135759876984547
-16116,543,2417,0.140823258017981,0.140823258017981
-16117,2417,8309,0.134744289641959,0.134744289641959
-16121,9523,8323,0.0490645159279825,0.0490645159279825
-16122,8323,2296,0.111956296963114,0.111956296963114
-16123,2296,425,0.133707313641353,0.133707313641353
-16125,8580,9121,0.223068039429751,0.223068039429751
-16129,4649,7955,0.0999111170250792,0.0999111170250792
-16130,7955,9828,0.0800171872297717,0.0800171872297717
-16131,9829,8581,0.047687571765354,0.047687571765354
-16133,9073,1815,0.113861635058861,0.113861635058861
-16134,1815,9030,0.0294613091189667,0.0294613091189667
-16135,9030,9035,0.0740720067279475,0.0740720067279475
-16136,9035,2259,0.0101253625653209,0.0101253625653209
-16137,2259,6127,0.0869883467865613,0.0869883467865613
-16138,6127,3970,0.0982525233162176,0.0982525233162176
-16139,3970,4005,0.0213357195383616,0.0213357195383616
-16170,9839,7732,1.81004213705151,1.81004213705151
-16140,4005,9831,0.0527909920856998,0.0527909920856998
-16143,7028,9832,0.0518403992809488,0.0518403992809488
-16144,9832,1405,0.0193610465151665,0.0193610465151665
-16145,1405,9086,0.0330290864914803,0.0330290864914803
-16146,9086,9833,0.0517615954401031,0.0517615954401031
-16147,9833,7389,0.013992344500971,0.013992344500971
-16148,7389,7381,0.039974198258354,0.039974198258354
-16149,7381,5215,0.0612246627137571,0.0612246627137571
-16150,5215,3395,0.05711231452959,0.05711231452959
-16152,7953,9834,0.0172080507351113,0.0172080507351113
-16154,9834,274,0.0658337540289098,0.0658337540289098
-16156,2189,9835,0.248404343096233,0.248404343096233
-16214,8735,9837,1.99433693652165,1.99433693652165
-16215,8737,9838,0.871081020569746,0.871081020569746
-4419,2776,4130,0.131599235651272,0.131599235651272
-16159,9143,9028,0.680206597840058,0.680206597840058
-16163,722,8058,0.174054831255352,0.174054831255352
-16164,8058,521,0.0821177779256467,0.0821177779256467
-16165,521,6603,0.0924366308750619,0.0924366308750619
-16166,6603,5373,0.180047417371753,0.180047417371753
-16168,1948,2528,0.0688038536836977,0.0688038536836977
-16333,7146,2907,0.104983935013538,0.104983935013538
-16334,2907,7925,0.0494998939900097,0.0494998939900097
-16338,3444,3467,0.0304982971000002,0.0304982971000002
-16339,3467,8082,0.246312262462312,0.246312262462312
-16342,8704,8153,0.0931754474511838,0.0931754474511838
-16343,8153,7614,0.0941189496630448,0.0941189496630448
-16344,7614,7267,0.0948021938707784,0.0948021938707784
-16345,7267,7586,0.0921634745405222,0.0921634745405222
-16346,7586,7587,0.0431064926802277,0.0431064926802277
-16347,7587,2005,0.0500940428381568,0.0500940428381568
-16348,2005,3364,0.0956080752868491,0.0956080752868491
-16349,3364,2759,0.0936601356465838,0.0936601356465838
-16350,2759,7009,0.0948690491965415,0.0948690491965415
-16352,2285,3605,0.100419536914451,0.100419536914451
-16353,3605,7531,0.0985834303955712,0.0985834303955712
-16354,7531,2140,0.105692387990087,0.105692387990087
-16355,2140,5996,0.104777507715381,0.104777507715381
-16356,5996,7676,0.0990116406010299,0.0990116406010299
-16357,7676,9874,1.60848579675559,1.60848579675559
-17199,2711,10073,0.10997712384001,0.10997712384001
-16358,9875,2326,1.55889022258017,1.55889022258017
-16360,5997,2127,0.151773007567564,0.151773007567564
-16361,2127,3609,0.151558147644208,0.151558147644208
-16362,3609,7010,0.212760869396779,0.212760869396779
-16365,3365,2006,0.0553745270182344,0.0553745270182344
-16366,2006,7588,0.0502101113635407,0.0502101113635407
-16367,7588,7258,0.104315488387994,0.104315488387994
-16368,7258,7615,0.106145187491952,0.106145187491952
-16369,7615,9877,0.104437372352784,0.104437372352784
-16429,9892,3407,0.0665957848901693,0.0665957848901693
-16430,3407,9893,0.16801404607557,0.16801404607557
-16433,9895,9896,0.440540235104303,0.440540235104303
-16436,9897,9898,0.0704932318773383,0.0704932318773383
-16438,95,3655,0.111235679997702,0.111235679997702
-16440,9899,5747,0.0711149911978779,0.0711149911978779
-16445,9902,9903,0.536321309295718,0.536321309295718
-16453,9908,9909,0.550826257700494,0.550826257700494
-16458,9907,9908,0.00771583659604379,0.00771583659604379
-16460,9909,9912,0.0865311626257968,0.0865311626257968
-16461,9912,9910,0.0378168798460609,0.0378168798460609
-16471,3282,9916,0.18653100874984,0.18653100874984
-16473,9917,8680,0.0249041944601551,0.0249041944601551
-19510,10535,10536,0.0273195782326388,0.0273195782326388
-16475,8507,9918,0.021850852998121,0.021850852998121
-16476,9918,3018,0.0101317448895217,0.0101317448895217
-16478,9919,9920,0.0829003664734834,0.0829003664734834
-16479,9921,3681,0.0300651916457247,0.0300651916457247
-16668,9926,9974,0.105582813458159,0.105582813458159
-16669,9588,1633,0.0730557533632891,0.0730557533632891
-16671,9928,9975,0.0177169257267767,0.0177169257267767
-117,124,125,0.0336263849765442,0.0336263849765442
-16672,9975,9929,0.0234356081852519,0.0234356081852519
-16674,9976,9977,0.0468170562405583,0.0468170562405583
-16710,104,7825,0.0602462277844684,0.0602462277844684
-16712,104,3757,0.402008044434906,0.402008044434906
-16713,3757,1487,0.204145741130723,0.204145741130723
-16714,1487,132,0.199447130341484,0.199447130341484
-16716,1701,5546,0.198096603236586,0.198096603236586
-16777,69,3510,0.205561826495526,0.205561826495526
-4421,1201,4132,0.0220332988005433,0.0220332988005433
-16718,7283,485,0.11761309283436,0.11761309283436
-16720,10003,3244,0.0554692551325786,0.0554692551325786
-16721,3244,7234,0.20486059291662,0.20486059291662
-16722,7234,1896,0.200393401337734,0.200393401337734
-16723,1896,6106,0.199619177779868,0.199619177779868
-16724,6106,3190,0.204209613390108,0.204209613390108
-16725,3190,3074,0.20155062603718,0.20155062603718
-17204,10076,9899,0.140445516840247,0.140445516840247
-17206,10077,9891,0.365702001724341,0.365702001724341
-17210,9916,551,0.0168353379628002,0.0168353379628002
-17211,551,10077,0.029511971826839,0.029511971826839
-17221,9830,5174,0.203086414023487,0.203086414023487
-17225,7299,3774,0.0270450210392685,0.0270450210392685
-17227,10078,240,0.11490035547177,0.11490035547177
-17229,240,241,0.0697724132050665,0.0697724132050665
-17230,241,242,0.0623380559401012,0.0623380559401012
-17231,242,243,0.121807717540091,0.121807717540091
-17238,246,247,0.10870569104286,0.10870569104286
-17239,247,248,0.0772679392991742,0.0772679392991742
-17241,235,3406,0.0743704107751119,0.0743704107751119
-17242,3406,10079,0.167074762801468,0.167074762801468
-17244,331,10014,0.0356018290483491,0.0356018290483491
-17245,10014,8533,0.134990804356131,0.134990804356131
-17247,510,8534,0.190527366373376,0.190527366373376
-17249,9649,6335,0.0185334131201332,0.0185334131201332
-17250,6335,10080,0.0823637888630556,0.0823637888630556
-17251,10080,3812,0.199228355515768,0.199228355515768
-17252,3812,5918,0.151375161417453,0.151375161417453
-17254,917,2204,0.201707005619294,0.201707005619294
-17255,2204,4853,0.158074944552835,0.158074944552835
-17506,10119,8389,0.0881257330115891,0.0881257330115891
-17514,10115,4493,0.0857000040414071,0.0857000040414071
-17515,4493,10122,0.00789608138487867,0.00789608138487867
-17516,10122,10123,0.0829902602540724,0.0829902602540724
-17517,10123,3738,0.117121022748715,0.117121022748715
-16415,3033,3034,0.026586968802262,0.026586968802262
-17518,3738,5617,0.105494461178937,0.105494461178937
-17519,5617,10124,0.0771328841888806,0.0771328841888806
-18717,1848,7866,0.175365518810985,0.175365518810985
-17520,10124,3940,0.0438462962781839,0.0438462962781839
-18649,10111,1854,0.1585792263447,0.1585792263447
-17522,6651,7970,0.100526894140491,0.100526894140491
-17523,7970,10125,0.0156643759566378,0.0156643759566378
-17525,342,10126,0.0436005942347808,0.0436005942347808
-17527,10126,10121,0.0408685827486489,0.0408685827486489
-17529,8016,10127,0.0296331396909763,0.0296331396909763
-17533,9200,10128,0.0316360066553629,0.0316360066553629
-17535,10128,3937,0.0160944313012695,0.0160944313012695
-17537,10125,10129,0.0323384241188202,0.0323384241188202
-17540,8937,10130,0.0382349269331771,0.0382349269331771
-18160,6035,10256,0.201529974874074,0.201529974874074
-18081,3725,3961,0.10669546577579,0.10669546577579
-18082,3961,5599,0.120037242247265,0.120037242247265
-18083,5599,10212,0.0720417181829305,0.0720417181829305
-18085,6582,8060,0.177813026382298,0.177813026382298
-18087,79,3516,0.204359090736991,0.204359090736991
-18089,10257,1076,0.140362637117951,0.140362637117951
-18092,8839,10258,0.0505579939719693,0.0505579939719693
-18093,10258,1216,0.0474392361763922,0.0474392361763922
-18094,1216,6309,0.0509984491369365,0.0509984491369365
-18095,6309,4788,0.0491735679878017,0.0491735679878017
-18418,8332,8359,0.203675131612914,0.203675131612914
-18096,4788,10256,0.0504039235105897,0.0504039235105897
-18098,2169,10259,0.0494310424509836,0.0494310424509836
-18099,10259,6301,0.0486534339401342,0.0486534339401342
-18100,6301,10260,0.0495166429402865,0.0495166429402865
-18101,10260,6428,0.0494555977491468,0.0494555977491468
-18102,6428,10261,0.0500541316962619,0.0500541316962619
-18103,10261,8837,0.049703265213276,0.049703265213276
-18104,8837,10262,0.0487206483354329,0.0487206483354329
-18105,10262,4661,0.0502842889238415,0.0502842889238415
-18210,6766,8919,0.14588598272053,0.14588598272053
-18215,6383,6883,0.201049789723751,0.201049789723751
-18217,9380,6467,0.149037633666744,0.149037633666744
-18218,6467,5528,0.155039270882985,0.155039270882985
-18219,5528,5739,0.157509840329179,0.157509840329179
-18220,5739,2443,0.171457541049395,0.171457541049395
-18221,2443,9373,0.174175733096206,0.174175733096206
-18222,9373,1695,0.20076305206058,0.20076305206058
-18224,6884,8362,0.203398590237467,0.203398590237467
-18225,8362,8336,0.20070690829837,0.20070690829837
-18226,8336,7851,0.201718717149991,0.201718717149991
-18228,9334,6072,0.194542227529238,0.194542227529238
-18229,6072,2552,0.201793795787929,0.201793795787929
-18231,10282,2550,0.408975962052575,0.408975962052575
-18233,6070,9333,0.193859431649891,0.193859431649891
-18235,3976,7037,0.199530180994258,0.199530180994258
-200,212,213,0.0847562945477418,0.0847562945477418
-18390,3978,7038,0.19806787554915,0.19806787554915
-18392,3425,3425,0.000442266584977921,0.000442266584977921
-18397,9331,6062,0.201652000193759,0.201652000193759
-18398,6062,2541,0.201129932352607,0.201129932352607
-18581,5716,10279,0.0494611669239994,0.0494611669239994
-18582,10279,7436,0.0477007849303031,0.0477007849303031
-18583,7436,10283,0.0501702475316452,0.0501702475316452
-17420,10101,10103,0.0112555006692224,0.0112555006692224
-18584,10283,7175,0.0483500943699416,0.0483500943699416
-18585,7175,6738,0.0504392554289189,0.0504392554289189
-18586,6738,7790,0.0494479351051842,0.0494479351051842
-18587,7790,6666,0.0500428725179926,0.0500428725179926
-19485,10408,10409,0.0449233009136641,0.0449233009136641
-18958,4669,4949,0.0991091352300086,0.0991091352300086
-18959,4949,10410,0.051350182738824,0.051350182738824
-18961,7220,10411,0.0512063955237151,0.0512063955237151
-18962,10411,5674,0.0503168586815151,0.0503168586815151
-18964,5851,1441,0.115857091100705,0.115857091100705
-18965,1441,10412,0.122824478936007,0.122824478936007
-18966,10412,7622,0.0791461153811418,0.0791461153811418
-18967,7622,6933,0.202629079077677,0.202629079077677
-18968,6933,5888,0.202049147826104,0.202049147826104
-18969,5888,10407,0.149951393120126,0.149951393120126
-18971,4142,7756,0.106122091000002,0.106122091000002
-18973,3621,1827,0.0998991515255571,0.0998991515255571
-18974,1827,10091,0.0457369036734835,0.0457369036734835
-18975,10091,10090,0.0485102588443954,0.0485102588443954
-18976,10090,5102,0.00428121670773934,0.00428121670773934
-18977,5102,9830,0.0472330884345854,0.0472330884345854
-18978,9830,1764,0.0499536922707767,0.0499536922707767
-19245,5031,10461,0.0349404698955745,0.0349404698955745
-19246,10461,10462,0.146091635323691,0.146091635323691
-19247,10462,5803,0.103032761304249,0.103032761304249
-19249,10129,4929,0.0162234814669486,0.0162234814669486
-19250,4929,2997,0.0775054077358341,0.0775054077358341
-19251,2997,7215,0.0556994645707447,0.0556994645707447
-19252,7215,4943,0.101417024663026,0.101417024663026
-19253,4943,4680,0.100527034724402,0.100527034724402
-19254,4680,7861,0.10148450975115,0.10148450975115
-19255,7861,5802,0.109659923162335,0.109659923162335
-19256,5802,8768,0.114010676979814,0.114010676979814
-19257,8768,10464,0.134804410176221,0.134804410176221
-19258,10464,338,0.0847524339031626,0.0847524339031626
-19259,338,10465,0.0582049460436449,0.0582049460436449
-19261,9467,561,0.02991036647086,0.02991036647086
-15187,8324,9523,0.0327715210342319,0.0327715210342319
-15189,9403,6744,0.131603339182178,0.131603339182178
-15190,6744,6144,0.131367316381262,0.131367316381262
-15191,6144,4018,0.137213550559119,0.137213550559119
-15192,4018,7022,0.137229962505115,0.137229962505115
-15193,7022,7392,0.129151524081427,0.129151524081427
-15195,9524,9525,0.0293502828068984,0.0293502828068984
-15196,9525,3400,0.0502879609443278,0.0502879609443278
-15198,9212,8374,0.0509876682022625,0.0509876682022625
-15199,8374,9526,0.0501407630476736,0.0501407630476736
-15201,7443,9527,0.0485275735168955,0.0485275735168955
-15202,9527,7160,0.0501690368011668,0.0501690368011668
-15204,9528,7772,0.0491757515961192,0.0491757515961192
-19414,3251,7295,0.215557365491205,0.215557365491205
-19415,7295,38,0.193056632398898,0.193056632398898
-19416,38,3537,0.207444876530122,0.207444876530122
-19417,3537,4232,0.199406339345135,0.199406339345135
-19419,3248,7289,0.216790622749105,0.216790622749105
-19420,7289,34,0.19126988034169,0.19126988034169
-19660,6763,3987,0.201101495268523,0.201101495268523
-19664,9366,9360,0.104402218346712,0.104402218346712
-19665,9360,10609,0.0511942469588291,0.0511942469588291
-19666,10609,10608,0.151226661870126,0.151226661870126
-19668,10608,10610,0.149537813443153,0.149537813443153
-19674,1809,10611,0.33816836736717,0.33816836736717
-19676,10376,10403,0.0245741855053009,0.0245741855053009
-19678,10612,1810,0.127204321184034,0.127204321184034
-19681,10613,10400,0.0511661482023126,0.0511661482023126
-16697,7094,9611,0.00886963723885407,0.00886963723885407
-19683,10614,10404,0.0688061700167682,0.0688061700167682
-19873,9513,4580,0.132311871209248,0.132311871209248
-19684,10404,10611,0.093589959625359,0.093589959625359
-17421,10103,10082,0.0236886540751766,0.0236886540751766
-19685,10611,10612,0.0295914472405657,0.0295914472405657
-19686,10612,10614,0.0207133170517971,0.0207133170517971
-19688,10615,10399,0.0680853608411523,0.0680853608411523
-19742,8865,3778,0.153182304960692,0.153182304960692
-19743,3778,10251,0.199472712546792,0.199472712546792
-20418,10775,10774,0.0781617215430941,0.0781617215430941
-19804,10646,2619,0.0523061501297365,0.0523061501297365
-19839,10655,10656,0.208642261382715,0.208642261382715
-19840,10656,9515,0.207256465232075,0.207256465232075
-19841,9515,4581,0.131476935756536,0.131476935756536
-19842,4581,8369,0.136571452698726,0.136571452698726
-19843,8369,5296,0.134437189399661,0.134437189399661
-19849,9510,10659,0.196832023994668,0.196832023994668
-19850,10659,10660,0.00933491084100046,0.00933491084100046
-19857,10663,10664,0.203268481110854,0.203268481110854
-19858,10664,4584,0.340902950197611,0.340902950197611
-19859,4584,6443,0.133958738324445,0.133958738324445
-19860,6443,5300,0.13749324562242,0.13749324562242
-19862,10665,7406,0.149893826243372,0.149893826243372
-19865,10667,9512,0.206545737430627,0.206545737430627
-608,599,600,0.326867712180581,0.326867712180581
-19870,10669,10666,0.0946602410525992,0.0946602410525992
-19871,10666,10670,0.114297265097593,0.114297265097593
-19872,10670,9513,0.206208296842551,0.206208296842551
-20654,6734,10882,0.0587106683934502,0.0587106683934502
-19874,4580,8368,0.136014360939856,0.136014360939856
-19875,8368,3817,0.133956606983629,0.133956606983629
-19887,627,10669,0.00369254651812945,0.00369254651812945
-19888,10669,10673,0.0509541857454109,0.0509541857454109
-19889,10673,7185,0.0463624089792375,0.0463624089792375
-19890,7185,10655,0.00294147338451417,0.00294147338451417
-19891,10655,10658,0.0513792379314705,0.0513792379314705
-19892,10658,9726,0.0479329871824602,0.0479329871824602
-19893,9726,10654,0.050711837363241,0.050711837363241
-19894,10654,1102,0.049608905570541,0.049608905570541
-19895,1102,10674,0.051538155846358,0.051538155846358
-19896,10674,7514,0.0472454257465845,0.0472454257465845
-19897,7514,10675,0.00204366911425749,0.00204366911425749
-19898,10675,10650,0.0481859646371305,0.0481859646371305
-19899,10650,3868,0.0500586048613679,0.0500586048613679
-16182,5547,1702,0.197838014226301,0.197838014226301
-19900,3868,10663,0.00177015306197821,0.00177015306197821
-19902,10676,5589,0.0437900336804139,0.0437900336804139
-19975,9710,10678,0.0499234178433857,0.0499234178433857
-19976,10678,9722,0.0489092169162438,0.0489092169162438
-19977,9722,10686,0.0503973293919778,0.0503973293919778
-19978,10686,3380,0.0518081278246911,0.0518081278246911
-19979,3380,10660,0.0523052391085021,0.0523052391085021
-19980,10660,10679,0.0495088072044065,0.0495088072044065
-19981,10679,10667,0.0507313759263116,0.0507313759263116
-19982,10667,10670,0.0483586645716411,0.0483586645716411
-19983,10670,10680,0.0518679752837857,0.0518679752837857
-19984,10680,10656,0.050123635320888,0.050123635320888
-19985,10656,10657,0.0496280116055878,0.0496280116055878
-19986,10657,9727,0.0488069327339047,0.0488069327339047
-19989,1103,10684,0.0492526075164636,0.0492526075164636
-656,646,647,0.146781335789774,0.146781335789774
-20153,9416,8943,0.363005134814212,0.363005134814212
-20155,9241,426,0.0770893533882784,0.0770893533882784
-20157,461,6171,0.271278721099677,0.271278721099677
-20161,1795,8719,0.00999704268874585,0.00999704268874585
-20163,4233,1795,0.205432809418909,0.205432809418909
-20165,3252,7296,0.216277689734072,0.216277689734072
-20166,7296,39,0.192678596239665,0.192678596239665
-20167,39,3538,0.207091579860447,0.207091579860447
-20168,3538,4234,0.200695550258567,0.200695550258567
-20170,6489,3675,0.150803028705812,0.150803028705812
-20172,9313,4863,0.191918567433925,0.191918567433925
-20173,4863,2213,0.160028953629168,0.160028953629168
-20174,2213,928,0.187511558441934,0.187511558441934
-17423,10083,10104,0.109040593432451,0.109040593432451
-20175,928,5932,0.175834480120689,0.175834480120689
-20176,5932,3804,0.153555987473657,0.153555987473657
-20178,3804,10247,0.200040701273324,0.200040701273324
-20181,6549,4768,0.17858020416066,0.17858020416066
-20185,10705,8247,0.0550533285282311,0.0550533285282311
-15205,7772,9040,0.0507978153373748,0.0507978153373748
-15206,9040,1113,0.0497891730866418,0.0497891730866418
-15208,9529,7493,0.0494909698776819,0.0494909698776819
-15209,7493,9169,0.051731129981418,0.051731129981418
-15210,9169,3835,0.0502567043103765,0.0502567043103765
-15212,5624,3708,0.103423232464888,0.103423232464888
-15213,3708,718,0.104893137935114,0.104893137935114
-15214,718,9442,0.108559355644902,0.108559355644902
-15215,9442,8519,0.0865482797270432,0.0865482797270432
-15218,539,540,0.260599478311813,0.260599478311813
-15220,9430,9531,0.0962600395709663,0.0962600395709663
-15232,8334,8360,0.0525484415568663,0.0525484415568663
-15234,9532,9533,0.00803607126282377,0.00803607126282377
-16285,2852,1362,0.131790180095648,0.131790180095648
-15236,9534,9535,0.0751513734309232,0.0751513734309232
-15237,9535,9536,0.0195917533971332,0.0195917533971332
-15238,9536,9537,0.0515491230280822,0.0515491230280822
-18878,3216,6125,0.202386413121619,0.202386413121619
-15239,9537,9538,0.0217956250277941,0.0217956250277941
-15248,8177,9543,0.0137987617761691,0.0137987617761691
-15249,9541,9542,0.0585754347953461,0.0585754347953461
-15262,9552,9550,0.00461416645458039,0.00461416645458039
-15263,9550,8208,0.00942903742084459,0.00942903742084459
-15264,8208,8203,0.268586250441468,0.268586250441468
-15265,8203,8187,0.252138571661244,0.252138571661244
-15267,8182,9552,0.0592295781497915,0.0592295781497915
-15275,9553,392,0.159342904018314,0.159342904018314
-15276,392,443,0.100075433980265,0.100075433980265
-15277,443,8209,0.110751336507506,0.110751336507506
-15278,3258,9554,0.029060284587417,0.029060284587417
-15279,9555,9556,0.0194857519875014,0.0194857519875014
-15280,9556,9557,0.01686832436596,0.01686832436596
-15284,9558,8799,0.0124547414515574,0.0124547414515574
-15287,9268,8812,0.43752637477907,0.43752637477907
-15372,9568,7345,0.407049578137861,0.407049578137861
-15373,7345,7369,0.0183549065123627,0.0183549065123627
-15374,7369,7156,0.617874851338927,0.617874851338927
-15375,7156,8802,0.0193374199518318,0.0193374199518318
-15376,8802,7317,0.278372348360029,0.278372348360029
-15377,7317,7975,0.104085714382657,0.104085714382657
-15378,7975,8806,0.102424669696849,0.102424669696849
-20689,10900,10890,0.00428101320774671,0.00428101320774671
-15380,2642,4108,0.0801282359532547,0.0801282359532547
-15882,9238,9569,0.375213941828735,0.375213941828735
-4422,4132,3782,0.199943657895071,0.199943657895071
-15381,4108,7064,0.0951259934580263,0.0951259934580263
-15383,993,9570,0.0346111476896159,0.0346111476896159
-15385,9570,2914,0.0185752046128979,0.0185752046128979
-15393,9572,9573,0.0529385333780706,0.0529385333780706
-15394,9574,9575,0.235820407161737,0.235820407161737
-15395,8031,9576,0.0470934184180165,0.0470934184180165
-15396,9577,9578,0.0233972200853265,0.0233972200853265
-15398,8797,9577,0.0680401949692739,0.0680401949692739
-15404,9583,9584,0.0189997554494897,0.0189997554494897
-15413,8399,9591,0.147004287358107,0.147004287358107
-15414,9591,9592,0.0201167087704522,0.0201167087704522
-15415,9592,8857,0.127975925737851,0.127975925737851
-15416,8857,7897,0.144523217943683,0.144523217943683
-15864,9238,9744,0.017876559138977,0.017876559138977
-765,765,766,0.102953430637808,0.102953430637808
-15417,7897,8290,0.14604137147811,0.14604137147811
-15418,8290,8283,0.146330295926468,0.146330295926468
-15419,8283,9593,0.142033870447888,0.142033870447888
-15420,9593,5781,0.00569268198805717,0.00569268198805717
-15421,5781,8573,0.144843439528192,0.144843439528192
-15422,8573,6709,0.145981160506706,0.145981160506706
-15423,6709,8489,0.147059173742998,0.147059173742998
-20690,10890,10906,0.00389182243300479,0.00389182243300479
-15424,8489,9595,0.146421765893647,0.146421765893647
-15425,9595,8637,0.147888642293711,0.147888642293711
-15427,4935,9590,0.0193454164735318,0.0193454164735318
-15430,8608,1478,0.0099286705971119,0.0099286705971119
-15433,7965,9599,0.0149228575371813,0.0149228575371813
-15434,9599,9600,0.0470176213777162,0.0470176213777162
-16271,9867,94,0.0502509464237392,0.0502509464237392
-16273,9867,3654,0.100162413874862,0.100162413874862
-15435,9600,9601,0.0734739685688771,0.0734739685688771
-15436,9601,9602,0.120469898327734,0.120469898327734
-15474,9617,9618,0.0309123358720865,0.0309123358720865
-15475,9618,9620,0.138252717835719,0.138252717835719
-15476,9620,8583,0.0318418680569216,0.0318418680569216
-15477,8583,8311,0.113486958547973,0.113486958547973
-15478,8311,2808,0.019311822890669,0.019311822890669
-15479,2808,9621,0.209882261055166,0.209882261055166
-15480,9621,8522,0.0161981079077479,0.0161981079077479
-15481,8522,8465,0.180991531047255,0.180991531047255
-15487,9624,8468,0.0340418553637742,0.0340418553637742
-15786,9625,9596,0.0115036173464072,0.0115036173464072
-15489,9626,9618,0.0131866115872677,0.0131866115872677
-15494,4937,9617,0.0698272217766147,0.0698272217766147
-15496,9628,9607,0.229575641341845,0.229575641341845
-15497,9607,9629,0.399617180847297,0.399617180847297
-15498,9629,8646,0.256050430773093,0.256050430773093
-15500,9630,7969,0.0158758080194332,0.0158758080194332
-20692,10907,5885,0.00586950671491746,0.00586950671491746
-20693,5885,10908,0.00728749668565428,0.00728749668565428
-15501,7969,6652,0.0898251140375734,0.0898251140375734
-15502,6652,3939,0.0164838165497055,0.0164838165497055
-15504,5618,2286,0.10606737169151,0.10606737169151
-15506,4494,9631,0.0855716406365801,0.0855716406365801
-15508,9632,9630,0.0305358161263308,0.0305358161263308
-15510,9633,4938,0.00998098524134014,0.00998098524134014
-15511,4938,6650,0.146459053749354,0.146459053749354
-15512,6650,3942,0.0669626682021978,0.0669626682021978
-15513,3942,9634,0.0625685122990456,0.0625685122990456
-15514,9634,5614,0.0589940973382129,0.0589940973382129
-15515,5614,9635,0.0521244888471325,0.0521244888471325
-15518,9636,9633,0.0394950652718853,0.0394950652718853
-15520,9637,4687,0.0148908622684888,0.0148908622684888
-15522,5369,9637,0.0293813837370069,0.0293813837370069
-15524,9638,4939,0.016179725599566,0.016179725599566
-15525,4939,7226,0.0545709952111213,0.0545709952111213
-15526,7226,9640,0.0899454990944897,0.0899454990944897
-15527,9640,6648,0.0447546990135401,0.0447546990135401
-15528,6648,9641,0.0618904241631349,0.0618904241631349
-15529,9641,3943,0.062420581454241,0.062420581454241
-15530,3943,9642,0.0627968141202241,0.0627968141202241
-15531,9642,5613,0.0612320254822175,0.0612320254822175
-15532,5613,9643,0.0497740720528068,0.0497740720528068
-15533,9643,3735,0.0551525120669933,0.0551525120669933
-15534,3735,4491,0.207391837271035,0.207391837271035
-15535,4491,129,0.109629298465467,0.109629298465467
-15536,129,7948,0.0410521986313786,0.0410521986313786
-15537,7948,2527,0.287151637527745,0.287151637527745
-15538,2527,9644,0.066959748271427,0.066959748271427
-15539,9644,1221,0.102833533420687,0.102833533420687
-16595,9951,6712,0.00734129639736197,0.00734129639736197
-15542,618,9638,0.0309196803723069,0.0309196803723069
-15548,9647,9648,0.0291957554146951,0.0291957554146951
-15549,7572,9649,0.0425327114545183,0.0425327114545183
-15551,9650,9651,0.00414955523410263,0.00414955523410263
-15553,9651,9652,0.0110054302366685,0.0110054302366685
-15555,9652,9653,0.018743029705938,0.018743029705938
-15558,9656,4160,0.0156451635843959,0.0156451635843959
-15559,4160,4769,0.262100180691146,0.262100180691146
-15560,4769,6550,0.17763389531497,0.17763389531497
-15561,6550,9299,0.171507609467602,0.171507609467602
-15564,3803,5934,0.15587305192408,0.15587305192408
-15565,5934,930,0.176935041153743,0.176935041153743
-15566,930,2215,0.185037322727603,0.185037322727603
-15567,2215,4865,0.15888388268895,0.15888388268895
-15568,4865,9477,0.193757182508649,0.193757182508649
-15569,9477,5466,0.16958064463752,0.16958064463752
-15570,5466,9658,0.179556785798918,0.179556785798918
-15571,9658,9659,0.177338892845698,0.177338892845698
-15572,9659,662,0.00516539932395329,0.00516539932395329
-18431,10291,7169,0.0508784288394603,0.0508784288394603
-15573,662,9660,0.00343592323317494,0.00343592323317494
-15575,9464,4609,0.17585408606,0.17585408606
-15576,4609,6490,0.148161596916065,0.148161596916065
-15577,6490,7974,0.0885778987826885,0.0885778987826885
-15579,4336,9656,0.0458791064556152,0.0458791064556152
-15581,7573,3556,0.0299599314208067,0.0299599314208067
-15583,851,7096,0.0990470064031014,0.0990470064031014
-15584,7096,9661,0.0107677923604542,0.0107677923604542
-15585,9661,9662,0.0081027242638239,0.0081027242638239
-15586,9662,9663,0.00747970901198794,0.00747970901198794
-15587,9663,9664,0.00836437719840195,0.00836437719840195
-15588,9664,9665,0.00928103292942469,0.00928103292942469
-15589,9665,9666,0.00696482735297281,0.00696482735297281
-15590,9666,9667,0.00676039634627663,0.00676039634627663
-15591,9667,9668,0.00737940382126904,0.00737940382126904
-15592,9668,9669,0.0330209265296029,0.0330209265296029
-15593,9669,8703,0.0154036792176203,0.0154036792176203
-15594,8703,8152,0.0935877668611654,0.0935877668611654
-15595,8152,7613,0.0937841622026169,0.0937841622026169
-15596,7613,7266,0.0918493440897444,0.0918493440897444
-15597,7266,7585,0.0967046653962524,0.0967046653962524
-15599,2003,3363,0.0896469251714999,0.0896469251714999
-15600,3363,2757,0.0953909752557553,0.0953909752557553
-15601,2757,9670,0.0852737689905025,0.0852737689905025
-15602,9670,9671,0.00427910266137011,0.00427910266137011
-15603,9671,7008,0.00522846022655691,0.00522846022655691
-15604,7008,9672,0.00318311155269209,0.00318311155269209
-15605,9672,9673,0.00446550904917084,0.00446550904917084
-15606,9673,9674,0.0041674932546887,0.0041674932546887
-15607,9674,2283,0.0902343315694916,0.0902343315694916
-15608,2283,3604,0.0998061678618656,0.0998061678618656
-15609,3604,7530,0.0990712121378624,0.0990712121378624
-15610,7530,2138,0.109343720002506,0.109343720002506
-15611,2138,5995,0.0993207600682094,0.0993207600682094
-15612,5995,7675,0.101107003151938,0.101107003151938
-15613,7675,9675,0.0981911301047578,0.0981911301047578
-15614,9675,9676,0.100210056589884,0.100210056589884
-15615,9676,9677,0.100165741773797,0.100165741773797
-15616,9677,9678,0.100142214318315,0.100142214318315
-15617,9678,9679,0.0993326168253197,0.0993326168253197
-899,913,914,0.147143450226327,0.147143450226327
-20715,10914,9397,0.00810191720556871,0.00810191720556871
-15619,9680,9681,0.102717909771226,0.102717909771226
-15620,9681,9682,0.100023276858498,0.100023276858498
-15621,9682,9683,0.100843312370816,0.100843312370816
-15622,9683,9684,0.101658088937986,0.101658088937986
-15623,9684,9685,0.0375181649725389,0.0375181649725389
-15624,9685,9686,0.0593326737516342,0.0593326737516342
-15625,9686,9687,0.102011015676098,0.102011015676098
-15627,9688,9689,0.110065273053945,0.110065273053945
-15628,9689,9690,0.109733851792721,0.109733851792721
-15629,9690,9691,0.0939207749458389,0.0939207749458389
-15630,9691,9692,0.102876500148466,0.102876500148466
-15631,9692,9693,0.0940860472810003,0.0940860472810003
-15633,851,7096,0.0990470064031014,0.0990470064031014
-15634,7096,9661,0.0107677923604542,0.0107677923604542
-15635,9661,9662,0.0081027242638239,0.0081027242638239
-15636,9662,9663,0.00747970901198794,0.00747970901198794
-15637,9663,9664,0.00836437719840195,0.00836437719840195
-15638,9664,9665,0.00928103292942469,0.00928103292942469
-15639,9665,9666,0.00696482735297281,0.00696482735297281
-15641,9667,9668,0.00737940382126904,0.00737940382126904
-15642,9668,9669,0.0330209265296029,0.0330209265296029
-15644,8703,8152,0.0935877668611654,0.0935877668611654
-20716,9397,9341,0.0111932287865196,0.0111932287865196
-15645,8152,7613,0.0937841622026169,0.0937841622026169
-15646,7613,7266,0.0918493440897444,0.0918493440897444
-15647,7266,7585,0.0967046653962524,0.0967046653962524
-15648,7585,2003,0.0946559616738872,0.0946559616738872
-15649,2003,3363,0.0896469251714999,0.0896469251714999
-15650,3363,2757,0.0953909752557553,0.0953909752557553
-15651,2757,9670,0.0852737689905025,0.0852737689905025
-15652,9670,9671,0.00427910266137011,0.00427910266137011
-15653,9671,7008,0.00522846022655691,0.00522846022655691
-15654,7008,9672,0.00318311155269209,0.00318311155269209
-15655,9672,9673,0.00446550904917084,0.00446550904917084
-15656,9673,9674,0.0041674932546887,0.0041674932546887
-15657,9674,2283,0.0902343315694916,0.0902343315694916
-15658,2283,3604,0.0998061678618656,0.0998061678618656
-15659,3604,7530,0.0990712121378624,0.0990712121378624
-940,955,956,0.0467857248690536,0.0467857248690536
-15660,7530,2138,0.109343720002506,0.109343720002506
-15661,2138,5995,0.0993207600682094,0.0993207600682094
-15663,7675,9675,0.0981911301047578,0.0981911301047578
-15664,9675,9676,0.100210056589884,0.100210056589884
-15665,9676,9677,0.100165741773797,0.100165741773797
-15666,9677,9678,0.100142214318315,0.100142214318315
-20717,9341,10910,0.0086655068036058,0.0086655068036058
-15667,9678,9679,0.0993326168253197,0.0993326168253197
-15668,9679,9680,0.101799223111765,0.101799223111765
-15669,9680,9681,0.102717909771226,0.102717909771226
-15670,9681,9682,0.100023276858498,0.100023276858498
-15671,9682,9683,0.100843312370816,0.100843312370816
-15672,9683,9684,0.101658088937986,0.101658088937986
-15673,9684,9685,0.0375181649725389,0.0375181649725389
-15675,9686,9687,0.102011015676098,0.102011015676098
-15676,9687,9688,0.091295408872665,0.091295408872665
-15677,9688,9689,0.110065273053945,0.110065273053945
-15678,9689,9690,0.109733851792721,0.109733851792721
-15679,9690,9691,0.0939207749458389,0.0939207749458389
-15680,9691,9692,0.102876500148466,0.102876500148466
-15681,9692,9693,0.0940860472810003,0.0940860472810003
-15684,7680,3450,0.103468199661171,0.103468199661171
-15686,6014,3880,0.103612570358144,0.103612570358144
-15687,3880,842,0.103458609408344,0.103458609408344
-15688,842,7097,0.103202015659942,0.103202015659942
-15689,7097,9694,0.047717886337947,0.047717886337947
-15690,9694,8693,0.0153273459011852,0.0153273459011852
-15691,8693,8154,0.0909950973067502,0.0909950973067502
-15692,8154,7616,0.0940844002869557,0.0940844002869557
-20719,10885,9398,0.0070860203578635,0.0070860203578635
-15693,7616,7269,0.0941699315585107,0.0941699315585107
-15695,2024,3357,0.101537173300766,0.101537173300766
-15696,3357,2761,0.09936727049288,0.09936727049288
-15697,2761,7002,0.0992423706702366,0.0992423706702366
-15698,7002,2264,0.0979906184711561,0.0979906184711561
-15699,2264,3594,0.0994063483699449,0.0994063483699449
-15700,3594,7517,0.101662572945496,0.101662572945496
-15701,7517,2099,0.100157096238172,0.100157096238172
-15702,2099,5976,0.101294873446063,0.101294873446063
-15703,5976,7666,0.100715370574341,0.100715370574341
-15705,2329,9695,0.166702045988164,0.166702045988164
-15706,8023,8686,0.102850512121315,0.102850512121315
-15708,8810,7064,0.0240522165973304,0.0240522165973304
-15710,8803,7155,0.0191394427517654,0.0191394427517654
-15711,7155,6281,0.12107437233707,0.12107437233707
-15712,6281,1050,0.111583194341316,0.111583194341316
-15714,3913,3150,0.158539469564201,0.158539469564201
-15715,3150,3124,0.0198304894474349,0.0198304894474349
-15716,3124,7370,0.0954616596060542,0.0954616596060542
-15717,7370,7346,0.018354860843617,0.018354860843617
-15718,7346,6806,0.0981383819816197,0.0981383819816197
-15719,6806,6802,0.0198184437093697,0.0198184437093697
-15720,6802,4711,0.111589534373845,0.111589534373845
-15721,4711,782,0.0471200606837116,0.0471200606837116
-15722,782,5113,0.0527296074626885,0.0527296074626885
-15723,5113,1545,0.0490000601275782,0.0490000601275782
-15724,1545,6325,0.0500984428583215,0.0500984428583215
-15728,9449,9696,0.165726699390797,0.165726699390797
-15732,8801,5164,0.779026857141219,0.779026857141219
-15734,9303,1207,0.168708605950551,0.168708605950551
-15735,1207,9698,0.0215813490172367,0.0215813490172367
-15736,9698,3771,0.199072281764282,0.199072281764282
-15738,8867,958,0.177734005515433,0.177734005515433
-15739,958,9420,0.172099550054797,0.172099550054797
-15740,9420,4896,0.162799282631442,0.162799282631442
-15741,4896,9470,0.183516274472291,0.183516274472291
-15742,9470,5493,0.174731799993968,0.174731799993968
-15743,5493,9699,0.19822011575815,0.19822011575815
-15745,6718,4833,0.101679501011927,0.101679501011927
-15746,4833,6378,0.103648655421083,0.103648655421083
-15747,6378,3188,0.103521991883946,0.103521991883946
-15749,8692,1060,0.0921643567251203,0.0921643567251203
-15750,1060,1697,0.0932426366322247,0.0932426366322247
-15751,1697,7268,0.0954492333486145,0.0954492333486145
-15752,7268,6671,0.0907592732101769,0.0907592732101769
-15754,2023,3356,0.0971424118361729,0.0971424118361729
-15756,2760,7001,0.10039029368168,0.10039029368168
-15757,7001,2263,0.0995790205304853,0.0995790205304853
-15758,2263,3487,0.100064167822274,0.100064167822274
-15760,5346,2098,0.0987082712844417,0.0987082712844417
-15761,2098,2940,0.101254724790906,0.101254724790906
-15763,6814,9700,0.201962621208867,0.201962621208867
-15766,9701,9702,0.01946308379228,0.01946308379228
-15767,9702,7793,0.0917115184551997,0.0917115184551997
-15768,7793,9703,0.0139663687397926,0.0139663687397926
-15769,9703,9044,0.0844498524584079,0.0844498524584079
-15770,9044,1093,0.00878466321187049,0.00878466321187049
-15771,1093,7489,0.0946907062423257,0.0946907062423257
-15772,7489,3839,0.0924847260791552,0.0924847260791552
-15773,3839,9041,0.00820472152594153,0.00820472152594153
-15774,9041,5598,0.0888252595207534,0.0888252595207534
-15775,5598,9038,0.0124773684874939,0.0124773684874939
-15776,9038,7546,0.0939528798953845,0.0939528798953845
-15817,9704,9705,0.0108623818240175,0.0108623818240175
-15777,7546,9706,0.691905770916309,0.691905770916309
-15800,1403,9709,0.0705866891174833,0.0705866891174833
-15801,9709,620,0.0978636674417251,0.0978636674417251
-15802,620,9710,0.210732715068668,0.210732715068668
-15803,9710,1934,0.00294671517895333,0.00294671517895333
-15812,9716,2323,0.0248152326425255,0.0248152326425255
-15814,9717,9718,0.0914794540174667,0.0914794540174667
-15815,9718,9719,0.0447183943765151,0.0447183943765151
-19498,10525,10526,0.0198486557174526,0.0198486557174526
-15816,9719,9704,0.266399501314719,0.266399501314719
-15823,622,9720,0.114642644128587,0.114642644128587
-15824,9720,9721,0.0112307689682394,0.0112307689682394
-15825,9721,9722,0.0869660670624723,0.0869660670624723
-15826,9722,9508,0.205466270114504,0.205466270114504
-15828,9723,8889,0.0324596924967659,0.0324596924967659
-15829,8889,7134,0.00993032916751998,0.00993032916751998
-15831,9724,9725,0.00760667507368999,0.00760667507368999
-15832,9725,9726,0.189210618262835,0.189210618262835
-15833,9726,9727,0.207046790394153,0.207046790394153
-19270,10423,10424,0.0241914475611954,0.0241914475611954
-435,364,434,0.342302602243315,0.342302602243315
-437,435,436,0.251313063977777,0.251313063977777
-438,291,437,0.00683009618704691,0.00683009618704691
-439,437,438,0.127267952892383,0.127267952892383
-18188,4070,6055,0.154839029661679,0.154839029661679
-2329,914,2297,0.0421335193471221,0.0421335193471221
-2331,2320,2321,0.0970544429847538,0.0970544429847538
-2332,2321,2325,0.106348268281835,0.106348268281835
-2334,2326,2327,0.097322097365987,0.097322097365987
-2335,2327,1153,0.100532392748858,0.100532392748858
-2338,2329,2330,0.176644411418714,0.176644411418714
-2339,2330,2331,0.174810883246149,0.174810883246149
-2340,2331,2332,0.246452825481674,0.246452825481674
-12346,8662,8663,0.00747381550039305,0.00747381550039305
-15258,8632,9548,0.0273148076656665,0.0273148076656665
-2341,2332,2333,0.239714451404855,0.239714451404855
-2342,2333,2334,0.0332654390408316,0.0332654390408316
-2344,2335,2336,0.129842641397919,0.129842641397919
-2346,2337,2338,0.0990445311811364,0.0990445311811364
-2348,2265,2339,0.101695232363891,0.101695232363891
-2349,2339,2340,0.100657111492997,0.100657111492997
-2350,2340,2100,0.0993531902440497,0.0993531902440497
-20593,3590,10852,0.00726410078461852,0.00726410078461852
-20595,10864,10861,0.0184079229928756,0.0184079229928756
-20596,10861,10869,0.0187971985012912,0.0187971985012912
-20598,10844,10816,0.176342451403751,0.176342451403751
-20599,10816,10784,0.0180725957817606,0.0180725957817606
-18882,3271,7310,0.200940882978518,0.200940882978518
-20600,10784,10835,0.00593511915863137,0.00593511915863137
-20602,2958,10836,0.0107685222165634,0.0107685222165634
-20605,10827,10870,0.0187474646325031,0.0187474646325031
-20606,10870,10871,0.0569206829492766,0.0569206829492766
-20746,10919,10920,0.0829974075948199,0.0829974075948199
-20607,10872,10858,0.118628394955246,0.118628394955246
-20609,2959,10837,0.0110654933350888,0.0110654933350888
-20610,10837,10819,0.0119664824389379,0.0119664824389379
-11704,1158,1159,0.143826308402294,0.143826308402294
-16709,10000,10001,0.0457062376473756,0.0457062376473756
-20652,9411,7929,0.0718148143148174,0.0718148143148174
-20655,4390,9954,0.0752796609482001,0.0752796609482001
-20656,9954,10883,0.0805000116188462,0.0805000116188462
-20657,10883,10884,0.00921180121982239,0.00921180121982239
-20658,10884,8289,0.0487008508548274,0.0487008508548274
-20660,5957,6482,0.0027689648671592,0.0027689648671592
-20661,6482,5774,0.120389794748458,0.120389794748458
-20662,5774,4620,0.0232425190443662,0.0232425190443662
-20663,4620,5809,0.169650245221728,0.169650245221728
-20664,5809,10472,0.013534248318244,0.013534248318244
-2394,2385,2386,0.330871173224232,0.330871173224232
-2396,2387,2072,0.091718253525282,0.091718253525282
-2398,2388,2389,0.0952556218940292,0.0952556218940292
-2399,2389,2390,0.088517954558777,0.088517954558777
-2400,2390,2391,0.100075566647637,0.100075566647637
-2401,2391,2392,0.0940014926636224,0.0940014926636224
-2402,2392,2394,0.0931645591460492,0.0931645591460492
-2403,2394,2395,0.0490422843236324,0.0490422843236324
-2404,2396,2397,0.101232025457682,0.101232025457682
-2405,2397,835,0.0985806787691326,0.0985806787691326
-2406,835,2398,0.196049611343252,0.196049611343252
-2407,2398,2399,0.0153233199302382,0.0153233199302382
-2408,2399,2400,0.00232458495354821,0.00232458495354821
-2412,2402,2403,0.0775441054784182,0.0775441054784182
-2415,2405,2406,0.101142772155656,0.101142772155656
-498,441,442,0.0937180388509973,0.0937180388509973
-500,443,444,0.0957304857475106,0.0957304857475106
-14680,445,446,0.198543865097556,0.198543865097556
-443,447,448,0.0518475604896436,0.0518475604896436
-446,450,451,0.1546192530483,0.1546192530483
-310,318,319,0.318271935051083,0.318271935051083
-447,451,452,0.176746748854474,0.176746748854474
-448,452,453,0.173946054533759,0.173946054533759
-449,453,454,0.161145911336434,0.161145911336434
-450,454,455,0.183605091547984,0.183605091547984
-452,456,457,0.174314536622101,0.174314536622101
-453,457,458,0.162044543484691,0.162044543484691
-454,458,459,0.182862983981988,0.182862983981988
-456,460,6,0.0823027301557762,0.0823027301557762
-1198,1212,1213,0.0683736094322978,0.0683736094322978
-465,266,468,0.155710664946604,0.155710664946604
-466,469,470,0.0207613766308904,0.0207613766308904
-468,471,472,0.378751941435673,0.378751941435673
-472,475,476,0.0306017516715067,0.0306017516715067
-474,477,478,0.142331986757376,0.142331986757376
-476,401,479,0.0792493107270532,0.0792493107270532
-480,481,482,0.61054856130416,0.61054856130416
-481,482,483,0.00751372921095178,0.00751372921095178
-482,483,484,0.0775332394520986,0.0775332394520986
-483,484,485,0.089248827005011,0.089248827005011
-17372,40,3540,0.206359755216492,0.206359755216492
-19502,10529,10530,0.0177249357864871,0.0177249357864871
-2653,2611,2612,0.141657164390576,0.141657164390576
-2654,2612,2613,0.112637909268372,0.112637909268372
-2655,2613,2614,0.0580743648208686,0.0580743648208686
-17439,9901,10107,0.0190863480039502,0.0190863480039502
-2656,2614,2615,0.100743891980042,0.100743891980042
-2657,2615,2616,0.100475490032633,0.100475490032633
-2658,2616,2617,0.0513770343819779,0.0513770343819779
-2660,2618,2619,0.0511386540650187,0.0511386540650187
-2661,2619,2620,0.0507766966271612,0.0507766966271612
-2662,2620,2621,0.0437935865590098,0.0437935865590098
-2664,2622,2623,0.138741239129278,0.138741239129278
-2665,2623,2624,0.0616812798954739,0.0616812798954739
-2666,2624,2625,0.041735581046466,0.041735581046466
-2668,2626,2627,0.080053274568439,0.080053274568439
-2669,2627,2628,0.0586986059075718,0.0586986059075718
-2672,2630,2631,0.0511347279443915,0.0511347279443915
-2673,2631,2632,0.0473711830288774,0.0473711830288774
-2701,1199,2633,0.0222472727939579,0.0222472727939579
-2800,2469,2753,0.205232670024875,0.205232670024875
-2801,2753,2754,0.200329673691245,0.200329673691245
-2802,2754,796,0.200317660350865,0.200317660350865
-2803,796,2755,0.202508246596186,0.202508246596186
-2804,2755,2756,0.202966691897007,0.202966691897007
-2805,2756,2757,0.203516573136303,0.203516573136303
-2806,2757,2758,0.206901705972361,0.206901705972361
-2807,2758,2759,0.18527317626533,0.18527317626533
-2809,2760,2761,0.172193089993048,0.172193089993048
-2810,2761,2337,0.176949778602699,0.176949778602699
-2811,2337,2762,0.175813497300624,0.175813497300624
-2812,2762,2763,0.241500363205236,0.241500363205236
-2813,2763,2764,0.135070479950714,0.135070479950714
-2814,2764,2765,0.106502558770285,0.106502558770285
-2815,2765,2766,0.0334927078919062,0.0334927078919062
-2816,2766,2767,0.200988096936329,0.200988096936329
-2817,2767,2768,0.200799068465386,0.200799068465386
-2819,2769,1141,0.136317655493671,0.136317655493671
-2820,1141,908,0.140881200888928,0.140881200888928
-1246,190,1268,0.101376125490378,0.101376125490378
-20670,10891,10892,0.0391113232197559,0.0391113232197559
-20671,10892,10893,0.0381065586329798,0.0381065586329798
-20672,10893,10894,0.00879572218910387,0.00879572218910387
-20673,10894,6880,0.00914047873035344,0.00914047873035344
-20675,10895,10896,0.0564298376836357,0.0564298376836357
-20676,10896,10897,0.0882221479591311,0.0882221479591311
-20677,10897,10898,0.0915468728847566,0.0915468728847566
-20678,10898,10889,0.0977975944203811,0.0977975944203811
-12368,8665,8670,0.0146509072378509,0.0146509072378509
-20679,10889,10899,0.0863988642991602,0.0863988642991602
-20680,10899,10900,0.00621581990565306,0.00621581990565306
-20682,10899,10901,0.0272487435286037,0.0272487435286037
-20683,10902,10892,0.0353963477419812,0.0353963477419812
-20685,10903,10904,0.0311951245060147,0.0311951245060147
-20686,10905,8231,0.00978569112678673,0.00978569112678673
-20687,8231,10753,0.00720642488718956,0.00720642488718956
-11,11,12,0.132606225003913,0.132606225003913
-13,13,14,0.261405445974353,0.261405445974353
-14,14,15,0.0524534751729061,0.0524534751729061
-15,15,16,0.0498286567506269,0.0498286567506269
-16,16,17,0.0506321145105979,0.0506321145105979
-17,17,18,0.0480115772672805,0.0480115772672805
-19,19,20,0.586520216245135,0.586520216245135
-21,22,23,0.0471109050306669,0.0471109050306669
-22,23,24,0.117066818844753,0.117066818844753
-25,26,27,0.131659873107185,0.131659873107185
-27,28,29,0.0945023300061256,0.0945023300061256
-28,29,32,0.0547795902237084,0.0547795902237084
-29,32,33,0.0472851468321661,0.0472851468321661
-30,33,34,0.0541728824006047,0.0541728824006047
-1,1,2,0.182682884421833,0.182682884421833
-31,34,35,0.0481653228438301,0.0481653228438301
-32,35,36,0.0518878807765827,0.0518878807765827
-34,37,38,0.0490317013211587,0.0490317013211587
-35,38,39,0.0492286314169291,0.0492286314169291
-36,39,40,0.0502550749626562,0.0502550749626562
-37,40,41,0.0504947813294015,0.0504947813294015
-19671,9367,10610,0.0557753987785757,0.0557753987785757
-38,41,42,0.0486093395250147,0.0486093395250147
-39,42,43,0.0502383575999221,0.0502383575999221
-40,43,44,0.0498102685006676,0.0498102685006676
-42,45,46,0.0520249865615885,0.0520249865615885
-43,46,47,0.0510850489044332,0.0510850489044332
-44,47,48,0.0480642310133195,0.0480642310133195
-45,48,49,0.0520776483582305,0.0520776483582305
-47,50,51,0.0661075861419648,0.0661075861419648
-48,51,52,0.0568810950926816,0.0568810950926816
-49,52,53,0.0608706853363099,0.0608706853363099
-50,53,54,0.0662114802606989,0.0662114802606989
-51,54,55,0.0474185291403829,0.0474185291403829
-52,55,56,0.0539297292184645,0.0539297292184645
-53,56,57,0.108686747732496,0.108686747732496
-54,57,58,0.187258749990905,0.187258749990905
-56,59,60,1.21682866156064,1.21682866156064
-58,62,65,0.111732852527499,0.111732852527499
-60,66,67,0.0462182288009238,0.0462182288009238
-61,67,68,0.0059633062869109,0.0059633062869109
-63,69,70,0.0080040379689871,0.0080040379689871
-65,71,72,0.00371377887510826,0.00371377887510826
-66,72,73,0.0481593874311522,0.0481593874311522
-67,73,74,0.0476872742951146,0.0476872742951146
-68,74,75,0.050981067010882,0.050981067010882
-69,75,76,0.047311096476864,0.047311096476864
-70,76,77,0.00343925081784597,0.00343925081784597
-71,77,78,0.0504851331557092,0.0504851331557092
-72,78,79,0.0447329738384301,0.0447329738384301
-73,79,80,0.00573274424924571,0.00573274424924571
-74,80,81,0.048934333458383,0.048934333458383
-75,81,82,0.0451562090400863,0.0451562090400863
-76,82,83,0.0525053441886158,0.0525053441886158
-77,83,84,0.0468507536792171,0.0468507536792171
-79,85,86,0.0489620579654281,0.0489620579654281
-80,86,87,0.056293962476598,0.056293962476598
-81,87,88,0.0565505675369976,0.0565505675369976
-82,88,89,0.049261447484153,0.049261447484153
-83,89,90,0.0461992376398338,0.0461992376398338
-84,90,91,0.0452410545911285,0.0452410545911285
-85,91,92,0.040125194779582,0.040125194779582
-86,92,93,0.0417705541366205,0.0417705541366205
-87,93,94,0.0307746903425865,0.0307746903425865
-88,94,95,0.0484715360122363,0.0484715360122363
-90,58,96,0.0988139178735054,0.0988139178735054
-91,96,97,0.101340345409915,0.101340345409915
-92,97,98,0.0883916436599661,0.0883916436599661
-93,98,99,0.0102766637725455,0.0102766637725455
-94,99,100,0.0815080239205417,0.0815080239205417
-95,100,101,0.0191432455952872,0.0191432455952872
-99,104,105,0.149790406602899,0.149790406602899
-100,106,107,0.104888043119077,0.104888043119077
-101,107,108,0.276057285299863,0.276057285299863
-103,109,110,0.318041485575751,0.318041485575751
-105,111,112,0.0487653491195207,0.0487653491195207
-106,113,114,0.160343090933149,0.160343090933149
-107,114,115,0.208121584183608,0.208121584183608
-111,118,119,0.137350395143796,0.137350395143796
-113,120,121,0.356240759753107,0.356240759753107
-114,121,122,0.149871853701347,0.149871853701347
-115,122,123,0.148228608040365,0.148228608040365
-116,123,124,0.294126045752515,0.294126045752515
-118,125,126,0.131313615022207,0.131313615022207
-119,126,127,0.263795049720844,0.263795049720844
-123,130,131,0.221071288024568,0.221071288024568
-125,132,133,0.0549684068983719,0.0549684068983719
-126,133,135,0.0478699749630446,0.0478699749630446
-127,135,136,0.130706329520293,0.130706329520293
-128,136,137,0.0495130025200929,0.0495130025200929
-129,137,138,0.0194653537975714,0.0194653537975714
-130,138,139,0.0302495949579548,0.0302495949579548
-131,139,140,0.097138516429268,0.097138516429268
-133,141,142,0.0984160429772276,0.0984160429772276
-1414,1439,1440,0.0969799596597411,0.0969799596597411
-135,143,144,0.094779584184767,0.094779584184767
-136,144,145,0.102947980955417,0.102947980955417
-137,145,146,0.0998791210708115,0.0998791210708115
-138,146,147,0.10354963170018,0.10354963170018
-139,147,148,0.0970503169891706,0.0970503169891706
-141,149,150,0.0462633170535789,0.0462633170535789
-142,150,151,0.0859494466376985,0.0859494466376985
-143,151,152,0.084056042435147,0.084056042435147
-144,152,131,0.0865811985903579,0.0865811985903579
-145,131,155,0.0846809008371401,0.0846809008371401
-146,155,156,0.0860732350550831,0.0860732350550831
-147,156,157,0.0810260254286054,0.0810260254286054
-148,157,158,0.0821650587696609,0.0821650587696609
-149,158,159,0.0810216994355951,0.0810216994355951
-150,159,160,0.0856058417834562,0.0856058417834562
-151,160,161,0.0815928873404902,0.0815928873404902
-152,161,162,0.00737779613210769,0.00737779613210769
-154,163,164,0.00763240627009494,0.00763240627009494
-155,164,165,0.0713522613021865,0.0713522613021865
-156,165,166,0.00987473687183569,0.00987473687183569
-157,166,167,0.0668981585963986,0.0668981585963986
-158,167,168,0.0113627652096004,0.0113627652096004
-159,168,169,0.0796520415458163,0.0796520415458163
-160,169,170,0.0789939822174276,0.0789939822174276
-161,170,171,0.0216393201096419,0.0216393201096419
-162,171,172,0.05739626274334,0.05739626274334
-163,172,173,0.0799414498698892,0.0799414498698892
-164,173,174,0.161327077814812,0.161327077814812
-165,174,175,0.292992058630926,0.292992058630926
-166,175,176,0.108231632340063,0.108231632340063
-167,176,177,0.106370208061557,0.106370208061557
-168,177,178,0.0920329418240447,0.0920329418240447
-169,178,179,0.199657740223053,0.199657740223053
-170,179,180,0.100614906430247,0.100614906430247
-1461,1483,1484,0.0976853528091841,0.0976853528091841
-171,180,181,0.0991515808605787,0.0991515808605787
-172,181,182,0.101348037813126,0.101348037813126
-175,184,185,0.0991513776470571,0.0991513776470571
-178,187,188,0.0984378662868895,0.0984378662868895
-179,188,189,0.709590130188447,0.709590130188447
-180,190,191,0.100578501060841,0.100578501060841
-181,191,192,0.0991218871214513,0.0991218871214513
-182,192,193,0.20342936542853,0.20342936542853
-183,193,194,0.207080695389682,0.207080695389682
-184,194,195,0.202642969626672,0.202642969626672
-185,195,196,0.201913108682536,0.201913108682536
-186,196,197,0.201920207523846,0.201920207523846
-187,197,198,0.201206377797867,0.201206377797867
-188,198,199,0.199728327239083,0.199728327239083
-189,199,200,0.179903776297828,0.179903776297828
-190,200,201,0.00513723410606708,0.00513723410606708
-191,201,202,0.207079558909688,0.207079558909688
-194,169,204,0.256940343045097,0.256940343045097
-195,204,205,0.14761309930181,0.14761309930181
-384,386,387,0.312847187378026,0.312847187378026
-197,208,209,0.0482198776992404,0.0482198776992404
-198,209,210,1.36238336075367,1.36238336075367
-199,211,212,0.0762056360151952,0.0762056360151952
-210,221,222,0.10839564681744,0.10839564681744
-212,223,224,0.197685755221764,0.197685755221764
-213,224,225,0.136500664002185,0.136500664002185
-215,226,227,0.0378358956085511,0.0378358956085511
-217,228,229,0.0700057652168164,0.0700057652168164
-218,229,230,0.156709235598665,0.156709235598665
-220,231,232,0.0710636642555904,0.0710636642555904
-223,234,235,0.0652725377045483,0.0652725377045483
-227,237,238,0.33099974682308,0.33099974682308
-19951,4950,4670,0.10032168356836,0.10032168356836
-229,239,240,0.145321847286165,0.145321847286165
-230,240,241,0.0697724132050665,0.0697724132050665
-231,241,242,0.0623380559401012,0.0623380559401012
-232,242,243,0.121807717540091,0.121807717540091
-233,243,244,0.123936016070967,0.123936016070967
-234,244,245,0.0423914167747626,0.0423914167747626
-235,245,30,0.0421885133223055,0.0421885133223055
-238,134,246,0.0735610173824186,0.0735610173824186
-246,253,254,0.386604280856974,0.386604280856974
-261,271,272,0.0791195509987444,0.0791195509987444
-262,272,273,0.0178978198366689,0.0178978198366689
-263,273,274,0.0364878269996901,0.0364878269996901
-264,274,275,0.130636800507014,0.130636800507014
-265,275,276,0.0381201943550558,0.0381201943550558
-272,282,283,0.097546663905458,0.097546663905458
-556,66,551,0.00841985913797999,0.00841985913797999
-557,551,552,0.04510313602044,0.04510313602044
-559,553,554,0.116858726253731,0.116858726253731
-562,249,556,0.0347143242166075,0.0347143242166075
-563,557,250,0.0320475892789012,0.0320475892789012
-581,573,574,3.62449911588374,3.62449911588374
-582,495,575,0.042579905853808,0.042579905853808
-583,575,576,0.0263063929759334,0.0263063929759334
-585,577,311,0.0472092453507094,0.0472092453507094
-587,578,579,0.310605662522472,0.310605662522472
-589,580,206,0.0784574482758401,0.0784574482758401
-591,581,582,0.323379230044806,0.323379230044806
-593,583,584,0.18304036244052,0.18304036244052
-595,585,586,0.0719402278196197,0.0719402278196197
-597,587,588,0.0168822192889414,0.0168822192889414
-599,589,590,0.0668977161070656,0.0668977161070656
-601,592,593,0.00991684169352972,0.00991684169352972
-606,597,598,0.0427315746706827,0.0427315746706827
-610,601,602,0.0635315500234909,0.0635315500234909
-611,602,603,0.0528935910157463,0.0528935910157463
-16699,9993,9994,0.012991856325609,0.012991856325609
-612,603,604,0.0535739683641864,0.0535739683641864
-615,606,307,0.0053241575287587,0.0053241575287587
-616,307,607,0.210415758379136,0.210415758379136
-618,608,609,0.0943257357645838,0.0943257357645838
-620,610,611,0.12631191015444,0.12631191015444
-621,611,612,0.121362330065702,0.121362330065702
-11699,1033,1034,0.0933842207119007,0.0933842207119007
-622,612,613,0.120087101438352,0.120087101438352
-623,613,614,0.109496386514743,0.109496386514743
-625,615,616,0.099485158811405,0.099485158811405
-626,616,617,0.0380723765849069,0.0380723765849069
-627,617,618,0.0166082915806853,0.0166082915806853
-629,619,620,0.0454138336035488,0.0454138336035488
-630,620,621,0.0942731398582661,0.0942731398582661
-631,621,622,0.00735436876666859,0.00735436876666859
-632,622,623,0.102647301082546,0.102647301082546
-633,623,544,0.0305138174261522,0.0305138174261522
-636,625,626,0.0461061908767262,0.0461061908767262
-637,626,627,0.0495093856599813,0.0495093856599813
-639,628,629,0.00822721040716169,0.00822721040716169
-640,629,630,0.102896638771385,0.102896638771385
-641,630,631,0.106879933016847,0.106879933016847
-642,631,632,0.103715813554019,0.103715813554019
-643,632,633,0.10692744992309,0.10692744992309
-644,633,634,0.103895780437174,0.103895780437174
-645,634,635,0.10514306949893,0.10514306949893
-647,636,637,0.00886536795801057,0.00886536795801057
-648,637,638,0.204097990393348,0.204097990393348
-649,638,639,0.00993994545767469,0.00993994545767469
-651,640,641,0.322116221139114,0.322116221139114
-653,643,644,0.14058289547664,0.14058289547664
-654,644,645,0.143886814663415,0.143886814663415
-657,647,648,0.1449055455771,0.1449055455771
-660,650,651,0.0986374455510098,0.0986374455510098
-661,651,652,0.109870142544629,0.109870142544629
-662,652,653,0.107278100090415,0.107278100090415
-663,653,654,0.105274765421146,0.105274765421146
-664,654,655,0.107321673078917,0.107321673078917
-665,655,659,0.103426909396494,0.103426909396494
-666,659,660,0.0476206970204551,0.0476206970204551
-667,660,661,0.0487580750629072,0.0487580750629072
-668,661,662,0.103115405190933,0.103115405190933
-669,662,663,0.118337011744519,0.118337011744519
-670,663,664,0.118107974454135,0.118107974454135
-671,664,665,0.223948343500364,0.223948343500364
-672,665,666,0.106040631048838,0.106040631048838
-673,666,667,0.0256000736542961,0.0256000736542961
-674,667,668,0.0803036973488277,0.0803036973488277
-675,668,669,0.107519240980512,0.107519240980512
-1662,1688,1689,0.0492594246995293,0.0492594246995293
-677,670,671,0.106757477563009,0.106757477563009
-678,671,672,0.103159385358598,0.103159385358598
-679,672,673,0.111733647900791,0.111733647900791
-680,673,674,0.10480806031483,0.10480806031483
-681,674,675,0.0524357665703955,0.0524357665703955
-682,675,676,0.0522607419390769,0.0522607419390769
-683,676,677,0.0516311575112871,0.0516311575112871
-684,677,678,0.0529566114294976,0.0529566114294976
-685,678,679,0.0524070698016137,0.0524070698016137
-686,679,680,0.187479766906081,0.187479766906081
-690,683,684,0.0954023275162926,0.0954023275162926
-691,684,685,0.100472575096637,0.100472575096637
-692,685,686,0.0954830683114717,0.0954830683114717
-693,686,687,0.0981912656165647,0.0981912656165647
-694,687,688,0.0529127579061837,0.0529127579061837
-695,688,689,0.097652475318391,0.097652475318391
-696,689,690,0.0954475604442949,0.0954475604442949
-697,690,691,1.04422795392214,1.04422795392214
-698,692,693,0.101491505067343,0.101491505067343
-700,694,695,0.0992328230839297,0.0992328230839297
-701,695,696,0.102484361376735,0.102484361376735
-703,697,698,0.0986965284486813,0.0986965284486813
-704,698,699,0.0994466333494717,0.0994466333494717
-705,699,700,0.0997814367951755,0.0997814367951755
-706,700,702,0.0968138925983087,0.0968138925983087
-707,702,703,0.100377700728806,0.100377700728806
-708,703,704,0.0945219805489684,0.0945219805489684
-709,704,705,0.101319162842739,0.101319162842739
-711,706,707,0.0929527445510612,0.0929527445510612
-712,707,708,0.132514897770158,0.132514897770158
-713,708,709,0.136169309583257,0.136169309583257
-714,709,710,0.133600704636896,0.133600704636896
-715,710,711,0.131877184107974,0.131877184107974
-716,711,712,0.137129048962243,0.137129048962243
-717,712,714,0.139625593223683,0.139625593223683
-718,714,715,0.140147388874583,0.140147388874583
-720,716,717,0.139181895573122,0.139181895573122
-721,717,718,0.136478657719685,0.136478657719685
-722,718,719,0.0608836584293049,0.0608836584293049
-723,719,720,0.0543052596791692,0.0543052596791692
-724,720,721,0.402215107963206,0.402215107963206
-726,722,723,0.109800761131151,0.109800761131151
-728,724,725,0.0404933936313706,0.0404933936313706
-729,725,726,0.0429068637575149,0.0429068637575149
-730,726,54,0.117488559492451,0.117488559492451
-732,728,729,0.201386679597364,0.201386679597364
-733,729,730,0.204011830144653,0.204011830144653
-734,730,731,0.199761692314281,0.199761692314281
-17425,10099,10083,0.0366406616748247,0.0366406616748247
-735,731,732,0.201563131430502,0.201563131430502
-736,732,733,0.402282143818784,0.402282143818784
-737,734,735,0.0902645098486118,0.0902645098486118
-738,735,736,0.0928507623233121,0.0928507623233121
-739,736,737,0.0900332912586976,0.0900332912586976
-740,737,738,0.0739532182409675,0.0739532182409675
-741,738,739,0.100409435325613,0.100409435325613
-742,739,740,0.0918337393875257,0.0918337393875257
-743,740,741,0.0605135925040139,0.0605135925040139
-744,741,744,0.09764928319827,0.09764928319827
-745,744,745,0.100176801141236,0.100176801141236
-746,745,746,0.0948931710062943,0.0948931710062943
-747,746,747,0.0932950961705344,0.0932950961705344
-748,747,748,0.0948942633213168,0.0948942633213168
-749,748,749,0.0880271421463829,0.0880271421463829
-750,749,750,0.101773658707536,0.101773658707536
-751,750,751,0.094781491782375,0.094781491782375
-752,751,752,0.0909312964030863,0.0909312964030863
-754,753,754,0.0476837940219257,0.0476837940219257
-755,754,755,0.0476837940207114,0.0476837940207114
-756,755,756,0.100492444483886,0.100492444483886
-760,760,761,0.278292588595779,0.278292588595779
-18241,8960,6768,0.145513824807152,0.145513824807152
-762,762,763,0.102174293003021,0.102174293003021
-763,763,764,0.0992571756698332,0.0992571756698332
-764,764,765,0.100622536912342,0.100622536912342
-766,766,767,0.101850111631528,0.101850111631528
-767,767,768,0.0961954013729948,0.0961954013729948
-768,768,769,0.207085640087389,0.207085640087389
-769,769,770,0.1068825400281,0.1068825400281
-770,770,771,0.105967528573409,0.105967528573409
-771,771,772,0.107278769323728,0.107278769323728
-772,772,199,0.0969401274978018,0.0969401274978018
-773,199,776,0.101328977128045,0.101328977128045
-774,776,777,0.0984004881984158,0.0984004881984158
-775,777,778,0.0991276696889056,0.0991276696889056
-779,784,785,0.101305408476756,0.101305408476756
-780,785,786,0.0976265458519536,0.0976265458519536
-781,786,787,0.0966903245975086,0.0966903245975086
-783,788,789,0.0146697046803596,0.0146697046803596
-784,789,790,0.0984239882007814,0.0984239882007814
-785,790,791,0.0942419953953979,0.0942419953953979
-786,791,792,0.0942417343682122,0.0942417343682122
-787,792,793,0.0942331855902031,0.0942331855902031
-789,794,795,0.0937138545964453,0.0937138545964453
-790,795,796,0.0956046195795482,0.0956046195795482
-791,796,797,0.0946549122760597,0.0946549122760597
-792,797,798,0.100527766007763,0.100527766007763
-793,798,799,0.10316918665,0.10316918665
-795,800,801,0.103459881633314,0.103459881633314
-796,801,802,0.0997925526863961,0.0997925526863961
-797,802,803,0.0998006432146063,0.0998006432146063
-854,804,805,0.1238606801811,0.1238606801811
-799,807,808,0.10163704947704,0.10163704947704
-800,808,812,0.0515064726572222,0.0515064726572222
-801,812,813,0.0494547954602067,0.0494547954602067
-802,813,814,0.051447981297694,0.051447981297694
-803,814,815,0.0525679212147471,0.0525679212147471
-804,815,816,0.0487973630951461,0.0487973630951461
-805,816,817,0.0522598325196538,0.0522598325196538
-806,817,818,0.103406751654374,0.103406751654374
-807,818,819,0.10785615815132,0.10785615815132
-808,819,820,0.10473605712406,0.10473605712406
-809,820,821,0.112264494558786,0.112264494558786
-810,821,822,0.0974128787334051,0.0974128787334051
-811,822,823,0.107993299539667,0.107993299539667
-812,823,824,0.0548178827467902,0.0548178827467902
-17428,10106,10103,0.0082057240713584,0.0082057240713584
-1819,1835,1836,0.0691383900190408,0.0691383900190408
-813,824,825,0.0508588332180354,0.0508588332180354
-816,827,828,0.0512039318870449,0.0512039318870449
-817,828,829,0.0518718595198435,0.0518718595198435
-818,829,830,0.106833526059922,0.106833526059922
-820,831,832,0.385745696022263,0.385745696022263
-821,832,833,0.404856481972801,0.404856481972801
-823,834,835,0.105948732119107,0.105948732119107
-824,835,838,0.0910625591495108,0.0910625591495108
-826,839,840,0.0919963536570051,0.0919963536570051
-828,841,842,0.174755253051921,0.174755253051921
-829,842,843,0.178568082023164,0.178568082023164
-830,843,844,0.17297498203528,0.17297498203528
-831,844,845,0.173265495891133,0.173265495891133
-832,845,846,0.177949551875208,0.177949551875208
-833,846,847,0.164704515205255,0.164704515205255
-835,848,849,0.140807407128784,0.140807407128784
-839,852,853,0.167627273627897,0.167627273627897
-840,853,854,0.0221861617364752,0.0221861617364752
-841,854,855,0.199351380476648,0.199351380476648
-842,855,856,0.154506611729302,0.154506611729302
-843,856,857,0.177121299660486,0.177121299660486
-844,857,858,0.173233506037634,0.173233506037634
-845,858,859,0.161447290254498,0.161447290254498
-846,859,860,0.184417991926907,0.184417991926907
-847,860,861,0.174097913655798,0.174097913655798
-848,861,862,0.200651350067359,0.200651350067359
-851,864,865,0.136205566327931,0.136205566327931
-852,865,866,0.134098020570816,0.134098020570816
-853,866,804,0.130206342500308,0.130206342500308
-855,805,869,0.151636521465058,0.151636521465058
-856,869,870,0.0565102957854785,0.0565102957854785
-859,872,873,0.106081890543097,0.106081890543097
-860,873,874,0.104885275538693,0.104885275538693
-861,874,875,0.105346104071406,0.105346104071406
-862,875,876,0.105115636520032,0.105115636520032
-16596,6712,8570,0.146117658845452,0.146117658845452
-864,877,878,0.106492224339564,0.106492224339564
-865,878,879,0.105226257982301,0.105226257982301
-866,879,880,0.109300044149485,0.109300044149485
-867,880,881,0.105305755069531,0.105305755069531
-868,881,882,0.0524982326673818,0.0524982326673818
-869,882,883,0.0527289587191423,0.0527289587191423
-870,883,884,0.104777165086199,0.104777165086199
-871,884,885,0.101110616467656,0.101110616467656
-873,886,887,0.105175290472485,0.105175290472485
-874,887,888,0.105460060240618,0.105460060240618
-875,888,889,0.104542724277831,0.104542724277831
-878,891,892,0.107871242081588,0.107871242081588
-879,892,893,0.100327397599291,0.100327397599291
-880,893,894,0.10715921423401,0.10715921423401
-11694,895,896,0.0160104862378167,0.0160104862378167
-881,894,897,0.103236099875311,0.103236099875311
-882,897,898,0.106539225146671,0.106539225146671
-16754,10009,7565,0.0493392725986542,0.0493392725986542
-20639,10032,10878,0.0503841615701827,0.0503841615701827
-885,864,900,0.0968355268957622,0.0968355268957622
-886,900,901,0.0921857962021889,0.0921857962021889
-887,901,902,0.0154453872411826,0.0154453872411826
-888,902,903,0.099023611112339,0.099023611112339
-889,903,904,0.106658816969038,0.106658816969038
-890,904,905,0.102850064051981,0.102850064051981
-891,905,906,0.106374102165022,0.106374102165022
-893,907,908,0.107980942566683,0.107980942566683
-897,911,912,0.0137000260099873,0.0137000260099873
-900,914,915,0.266296417735211,0.266296417735211
-902,916,917,0.109365780913081,0.109365780913081
-903,917,918,0.110688879788924,0.110688879788924
-904,918,919,0.0528048087506356,0.0528048087506356
-905,919,920,0.0548227612983216,0.0548227612983216
-1909,1921,1922,0.0521063364540888,0.0521063364540888
-12333,8655,8656,0.00566894958463717,0.00566894958463717
-906,920,921,0.0600921295133805,0.0600921295133805
-907,921,922,0.0524145297386554,0.0524145297386554
-908,922,923,0.0533449751273277,0.0533449751273277
-909,923,924,0.0522830317618348,0.0522830317618348
-910,924,925,0.0531296104749593,0.0531296104749593
-911,925,926,0.0494870453453698,0.0494870453453698
-912,926,927,0.0490530439973252,0.0490530439973252
-916,930,931,0.0484862367563559,0.0484862367563559
-917,931,932,0.0491192175023229,0.0491192175023229
-918,932,933,0.0512499454427793,0.0512499454427793
-935,950,951,0.0925005138771614,0.0925005138771614
-936,951,952,0.09155937925052,0.09155937925052
-937,952,953,0.096647434304121,0.096647434304121
-938,953,954,0.0946813321937467,0.0946813321937467
-939,954,955,0.0465376592907314,0.0465376592907314
-941,956,957,0.0470827842175089,0.0470827842175089
-942,957,958,0.0477097696809632,0.0477097696809632
-943,958,959,0.0469673192776546,0.0469673192776546
-944,959,857,0.0470271779665272,0.0470271779665272
-945,857,452,0.0433482724753884,0.0433482724753884
-946,452,960,0.0461959621064724,0.0461959621064724
-947,960,456,0.0448744265859584,0.0448744265859584
-948,456,961,0.0477309298676521,0.0477309298676521
-950,962,963,0.203057783136815,0.203057783136815
-951,963,964,0.111884367881333,0.111884367881333
-952,964,965,0.176567620505235,0.176567620505235
-953,965,966,0.178378901323504,0.178378901323504
-958,970,971,0.205957142551392,0.205957142551392
-960,972,973,0.204078625402165,0.204078625402165
-961,973,282,0.115147222371539,0.115147222371539
-964,976,977,0.0518319225146996,0.0518319225146996
-965,977,978,0.124228855322375,0.124228855322375
-966,978,979,0.172234101769625,0.172234101769625
-967,979,980,0.191895457064314,0.191895457064314
-968,980,981,0.160844607226305,0.160844607226305
-969,981,936,0.183612712644296,0.183612712644296
-18742,7651,6216,0.274731695307389,0.274731695307389
-970,936,982,0.178134725901618,0.178134725901618
-972,983,984,0.199061323006722,0.199061323006722
-973,984,985,0.188587247900735,0.188587247900735
-974,985,986,0.0433580404548831,0.0433580404548831
-975,986,987,0.125051012370851,0.125051012370851
-977,988,989,0.141681092806979,0.141681092806979
-978,989,990,0.0574887447164737,0.0574887447164737
-979,990,991,0.201644088462744,0.201644088462744
-981,992,993,0.0142751187411164,0.0142751187411164
-983,994,995,0.198087310718341,0.198087310718341
-984,995,996,0.021294324874815,0.021294324874815
-986,997,998,0.477759831198138,0.477759831198138
-988,999,1000,0.107359092710075,0.107359092710075
-989,1000,1001,0.213427542201395,0.213427542201395
-990,1001,1002,0.0204216124756694,0.0204216124756694
-991,1002,1003,0.169295945736254,0.169295945736254
-992,1003,1004,0.202119044170343,0.202119044170343
-993,1004,1007,0.405136142942317,0.405136142942317
-994,1008,753,0.128100004965855,0.128100004965855
-996,1009,277,0.197304277838347,0.197304277838347
-998,1010,1011,0.168461631075683,0.168461631075683
-999,1011,1012,0.0217275963794507,0.0217275963794507
-1000,1012,1013,0.199706135128057,0.199706135128057
-1001,1013,1014,0.154996233446664,0.154996233446664
-1002,1014,1015,0.0484476295387052,0.0484476295387052
-1005,1018,1019,0.198018950245581,0.198018950245581
-1006,1019,1020,0.173297369328456,0.173297369328456
-1007,1020,1021,0.177035115256862,0.177035115256862
-1008,1021,1022,0.17859043694682,0.17859043694682
-1009,1022,674,0.00356025053355106,0.00356025053355106
-1010,674,1023,0.00366943257948706,0.00366943257948706
-1011,1023,1024,0.17484373239475,0.17484373239475
-1012,1024,1025,0.173998681621435,0.173998681621435
-1015,1027,1028,0.0704684258530158,0.0704684258530158
-1017,1029,1030,0.0048505404615695,0.0048505404615695
-1018,1030,1031,0.00340295138148338,0.00340295138148338
-1019,1031,1035,0.134848566335067,0.134848566335067
-1020,1035,1036,0.137493615415566,0.137493615415566
-16764,9868,2745,0.0490633016235184,0.0490633016235184
-1021,1036,827,0.141821861187588,0.141821861187588
-1023,1037,1038,0.144096028267239,0.144096028267239
-1024,1038,1039,0.13873602575008,0.13873602575008
-1025,1039,1040,0.137557829611355,0.137557829611355
-1026,1040,1041,0.134490266221638,0.134490266221638
-1027,1041,1042,0.141541481862683,0.141541481862683
-1028,1042,1043,0.00492593525103261,0.00492593525103261
-1029,1043,1044,0.138593778312369,0.138593778312369
-1030,1044,1045,0.140603553737706,0.140603553737706
-1031,1045,881,0.137936273445967,0.137936273445967
-1032,881,1046,0.138493298016227,0.138493298016227
-1033,1046,1047,0.135001777755027,0.135001777755027
-1034,1047,1048,0.131055322767976,0.131055322767976
-1035,1048,1049,0.124939018757432,0.124939018757432
-1037,1050,1051,0.292899479856136,0.292899479856136
-1038,1051,1052,0.166422260927488,0.166422260927488
-1040,735,1053,0.129020329518136,0.129020329518136
-1042,1054,1055,0.104556386299221,0.104556386299221
-1044,1056,1057,0.0821976961903273,0.0821976961903273
-1046,1058,1059,0.198827335717405,0.198827335717405
-1048,1060,1061,0.168836903384636,0.168836903384636
-1050,1062,1063,0.404705159588638,0.404705159588638
-1051,1067,1068,0.132512985213334,0.132512985213334
-1052,1068,1069,0.13497040303733,0.13497040303733
-1053,1069,1070,0.132768776601327,0.132768776601327
-1056,1072,1073,0.0939030414376985,0.0939030414376985
-1058,1074,1075,0.180616569310233,0.180616569310233
-1059,1075,1076,0.0336398662027363,0.0336398662027363
-1060,1076,1077,0.0410609349522483,0.0410609349522483
-1061,1077,1078,0.0827433862317427,0.0827433862317427
-1062,1078,1079,0.0826887112506465,0.0826887112506465
-1064,1080,464,0.0761353371210495,0.0761353371210495
-1065,464,1081,0.349900041786437,0.349900041786437
-1066,1081,1082,0.00956876487693368,0.00956876487693368
-1068,1083,1084,0.207455473901342,0.207455473901342
-1069,1084,1085,0.20253048003379,0.20253048003379
-1070,1085,1086,0.20117520633799,0.20117520633799
-1071,1086,1087,0.200445374909098,0.200445374909098
-1073,1088,1089,0.193552555847569,0.193552555847569
-1074,1089,1090,0.201907921550129,0.201907921550129
-1075,1090,1091,0.409168814751628,0.409168814751628
-1078,1094,1095,0.176210660233647,0.176210660233647
-1082,1098,1099,0.214073333831546,0.214073333831546
-1083,1099,1100,0.273059176292595,0.273059176292595
-1085,1101,1102,0.177543118890406,0.177543118890406
-1086,1102,1103,0.205192174072119,0.205192174072119
-1089,1105,1106,0.177750162727048,0.177750162727048
-1090,1106,1107,0.0539560094135977,0.0539560094135977
-1091,1107,1108,0.122234944576301,0.122234944576301
-1092,1108,1109,0.177333676437683,0.177333676437683
-1093,1109,1110,0.180925459405873,0.180925459405873
-1095,1111,1112,0.128811671442731,0.128811671442731
-1096,1112,1113,0.134815073580703,0.134815073580703
-1097,1113,1114,0.136688571742098,0.136688571742098
-1098,1114,1115,0.101403665812315,0.101403665812315
-1099,1115,1116,0.102067679100378,0.102067679100378
-1102,1118,1119,0.204345080233058,0.204345080233058
-1103,1119,1120,0.199139333361331,0.199139333361331
-1104,1120,1121,0.0469911073941159,0.0469911073941159
-1105,1121,1122,0.0592169845475301,0.0592169845475301
-1106,1122,1123,0.0953718885827498,0.0953718885827498
-1107,1123,1124,0.0510557799357253,0.0510557799357253
-1108,1124,1125,0.150795725410384,0.150795725410384
-1109,1125,1126,0.203566805558282,0.203566805558282
-1111,1127,1128,0.0472430646130033,0.0472430646130033
-1112,1128,1129,0.205543981836037,0.205543981836037
-1114,1130,1131,0.164841461931526,0.164841461931526
-1115,1131,1132,0.171242319742711,0.171242319742711
-1116,1132,1133,0.15535130673221,0.15535130673221
-1117,1133,1134,0.155906924058663,0.155906924058663
-1118,1134,1135,0.158641971110509,0.158641971110509
-1120,1136,1137,0.202486056810199,0.202486056810199
-1124,1140,1141,0.106376038726262,0.106376038726262
-1125,1141,1142,0.11299023410348,0.11299023410348
-1127,1143,1144,0.105553895231553,0.105553895231553
-1128,1144,1145,0.104117784384988,0.104117784384988
-1129,1145,1146,0.103483298103444,0.103483298103444
-1131,1147,1148,0.20922373460901,0.20922373460901
-1132,1148,1149,0.150393643985841,0.150393643985841
-1133,1149,1150,0.0550246362758013,0.0550246362758013
-1134,1150,1151,0.102697719375893,0.102697719375893
-1135,1151,1152,0.0983530643806034,0.0983530643806034
-1136,1152,1153,0.0500465548413358,0.0500465548413358
-1137,1153,1154,0.957298194837815,0.957298194837815
-1138,1155,1156,0.108691319059022,0.108691319059022
-1139,1156,1157,0.102249102579738,0.102249102579738
-1140,1157,1160,0.108168549451273,0.108168549451273
-1141,1160,1161,0.101829092464478,0.101829092464478
-1144,1162,1163,0.0512778300683452,0.0512778300683452
-1146,1164,1165,0.100040433804019,0.100040433804019
-1147,1165,1166,0.107579273983848,0.107579273983848
-1148,1166,1167,0.103452121653836,0.103452121653836
-1149,1167,1168,0.102717798897395,0.102717798897395
-1150,1168,1169,0.106376023896376,0.106376023896376
-1151,1169,1170,0.105583034841699,0.105583034841699
-1152,1170,1171,0.105884448878202,0.105884448878202
-1153,1171,1172,0.107984392656028,0.107984392656028
-1154,1172,1173,0.100211807661524,0.100211807661524
-1156,1174,1175,0.0651406407561477,0.0651406407561477
-1157,1176,1177,0.0916420940843904,0.0916420940843904
-1158,1177,1178,0.317057086238115,0.317057086238115
-1159,1178,1179,0.0403904373250439,0.0403904373250439
-1160,1179,1180,0.087664479851631,0.087664479851631
-1163,555,558,0.0996109464859662,0.0996109464859662
-1165,1182,1183,0.200712633020301,0.200712633020301
-1166,1183,141,0.201303158931495,0.201303158931495
-1167,141,1184,0.160264959796536,0.160264959796536
-1169,1185,1186,0.0892826433471673,0.0892826433471673
-16608,9325,9944,0.146983175121654,0.146983175121654
-1171,1187,1011,0.0980488049438762,0.0980488049438762
-1172,1011,1188,0.100351187096818,0.100351187096818
-1173,1188,1189,0.0991689160182861,0.0991689160182861
-1174,1189,1190,0.0985624561842153,0.0985624561842153
-1175,1190,1191,0.0992629404802966,0.0992629404802966
-1177,1192,1193,0.0982024972051538,0.0982024972051538
-1178,1193,1194,0.0979660824445765,0.0979660824445765
-1179,1194,1195,0.0324477724054976,0.0324477724054976
-1180,1195,1196,0.0675268282620706,0.0675268282620706
-1182,1197,1198,0.0679368973278076,0.0679368973278076
-1184,1199,1200,0.0686815112230977,0.0686815112230977
-1185,1200,1201,0.0309923494566171,0.0309923494566171
-1186,1201,1202,0.0899174664521967,0.0899174664521967
-1187,1202,1203,0.0945518763756908,0.0945518763756908
-1188,1203,1204,0.0933113340782308,0.0933113340782308
-1189,1204,1205,0.09509225728821,0.09509225728821
-1190,1205,1206,0.0947055520559319,0.0947055520559319
-1191,1206,1207,0.0954663818870976,0.0954663818870976
-1192,1207,1208,0.0457748420522195,0.0457748420522195
-1193,1208,853,0.0452361278424885,0.0452361278424885
-1194,853,1209,0.0465328064656566,0.0465328064656566
-1195,1209,1210,0.0443349306457526,0.0443349306457526
-1196,1210,1211,0.0926255737985973,0.0926255737985973
-1200,1214,1215,0.199187167786165,0.199187167786165
-1201,1215,1216,0.200954541481784,0.200954541481784
-1202,1216,1217,0.405030982441888,0.405030982441888
-1203,1218,1219,0.0492032479248998,0.0492032479248998
-1204,1219,1220,0.0957003230509211,0.0957003230509211
-1206,1221,1222,0.0745042299709739,0.0745042299709739
-1207,1222,1223,0.102728552500243,0.102728552500243
-1208,1223,1224,0.112933078893132,0.112933078893132
-1210,1225,1226,0.132646861758746,0.132646861758746
-1212,1227,1228,0.133737749967366,0.133737749967366
-1213,1228,1229,0.138340301298334,0.138340301298334
-1214,1229,1230,0.133937469551528,0.133937469551528
-1215,1230,1231,0.133215122537399,0.133215122537399
-1216,1231,1236,0.135593895539884,0.135593895539884
-1217,1236,1237,0.134329596288595,0.134329596288595
-1218,1237,1238,0.133838756927755,0.133838756927755
-1220,1239,1240,0.201119608536246,0.201119608536246
-1222,1241,1242,0.0687159203588902,0.0687159203588902
-1223,1242,1243,0.133400908392016,0.133400908392016
-1224,1243,1247,0.135380581131659,0.135380581131659
-1225,1247,1248,0.134002229768192,0.134002229768192
-1226,1248,1249,0.133545106900313,0.133545106900313
-1227,1249,1250,0.135368900396577,0.135368900396577
-1228,1250,1251,0.135024432224222,0.135024432224222
-1229,1251,1252,0.104469760585228,0.104469760585228
-1230,1252,1253,0.0306570001135196,0.0306570001135196
-1231,1253,1254,0.0720522950545032,0.0720522950545032
-1232,1254,1255,0.0658986376594475,0.0658986376594475
-1233,1255,1256,0.0399746208950617,0.0399746208950617
-1234,1256,1257,0.0944491578366609,0.0944491578366609
-1235,1257,1258,0.132766928353997,0.132766928353997
-1236,1258,1259,0.135424431672451,0.135424431672451
-1237,1259,1260,0.140672385455392,0.140672385455392
-1238,1260,1261,0.134975501941172,0.134975501941172
-1239,1261,1262,0.0645486549169547,0.0645486549169547
-1240,1262,1263,0.0682069680036474,0.0682069680036474
-1241,1263,1264,0.132661334326961,0.132661334326961
-1242,1264,1265,0.198750077150319,0.198750077150319
-1243,1265,1266,0.153240793837705,0.153240793837705
-1245,273,1267,0.0675767060379672,0.0675767060379672
-1247,1268,1269,0.0991648269688332,0.0991648269688332
-1248,1269,1270,0.105715575753422,0.105715575753422
-1249,1270,1271,0.096909170039208,0.096909170039208
-1251,1272,1273,0.132822339876578,0.132822339876578
-1252,1273,1274,0.108602805332053,0.108602805332053
-1253,1274,1275,0.0271637528935803,0.0271637528935803
-1254,1275,1276,0.112230208152067,0.112230208152067
-1255,1276,1277,0.0176649567962355,0.0176649567962355
-1256,1277,1278,0.135399208639876,0.135399208639876
-1257,1278,1279,0.134958357098824,0.134958357098824
-1258,1279,1280,0.13471438954866,0.13471438954866
-1259,1280,1281,0.0527317447874755,0.0527317447874755
-1260,1281,1282,0.0822068643990868,0.0822068643990868
-1262,24,1283,0.0541075654220215,0.0541075654220215
-1263,1283,1284,0.0277584904979192,0.0277584904979192
-1264,1284,1285,0.0119510600074318,0.0119510600074318
-1265,1285,1286,0.00765101800505865,0.00765101800505865
-1267,1287,1288,0.0102422085479252,0.0102422085479252
-1269,1289,1290,0.18749026453307,0.18749026453307
-1270,1290,1291,0.200784792674354,0.200784792674354
-1271,1291,1292,0.406662337861329,0.406662337861329
-1272,1293,1028,0.104130177494266,0.104130177494266
-1274,1294,1295,0.209580478517529,0.209580478517529
-1275,1295,1296,0.202179673681852,0.202179673681852
-1276,1296,1297,0.102644670381459,0.102644670381459
-1277,1297,1298,0.08553722531747,0.08553722531747
-1278,1299,1300,0.10911250090994,0.10911250090994
-1279,1300,1305,0.103516561820708,0.103516561820708
-1280,1305,1306,0.107188605435255,0.107188605435255
-1282,1307,1308,0.104254785791266,0.104254785791266
-1283,1308,1309,0.104981820314566,0.104981820314566
-1284,1309,1310,0.0539236153779667,0.0539236153779667
-1285,1310,1311,0.0525379554780919,0.0525379554780919
-1287,1312,1313,0.0516652738700608,0.0516652738700608
-1288,1313,1314,0.0506813468547144,0.0506813468547144
-1289,1314,1315,0.0508976456987324,0.0508976456987324
-1290,1315,1316,0.0521616744394787,0.0521616744394787
-1291,1316,1317,0.0506396099336441,0.0506396099336441
-1292,1317,1318,0.0516214270666003,0.0516214270666003
-1293,1318,1319,0.0518951446578895,0.0518951446578895
-1294,1319,1320,0.0518013233234396,0.0518013233234396
-1295,1320,1321,0.0498510970504219,0.0498510970504219
-1296,1321,1322,0.0511186989957182,0.0511186989957182
-1297,1322,1323,0.0508331487974254,0.0508331487974254
-1300,1325,1326,0.08881123864976,0.08881123864976
-1304,499,1329,0.167484239247501,0.167484239247501
-1305,1329,1332,0.203905657642638,0.203905657642638
-1306,1332,1333,0.204847680679676,0.204847680679676
-1307,1333,1334,0.201123583387407,0.201123583387407
-1309,1335,1336,0.157474175144751,0.157474175144751
-1310,1336,1337,0.117575441930224,0.117575441930224
-1311,1337,1338,0.0942761529447682,0.0942761529447682
-1313,1339,1340,0.0991229934735866,0.0991229934735866
-1314,1340,193,0.100574656408132,0.100574656408132
-1315,193,1341,0.102057084030905,0.102057084030905
-1316,1341,1342,0.101342753238197,0.101342753238197
-1317,1342,1343,0.0983873083767276,0.0983873083767276
-1318,1343,1344,0.103799446896886,0.103799446896886
-1320,1345,1346,0.0125938712274396,0.0125938712274396
-1323,1348,1349,0.273909093656176,0.273909093656176
-1325,1350,1351,0.136546503712986,0.136546503712986
-1326,1351,1352,0.134960662965356,0.134960662965356
-1327,1352,1353,0.12926179848792,0.12926179848792
-1328,1353,1354,0.137757238088674,0.137757238088674
-1329,1354,1355,0.134312853283448,0.134312853283448
-1330,1355,1356,0.132780195397846,0.132780195397846
-1334,1359,1360,0.200708631878513,0.200708631878513
-1336,142,1364,0.213116678885437,0.213116678885437
-1338,1365,1366,0.152775417186349,0.152775417186349
-1339,1367,1368,0.213588518747439,0.213588518747439
-1341,1369,1370,0.0932290478454428,0.0932290478454428
-1342,1371,1372,0.0501807359890933,0.0501807359890933
-1343,1372,1373,0.0506488838331464,0.0506488838331464
-1344,1373,1374,0.0509778039678037,0.0509778039678037
-1345,1374,1375,0.0510804446988023,0.0510804446988023
-1346,1375,1376,0.0530938888935116,0.0530938888935116
-1347,1376,1377,0.0533676128248485,0.0533676128248485
-1348,1377,1378,0.0492215264037076,0.0492215264037076
-1349,1378,1379,0.0493909004241748,0.0493909004241748
-1350,1379,1380,0.102775081126436,0.102775081126436
-1351,1380,1381,0.100172308119327,0.100172308119327
-1353,1382,1383,0.0341877559991377,0.0341877559991377
-1354,1383,1384,0.104577694208817,0.104577694208817
-1356,1385,1386,0.193890579001187,0.193890579001187
-2459,714,2450,0.108569713532818,0.108569713532818
-1358,1387,1388,0.203368582544414,0.203368582544414
-1359,1388,1389,0.203745939128333,0.203745939128333
-1361,1390,1391,0.199208620541168,0.199208620541168
-1362,1391,1392,0.199941300123434,0.199941300123434
-1364,1393,1394,0.177657657089983,0.177657657089983
-1365,1394,1395,0.177656134299769,0.177656134299769
-1366,1395,1396,0.0721099099294465,0.0721099099294465
-1367,1396,1397,0.103333445330309,0.103333445330309
-1368,1397,1398,0.177111308895875,0.177111308895875
-1369,1398,1399,0.177390305757292,0.177390305757292
-1370,1399,1400,0.0617135848764214,0.0617135848764214
-1371,1400,1401,0.0203196347458361,0.0203196347458361
-1373,1402,1403,0.0235752242204257,0.0235752242204257
-1375,1404,1402,0.00627534757508794,0.00627534757508794
-1377,1405,1406,0.205561430653916,0.205561430653916
-1378,1406,1407,0.198211407371417,0.198211407371417
-1379,1407,1404,0.205478920022626,0.205478920022626
-1381,1408,1409,0.100293396704139,0.100293396704139
-2482,2015,1998,0.0374209544699414,0.0374209544699414
-1382,1409,1410,0.293581023203639,0.293581023203639
-1386,1413,1414,0.135399373352711,0.135399373352711
-1387,1414,1415,0.134222064866511,0.134222064866511
-1388,1415,1416,0.135554703950228,0.135554703950228
-1390,1417,1418,0.0459508709120374,0.0459508709120374
-1391,1418,1419,0.202303287973101,0.202303287973101
-1394,1421,1422,0.101428183167069,0.101428183167069
-1395,1422,1423,0.0971760324958247,0.0971760324958247
-1396,1423,1424,0.100465380366459,0.100465380366459
-1397,1424,1425,0.0503823697773718,0.0503823697773718
-1398,1425,1426,0.0484682644313395,0.0484682644313395
-1399,1426,1427,0.0493995225121813,0.0493995225121813
-1400,1427,1138,0.0500574902796296,0.0500574902796296
-1401,1138,1428,0.0487273610513856,0.0487273610513856
-1403,1429,1430,0.0510517494638005,0.0510517494638005
-1404,1430,1431,0.0485479238043371,0.0485479238043371
-1405,1431,1432,0.0499990939034271,0.0499990939034271
-1406,1432,1433,0.0540496336498359,0.0540496336498359
-1408,1434,1435,0.101502735016485,0.101502735016485
-1409,1435,1436,0.0975542961638382,0.0975542961638382
-1410,1436,1437,0.099750341261668,0.099750341261668
-1411,1437,1265,0.0977907961309881,0.0977907961309881
-1413,1438,1439,0.100436447451859,0.100436447451859
-1416,1441,1442,0.100952147732681,0.100952147732681
-1417,1442,1329,0.0966125375658313,0.0966125375658313
-1418,1329,1386,0.101098635736807,0.101098635736807
-1419,1386,1443,0.103303628365074,0.103303628365074
-1420,1443,1444,0.105351454494942,0.105351454494942
-1421,1444,1445,0.104823988220675,0.104823988220675
-1422,1445,1446,0.0939934684249721,0.0939934684249721
-1424,1447,1448,0.0986593061594928,0.0986593061594928
-1425,1448,1449,0.102799709683289,0.102799709683289
-1426,1449,1450,0.0947158385157811,0.0947158385157811
-1427,1450,1451,0.0999075147918272,0.0999075147918272
-1429,1452,784,0.0977509062908684,0.0977509062908684
-1431,1453,1454,0.0719801500300486,0.0719801500300486
-1432,1454,147,0.198407848383786,0.198407848383786
-1433,147,1455,0.0338525123105229,0.0338525123105229
-1435,151,1456,0.201963345264684,0.201963345264684
-1438,1458,1459,0.393387760227334,0.393387760227334
-1439,1460,1343,0.203476082408649,0.203476082408649
-1440,1343,1461,0.205811743637529,0.205811743637529
-1441,1461,1462,0.203884797606556,0.203884797606556
-1442,1462,1463,0.199707411933497,0.199707411933497
-1443,1463,1464,0.202654089186264,0.202654089186264
-1444,1464,1465,0.201184980777767,0.201184980777767
-1446,778,1466,0.187246918966658,0.187246918966658
-1447,1466,1467,0.197539000166948,0.197539000166948
-1448,1467,1468,0.208212504536917,0.208212504536917
-1450,1469,1470,0.186875447219802,0.186875447219802
-1451,173,1471,0.256211082856798,0.256211082856798
-1454,1473,1474,0.0115011236026218,0.0115011236026218
-1455,1474,1475,0.0782239536830869,0.0782239536830869
-1456,1475,1476,0.086773238144748,0.086773238144748
-1457,1476,1479,0.0924870142175924,0.0924870142175924
-1458,1479,1480,0.37958729242533,0.37958729242533
-1460,1482,1483,0.0482525610515095,0.0482525610515095
-1463,1183,1360,0.0998764831880159,0.0998764831880159
-1464,1360,1485,0.101348070124559,0.101348070124559
-1465,1485,1486,0.0984049068298888,0.0984049068298888
-1467,1487,1488,0.111519868825334,0.111519868825334
-1471,1454,1491,0.201276239535877,0.201276239535877
-1473,1492,1493,0.102671300709598,0.102671300709598
-1474,1493,1494,0.114201675013651,0.114201675013651
-1475,1494,1495,0.100620235623392,0.100620235623392
-1476,1495,1496,0.0991406161889474,0.0991406161889474
-1477,1496,1497,0.0998844924107287,0.0998844924107287
-1478,1497,1498,0.102075212599034,0.102075212599034
-1479,1498,1499,0.0984215743592215,0.0984215743592215
-1480,1499,1500,0.710275264674714,0.710275264674714
-1481,1501,1502,0.109574036549915,0.109574036549915
-1482,1502,1503,0.290817056726042,0.290817056726042
-1484,1504,1505,0.0925327391334129,0.0925327391334129
-1485,1505,1506,0.0984021297067109,0.0984021297067109
-1486,1506,1508,0.0976913946915281,0.0976913946915281
-1489,1509,1510,0.0972031962531711,0.0972031962531711
-1490,1510,1511,0.029446204772298,0.029446204772298
-1494,1514,1515,0.0918220075397064,0.0918220075397064
-1499,1518,1519,0.202094906389576,0.202094906389576
-1500,1519,1520,0.199707443263373,0.199707443263373
-1501,1520,1521,0.202063984146535,0.202063984146535
-1502,1521,1522,0.20219834838932,0.20219834838932
-1503,1522,1523,0.199783925434931,0.199783925434931
-1504,1523,47,0.203533027899534,0.203533027899534
-2599,2565,2566,0.0719878134592224,0.0719878134592224
-1506,1524,1525,0.202471618520659,0.202471618520659
-1507,1525,1526,0.207090708341307,0.207090708341307
-1508,1526,1527,0.19569314849173,0.19569314849173
-1509,1527,1528,0.200397251106195,0.200397251106195
-1511,1529,1530,2.00893755060013,2.00893755060013
-1516,1535,1536,0.100586492660266,0.100586492660266
-1518,1009,1537,0.0517503943444181,0.0517503943444181
-1519,1537,1540,0.0418405299236717,0.0418405299236717
-1520,1540,1541,0.0515572086033239,0.0515572086033239
-1521,1541,1542,0.0506297333875711,0.0506297333875711
-1522,1542,1547,0.050402272284143,0.050402272284143
-1523,1547,972,0.0996461444866795,0.0996461444866795
-1524,972,1548,0.0962022319753865,0.0962022319753865
-1525,1548,1549,0.0953657467513535,0.0953657467513535
-1526,1549,1550,0.0963437695650725,0.0963437695650725
-1528,1551,1552,0.142721374587541,0.142721374587541
-1529,1552,1553,0.0277011537567162,0.0277011537567162
-1530,1554,1555,0.0435488620803952,0.0435488620803952
-1531,1555,1053,0.0900813280777187,0.0900813280777187
-1532,1053,1556,0.091689363858679,0.091689363858679
-1537,1560,1561,0.060529314582724,0.060529314582724
-1538,1561,1562,0.0982757577888809,0.0982757577888809
-16447,9904,9905,0.234187757526107,0.234187757526107
-1539,1562,1563,0.0964555264462913,0.0964555264462913
-1540,1563,1564,0.0948745488688521,0.0948745488688521
-1541,1564,1565,0.0967033454927318,0.0967033454927318
-1542,1565,1566,0.0968058200777679,0.0968058200777679
-1543,1566,1567,0.0857541821683109,0.0857541821683109
-1544,1567,1568,0.099340207555012,0.099340207555012
-1545,1568,1571,0.0938405349536985,0.0938405349536985
-1546,1571,1572,0.0960880186310076,0.0960880186310076
-1548,1573,1574,0.0687509395523497,0.0687509395523497
-1551,1576,1577,0.102936179368501,0.102936179368501
-1555,1580,1581,0.0874483930882581,0.0874483930882581
-1558,1583,1584,0.322225767594647,0.322225767594647
-1559,1585,158,0.325178498041831,0.325178498041831
-1560,158,1586,0.248813969770461,0.248813969770461
-1562,1587,1588,0.682458212363131,0.682458212363131
-1563,1589,1590,0.093984831401002,0.093984831401002
-1564,1590,1591,0.0969174980637894,0.0969174980637894
-1565,1591,1592,0.0961947351154639,0.0961947351154639
-1566,1592,1593,0.0903125194205546,0.0903125194205546
-1567,1593,768,0.157881413911052,0.157881413911052
-1568,768,1596,0.172691061788589,0.172691061788589
-1569,1596,1597,0.125221889854682,0.125221889854682
-11466,780,781,0.0395520182900152,0.0395520182900152
-14682,727,782,0.194557772372847,0.194557772372847
-1575,1603,1604,0.122808892568626,0.122808892568626
-1576,1604,1605,0.14134447308364,0.14134447308364
-1577,1605,1606,0.00315234288642188,0.00315234288642188
-1578,1606,1607,0.00237760055681402,0.00237760055681402
-1579,1607,1034,0.102833271602923,0.102833271602923
-1580,1034,1608,0.043468513404088,0.043468513404088
-1581,1608,1033,0.049915824892393,0.049915824892393
-1582,1033,1609,0.0942592902205972,0.0942592902205972
-1583,1609,1610,0.146590259158182,0.146590259158182
-1585,1611,1612,0.124755429872932,0.124755429872932
-1587,1613,1614,0.146275547777326,0.146275547777326
-1588,1614,1615,0.26514479082652,0.26514479082652
-1589,1615,1616,0.120777633356172,0.120777633356172
-1590,1616,1617,0.146979440780155,0.146979440780155
-1591,1617,1618,0.586436662116935,0.586436662116935
-10219,5410,5429,0.0496147818599398,0.0496147818599398
-1592,1618,1619,0.120318550023187,0.120318550023187
-1593,1620,1621,0.123170513487948,0.123170513487948
-1594,1621,1622,0.0891128334653611,0.0891128334653611
-1595,1622,1623,0.0126945079405001,0.0126945079405001
-1597,1624,1625,0.0361628363016983,0.0361628363016983
-1598,1625,1626,0.0965078268867085,0.0965078268867085
-1599,1626,1627,0.122881556236448,0.122881556236448
-1601,1628,1629,0.0514694071076013,0.0514694071076013
-1604,1635,1337,0.196038913624896,0.196038913624896
-1605,1337,1636,0.207228602655476,0.207228602655476
-1606,1636,1637,0.20264296962565,0.20264296962565
-1607,1637,1638,0.203387402917304,0.203387402917304
-1608,1638,1639,0.0190931929940632,0.0190931929940632
-1609,1639,1640,0.0954982678568342,0.0954982678568342
-1612,1642,1643,0.0969376424953903,0.0969376424953903
-1613,1643,1644,0.0932591849763066,0.0932591849763066
-1614,1644,769,0.109404688325734,0.109404688325734
-1616,1645,1646,0.0870106428010285,0.0870106428010285
-1617,1646,1647,0.21369947718983,0.21369947718983
-1618,1647,160,0.103968034130831,0.103968034130831
-1619,160,1648,0.148969074067601,0.148969074067601
-1620,1648,1649,0.102090714125769,0.102090714125769
-1621,1649,1650,0.152016365267068,0.152016365267068
-1624,1652,1653,3.12548314855053,3.12548314855053
-1625,1654,1655,0.099787477314555,0.099787477314555
-1626,1655,1656,0.0573939833292015,0.0573939833292015
-1627,1656,1657,0.0412244638452508,0.0412244638452508
-1628,1657,1658,0.159748945001355,0.159748945001355
-1630,1659,1660,0.0562485254553907,0.0562485254553907
-1631,1660,1661,0.140693983223782,0.140693983223782
-1632,1661,1662,0.199243791884909,0.199243791884909
-1633,1662,1663,0.200873345889282,0.200873345889282
-1634,1663,1664,0.200754056548572,0.200754056548572
-1636,1665,1626,0.102716653811918,0.102716653811918
-1637,1626,1666,0.1010071593638,0.1010071593638
-1638,1666,1667,0.101237955319616,0.101237955319616
-1639,1667,1668,0.101237948338119,0.101237948338119
-1640,1668,711,0.101306598900241,0.101306598900241
-1641,711,1669,0.10042603616611,0.10042603616611
-1642,1669,1670,0.0958961450641524,0.0958961450641524
-1644,1671,1672,0.137716093557474,0.137716093557474
-2762,2714,2715,0.0991860693431078,0.0991860693431078
-1651,1678,1679,0.133306617824866,0.133306617824866
-1652,1679,1250,0.131938339831678,0.131938339831678
-1653,1250,1680,0.132959450261057,0.132959450261057
-1654,1680,1681,0.132733669106231,0.132733669106231
-1655,1681,1682,0.132964768190064,0.132964768190064
-1657,1683,1684,0.0490945965896849,0.0490945965896849
-1658,1684,1685,0.0490108159838641,0.0490108159838641
-1659,1685,1686,0.0499458328019049,0.0499458328019049
-1660,1686,1687,0.0506073899683783,0.0506073899683783
-1661,1687,1688,0.0999922931051382,0.0999922931051382
-1663,1689,1690,0.0532341368396536,0.0532341368396536
-1664,1690,1691,0.0494816378016481,0.0494816378016481
-1665,1691,1129,0.0483962553320354,0.0483962553320354
-2786,2740,2741,0.204165004811902,0.204165004811902
-1669,1694,1695,0.0515058444916569,0.0515058444916569
-1670,1695,1696,0.049583388064832,0.049583388064832
-1672,1697,1698,0.164817053327799,0.164817053327799
-1674,1699,1700,0.200184975462711,0.200184975462711
-1676,1701,1702,0.0562043024646792,0.0562043024646792
-1677,1702,1703,0.0473559609478773,0.0473559609478773
-1679,1704,1705,0.398746605392666,0.398746605392666
-1681,1706,1365,0.144540603588288,0.144540603588288
-1682,1365,1707,0.0528990154558718,0.0528990154558718
-1683,1707,1708,0.10134484884037,0.10134484884037
-1684,1708,1709,0.0991459088544214,0.0991459088544214
-1685,1709,1710,0.100657696530189,0.100657696530189
-1686,1710,1711,0.102825031241611,0.102825031241611
-1687,1711,1712,0.0822822408497534,0.0822822408497534
-1688,1712,1713,0.0873989484445677,0.0873989484445677
-1689,1713,1714,0.083724486939572,0.083724486939572
-1691,1715,1716,0.0772899080720762,0.0772899080720762
-1693,1717,1718,0.0829924152482612,0.0829924152482612
-12973,1824,2797,0.01303984476973,0.01303984476973
-1695,1719,1720,0.0851881782403355,0.0851881782403355
-1696,1720,1721,0.0815306594337643,0.0815306594337643
-1697,1721,1586,0.0807934684584117,0.0807934684584117
-1698,1586,1722,0.0815207303880199,0.0815207303880199
-1699,1722,1649,0.0940041718050458,0.0940041718050458
-1702,1723,1724,0.079056501466603,0.079056501466603
-1703,1724,1725,0.0798640413181071,0.0798640413181071
-1707,204,1728,0.0808035328564148,0.0808035328564148
-1708,1728,1729,0.0793099389847985,0.0793099389847985
-1709,1729,1471,0.0807902086419881,0.0807902086419881
-1710,1471,1730,0.159227595521595,0.159227595521595
-1712,1731,1732,0.00918106235729301,0.00918106235729301
-1713,1732,1733,0.0904244628649386,0.0904244628649386
-1714,1733,1734,0.1024374483727,0.1024374483727
-1715,1734,1735,0.102816532682191,0.102816532682191
-1716,1735,1736,0.0492571813589573,0.0492571813589573
-1718,1737,1738,0.0480836518232765,0.0480836518232765
-1720,1456,1739,0.0851993535054976,0.0851993535054976
-1722,1740,1741,0.0851913863702705,0.0851913863702705
-1724,1742,1743,1.05721580006997,1.05721580006997
-1727,1746,1747,0.203318990561603,0.203318990561603
-1728,1747,1748,0.105159616756228,0.105159616756228
-1730,1749,1750,0.0560818664301058,0.0560818664301058
-1732,1751,1752,0.478248386364013,0.478248386364013
-1733,1752,1753,0.443656760721259,0.443656760721259
-1735,1754,1755,0.1348267792147,0.1348267792147
-1736,1755,1756,0.129877519863856,0.129877519863856
-1738,1757,1758,0.139572444331893,0.139572444331893
-1740,1759,151,0.222068972422621,0.222068972422621
-1742,1760,1761,0.217075886587119,0.217075886587119
-1744,95,1762,0.0857577538793466,0.0857577538793466
-1746,1763,1764,0.202675621070888,0.202675621070888
-1747,1764,1765,0.199646627713467,0.199646627713467
-1749,1768,1769,0.203715891739879,0.203715891739879
-18799,8969,430,0.0787540687567586,0.0787540687567586
-1751,1772,1773,0.1980611092504,0.1980611092504
-1752,1773,1774,0.203412766578772,0.203412766578772
-1753,1774,1775,0.202109933054243,0.202109933054243
-1754,1775,43,0.202669215310678,0.202669215310678
-1755,43,1776,0.197841814631247,0.197841814631247
-1756,1776,1777,0.202676328377112,0.202676328377112
-1757,1777,1778,0.204936151058667,0.204936151058667
-1758,1778,1779,0.1977714314521,0.1977714314521
-1759,1779,1780,0.0315877327413917,0.0315877327413917
-1760,1780,1781,0.0188253963586558,0.0188253963586558
-1763,1782,570,0.0446437216270623,0.0446437216270623
-1764,570,1783,0.0483070548371257,0.0483070548371257
-1765,1783,1784,0.0445253123220399,0.0445253123220399
-1766,1784,1785,0.0510546887722961,0.0510546887722961
-1768,1786,1787,0.0533839966500878,0.0533839966500878
-1769,1787,1788,0.0521924619717138,0.0521924619717138
-1770,1788,1789,0.0490694542852552,0.0490694542852552
-1771,1789,1790,0.0491381693257593,0.0491381693257593
-1774,1792,1793,0.188232081449375,0.188232081449375
-1775,1793,1794,0.0938047512624172,0.0938047512624172
-1777,1795,1796,0.0479551643273822,0.0479551643273822
-1779,1797,1798,0.0506257576844139,0.0506257576844139
-1780,1798,1778,0.0476226019606038,0.0476226019606038
-1781,1778,1799,0.0506000833049729,0.0506000833049729
-1782,1799,1800,0.0489339836382716,0.0489339836382716
-1783,1800,1801,0.0520587364066008,0.0520587364066008
-1784,1801,1526,0.0499381116869285,0.0499381116869285
-1785,1526,1802,0.0482912843745838,0.0482912843745838
-1786,1802,1803,0.052312654556816,0.052312654556816
-1788,466,1804,0.00820558552351573,0.00820558552351573
-1789,1804,1805,0.0939988504660162,0.0939988504660162
-1790,1805,1806,0.0853375028247139,0.0853375028247139
-1792,1807,1808,0.0203438851658787,0.0203438851658787
-1793,1808,1809,0.0251680266073563,0.0251680266073563
-1794,1809,1810,0.203784780502352,0.203784780502352
-1795,1810,1811,0.245267310527272,0.245267310527272
-1797,1812,1513,0.252426666173968,0.252426666173968
-1799,1479,1813,0.176119796231885,0.176119796231885
-1800,1813,1814,0.410709550491308,0.410709550491308
-1802,1815,1816,0.0577133885110317,0.0577133885110317
-1805,1818,1819,0.0740878722178254,0.0740878722178254
-1806,1819,1820,0.135457901381645,0.135457901381645
-1808,1821,1822,0.206145194610924,0.206145194610924
-1812,1828,1829,0.106425576539939,0.106425576539939
-1813,1829,1830,0.105266693821804,0.105266693821804
-1814,1830,1831,0.0587144262982408,0.0587144262982408
-1815,1831,1832,0.0458724352500271,0.0458724352500271
-1817,1833,1834,0.199229532947629,0.199229532947629
-1820,1836,1837,0.0309799563804686,0.0309799563804686
-1822,1838,1839,0.146418601014837,0.146418601014837
-1823,1839,1840,0.141683677614281,0.141683677614281
-1824,1840,1841,0.111588649653809,0.111588649653809
-1827,1844,1845,0.101354924922083,0.101354924922083
-1828,1845,1397,0.106656735273228,0.106656735273228
-1829,1397,1846,0.052351737797171,0.052351737797171
-1831,1847,1848,0.0531037804059208,0.0531037804059208
-1832,1848,1849,0.0506063775898189,0.0506063775898189
-1833,1849,1850,0.0517100300362486,0.0517100300362486
-1834,1850,1851,0.0523258164287328,0.0523258164287328
-1835,1851,1852,0.0499829479152778,0.0499829479152778
-1836,1852,1853,0.051505297770613,0.051505297770613
-1837,1853,1854,0.051498980863322,0.051498980863322
-1840,1856,1857,0.051410475877809,0.051410475877809
-1841,1857,1858,0.0513674435994921,0.0513674435994921
-1842,1858,1109,0.0515213919005775,0.0515213919005775
-1843,1109,1859,0.0506198107739765,0.0506198107739765
-1844,1859,1860,0.0511967416282439,0.0511967416282439
-1845,1860,1861,0.0519748871795966,0.0519748871795966
-1847,1862,1863,0.0554265580601903,0.0554265580601903
-1848,1863,1864,0.397067534239407,0.397067534239407
-1849,1865,1481,0.206774260684103,0.206774260684103
-1850,1481,136,0.199116779757445,0.199116779757445
-1852,1866,1867,0.100566373592942,0.100566373592942
-1853,1867,1868,0.101320817159016,0.101320817159016
-1855,1869,1295,0.0991404141660552,0.0991404141660552
-1856,1295,1368,0.0970426412791379,0.0970426412791379
-1857,1368,1870,0.108154398880898,0.108154398880898
-1859,1871,1872,0.100234830388367,0.100234830388367
-1860,1872,1873,0.0980754533399867,0.0980754533399867
-1861,1873,1874,0.101854943741879,0.101854943741879
-1862,1874,1875,0.0125795021137856,0.0125795021137856
-1863,1875,1876,0.0797821176517698,0.0797821176517698
-1864,1876,1877,0.103719210283603,0.103719210283603
-1866,1740,1878,0.161887620550325,0.161887620550325
-1868,1879,1880,0.0487542093720633,0.0487542093720633
-1869,1880,1122,0.0510369170722426,0.0510369170722426
-1871,1882,1883,0.588595740779303,0.588595740779303
-1872,1884,1885,0.152111272923972,0.152111272923972
-1873,1885,1886,0.199118819593963,0.199118819593963
-1874,1886,1887,0.200266209543398,0.200266209543398
-1876,1891,1892,0.0559298383062073,0.0559298383062073
-2989,776,2928,0.18503947742992,0.18503947742992
-1878,1893,1894,0.32823055853467,0.32823055853467
-1880,1895,1896,0.106010053095039,0.106010053095039
-1881,1896,1897,0.0966039225045284,0.0966039225045284
-1882,1897,1898,0.101329648076306,0.101329648076306
-1883,1898,1899,0.105723867542497,0.105723867542497
-1884,1899,1900,0.100059117952088,0.100059117952088
-1885,1900,1901,0.0102909725043749,0.0102909725043749
-1886,1901,1902,0.0917204387150709,0.0917204387150709
-1887,1902,1903,0.0488400104067164,0.0488400104067164
-1888,1903,1904,0.0516943831129701,0.0516943831129701
-1889,1904,1905,0.0485157141379251,0.0485157141379251
-1890,1905,1906,0.00454251169325352,0.00454251169325352
-1891,1906,1907,0.0474170350841876,0.0474170350841876
-1892,1907,1908,0.0520037008543052,0.0520037008543052
-1893,1908,1772,0.0471189408868131,0.0471189408868131
-1894,1772,1909,0.0492432884260358,0.0492432884260358
-1896,1910,1911,0.0495320112775386,0.0495320112775386
-1897,1911,1520,0.0493945814205325,0.0493945814205325
-1898,1520,1912,0.0533971088216985,0.0533971088216985
-1899,1912,1913,0.0492909868241652,0.0492909868241652
-1902,1914,1915,0.0940987095228026,0.0940987095228026
-1903,1915,1916,0.102901306177953,0.102901306177953
-1904,1916,1917,0.099610911557729,0.099610911557729
-1905,1917,1918,0.102910577647033,0.102910577647033
-1906,1918,1919,0.0967734482498666,0.0967734482498666
-1908,1920,1921,0.0462806189179572,0.0462806189179572
-1910,1922,1923,0.0456516788886206,0.0456516788886206
-1911,1923,1924,0.0505452419126903,0.0505452419126903
-1912,1924,1925,0.0504057374799388,0.0504057374799388
-1913,1925,1926,0.0476340401482501,0.0476340401482501
-1914,1926,1927,0.051053036843087,0.051053036843087
-1915,1927,1928,0.049153971321488,0.049153971321488
-1918,1930,1931,0.0561439680866497,0.0561439680866497
-1919,1931,1932,0.053826281457259,0.053826281457259
-3034,2965,2966,0.00876223324596343,0.00876223324596343
-1920,1932,1933,0.0477206876272752,0.0477206876272752
-1923,1935,1936,0.066876205689997,0.066876205689997
-1924,1937,1938,0.0446617758397252,0.0446617758397252
-1925,1938,1939,0.0840391912235338,0.0840391912235338
-1926,1939,1940,0.227469383602409,0.227469383602409
-1931,1944,1945,0.0952703264542464,0.0952703264542464
-1932,1945,1946,0.0974265293580338,0.0974265293580338
-1933,1947,1948,0.151605873109213,0.151605873109213
-1938,1952,1953,0.109258836266427,0.109258836266427
-1939,1953,1954,0.122481399421688,0.122481399421688
-1940,1954,1955,0.119684093740802,0.119684093740802
-1943,1957,1958,0.204446635842756,0.204446635842756
-1944,1958,1959,0.0997279110592744,0.0997279110592744
-1945,1959,1960,1.05168738215655,1.05168738215655
-1946,1960,1961,1.71048983577162,1.71048983577162
-1947,1962,1963,2.33567129984142,2.33567129984142
-1948,1963,1964,1.08148581800227,1.08148581800227
-1950,1965,1966,0.103934061554546,0.103934061554546
-1951,1966,1967,0.0454999873171455,0.0454999873171455
-1952,1967,1968,0.0964089929828049,0.0964089929828049
-1953,1968,1969,0.125489170754965,0.125489170754965
-1954,1969,1972,0.165851140560008,0.165851140560008
-1955,1972,1973,0.145299005046435,0.145299005046435
-1956,1973,1974,0.145772913358701,0.145772913358701
-1957,1974,1975,0.149974913959851,0.149974913959851
-1958,1975,1976,0.145057930633755,0.145057930633755
-1959,1976,1977,0.143477867614704,0.143477867614704
-1961,1978,420,0.0932140793920545,0.0932140793920545
-1963,1963,1979,1.08603450886527,1.08603450886527
-1964,1979,1980,0.0983329965983175,0.0983329965983175
-1965,1980,1981,0.0917353737473226,0.0917353737473226
-1966,1981,1982,0.055771341470748,0.055771341470748
-1967,1982,1983,0.0968737393586206,0.0968737393586206
-1968,1983,1984,0.0954710209286709,0.0954710209286709
-1969,1984,1985,0.0293519873253464,0.0293519873253464
-1970,1985,1986,0.0704554284720801,0.0704554284720801
-1971,1986,1988,0.095403189447009,0.095403189447009
-1972,1988,1989,0.146040552740524,0.146040552740524
-1973,1989,1990,0.147511070915923,0.147511070915923
-1974,1990,1991,0.147511070914708,0.147511070914708
-1975,1991,1992,0.145306416846094,0.145306416846094
-1976,1992,1993,0.143786568306041,0.143786568306041
-1977,1993,1994,0.0151225768059817,0.0151225768059817
-1978,1994,420,0.0955903616259906,0.0955903616259906
-1980,1995,157,0.328733376766768,0.328733376766768
-1981,157,1721,0.24955962831592,0.24955962831592
-1983,1996,1997,0.475009767293493,0.475009767293493
-1984,1998,1999,0.203988417966153,0.203988417966153
-1985,1999,2000,0.200819821039785,0.200819821039785
-1986,2000,794,0.198875475027904,0.198875475027904
-1987,794,2001,0.203566311480143,0.203566311480143
-1988,2001,2002,0.201451879254481,0.201451879254481
-1989,2002,2003,0.203252240244887,0.203252240244887
-1990,2003,2004,0.204825535738971,0.204825535738971
-1991,2004,2005,0.188227904196053,0.188227904196053
-1992,2005,2006,0.0174353644977756,0.0174353644977756
-1994,353,2007,0.251582112428801,0.251582112428801
-1995,2007,2008,0.132634173204781,0.132634173204781
-1996,2008,2009,0.107027307843563,0.107027307843563
-1999,2011,646,0.139457974349072,0.139457974349072
-2000,646,2012,0.135033465549491,0.135033465549491
-2001,2012,1990,0.089412705524254,0.089412705524254
-2002,1990,1974,0.0383268944933106,0.0383268944933106
-2003,1974,2013,0.133766034901227,0.133766034901227
-2004,2013,2014,0.133581539638141,0.133581539638141
-2005,2014,2015,0.142379951799733,0.142379951799733
-2007,2016,2017,0.251899237124673,0.251899237124673
-2008,2017,2018,0.133367826813466,0.133367826813466
-2009,2018,2019,0.10602884511386,0.10602884511386
-2010,2019,2020,0.0337181930055553,0.0337181930055553
-2011,2020,2021,0.200388320757191,0.200388320757191
-2014,2023,2024,0.171565352607288,0.171565352607288
-2016,2025,2026,0.0477258088803687,0.0477258088803687
-2017,2026,2027,0.0809138557734271,0.0809138557734271
-2018,2027,2028,0.105296432652635,0.105296432652635
-2021,2030,2031,0.0518714690593594,0.0518714690593594
-2023,2032,2033,0.10377665457529,0.10377665457529
-2024,2033,2034,0.105027724692891,0.105027724692891
-2025,2034,2035,0.0547353150471903,0.0547353150471903
-2026,2035,2036,0.0513505470015755,0.0513505470015755
-2027,2036,2037,0.0518915831567366,0.0518915831567366
-2028,2038,2039,0.101144662033058,0.101144662033058
-2029,2039,2040,0.00469012569566242,0.00469012569566242
-2030,2040,2041,0.105219334964384,0.105219334964384
-2032,2042,2043,0.0933903014689556,0.0933903014689556
-2033,2043,559,0.0150758315973471,0.0150758315973471
-2034,559,2044,0.0636386622186814,0.0636386622186814
-2035,2044,2045,0.0177005397698663,0.0177005397698663
-2039,2048,1918,0.201578926546004,0.201578926546004
-2040,1918,2049,0.199006200917286,0.199006200917286
-2043,2051,70,0.203396158473628,0.203396158473628
-2045,1197,2052,0.0220081346494975,0.0220081346494975
-2046,2052,2053,0.200331631924477,0.200331631924477
-2047,2053,2054,0.154360922478377,0.154360922478377
-2048,2054,948,0.176666608936966,0.176666608936966
-2049,948,2055,0.165719712872644,0.165719712872644
-2050,2055,2056,0.169383792792816,0.169383792792816
-2052,2057,2058,0.174576187564815,0.174576187564815
-2053,2058,2059,0.172745648066703,0.172745648066703
-2054,2059,2060,0.176912657229173,0.176912657229173
-2055,2060,2061,0.164650081589568,0.164650081589568
-2057,2062,746,0.0627806188777907,0.0627806188777907
-2059,1564,2063,0.138541795103745,0.138541795103745
-2060,2063,2064,0.12093608528602,0.12093608528602
-2062,2065,693,0.201596255528806,0.201596255528806
-2063,693,2066,0.202309385780635,0.202309385780635
-2065,2067,2068,0.201208296937256,0.201208296937256
-2069,2072,2073,0.141581011374908,0.141581011374908
-2072,2075,2076,0.13960716604907,0.13960716604907
-2073,2076,2077,0.137352432815083,0.137352432815083
-2074,2077,2078,0.139172335676639,0.139172335676639
-2075,2078,2079,0.137570556837278,0.137570556837278
-2077,2080,2081,0.124260733003778,0.124260733003778
-2078,2081,2082,0.0143334567754311,0.0143334567754311
-2079,2082,1169,0.140817691182502,0.140817691182502
-2080,1169,889,0.136202795453782,0.136202795453782
-2081,889,2083,0.140272589797925,0.140272589797925
-2082,2083,2084,0.132655733622477,0.132655733622477
-2084,2085,2086,0.130758013034065,0.130758013034065
-2085,1055,2087,0.365531347335866,0.365531347335866
-2086,2087,2088,0.13568199350655,0.13568199350655
-2087,2088,2089,0.14074386927803,0.14074386927803
-2088,2089,2090,0.132744503428598,0.132744503428598
-2090,2091,2092,0.0599168224199403,0.0599168224199403
-2091,2093,1220,0.0866154902836551,0.0866154902836551
-2093,2095,2096,0.243872573445978,0.243872573445978
-2094,2096,2097,0.241082179338788,0.241082179338788
-2096,2098,2099,0.174814701889178,0.174814701889178
-2097,2099,2100,0.175154975379932,0.175154975379932
-2100,2102,2103,0.114419579517541,0.114419579517541
-2101,2103,2104,0.285214999643623,0.285214999643623
-2102,2104,2107,0.394315301182406,0.394315301182406
-2104,333,2108,0.278529398579064,0.278529398579064
-2106,1150,1822,0.102734424254821,0.102734424254821
-2108,2109,2110,0.202389435684367,0.202389435684367
-2109,2110,2111,0.203214045748693,0.203214045748693
-2110,2111,2112,0.241815761631872,0.241815761631872
-2111,2112,2113,0.100823640639482,0.100823640639482
-2112,2113,2114,0.00265953685516916,0.00265953685516916
-2114,2115,2116,0.238307263458502,0.238307263458502
-2116,2117,2118,0.172019623051487,0.172019623051487
-2117,2118,2119,0.0267252812490126,0.0267252812490126
-2118,2119,2120,0.200138632498134,0.200138632498134
-2119,2120,2121,0.20340922729078,0.20340922729078
-2120,2121,2122,0.197749465935997,0.197749465935997
-2121,2122,2123,0.20148284791492,0.20148284791492
-2122,2123,2124,0.206967663578278,0.206967663578278
-2123,2124,688,0.198127359399408,0.198127359399408
-2124,688,1981,0.162008033573987,0.162008033573987
-2127,2127,2128,0.0963587083366664,0.0963587083366664
-2128,2128,1149,0.101309363144821,0.101309363144821
-2130,2129,2130,0.268413747321973,0.268413747321973
-15791,2106,2131,0.0329007751166605,0.0329007751166605
-2131,2130,2132,0.135315648859656,0.135315648859656
-2133,2133,2134,0.206936888424913,0.206936888424913
-2134,2134,2135,0.199680286737687,0.199680286737687
-2135,2135,801,0.201106069676904,0.201106069676904
-2136,801,2136,0.201743876713814,0.201743876713814
-2137,2136,2137,0.208870260631958,0.208870260631958
-2138,2137,2138,0.202159360168084,0.202159360168084
-2139,2138,2139,0.199627649413879,0.199627649413879
-2140,2139,2140,0.186052011799078,0.186052011799078
-2142,2141,2142,0.0396569310433899,0.0396569310433899
-2168,2167,2168,0.189234637777307,0.189234637777307
-2143,2142,2143,0.0683760552809121,0.0683760552809121
-2144,2143,2144,0.00806043179372478,0.00806043179372478
-2145,2144,2145,0.00436074705638217,0.00436074705638217
-2146,2145,2146,0.00359181344508779,0.00359181344508779
-2147,2146,2147,0.00395340009925433,0.00395340009925433
-2148,2147,2148,0.136610372293043,0.136610372293043
-2149,2148,2149,0.180604844053974,0.180604844053974
-2152,2152,2153,0.132023781927159,0.132023781927159
-2153,2153,2154,0.135708940609739,0.135708940609739
-2154,2154,1415,0.130555983926377,0.130555983926377
-2155,1415,1355,0.134241500709378,0.134241500709378
-2156,1355,2155,0.0746101236889861,0.0746101236889861
-2161,2159,2161,0.133841125283574,0.133841125283574
-2162,2161,2162,0.1372260849468,0.1372260849468
-2163,2162,2163,0.128741940100472,0.128741940100472
-2164,2163,2164,0.135391700615332,0.135391700615332
-2169,2168,2169,0.201124079513876,0.201124079513876
-2170,2169,2170,0.108103708021473,0.108103708021473
-2172,2172,2173,0.13444261016809,0.13444261016809
-2173,2173,2174,0.13827137965728,0.13827137965728
-2174,2174,2175,0.134068324786893,0.134068324786893
-2175,2175,2176,0.133067365005956,0.133067365005956
-2176,2176,2177,0.135535927176987,0.135535927176987
-2177,2177,2178,0.134471884610529,0.134471884610529
-2180,2180,2181,0.201420608111328,0.201420608111328
-2182,2182,2183,0.0166632573599522,0.0166632573599522
-2183,2183,2184,0.101864448677803,0.101864448677803
-2184,2184,2185,0.047789206759145,0.047789206759145
-2185,2185,2186,0.0423227378750124,0.0423227378750124
-4423,3782,4133,0.154572357311794,0.154572357311794
-2186,2186,2187,0.66062410841751,0.66062410841751
-2188,2188,1945,0.10637947146537,0.10637947146537
-2189,1945,2189,0.148995294788127,0.148995294788127
-2211,2212,2213,0.0467155303221573,0.0467155303221573
-2190,2189,2190,0.327169136665339,0.327169136665339
-2192,2191,2192,0.0188299118027414,0.0188299118027414
-2193,2192,2193,0.210910851782462,0.210910851782462
-2195,2194,2195,0.365278744815015,0.365278744815015
-2196,2195,2196,0.0130424738912125,0.0130424738912125
-2197,2196,2197,0.0449464311286017,0.0449464311286017
-2198,2197,2198,0.0030293307914236,0.0030293307914236
-2199,2198,2199,0.128682754082238,0.128682754082238
-2200,2199,2200,0.110573702095649,0.110573702095649
-2202,2203,2204,0.10817464433389,0.10817464433389
-2203,2204,2205,0.107622599984834,0.107622599984834
-2204,2205,2206,0.108403921870099,0.108403921870099
-2205,2206,2207,0.060733439657354,0.060733439657354
-2206,2207,2208,0.0534350684854931,0.0534350684854931
-2207,2208,2209,0.0529414575701877,0.0529414575701877
-2208,2209,2210,0.0527447832774698,0.0527447832774698
-2209,2210,2211,0.102434337721347,0.102434337721347
-2210,2211,2212,0.0503091444283059,0.0503091444283059
-2212,2213,2214,0.0457845256573543,0.0457845256573543
-2213,2214,2215,0.0483154919494593,0.0483154919494593
-2214,2215,2216,0.0500256719211907,0.0500256719211907
-2215,2216,2217,0.0483324272045254,0.0483324272045254
-2216,2217,2218,0.0492693454756351,0.0492693454756351
-2217,2218,2219,0.0514417765088717,0.0514417765088717
-2218,2219,2220,0.0488786158333744,0.0488786158333744
-2219,2220,981,0.0498905437062621,0.0498905437062621
-2220,981,2221,0.0506165357374516,0.0506165357374516
-2221,2221,2222,0.046223636949906,0.046223636949906
-2224,2224,2225,0.051453756147013,0.051453756147013
-2225,2225,2226,0.0468957891600155,0.0468957891600155
-2226,2226,2227,0.0492631927304953,0.0492631927304953
-2227,2227,2228,0.0520252151650071,0.0520252151650071
-2228,2228,2229,0.0550486617142997,0.0550486617142997
-2229,2230,2231,0.0139385553943917,0.0139385553943917
-2230,2231,2232,0.0929550410270359,0.0929550410270359
-2234,2236,2237,0.0961215858652653,0.0961215858652653
-2235,2237,2238,0.0993231725885536,0.0993231725885536
-19654,10604,10606,0.0711515052063537,0.0711515052063537
-2236,2238,2239,0.0986901078011995,0.0986901078011995
-2237,2239,2120,0.100412717366674,0.100412717366674
-2238,2120,2240,0.0994425769829808,0.0994425769829808
-2239,2240,2241,0.0986741447066025,0.0986741447066025
-2240,2241,2242,0.196986803845301,0.196986803845301
-2241,2245,2246,0.0853554831080311,0.0853554831080311
-2242,2246,1017,0.10642802452306,0.10642802452306
-2243,1017,2247,0.0517185594306615,0.0517185594306615
-2244,2247,2248,0.0530774886579764,0.0530774886579764
-16655,3462,3463,0.083025520087948,0.083025520087948
-2245,2248,2249,0.0515725288155829,0.0515725288155829
-2246,2249,2250,0.0550106406637853,0.0550106406637853
-2247,2250,2251,0.0492291609495858,0.0492291609495858
-2250,2253,2254,0.068064098421736,0.068064098421736
-2251,2254,381,0.0653278702953464,0.0653278702953464
-2253,2255,2256,0.176933367276823,0.176933367276823
-2255,2257,1830,0.176665129086282,0.176665129086282
-2257,1817,2258,0.0851310356517557,0.0851310356517557
-2258,2258,2259,0.0498677366751348,0.0498677366751348
-2260,2260,2261,0.20430957984894,0.20430957984894
-2263,2263,2264,0.172785898975569,0.172785898975569
-2265,2265,2266,0.17364958356586,0.17364958356586
-2266,2266,2267,0.245119251352525,0.245119251352525
-2267,2267,2268,0.132589695523512,0.132589695523512
-2268,2268,2269,0.106738596174206,0.106738596174206
-2269,2269,2270,0.0337285830402062,0.0337285830402062
-20279,7555,7554,0.0146999916602211,0.0146999916602211
-2270,2270,2271,0.269363966522552,0.269363966522552
-2273,2275,684,0.204569111503518,0.204569111503518
-2274,684,1986,0.157853726642528,0.157853726642528
-2278,2278,2279,0.207434558661452,0.207434558661452
-2279,2279,2280,0.20034839537718,0.20034839537718
-2280,2280,798,0.19667070755531,0.19667070755531
-2281,798,2281,0.204476797355414,0.204476797355414
-2283,2282,2283,0.201226119347201,0.201226119347201
-2284,2283,2284,0.201775247020165,0.201775247020165
-2287,2286,2287,0.00679684653457476,0.00679684653457476
-2288,2287,2288,0.00351717235619697,0.00351717235619697
-2289,2288,2289,0.00475072672267961,0.00475072672267961
-2290,2289,2290,0.085203263947135,0.085203263947135
-2292,2291,2292,0.21658567369152,0.21658567369152
-2293,2292,2293,0.294285406846423,0.294285406846423
-2295,1532,2294,0.0895735364116296,0.0895735364116296
-2296,2294,2295,0.130472447344756,0.130472447344756
-2298,2044,560,0.0834414685220809,0.0834414685220809
-2299,560,913,0.519257886958262,0.519257886958262
-2300,913,2297,0.14849143076931,0.14849143076931
-2301,2297,2299,0.276635413291223,0.276635413291223
-2356,2345,2346,0.126022029068994,0.126022029068994
-2302,2299,2300,0.882147486934507,0.882147486934507
-2304,2301,2302,0.171837385748798,0.171837385748798
-2305,2302,2303,0.168190952055295,0.168190952055295
-2308,1995,1585,0.0793668846267203,0.0793668846267203
-2310,1646,2305,0.0800618116658591,0.0800618116658591
-2311,2305,2306,0.0800532572745142,0.0800532572745142
-2312,2306,2307,0.0808374839403145,0.0808374839403145
-2313,2307,2308,0.0793040216351705,0.0793040216351705
-2315,2309,2310,0.0976846110372701,0.0976846110372701
-2317,2311,2312,0.131380688058575,0.131380688058575
-2318,2312,2313,0.00313000089825153,0.00313000089825153
-2319,2313,2157,0.109122831884578,0.109122831884578
-2320,2157,2314,0.0470081550211631,0.0470081550211631
-2321,2314,441,0.0450344666647882,0.0450344666647882
-2326,1614,2317,0.105832922283753,0.105832922283753
-2327,2317,2319,0.101211119794553,0.101211119794553
-2328,2319,914,0.105388128978222,0.105388128978222
-2351,2100,2341,0.101951720072048,0.101951720072048
-2352,2341,2342,0.101030261985598,0.101030261985598
-2353,2342,2330,0.0997965680595524,0.0997965680595524
-2354,2330,2343,0.101856778567858,0.101856778567858
-2355,2344,2345,0.0735649917770033,0.0735649917770033
-2357,2346,2347,0.106673075682264,0.106673075682264
-2358,2347,2348,0.104262034499471,0.104262034499471
-2359,2348,2057,0.103127373430199,0.103127373430199
-2360,2057,2350,0.104860273903505,0.104860273903505
-2361,2350,2351,0.102072059078566,0.102072059078566
-2362,2351,2352,0.10208795508847,0.10208795508847
-2363,2352,2353,0.103003886322398,0.103003886322398
-2364,2353,2354,0.104842753763622,0.104842753763622
-2365,2354,2355,0.102079170592138,0.102079170592138
-2366,2355,2356,0.104157794922069,0.104157794922069
-2367,2356,2357,0.102771960719463,0.102771960719463
-2368,2357,843,0.10323381873133,0.10323381873133
-2369,843,2358,0.104166303367793,0.104166303367793
-2370,2358,2359,0.04678514768012,0.04678514768012
-2372,2360,2361,0.106536201799638,0.106536201799638
-2373,2361,2362,0.0524641553188961,0.0524641553188961
-2374,2362,2363,0.0542089866141956,0.0542089866141956
-2376,964,2364,0.101990510698998,0.101990510698998
-2377,2364,2365,0.0991028819964669,0.0991028819964669
-2378,2365,2366,0.101583146356588,0.101583146356588
-2379,2366,2367,0.0976663347579885,0.0976663347579885
-2380,2367,2368,0.137463391512845,0.137463391512845
-2382,2369,2370,0.0935927888835794,0.0935927888835794
-2383,2370,2371,0.22137940675351,0.22137940675351
-2384,93,2372,0.144113051799641,0.144113051799641
-2386,2373,2374,0.118928753039855,0.118928753039855
-18871,9233,10374,0.171083495652578,0.171083495652578
-2387,2374,2375,0.0543464584708682,0.0543464584708682
-2389,2378,2379,0.0407086995566738,0.0407086995566738
-2392,2381,2382,0.0375038196347678,0.0375038196347678
-2393,2383,2384,0.0259773773232023,0.0259773773232023
-2416,2406,2407,0.0997923351013975,0.0997923351013975
-2417,2407,2408,0.102411248163046,0.102411248163046
-2418,2408,2410,0.102005785733823,0.102005785733823
-2419,2410,2411,0.0465568279250156,0.0465568279250156
-2420,2411,1116,0.0498480806250605,0.0498480806250605
-2421,1116,2412,0.0524212085974951,0.0524212085974951
-2422,2412,2413,0.00643722349691115,0.00643722349691115
-2423,2413,2414,0.0569639986120168,0.0569639986120168
-2424,2414,2415,0.054429107165009,0.054429107165009
-2426,1254,2416,0.203595366987771,0.203595366987771
-2427,2416,2418,0.194946286421225,0.194946286421225
-2429,2419,2420,0.10553685574305,0.10553685574305
-2430,2420,2421,0.100987191369147,0.100987191369147
-2431,2421,2422,0.140456845404627,0.140456845404627
-2432,2423,2424,0.132127040761259,0.132127040761259
-2433,2424,2425,0.0836330996531634,0.0836330996531634
-2434,2425,2426,0.048846065804279,0.048846065804279
-2435,2426,2427,0.133578105271454,0.133578105271454
-2437,2428,2429,0.0517867804859422,0.0517867804859422
-2438,2429,2430,0.0498462274807045,0.0498462274807045
-2439,2430,2431,0.0505796838521555,0.0505796838521555
-2440,2431,2432,0.04930585188023,0.04930585188023
-2441,2432,2433,0.0511391992663707,0.0511391992663707
-2442,2433,2434,0.049421053488602,0.049421053488602
-2444,2435,2436,0.0499548965774192,0.0499548965774192
-2446,2437,2438,0.0498278119665032,0.0498278119665032
-2447,2438,1131,0.0475201423687532,0.0475201423687532
-2448,1131,2440,0.0499034161165238,0.0499034161165238
-2449,2440,2441,0.0519460604074748,0.0519460604074748
-2450,2441,2442,0.103666385736129,0.103666385736129
-2451,2442,2443,0.0495636449318867,0.0495636449318867
-2452,2443,2444,0.0508868110117968,0.0508868110117968
-2454,2445,2446,0.0992414144632343,0.0992414144632343
-2455,2446,2447,0.0995661619141735,0.0995661619141735
-2456,2447,2448,0.102918667647187,0.102918667647187
-2457,2448,2449,0.103317708000917,0.103317708000917
-2458,2449,714,0.103614639817309,0.103614639817309
-2460,2450,2451,0.0843633084104915,0.0843633084104915
-2462,2452,2453,0.133209824518529,0.133209824518529
-2463,2453,2454,0.136026824487267,0.136026824487267
-2464,2454,1228,0.0997640460624544,0.0997640460624544
-2466,2455,2173,0.100670279604477,0.100670279604477
-2467,2173,2456,0.101681998391895,0.101681998391895
-2468,2456,2457,0.135717601546705,0.135717601546705
-2469,2457,2458,0.125216072912334,0.125216072912334
-2470,2458,1253,0.13515574813911,0.13515574813911
-2472,1811,2459,0.0528114155967436,0.0528114155967436
-2474,489,2460,0.0154146680516237,0.0154146680516237
-2475,2460,2461,0.0956622199995578,0.0956622199995578
-2476,2461,2462,0.050324686032827,0.050324686032827
-2477,2462,2463,0.0440541436649478,0.0440541436649478
-2478,2463,2464,0.09025955144498,0.09025955144498
-2479,2464,2465,0.00954118829962817,0.00954118829962817
-2480,2465,2466,0.0924623221003645,0.0924623221003645
-2481,2466,2015,0.0557729059183765,0.0557729059183765
-2483,1998,2467,0.0939242873690555,0.0939242873690555
-2485,2468,2469,0.0807187230923558,0.0807187230923558
-2486,2469,2470,0.0660886283093114,0.0660886283093114
-2487,2470,2471,0.0307524582434291,0.0307524582434291
-2488,2471,2277,0.0631719504961159,0.0631719504961159
-2489,2277,2278,0.040321437937915,0.040321437937915
-2490,2278,2472,0.0579924273198359,0.0579924273198359
-2491,2472,2473,0.039564008523498,0.039564008523498
-2492,2473,2474,0.0566191459993118,0.0566191459993118
-2493,2474,2475,0.0461657995077916,0.0461657995077916
-2494,2475,2476,0.0573841993244499,0.0573841993244499
-2495,2476,2133,0.0413742441677564,0.0413742441677564
-2496,2133,2477,0.100557820130683,0.100557820130683
-2497,2477,2478,0.100232094382669,0.100232094382669
-2523,1412,1352,0.126262872161581,0.126262872161581
-2498,2478,2479,3.80416722159948,3.80416722159948
-17380,5747,2721,0.292296181002999,0.292296181002999
-2500,2481,2482,0.133762433378551,0.133762433378551
-2502,2483,2484,0.132763004680832,0.132763004680832
-2503,2484,2153,0.135437121880425,0.135437121880425
-2506,2486,2487,0.0976687527368442,0.0976687527368442
-2507,2487,2488,0.100497620432408,0.100497620432408
-2508,2488,1263,0.0968234302487817,0.0968234302487817
-2510,2489,2490,0.129998303918767,0.129998303918767
-2511,2490,2491,0.131427328920895,0.131427328920895
-2512,2491,2492,0.134959393077107,0.134959393077107
-2513,2492,2493,0.13352181172892,0.13352181172892
-2514,2493,2494,0.134977098269894,0.134977098269894
-2515,2494,2495,0.133660770711518,0.133660770711518
-2517,2496,1452,0.127643758305543,0.127643758305543
-2519,2497,2498,0.181370133617083,0.181370133617083
-2521,2481,2499,0.0828768372746742,0.0828768372746742
-2522,2499,1412,0.137652613646732,0.137652613646732
-2524,1352,2502,0.0676943813373141,0.0676943813373141
-2526,2503,2504,0.133817315449894,0.133817315449894
-2527,2504,2505,0.135673996947998,0.135673996947998
-2528,2505,2506,0.131966049224978,0.131966049224978
-2529,2506,2507,0.147529903316466,0.147529903316466
-2530,2507,2508,0.139391603159038,0.139391603159038
-16296,2509,2510,0.0284493842376544,0.0284493842376544
-2532,2511,2512,0.0269759988952267,0.0269759988952267
-2533,2512,2513,0.0303785309203703,0.0303785309203703
-2534,2513,2514,0.100988065805353,0.100988065805353
-2535,2514,2515,0.134258813820628,0.134258813820628
-2536,2515,2516,0.1356600895436,0.1356600895436
-2537,2516,2517,0.13329676442141,0.13329676442141
-2538,2517,1672,0.132852712666159,0.132852712666159
-2539,1672,2518,0.137264898504848,0.137264898504848
-2540,2518,2453,0.136447294484888,0.136447294484888
-2541,2453,2519,0.136891385699314,0.136891385699314
-2542,2519,2520,0.134024921907499,0.134024921907499
-2544,2521,2522,0.0902887501429021,0.0902887501429021
-2545,2522,2523,0.0432770654501463,0.0432770654501463
-2546,2523,2524,0.0452800647802491,0.0452800647802491
-2547,2524,2525,0.0887962039212883,0.0887962039212883
-2549,2526,2527,0.14861247431244,0.14861247431244
-2550,2527,2528,0.177718576341635,0.177718576341635
-2552,2529,2530,0.0550007858390758,0.0550007858390758
-2553,2530,2531,0.0537231597686698,0.0537231597686698
-2557,254,1937,0.0763145446596447,0.0763145446596447
-2562,2536,2537,0.0969383510155091,0.0969383510155091
-2564,2523,2538,0.041595541767366,0.041595541767366
-2565,2538,2539,0.0446801019224323,0.0446801019224323
-2567,2540,2541,0.0535606711091096,0.0535606711091096
-2568,2541,2542,0.0510376050613383,0.0510376050613383
-2569,2542,2543,0.048208042370787,0.048208042370787
-2570,2543,2544,0.0495068215823226,0.0495068215823226
-2571,2544,2545,0.0497291777137453,0.0497291777137453
-2572,2545,2546,0.0482680412228731,0.0482680412228731
-2573,2546,2547,0.0511986246623993,0.0511986246623993
-2574,2547,2548,0.0481311400848056,0.0481311400848056
-2575,2548,2549,0.05133533567668,0.05133533567668
-2576,2549,1090,0.0473365047010202,0.0473365047010202
-2578,2550,2551,0.0490112208554607,0.0490112208554607
-2579,2551,2552,0.0504551815276218,0.0504551815276218
-2580,2552,2553,0.0492845875119232,0.0492845875119232
-2581,2553,2554,0.0515497460521136,0.0515497460521136
-2582,2554,2555,0.0526862102053863,0.0526862102053863
-2583,2555,2556,0.0982237295878,0.0982237295878
-2584,2556,2557,0.264254691363992,0.264254691363992
-2585,1004,2558,0.099742520234474,0.099742520234474
-2588,2560,1078,0.149639182772472,0.149639182772472
-2589,1078,2522,0.184839011544187,0.184839011544187
-2591,1484,2561,0.33893453481304,0.33893453481304
-2592,2561,2562,0.36930331062994,0.36930331062994
-2594,2563,2295,0.235151876914131,0.235151876914131
-2596,2141,2564,0.0808696846181639,0.0808696846181639
-2628,2589,2590,0.046646895086832,0.046646895086832
-2597,2564,1224,0.24032404212478,0.24032404212478
-2600,2373,2567,0.1712601795962,0.1712601795962
-2601,2567,2568,0.00945648555666562,0.00945648555666562
-2603,2565,2569,0.0807956808253844,0.0807956808253844
-2604,2569,2570,0.076951583144574,0.076951583144574
-2605,2570,2571,0.0476131935554626,0.0476131935554626
-2607,2572,2568,0.0312593605711727,0.0312593605711727
-2609,2569,2573,0.0486149705677772,0.0486149705677772
-2610,2570,2574,0.0674260333743846,0.0674260333743846
-2612,2567,2575,0.0505261001159507,0.0505261001159507
-2615,2577,2578,0.10424034664628,0.10424034664628
-2616,2578,2579,0.103512640883379,0.103512640883379
-2617,2579,1398,0.105102630546257,0.105102630546257
-2618,1398,2580,0.0531367598624707,0.0531367598624707
-2619,2580,2581,0.0517085263170068,0.0517085263170068
-2620,2581,2582,0.0723991341895349,0.0723991341895349
-2621,2582,2583,0.0331676268132885,0.0331676268132885
-2622,2583,2584,0.0138525911142565,0.0138525911142565
-2623,2584,2585,0.037416228202987,0.037416228202987
-2624,2585,2586,0.00994286750486891,0.00994286750486891
-2625,2586,2587,0.040254104254433,0.040254104254433
-2629,2590,2591,0.00335375549834044,0.00335375549834044
-2630,2591,2592,0.0463774647105825,0.0463774647105825
-2631,2592,2593,0.00549997045042586,0.00549997045042586
-2632,2593,2594,0.0383542392436341,0.0383542392436341
-2634,2595,2596,0.0344869484873441,0.0344869484873441
-2635,2596,2597,0.0176627396467139,0.0176627396467139
-2636,2597,2598,0.0280292044334563,0.0280292044334563
-2637,2598,2599,0.0242403080070769,0.0242403080070769
-2638,2599,1569,0.0218944112855232,0.0218944112855232
-2639,1569,2600,0.0286200762867591,0.0286200762867591
-2640,2600,1094,0.018347539243156,0.018347539243156
-2642,1110,2601,0.0142742072830798,0.0142742072830798
-2643,2601,2602,0.0369383896439539,0.0369383896439539
-2644,2602,2603,0.00917687822572764,0.00917687822572764
-2645,2603,2604,0.0430608643022986,0.0430608643022986
-2646,2604,2605,0.00238679099543715,0.00238679099543715
-2647,2605,2606,0.0472847267591164,0.0472847267591164
-2648,2606,2607,0.0508445190476207,0.0508445190476207
-2649,2607,2608,0.00234361810734104,0.00234361810734104
-2650,2608,2609,0.0517900277245267,0.0517900277245267
-2652,2610,2611,0.145180979465517,0.145180979465517
-2674,2632,2634,0.599531015097949,0.599531015097949
-2675,2635,2181,0.0871692653780363,0.0871692653780363
-2676,2181,2638,0.0863959675292808,0.0863959675292808
-2679,2640,2641,0.121944822987822,0.121944822987822
-2681,2642,2643,0.0194925006650245,0.0194925006650245
-2682,2643,2350,0.134347723988409,0.134347723988409
-2683,2350,2644,0.173564798460366,0.173564798460366
-2684,2644,2645,0.174686152075606,0.174686152075606
-2685,2645,2646,0.175389969986131,0.175389969986131
-2688,2648,747,0.0612580153194998,0.0612580153194998
-2689,747,1565,0.142756107755667,0.142756107755667
-2690,1565,2649,0.138016127389502,0.138016127389502
-2691,2649,2650,0.12023627946696,0.12023627946696
-2693,2651,694,0.200802439501944,0.200802439501944
-2695,2652,2653,0.127019992895419,0.127019992895419
-2696,2653,2654,0.201028199806741,0.201028199806741
-2697,2654,2655,0.134212276460076,0.134212276460076
-2698,2655,2656,0.140083368586782,0.140083368586782
-2699,2656,2657,0.13046105136647,0.13046105136647
-2702,2633,2659,0.199675824720705,0.199675824720705
-2704,2660,949,0.174693421852154,0.174693421852154
-2705,949,2661,0.165148304595761,0.165148304595761
-2706,2661,2662,0.173966950291824,0.173966950291824
-2707,2662,2663,0.184218102738583,0.184218102738583
-2708,2663,2664,0.172496811774092,0.172496811774092
-2710,2665,2666,0.394651095737645,0.394651095737645
-2711,2667,2668,0.201414903082426,0.201414903082426
-17301,8745,4260,0.201420130125937,0.201420130125937
-2713,2669,2388,0.109456559825348,0.109456559825348
-2714,2388,2670,0.140828374595316,0.140828374595316
-2717,2672,2673,0.139177577172101,0.139177577172101
-2718,2673,2674,0.137352749762486,0.137352749762486
-2719,2674,2675,0.139830667816654,0.139830667816654
-2720,2675,2676,0.136669684605715,0.136669684605715
-2722,2677,2678,0.12447911414286,0.12447911414286
-2750,2704,2705,0.0292446267270126,0.0292446267270126
-2751,2705,2706,0.00658282845173238,0.00658282845173238
-2752,2706,2707,0.0151449443945988,0.0151449443945988
-2753,2707,2708,0.0714770438658631,0.0714770438658631
-2754,2708,2709,0.00822853556213401,0.00822853556213401
-2756,2710,8,0.130042568169854,0.130042568169854
-2757,8,2711,0.118166571537094,0.118166571537094
-2759,2712,2713,0.102388493919056,0.102388493919056
-2760,2713,2416,0.103111259495513,0.103111259495513
-2761,2416,2714,0.100631617654013,0.100631617654013
-2764,2716,2717,0.200655449563851,0.200655449563851
-2765,2717,2718,0.200753725915124,0.200753725915124
-2766,2718,1440,0.196942260224429,0.196942260224429
-2767,1440,2719,0.00947384243402213,0.00947384243402213
-2768,2719,2720,0.190389032049707,0.190389032049707
-2770,2723,2724,0.133138466543617,0.133138466543617
-2771,2724,2725,0.135835722389097,0.135835722389097
-2772,2725,2726,0.133534041022806,0.133534041022806
-2773,2726,2727,0.134234713813183,0.134234713813183
-2774,2727,1681,0.134687505819062,0.134687505819062
-2775,1681,2728,0.137316317225174,0.137316317225174
-2777,2729,2730,0.104120921025978,0.104120921025978
-2778,2730,2731,0.201486044854047,0.201486044854047
-2779,2731,2732,0.409054627036075,0.409054627036075
-2780,2733,2734,0.231399786377778,0.231399786377778
-2781,2734,2735,0.0901704059113055,0.0901704059113055
-2782,2735,2736,0.0825094909725568,0.0825094909725568
-2783,2737,2738,0.200363396709187,0.200363396709187
-2784,2738,2739,0.20121833925615,0.20121833925615
-2785,2739,2740,0.202399438971847,0.202399438971847
-2788,2742,2743,0.404396545451488,0.404396545451488
-2789,2744,1762,0.0647074290459755,0.0647074290459755
-2790,1762,2372,0.0925216625359094,0.0925216625359094
-2791,2372,2745,0.0223137340397398,0.0223137340397398
-2792,2745,2737,0.050045237249892,0.050045237249892
-2794,2746,2747,0.14840065064165,0.14840065064165
-2796,2748,2749,0.200822547172327,0.200822547172327
-2797,2749,2750,0.193145905748916,0.193145905748916
-2821,908,2770,0.128136612557408,0.128136612557408
-2824,2261,2772,0.10049786598023,0.10049786598023
-2825,2772,2773,0.106378037300959,0.106378037300959
-2826,2773,2110,0.093897002068377,0.093897002068377
-2827,2110,2774,0.107389868338328,0.107389868338328
-2828,2774,2775,0.0994873393877801,0.0994873393877801
-2850,2776,2777,0.10879749556538,0.10879749556538
-2855,2804,866,0.20027757395038,0.20027757395038
-2829,2775,2778,1.00147658782101,1.00147658782101
-2830,2779,2780,0.0530172029480301,0.0530172029480301
-2832,2781,2782,0.107966324930259,0.107966324930259
-2833,2782,2783,0.103296913871679,0.103296913871679
-2834,2783,2784,0.105735267915707,0.105735267915707
-2835,2784,2785,0.104367827383757,0.104367827383757
-2836,2785,2786,0.106026097865505,0.106026097865505
-2837,2786,2787,0.104661406473263,0.104661406473263
-2838,2787,2788,0.109120444986171,0.109120444986171
-2842,2790,2791,0.105111335997404,0.105111335997404
-2843,2791,2792,0.100650542913524,0.100650542913524
-2844,2792,2793,0.105228706955749,0.105228706955749
-2845,2793,2794,0.119444969275907,0.119444969275907
-2846,2794,2795,0.0942235633572651,0.0942235633572651
-2847,2795,2084,0.102241906689643,0.102241906689643
-2848,2084,2796,0.105000278025472,0.105000278025472
-2849,2796,2776,0.104992294488636,0.104992294488636
-2851,2777,2799,0.102990536508203,0.102990536508203
-2852,2799,2802,0.104419262818378,0.104419262818378
-3832,3274,3648,0.198107670536066,0.198107670536066
-2853,2802,2803,0.106343009363166,0.106343009363166
-2854,2803,2804,0.0880619154851023,0.0880619154851023
-2856,866,2805,0.0997722055250997,0.0997722055250997
-2857,2805,2806,0.0898296288997372,0.0898296288997372
-2858,2806,2807,0.0154103032800591,0.0154103032800591
-2860,1345,2808,0.0745089191630195,0.0745089191630195
-2862,2809,2810,0.0999390470653334,0.0999390470653334
-2863,2810,2811,0.098203415750831,0.098203415750831
-2864,2811,2812,0.105704456533214,0.105704456533214
-2865,2812,1841,0.178602078382633,0.178602078382633
-2867,2813,2814,0.147059691176011,0.147059691176011
-2869,2815,2816,0.0358929050784097,0.0358929050784097
-2871,2817,2818,0.202436914455554,0.202436914455554
-2872,2818,721,0.208959052889522,0.208959052889522
-2873,721,2819,0.195578398743409,0.195578398743409
-2874,2819,2820,0.132104447079437,0.132104447079437
-2875,2820,2499,0.133495572380704,0.133495572380704
-2877,2821,2823,0.131028201505055,0.131028201505055
-2878,2823,2154,0.134224367729179,0.134224367729179
-2879,2154,2824,0.137197819412826,0.137197819412826
-2881,2825,2828,0.100509300133652,0.100509300133652
-2882,2828,2829,0.098379052864586,0.098379052864586
-2883,2829,1264,0.0995905743898471,0.0995905743898471
-2884,1264,2830,0.0991885382845514,0.0991885382845514
-2885,2830,2831,0.0990153060665791,0.0990153060665791
-2886,2831,2718,0.0991269733313679,0.0991269733313679
-2887,2718,2832,0.100500652429342,0.100500652429342
-2888,2832,2833,0.0102715407543069,0.0102715407543069
-2889,2833,2834,0.0960953974534679,0.0960953974534679
-2890,2834,2835,0.0326867749280955,0.0326867749280955
-2891,2835,2836,0.134256786764763,0.134256786764763
-2892,2836,2837,0.113988792124523,0.113988792124523
-2893,2837,2838,0.0204082374430359,0.0204082374430359
-2895,2839,2840,0.113685974247049,0.113685974247049
-2896,2840,2841,0.132754406259035,0.132754406259035
-2897,2841,2842,0.136852657742897,0.136852657742897
-2899,1793,2843,0.0809702263007341,0.0809702263007341
-2900,2843,2844,0.0969425296921621,0.0969425296921621
-2901,2844,2845,0.413436446480526,0.413436446480526
-2903,2263,2847,0.179984264422638,0.179984264422638
-2904,2847,2848,0.174004040987329,0.174004040987329
-2905,2848,2849,0.194108624427032,0.194108624427032
-2907,2850,1276,0.172413086756907,0.172413086756907
-2909,2853,785,0.245123885631009,0.245123885631009
-2911,2854,2855,0.0854841952170884,0.0854841952170884
-2912,2855,2747,0.0762350203886263,0.0762350203886263
-2913,2747,2856,0.0859704175448271,0.0859704175448271
-2914,2856,2857,0.100779098585589,0.100779098585589
-2915,2857,2858,0.0905252463288938,0.0905252463288938
-2917,2859,2860,0.0227727209766704,0.0227727209766704
-2918,361,1735,0.198105222979832,0.198105222979832
-2919,1735,2861,0.0382126884100893,0.0382126884100893
-2920,148,2862,0.0438716250050412,0.0438716250050412
-2921,1003,2863,0.0520715649387988,0.0520715649387988
-2922,2863,2864,0.0982728809134093,0.0982728809134093
-2923,2864,2865,0.0994946507259965,0.0994946507259965
-3895,3698,3699,0.204838159377623,0.204838159377623
-2924,2865,2869,0.090463384362138,0.090463384362138
-2925,2869,2870,0.0564720828613131,0.0564720828613131
-2926,2870,2871,0.0608640771597173,0.0608640771597173
-2927,2872,2873,0.044011799999607,0.044011799999607
-2928,2873,2088,0.0931496819660856,0.0931496819660856
-2929,2088,2655,0.0960691148224413,0.0960691148224413
-2930,2655,2874,0.0937706080748846,0.0937706080748846
-2931,2874,2875,0.0828791997484075,0.0828791997484075
-2932,2875,2876,0.093218621711434,0.093218621711434
-2933,2876,2877,0.0704167162147941,0.0704167162147941
-2935,2878,2879,0.0887403720940643,0.0887403720940643
-2936,2879,2880,0.0909098673154509,0.0909098673154509
-2937,2880,2881,0.0882058988614067,0.0882058988614067
-2938,2881,2882,0.181777411929199,0.181777411929199
-2940,2883,2884,0.115661337881372,0.115661337881372
-2941,2884,2885,0.14826485880128,0.14826485880128
-2942,2885,2886,0.112251623213379,0.112251623213379
-2943,2886,2887,0.119994591224275,0.119994591224275
-2944,2887,2888,0.178622958928809,0.178622958928809
-2945,2888,2889,0.00412533177852682,0.00412533177852682
-2946,2889,2890,0.00481474032387871,0.00481474032387871
-2947,2890,2893,0.135290874001292,0.135290874001292
-2948,2893,2894,0.137892832771659,0.137892832771659
-2949,2894,817,0.140150092060959,0.140150092060959
-2950,817,2895,0.143808402694827,0.143808402694827
-2951,2895,2896,0.0697081016101773,0.0697081016101773
-2952,2896,2897,0.0168682725384664,0.0168682725384664
-2954,2898,2899,0.139071498957887,0.139071498957887
-2956,2900,2901,0.139727551358826,0.139727551358826
-2957,2901,2902,0.00293554606295758,0.00293554606295758
-2958,2902,2903,0.102721876435386,0.102721876435386
-2959,2903,2904,0.0305452475451112,0.0305452475451112
-2960,2904,2905,0.00503713742922791,0.00503713742922791
-2961,2905,2906,0.0458567885450819,0.0458567885450819
-2962,2906,2907,0.0981295261146626,0.0981295261146626
-2963,2907,628,0.0369055971430695,0.0369055971430695
-2964,628,1143,0.0958611496898419,0.0958611496898419
-2966,2908,2909,0.0463126901024473,0.0463126901024473
-2967,2909,872,0.0318684671228471,0.0318684671228471
-2968,872,2910,0.0711758745978235,0.0711758745978235
-2969,2910,2911,0.067495322638235,0.067495322638235
-2970,2911,2912,0.033747661319103,0.033747661319103
-2971,2912,2913,0.0475024757380027,0.0475024757380027
-2973,2914,2915,0.202578999998173,0.202578999998173
-2975,2916,2917,0.184685764171195,0.184685764171195
-2976,2917,2918,0.00737265767013589,0.00737265767013589
-2978,2919,2920,0.110148820147866,0.110148820147866
-2979,2920,584,0.039258317875865,0.039258317875865
-2980,584,2921,0.228363185041033,0.228363185041033
-2982,2922,1341,0.198962442111046,0.198962442111046
-2983,1341,2923,0.207039061514662,0.207039061514662
-2984,2923,2924,0.201175175238786,0.201175175238786
-2985,2924,2925,0.203376851393596,0.203376851393596
-2986,2925,2926,0.201920207523594,0.201920207523594
-2987,2926,2927,0.200452413161122,0.200452413161122
-2988,2927,776,0.201931296094781,0.201931296094781
-2990,2928,2930,0.209285084837907,0.209285084837907
-2991,2930,2931,0.197960209647655,0.197960209647655
-2992,2931,171,0.402036974102358,0.402036974102358
-2994,2932,2933,0.200508042098485,0.200508042098485
-2995,170,1728,0.257039245710078,0.257039245710078
-2996,1728,2934,0.145411467525923,0.145411467525923
-2999,2935,2936,0.0880513532781809,0.0880513532781809
-3025,2957,2958,0.01030947748559,0.01030947748559
-3000,2936,209,0.228338005511316,0.228338005511316
-3002,2937,2938,0.107611509993879,0.107611509993879
-3005,2940,2941,0.175855452328419,0.175855452328419
-3006,2941,2942,0.174909636552997,0.174909636552997
-3007,2942,2943,0.192197232795451,0.192197232795451
-3009,2944,546,0.0293283601170504,0.0293283601170504
-3010,546,2945,0.155746660532693,0.155746660532693
-3012,1475,2946,0.311303155924368,0.311303155924368
-3013,2946,2947,0.184883982264712,0.184883982264712
-3014,2947,2948,0.224685205653341,0.224685205653341
-3016,2949,2950,0.0888669853746646,0.0888669853746646
-3017,2950,2951,0.114577615588497,0.114577615588497
-3018,1225,2952,0.114132076273042,0.114132076273042
-3019,2952,2161,0.115442153745618,0.115442153745618
-3020,2161,2953,0.105428749590907,0.105428749590907
-3022,2954,2955,0.0114463280554541,0.0114463280554541
-3023,2955,639,0.18619297340356,0.18619297340356
-3024,639,2957,0.0509835810434449,0.0509835810434449
-3026,2958,2959,0.0353738821651235,0.0353738821651235
-3027,2959,2960,0.00284670794487764,0.00284670794487764
-3028,2960,1288,0.104793015683124,0.104793015683124
-3029,1288,2961,0.051496901479137,0.051496901479137
-3030,2961,2962,0.00960868888037157,0.00960868888037157
-3031,2962,2963,0.0208687174266634,0.0208687174266634
-3032,2963,2964,0.0498882614596582,0.0498882614596582
-3033,2964,2965,0.123304259264834,0.123304259264834
-3035,2966,2967,0.00908677871596767,0.00908677871596767
-3036,2967,2968,0.115854235202851,0.115854235202851
-3037,2968,2969,0.00700956571064615,0.00700956571064615
-3038,2969,2970,0.00940368205913038,0.00940368205913038
-3039,2970,2971,0.0666840110355875,0.0666840110355875
-3040,2971,2972,0.0679662165544488,0.0679662165544488
-3041,2972,2973,0.0630976433471776,0.0630976433471776
-3042,2973,2974,0.0491600079555241,0.0491600079555241
-3044,2975,2976,0.0997731403964804,0.0997731403964804
-3045,2976,2977,0.100715566829797,0.100715566829797
-3046,2977,2978,0.0996876914159973,0.0996876914159973
-3047,2978,2979,0.10126058971698,0.10126058971698
-3048,2979,2980,0.103346225532192,0.103346225532192
-3049,2980,2981,0.0983114005972926,0.0983114005972926
-3050,2981,2982,0.09874223460454,0.09874223460454
-3051,2982,2983,0.0510749251490339,0.0510749251490339
-3053,2984,2985,0.0505192363533637,0.0505192363533637
-3054,2985,1120,0.0491942863881514,0.0491942863881514
-3055,1120,2986,0.0517085444587275,0.0517085444587275
-3056,2986,2987,0.0504766444323722,0.0504766444323722
-3057,2987,2988,0.0508471211122413,0.0508471211122413
-3058,2988,2989,0.0482147566017866,0.0482147566017866
-3059,2989,2990,0.0513143127772338,0.0513143127772338
-3060,2990,2991,0.0501432318630803,0.0501432318630803
-3061,2991,2992,0.788648410502006,0.788648410502006
-3062,2993,2994,0.01555628530979,0.01555628530979
-3063,2994,2995,0.10729267423115,0.10729267423115
-13562,2999,2165,0.242533262128423,0.242533262128423
-3067,2998,3000,0.0998948824480635,0.0998948824480635
-3068,3000,3001,0.145910673725247,0.145910673725247
-3069,3001,3002,0.147264770664277,0.147264770664277
-3070,3002,3003,0.145706831644125,0.145706831644125
-3071,3003,3004,0.146381189481243,0.146381189481243
-3073,3006,3007,0.143637545441942,0.143637545441942
-3074,3007,3008,0.14139337588105,0.14139337588105
-3075,3008,3009,0.0340034784472366,0.0340034784472366
-3076,3009,3010,0.117637494210671,0.117637494210671
-3077,3010,3011,0.1483412167568,0.1483412167568
-3078,3011,3012,0.146200597856632,0.146200597856632
-3079,3012,3013,0.146656153847153,0.146656153847153
-3080,3013,3014,0.219897120549826,0.219897120549826
-3081,3014,2686,0.0729664723843293,0.0729664723843293
-3082,2686,3015,0.146055074464899,0.146055074464899
-3083,3015,3016,0.115984680072215,0.115984680072215
-3084,3016,3017,0.0102106792826024,0.0102106792826024
-3085,3017,3018,0.0188093561808277,0.0188093561808277
-3087,3019,3020,0.14624208166964,0.14624208166964
-3088,3020,3021,0.149932974568378,0.149932974568378
-3089,3021,2900,0.114654486829615,0.114654486829615
-3091,3022,3023,0.0936947193853168,0.0936947193853168
-3093,3024,3025,0.0922829109447797,0.0922829109447797
-3095,3026,3027,0.10419715248802,0.10419715248802
-3096,3027,3028,0.108587123231645,0.108587123231645
-3097,3028,3029,0.103455866634876,0.103455866634876
-3099,3030,3031,0.0828114972096423,0.0828114972096423
-3100,3031,3032,0.0151385207198175,0.0151385207198175
-3102,3035,3036,0.131928682141755,0.131928682141755
-3103,3036,3037,0.0286281442546585,0.0286281442546585
-3104,3037,3038,0.0830678583996061,0.0830678583996061
-3105,3038,3039,0.0820487800074757,0.0820487800074757
-3107,3040,3041,0.0592379768525999,0.0592379768525999
-3108,3041,1041,0.101867076922678,0.101867076922678
-3109,1041,3042,0.108431988254042,0.108431988254042
-3110,3042,3043,0.103209130509255,0.103209130509255
-3111,3043,3044,0.103439867243447,0.103439867243447
-3113,3045,3046,0.1080426022678,0.1080426022678
-3114,3046,3047,0.106399445317148,0.106399445317148
-3115,3047,2078,0.104328053424176,0.104328053424176
-3116,2078,2675,0.103849131822114,0.103849131822114
-3117,2675,3048,0.106371798877004,0.106371798877004
-3118,3048,3049,0.1089909908922,0.1089909908922
-3120,2995,3050,0.0829711714500804,0.0829711714500804
-3123,3051,3052,0.0304368475861105,0.0304368475861105
-19556,10441,10561,0.00875730102663828,0.00875730102663828
-3124,3053,3054,0.10469695146486,0.10469695146486
-3125,3054,3026,0.105413327506124,0.105413327506124
-3127,3055,3056,0.0146859459125862,0.0146859459125862
-3128,3056,3057,0.0899179636493607,0.0899179636493607
-3129,3057,3058,0.0968918459632465,0.0968918459632465
-3130,3058,3059,0.0931803123592361,0.0931803123592361
-3131,3059,3060,0.0924628769882567,0.0924628769882567
-3132,3060,2004,0.0909779529022995,0.0909779529022995
-3134,3061,2758,0.0983285272926963,0.0983285272926963
-3135,2758,3062,0.094848132376921,0.094848132376921
-3137,2284,3063,0.10273020958756,0.10273020958756
-3138,3063,3064,0.09684156688728,0.09684156688728
-3139,3064,2139,0.105654196010103,0.105654196010103
-3141,3065,3066,0.101995188106893,0.101995188106893
-4424,4133,950,0.17542265784203,0.17542265784203
-3142,3066,3067,1.00083609181461,1.00083609181461
-3143,3068,3069,0.10392860568863,0.10392860568863
-3144,3069,3070,0.10232907709913,0.10232907709913
-3145,3070,3071,0.103927869583062,0.103927869583062
-3146,3071,3072,0.102097379803977,0.102097379803977
-3147,3072,3073,0.0487909895079958,0.0487909895079958
-3149,1294,3074,0.105333551259412,0.105333551259412
-3150,3074,3075,0.0524798747272766,0.0524798747272766
-3151,3075,3076,0.0475858963921332,0.0475858963921332
-3152,3076,3077,0.00514079080382434,0.00514079080382434
-3154,3078,3079,0.0117186508515134,0.0117186508515134
-3155,3079,3080,0.0860074021370197,0.0860074021370197
-3156,3080,3081,0.0112654570741388,0.0112654570741388
-3157,3081,3082,0.0998426271509478,0.0998426271509478
-3159,3083,3084,0.0978722553449722,0.0978722553449722
-3161,3085,3086,0.0498003240048994,0.0498003240048994
-3162,3086,3087,0.0499820755044021,0.0499820755044021
-3163,3087,1765,0.0500932715547668,0.0500932715547668
-3164,1765,3089,0.0453737460403596,0.0453737460403596
-3165,3089,3090,0.0566344564433548,0.0566344564433548
-3166,3090,3091,0.0479788729039099,0.0479788729039099
-3167,3091,1517,0.0504584819239423,0.0504584819239423
-3168,1517,3092,0.0513918113913408,0.0513918113913408
-3169,3092,3093,0.0524695902697227,0.0524695902697227
-3170,3093,1084,0.0829756278031258,0.0829756278031258
-3171,1084,3094,0.018362425266723,0.018362425266723
-3172,3094,3095,0.100037197959638,0.100037197959638
-3173,3095,3096,0.0986501993185581,0.0986501993185581
-3174,3096,3097,0.100130714805898,0.100130714805898
-3175,3097,2046,0.103528392648025,0.103528392648025
-3176,2046,3098,0.0976518708062817,0.0976518708062817
-3177,3098,3099,0.0995509890492463,0.0995509890492463
-3179,1954,3100,0.060604506910361,0.060604506910361
-3182,3102,3103,0.0990114382918269,0.0990114382918269
-3183,3103,3104,0.100593787088956,0.100593787088956
-3184,3104,3105,0.0983789631442794,0.0983789631442794
-3185,3105,2848,0.0976433646550276,0.0976433646550276
-3186,2848,3106,0.102064870879311,0.102064870879311
-3187,3106,3107,0.10100271733246,0.10100271733246
-3188,3107,3108,0.0995828832367363,0.0995828832367363
-3189,3108,2942,0.101438732689929,0.101438732689929
-3190,2942,3109,0.100378814460195,0.100378814460195
-3191,3109,3110,1.25206634961555,1.25206634961555
-3192,3111,3112,0.015422388825789,0.015422388825789
-3193,3112,3113,0.11412427509118,0.11412427509118
-3194,3113,3114,0.468645573431598,0.468645573431598
-3196,2023,3115,0.177146580591063,0.177146580591063
-3197,3115,3102,0.173943728587952,0.173943728587952
-3198,3102,3116,0.193451028525805,0.193451028525805
-3200,3117,1806,0.211443534426126,0.211443534426126
-3201,1806,3118,0.193022911848757,0.193022911848757
-3203,3119,3120,0.0940041909856305,0.0940041909856305
-3204,3120,3121,0.197561396619787,0.197561396619787
-3206,3122,3123,0.200799900699528,0.200799900699528
-3207,3124,3125,0.200863237154928,0.200863237154928
-3208,3125,3126,0.201874389323119,0.201874389323119
-3210,3127,3128,0.0750470474178356,0.0750470474178356
-3211,3128,3131,0.0761135403806392,0.0761135403806392
-3213,3029,3132,0.132611387982682,0.132611387982682
-3214,3132,3133,0.00539409864485362,0.00539409864485362
-3215,3133,3134,0.139160450695908,0.139160450695908
-3216,3134,1160,0.139291641031025,0.139291641031025
-3217,1160,879,0.139609262878975,0.139609262878975
-3218,879,3135,0.138493325710101,0.138493325710101
-3219,3135,2787,0.134090008076189,0.134090008076189
-3220,2787,3136,0.1321642245327,0.1321642245327
-3221,3136,3137,0.21408080552497,0.21408080552497
-3222,3137,3138,0.144895915790921,0.144895915790921
-3223,3138,3139,0.169628584853264,0.169628584853264
-3226,3141,3142,0.202888440515448,0.202888440515448
-3227,3142,2878,0.162092717607055,0.162092717607055
-3251,3162,2365,0.110303719018863,0.110303719018863
-3254,3164,3165,0.240177393696762,0.240177393696762
-3255,3165,3166,0.102768151984011,0.102768151984011
-3256,3166,3167,0.0509818546092244,0.0509818546092244
-3258,3168,3169,0.0591373244934598,0.0591373244934598
-3259,3169,3170,0.0530870196657507,0.0530870196657507
-3261,3171,3172,0.201914360897617,0.201914360897617
-3262,3172,3173,0.203130900823478,0.203130900823478
-3263,3173,3174,0.201562825315852,0.201562825315852
-3264,3174,3175,0.19958273918251,0.19958273918251
-3265,3175,3177,0.402921101557674,0.402921101557674
-3266,3178,3179,0.0905536808669309,0.0905536808669309
-3267,3179,3180,0.0577627490058349,0.0577627490058349
-3268,3180,3181,0.0505235668696686,0.0505235668696686
-3269,3181,3182,0.065160532538722,0.065160532538722
-3270,3182,3183,0.00793078546182679,0.00793078546182679
-3271,3183,3184,0.0531842364372946,0.0531842364372946
-3273,2386,3186,0.0378622155960126,0.0378622155960126
-3274,3186,3187,0.0069150542380481,0.0069150542380481
-3275,3187,3188,0.0174713630038869,0.0174713630038869
-3277,3189,3190,0.10095397068423,0.10095397068423
-3278,3190,3191,0.102948552858793,0.102948552858793
-3279,3191,3192,0.099117357243018,0.099117357243018
-3280,3192,3193,0.10499121023248,0.10499121023248
-3282,3194,3195,0.0985672231580753,0.0985672231580753
-3283,3195,3196,0.0975023503923766,0.0975023503923766
-16511,8899,8896,0.0458243741253751,0.0458243741253751
-3284,3196,3197,0.0505627463090716,0.0505627463090716
-3285,3197,3198,0.0500221717072617,0.0500221717072617
-3286,3198,3199,0.046867135973938,0.046867135973938
-3287,3199,1768,0.0529832159562647,0.0529832159562647
-3288,1768,3200,0.0470467690925653,0.0470467690925653
-3289,3200,3201,0.0524586560775799,0.0524586560775799
-3290,3201,3202,0.0495946350720587,0.0495946350720587
-3291,3202,1518,0.052984641558086,0.052984641558086
-3292,1518,3203,0.100125608990258,0.100125608990258
-3293,3203,1085,0.0831191573838339,0.0831191573838339
-3294,1085,3204,0.01719627237498,0.01719627237498
-3295,3204,3205,0.100278521536605,0.100278521536605
-3296,3205,3206,0.100159169300764,0.100159169300764
-3297,3206,3207,0.0980766730481921,0.0980766730481921
-3299,2047,3208,0.0998503328239714,0.0998503328239714
-3300,3208,3209,0.0991174142787685,0.0991174142787685
-3301,3209,3210,0.0465862087261248,0.0465862087261248
-3303,3211,3212,0.0483226107842397,0.0483226107842397
-3304,3212,3213,0.0508033572812722,0.0508033572812722
-3305,3213,3214,0.0520095145740976,0.0520095145740976
-3307,3215,3216,0.047636983079693,0.047636983079693
-3308,3216,3217,0.00228390635402469,0.00228390635402469
-3309,3217,3218,0.0492156902021281,0.0492156902021281
-3310,3218,3219,0.105720878983862,0.105720878983862
-3312,3220,3221,0.135734479783406,0.135734479783406
-3313,3221,2519,0.14595602798476,0.14595602798476
-3314,2519,3222,0.126165217374209,0.126165217374209
-3315,3222,1229,0.098841689459618,0.098841689459618
-3316,1229,3223,0.098924974953348,0.098924974953348
-3317,3223,2174,0.100839404349716,0.100839404349716
-3318,2174,3224,0.101432888438354,0.101432888438354
-3319,3224,3225,0.137343472225008,0.137343472225008
-3321,3226,379,0.0754564811292303,0.0754564811292303
-3322,379,63,0.0417835231628563,0.0417835231628563
-3323,63,1255,0.0152981335887719,0.0152981335887719
-3326,3228,3229,0.0836292502069327,0.0836292502069327
-3327,3229,3230,0.0485562677029858,0.0485562677029858
-3330,3232,3233,0.105369806952797,0.105369806952797
-3331,3233,3234,0.0244901910381055,0.0244901910381055
-3332,3235,3236,0.101967463967826,0.101967463967826
-3333,3236,3237,0.10049747789636,0.10049747789636
-3334,3237,3238,0.0983034665163014,0.0983034665163014
-3335,3238,3239,0.103439327677052,0.103439327677052
-3336,3239,715,0.100109252929192,0.100109252929192
-3337,715,3240,0.10857516210103,0.10857516210103
-3338,3240,3241,0.0836693243428755,0.0836693243428755
-3340,1256,2714,0.204938708369458,0.204938708369458
-3341,2714,3242,0.194775016549959,0.194775016549959
-3343,3243,3244,0.104619278832535,0.104619278832535
-3344,3244,3245,0.0999091629456622,0.0999091629456622
-3345,3245,3246,0.0969207243261653,0.0969207243261653
-3346,3246,3247,0.100620613481727,0.100620613481727
-3347,3247,3248,0.051818780315465,0.051818780315465
-3348,3248,3249,0.0493068623564548,0.0493068623564548
-3349,3249,3250,0.102061915203609,0.102061915203609
-3350,3250,3251,0.0474417721331526,0.0474417721331526
-3351,3251,3252,0.0496832213808208,0.0496832213808208
-3352,3252,3253,0.00274646412019378,0.00274646412019378
-3353,3253,3254,0.0454267490135207,0.0454267490135207
-3354,3254,3255,0.00458544852460102,0.00458544852460102
-3355,3255,3256,0.0483268582508211,0.0483268582508211
-3357,3257,3258,0.0459440862493274,0.0459440862493274
-3358,3258,3259,0.236332489020417,0.236332489020417
-3360,3260,2735,0.173472989255867,0.173472989255867
-3362,594,2050,0.105283533842597,0.105283533842597
-3363,2050,3261,0.0509100007310826,0.0509100007310826
-3364,3261,3262,0.0467523465641757,0.0467523465641757
-3365,3262,3263,0.0481309278210478,0.0481309278210478
-3366,3263,3264,0.051732585346973,0.051732585346973
-3367,3264,3265,0.0457622961694799,0.0457622961694799
-3368,3265,3266,0.0530171123380122,0.0530171123380122
-3369,3266,3267,0.0451783444295864,0.0451783444295864
-3370,3267,3268,0.0542978455447466,0.0542978455447466
-3371,3268,3269,0.0466844058034087,0.0466844058034087
-3372,3269,3270,0.050646295110284,0.050646295110284
-3373,3270,3271,0.0484988623690369,0.0484988623690369
-3374,3271,3272,0.0498932625841468,0.0498932625841468
-3375,3272,3273,0.0470944745658083,0.0470944745658083
-3376,3273,3274,0.0579078107783869,0.0579078107783869
-3377,3274,3275,0.151893561253266,0.151893561253266
-3378,3275,3276,0.0516549077274405,0.0516549077274405
-3379,3276,2734,0.0976564411094966,0.0976564411094966
-3380,2734,3277,0.0486100790727351,0.0486100790727351
-3381,3277,3278,0.0497906140365211,0.0497906140365211
-3382,3278,3279,0.0484124404037645,0.0484124404037645
-3383,3279,3280,0.00653599515433254,0.00653599515433254
-3384,3280,3178,0.0418764820732136,0.0418764820732136
-3385,3178,3284,0.0979449587868123,0.0979449587868123
-3386,3284,3285,0.201022039935831,0.201022039935831
-3389,3287,2316,0.156303067302058,0.156303067302058
-20281,10719,10710,0.0549191742699874,0.0549191742699874
-3390,2316,3288,0.10952595107857,0.10952595107857
-3391,3288,3289,0.0403941356128906,0.0403941356128906
-3392,3289,3290,0.0912238346425634,0.0912238346425634
-3393,3290,3291,0.0816082032445177,0.0816082032445177
-3394,3291,3292,0.0169509581328033,0.0169509581328033
-3395,3292,3293,0.0433466637454668,0.0433466637454668
-3396,3293,3294,0.0186582685984772,0.0186582685984772
-3397,3294,3295,0.152140762364393,0.152140762364393
-3403,3299,1325,0.177116632986756,0.177116632986756
-3404,1325,1381,0.178046664647513,0.178046664647513
-3406,1057,3300,0.119136901138604,0.119136901138604
-3408,3301,1581,0.141640668502809,0.141640668502809
-3409,1581,3302,0.308989164663259,0.308989164663259
-3411,3304,3305,0.143837220516125,0.143837220516125
-3412,3305,3306,0.147698693465714,0.147698693465714
-3414,3307,3308,0.146426311775338,0.146426311775338
-3415,3308,3309,0.146463761248984,0.146463761248984
-3416,3309,3310,0.146549783304075,0.146549783304075
-3417,3310,2029,0.145425360285073,0.145425360285073
-3418,2029,3311,0.146713513284486,0.146713513284486
-3419,3311,634,0.143866210964815,0.143866210964815
-3420,634,3312,0.147112545494359,0.147112545494359
-3421,3312,3313,0.145900102395242,0.145900102395242
-3422,3313,2321,0.147128656269274,0.147128656269274
-3424,3314,3315,0.0970240945457023,0.0970240945457023
-3425,3315,2190,0.185651929243496,0.185651929243496
-3427,737,1557,0.13315596414531,0.13315596414531
-3429,3316,3317,0.0821429797668101,0.0821429797668101
-3434,3321,3322,0.579886710164932,0.579886710164932
-3436,3323,3324,0.139196729808835,0.139196729808835
-3438,3325,3326,0.13668278082176,0.13668278082176
-3439,3326,3045,0.137860640994287,0.137860640994287
-3440,3045,3327,0.13778919161955,0.13778919161955
-3441,3327,3328,0.00447003605120276,0.00447003605120276
-3442,3328,3329,0.0233867925544547,0.0233867925544547
-3443,3329,3330,0.116012449407873,0.116012449407873
-3444,3330,1166,0.139882774592672,0.139882774592672
-3445,1166,886,0.137525679366119,0.137525679366119
-3446,886,3332,0.139657446365043,0.139657446365043
-3447,3332,2793,0.133361291612613,0.133361291612613
-3448,2793,3333,0.132228102569741,0.132228102569741
-3450,3334,3335,0.0903059057199572,0.0903059057199572
-3451,3335,3336,0.154418186694308,0.154418186694308
-3452,3336,3337,0.192225493046604,0.192225493046604
-3453,3337,3338,0.174660133594583,0.174660133594583
-3454,3338,3339,0.202477883587996,0.202477883587996
-3455,3339,3340,0.0759856229646665,0.0759856229646665
-3456,3340,3341,0.00965813264254578,0.00965813264254578
-3458,3342,1191,0.166878049186437,0.166878049186437
-3459,1191,3343,0.0216063183857929,0.0216063183857929
-3460,3343,3344,0.200920604325059,0.200920604325059
-3462,2346,3345,0.174959253236807,0.174959253236807
-3463,3345,1535,0.0463919707335885,0.0463919707335885
-3465,3346,3347,0.27909963341584,0.27909963341584
-3466,3347,740,0.112084486383373,0.112084486383373
-3467,740,1560,0.139918597194563,0.139918597194563
-3468,1560,3348,0.140278682022104,0.140278682022104
-3469,3348,3349,0.121438604958881,0.121438604958881
-3471,3350,3351,0.173966017570494,0.173966017570494
-3472,3351,3352,0.16543284170321,0.16543284170321
-3474,3353,3354,0.201189633952299,0.201189633952299
-3477,3356,3357,0.174637614655306,0.174637614655306
-3479,2467,3359,0.203720276949683,0.203720276949683
-3480,3359,3360,0.200874146006411,0.200874146006411
-3481,3360,795,0.199720493083652,0.199720493083652
-3482,795,3361,0.203163577363555,0.203163577363555
-3484,3362,3363,0.203261629260278,0.203261629260278
-3485,3363,3061,0.206912153397241,0.206912153397241
-3486,3061,3364,0.186005329793712,0.186005329793712
-3488,3365,1140,0.135699508009882,0.135699508009882
-3490,907,3366,0.12816779719188,0.12816779719188
-3492,3367,1297,0.200952363448705,0.200952363448705
-3494,3368,3369,0.101405416836813,0.101405416836813
-3495,3369,3370,0.0983850243457341,0.0983850243457341
-3497,3371,3372,0.0654246270475212,0.0654246270475212
-3498,3372,2939,0.0903071880553539,0.0903071880553539
-3499,2939,3373,0.0855248234583031,0.0855248234583031
-3500,3373,59,0.083918142781954,0.083918142781954
-3502,3374,3375,0.253631602277532,0.253631602277532
-3503,3376,3377,0.201161683466984,0.201161683466984
-3505,3378,623,0.0117822953093903,0.0117822953093903
-3506,623,3379,0.132533255410588,0.132533255410588
-3507,3379,3380,0.0779035335014782,0.0779035335014782
-3508,3380,3381,0.206545256567466,0.206545256567466
-20694,10906,10909,0.0421787313564029,0.0421787313564029
-3509,3381,3382,0.13283549460514,0.13283549460514
-3510,3382,3383,0.135569425081515,0.135569425081515
-3511,3383,3384,0.136156970349478,0.136156970349478
-3512,3384,3385,0.132775661568888,0.132775661568888
-3514,2584,3386,0.177011208890761,0.177011208890761
-3515,3386,3387,0.0885846426355864,0.0885846426355864
-3518,3389,3390,0.176205550995696,0.176205550995696
-3519,3390,3391,0.169210992899206,0.169210992899206
-3520,3391,3392,0.0099077669914251,0.0099077669914251
-3521,3392,1849,0.175456016508954,0.175456016508954
-3522,1849,2583,0.178501996899051,0.178501996899051
-3524,600,3393,0.2153977841733,0.2153977841733
-3526,3394,3395,0.118920951518272,0.118920951518272
-3527,3395,3396,0.142989811640976,0.142989811640976
-3528,3396,3397,0.262177718796624,0.262177718796624
-3530,14,3398,0.133564321671034,0.133564321671034
-3531,3398,3399,0.133563180552006,0.133563180552006
-3532,3399,3400,0.135746766447532,0.135746766447532
-3533,3400,3401,0.133513247236878,0.133513247236878
-3534,3401,3402,0.0998328095575455,0.0998328095575455
-3535,3402,3403,0.0352154332682272,0.0352154332682272
-3536,3403,2405,0.0667725534497617,0.0667725534497617
-3537,2405,3404,0.0682403264820305,0.0682403264820305
-3538,3404,3405,0.033013773721009,0.033013773721009
-3539,3405,3409,0.0499933274562477,0.0499933274562477
-3540,3409,3410,0.0543299225353451,0.0543299225353451
-3541,3410,1767,0.0526619512572465,0.0526619512572465
-3542,1767,3411,0.150417295173728,0.150417295173728
-3543,3411,2979,0.204011051874628,0.204011051874628
-3544,2979,656,0.0515792906446319,0.0515792906446319
-3546,1887,591,0.0491592770696459,0.0491592770696459
-3547,591,3412,0.0481379602388448,0.0481379602388448
-3548,3412,3413,0.102266489872996,0.102266489872996
-3549,3413,1888,0.0486842125387167,0.0486842125387167
-3550,1888,3414,0.0510943840977224,0.0510943840977224
-3551,3414,3415,0.00919583632372114,0.00919583632372114
-3552,3415,3416,0.0353489043837471,0.0353489043837471
-17077,3568,8074,0.699339640197117,0.699339640197117
-3553,3416,3417,0.050093361124945,0.050093361124945
-3554,3417,3418,0.0498820440925909,0.0498820440925909
-3555,3418,3419,0.0498984530952944,0.0498984530952944
-3556,3419,3420,0.00880663819045291,0.00880663819045291
-3557,3420,3421,0.0410819827191675,0.0410819827191675
-3558,3421,3422,0.0491592770696459,0.0491592770696459
-3559,3422,3423,0.0205377029518591,0.0205377029518591
-3560,3423,3424,0.02549703249469,0.02549703249469
-3562,3425,3425,0.000442266584977921,0.000442266584977921
-3563,3425,3426,0.0816315051221547,0.0816315051221547
-3565,3427,1664,0.0502947464100412,0.0502947464100412
-3567,1683,3428,0.020460323508623,0.020460323508623
-3568,3428,3429,0.0515955226949506,0.0515955226949506
-3569,3429,3430,0.133978887334031,0.133978887334031
-3570,3430,2427,0.13659869274501,0.13659869274501
-3571,2427,2428,0.063830021941611,0.063830021941611
-3572,2428,3231,0.0696897365044123,0.0696897365044123
-3573,3231,3431,0.132766742414187,0.132766742414187
-3574,3431,3432,0.106360486773292,0.106360486773292
-3575,3432,3433,0.0970117847237812,0.0970117847237812
-3576,3433,3434,0.1971376871667,0.1971376871667
-19819,5606,10648,0.0581167522759965,0.0581167522759965
-3577,3434,3435,0.133491532527273,0.133491532527273
-3582,2842,3438,0.0923852774741301,0.0923852774741301
-3584,1421,317,0.102691144252484,0.102691144252484
-3585,317,513,0.0772222660891488,0.0772222660891488
-3586,513,3439,0.0612593596381532,0.0612593596381532
-3587,3439,3440,0.148872782400453,0.148872782400453
-3588,3440,2540,0.197920167618774,0.197920167618774
-3589,2540,3441,0.415850973508269,0.415850973508269
-3590,3442,699,0.201963508155417,0.201963508155417
-3591,699,3443,0.200352700158165,0.200352700158165
-3593,3444,3445,0.0185806742090463,0.0185806742090463
-20212,5504,7078,0.147322900830237,0.147322900830237
-20213,7078,2034,0.146401533431931,0.146401533431931
-20214,2034,5323,0.145002332578884,0.145002332578884
-20215,5323,632,0.146882687938452,0.146882687938452
-4488,138,4177,0.203369481928684,0.203369481928684
-4489,4177,1741,0.0411375852444616,0.0411375852444616
-4490,1741,4178,0.159371364409943,0.159371364409943
-4492,4179,4180,0.471114595558298,0.471114595558298
-4493,4180,4181,0.219268705400549,0.219268705400549
-4495,4182,4183,0.0994268923770179,0.0994268923770179
-4496,4183,1296,0.100075433980265,0.100075433980265
-4497,1296,1369,0.0964029757899856,0.0964029757899856
-5794,5116,3795,0.199284062960758,0.199284062960758
-18557,318,10316,0.0220547227626022,0.0220547227626022
-4499,4184,4185,0.301634217878433,0.301634217878433
-4501,2809,3744,0.0998445716696615,0.0998445716696615
-4502,3744,4186,0.10131230641957,0.10131230641957
-4504,4187,4188,0.132156563746112,0.132156563746112
-4505,4188,4189,0.132402395077485,0.132402395077485
-4506,4189,4190,0.137552756241722,0.137552756241722
-4507,4190,4191,0.13379771872617,0.13379771872617
-4508,4191,1671,0.132214775902914,0.132214775902914
-4509,1671,4192,0.137147368544834,0.137147368544834
-4510,4192,2452,0.138219895716206,0.138219895716206
-4511,2452,3221,0.134932977312539,0.134932977312539
-4512,3221,4193,0.133628518122145,0.133628518122145
-4515,4195,554,0.154583323244677,0.154583323244677
-4516,554,4196,0.0224725093154139,0.0224725093154139
-4517,4083,4197,0.170590775930264,0.170590775930264
-4518,4197,3764,0.0397497113610314,0.0397497113610314
-4520,2820,1411,0.135923564862653,0.135923564862653
-4521,1411,1351,0.125050095081124,0.125050095081124
-4523,4198,4199,0.454148647656551,0.454148647656551
-4525,4200,4201,0.133477223659273,0.133477223659273
-4526,4201,4202,0.132617384077965,0.132617384077965
-4527,4202,4203,0.134214836424706,0.134214836424706
-4531,4206,1274,0.135021280032386,0.135021280032386
-4533,4207,4208,0.280988389053987,0.280988389053987
-4534,4209,4210,0.209285084830873,0.209285084830873
-4535,4210,4211,0.203065667561202,0.203065667561202
-4537,4212,3742,0.11682398880887,0.11682398880887
-4538,3742,4213,0.111567725645095,0.111567725645095
-4539,4213,1339,0.201798845648163,0.201798845648163
-4541,4214,4215,0.203408625976642,0.203408625976642
-4542,4215,4216,0.204114710404745,0.204114710404745
-4543,4216,4217,0.199718562750948,0.199718562750948
-4544,4217,4218,0.198271148516705,0.198271148516705
-4545,4218,771,0.17255385564489,0.17255385564489
-4547,2307,165,0.313487377331004,0.313487377331004
-4549,4219,4220,0.186213228977795,0.186213228977795
-4551,754,1537,0.148966155582635,0.148966155582635
-4553,4221,4222,0.161148121345995,0.161148121345995
-4554,4222,4223,0.216135114601666,0.216135114601666
-4555,4223,2863,0.186375265274556,0.186375265274556
-4556,2863,4224,0.202043234198664,0.202043234198664
-4558,2306,163,0.315813218507964,0.315813218507964
-4560,2936,4225,0.221837398274975,0.221837398274975
-4561,4226,4227,0.032037204481033,0.032037204481033
-4562,4227,3117,0.0749583948430369,0.0749583948430369
-4563,3117,4228,0.116878015161696,0.116878015161696
-4564,4228,4229,0.198835732908948,0.198835732908948
-4565,4229,3631,0.67836534857008,0.67836534857008
-4567,4230,4231,0.0278521738101303,0.0278521738101303
-4568,4231,3626,0.0483370034898742,0.0483370034898742
-4569,3626,4232,0.0510217447847317,0.0510217447847317
-4570,4232,4233,0.0469996469262497,0.0469996469262497
-4571,4233,4234,0.00322569080192639,0.00322569080192639
-4572,4234,4235,0.0476498478152495,0.0476498478152495
-4573,4235,4236,0.00275575991011001,0.00275575991011001
-4574,4236,4237,0.0466374525425622,0.0466374525425622
-4575,4237,4176,0.0490297893404984,0.0490297893404984
-4577,1777,4238,0.0499406466420926,0.0499406466420926
-4578,4238,4239,0.0481565861804565,0.0481565861804565
-4579,4239,4241,0.0519465642125291,0.0519465642125291
-4580,4241,1525,0.0497346926389818,0.0497346926389818
-4581,1525,4242,0.0484856348902157,0.0484856348902157
-4582,4242,4243,0.0507187078501555,0.0507187078501555
-4584,4244,4245,0.0527177379947323,0.0527177379947323
-4585,4245,4246,0.0464286276535365,0.0464286276535365
-4586,4246,4247,0.0517965186978674,0.0517965186978674
-4587,4247,4248,0.0444043495278385,0.0444043495278385
-4588,4248,569,0.0503939700372948,0.0503939700372948
-4589,569,4249,0.0487604458581461,0.0487604458581461
-4590,4249,4250,0.049686610105401,0.049686610105401
-4591,4250,3757,0.0516485422129312,0.0516485422129312
-4593,233,4251,0.0506501019029544,0.0506501019029544
-4594,4251,4252,0.049085285550805,0.049085285550805
-4595,4252,4253,0.0509968613887819,0.0509968613887819
-4596,4253,4254,0.0502265448038836,0.0502265448038836
-4597,4254,4255,0.0465382189133341,0.0465382189133341
-4598,4255,4256,0.0510900830663337,0.0510900830663337
-4599,4256,4257,0.0497787434592631,0.0497787434592631
-4600,4257,3481,0.048623750791878,0.048623750791878
-4601,3481,4258,0.0500598342416855,0.0500598342416855
-4602,4258,4259,0.0490673464291656,0.0490673464291656
-4603,4259,4260,0.0504371465498466,0.0504371465498466
-4604,4260,3695,0.0479901081376225,0.0479901081376225
-4606,4261,4262,0.0501538740654185,0.0501538740654185
-4607,4262,4263,0.0491706548036751,0.0491706548036751
-4608,4263,4264,0.0565833994828839,0.0565833994828839
-4610,277,4265,0.0528934097089145,0.0528934097089145
-4611,4265,4266,0.0968160140004115,0.0968160140004115
-20627,10752,10756,0.0716547469239426,0.0716547469239426
-4612,4266,4267,0.0968245593658874,0.0968245593658874
-4613,4267,973,0.0982940228399724,0.0982940228399724
-4614,973,4268,0.0961120665100732,0.0961120665100732
-4615,4268,3151,0.0982830823377853,0.0982830823377853
-4616,3151,4269,0.0956500899819903,0.0956500899819903
-4617,4269,4270,0.0774758788411222,0.0774758788411222
-4619,4271,3870,0.115440404669678,0.115440404669678
-4620,3870,839,0.0968819352907846,0.0968819352907846
-4621,839,4272,0.0909531666656291,0.0909531666656291
-4623,3911,4273,0.0389706485750465,0.0389706485750465
-4624,369,4274,0.037543890411303,0.037543890411303
-4625,4274,4275,0.0617087098520115,0.0617087098520115
-4629,2912,4277,0.0342245606725147,0.0342245606725147
-4630,4277,4278,0.104948893572031,0.104948893572031
-4631,4278,3313,0.105285822276279,0.105285822276279
-4632,3313,4279,0.10593807567588,0.10593807567588
-4634,1347,1613,0.100174688565551,0.100174688565551
-4635,1613,4280,0.104997472753206,0.104997472753206
-4665,4282,4283,0.0977314379471645,0.0977314379471645
-4639,4284,4285,0.190476396365953,0.190476396365953
-4640,4285,4286,0.254383171783508,0.254383171783508
-4642,4287,1279,0.116253581720056,0.116253581720056
-4643,1279,4288,0.133001385838575,0.133001385838575
-4644,4288,4289,0.132041969489344,0.132041969489344
-4645,4289,4290,0.131385678442372,0.131385678442372
-4647,3405,4291,0.101549832168715,0.101549832168715
-4648,4291,4292,0.100523519517599,0.100523519517599
-4649,4292,4293,0.100138462817161,0.100138462817161
-5953,5195,5227,0.170006104257124,0.170006104257124
-4650,4293,4294,0.099847555472709,0.099847555472709
-4651,4294,4295,0.0503614009997415,0.0503614009997415
-4652,4295,1117,0.0494296215921,0.0494296215921
-4653,1117,4296,0.050087846881447,0.050087846881447
-4654,4296,4297,0.0495578429804187,0.0495578429804187
-4655,4297,4298,0.0515578068709943,0.0515578068709943
-20458,10785,10812,0.0256322806680483,0.0256322806680483
-4656,4298,4299,0.00303478875120781,0.00303478875120781
-4659,4300,1508,0.0639307257992365,0.0639307257992365
-4660,1508,179,0.201223720751325,0.201223720751325
-4661,179,1707,0.203441168484602,0.203441168484602
-4663,4301,4302,0.143365965722663,0.143365965722663
-4686,4303,4304,0.0764005624211503,0.0764005624211503
-4664,4302,4305,2.47136733106287,2.47136733106287
-17126,4306,4307,0.198891077653185,0.198891077653185
-17128,4308,4309,0.137004722426324,0.137004722426324
-4666,4283,4310,0.00807297378678342,0.00807297378678342
-4667,4310,4311,0.088125570928718,0.088125570928718
-4668,4311,4312,0.0140203745468903,0.0140203745468903
-19629,10518,10593,0.0691965251351115,0.0691965251351115
-4670,4313,4314,0.114544256923558,0.114544256923558
-4671,4314,4315,0.197539157423005,0.197539157423005
-4672,4315,4035,0.10133193665102,0.10133193665102
-4675,3389,4317,0.176922247784819,0.176922247784819
-4676,4317,1313,0.17698917639034,0.17698917639034
-4677,1313,4318,0.2429613537943,0.2429613537943
-4678,4318,4319,0.0830631503019858,0.0830631503019858
-4679,4319,4320,0.0977203133854136,0.0977203133854136
-4680,4320,4321,0.113818121601187,0.113818121601187
-4681,4321,4322,0.0984100223094627,0.0984100223094627
-4683,4323,4324,0.0484810817232728,0.0484810817232728
-4684,4324,4325,0.0969202903062125,0.0969202903062125
-4685,4325,4303,0.026431034063363,0.026431034063363
-4687,4304,4326,0.107959479077584,0.107959479077584
-4689,4302,1574,0.191677995814021,0.191677995814021
-4691,3672,4328,0.125428790986072,0.125428790986072
-4692,4328,4329,0.0951720176425212,0.0951720176425212
-4693,4329,4330,0.139038263486678,0.139038263486678
-4694,4330,4331,0.139714401472726,0.139714401472726
-4700,4334,4335,0.200429884058467,0.200429884058467
-4702,2368,4336,0.0171503416673458,0.0171503416673458
-4704,2899,4337,0.105099867009157,0.105099867009157
-4705,4337,4338,0.106056680315678,0.106056680315678
-4706,4338,4339,0.104589847143113,0.104589847143113
-4707,4339,4340,0.370832351150224,0.370832351150224
-4708,4340,4341,0.0529480373416704,0.0529480373416704
-4709,4341,3902,0.107541125657943,0.107541125657943
-4710,3902,1039,0.104784630542914,0.104784630542914
-4711,1039,4342,0.104777071004161,0.104777071004161
-4712,4342,4343,0.105248493254523,0.105248493254523
-4713,4343,4344,0.101108879740712,0.101108879740712
-4714,4344,3325,0.105024412220906,0.105024412220906
-4715,3325,4345,0.102246237774905,0.102246237774905
-4716,4345,4346,0.102726745739932,0.102726745739932
-4717,4346,2076,0.108443527267173,0.108443527267173
-4718,2076,2673,0.108454042008862,0.108454042008862
-6026,4668,5275,0.106680903376796,0.106680903376796
-20495,10837,10818,0.00314569094185422,0.00314569094185422
-4719,2673,4123,0.102664740305431,0.102664740305431
-4720,4123,4347,0.110043125382133,0.110043125382133
-4721,4347,4348,0.0925868711229396,0.0925868711229396
-4722,4348,4349,0.101256639304288,0.101256639304288
-4723,4349,3471,0.100333218908324,0.100333218908324
-4724,3471,4350,0.101033713236321,0.101033713236321
-4726,850,4351,0.101364060095961,0.101364060095961
-4727,4351,4352,0.0951618291875102,0.0951618291875102
-4728,4352,4353,0.0166431794757682,0.0166431794757682
-4729,4353,4354,0.0900251519018866,0.0900251519018866
-4730,4354,4355,0.0948464364966571,0.0948464364966571
-4731,4355,4356,0.0929916889983271,0.0929916889983271
-4732,4356,4357,0.0946584559856625,0.0946584559856625
-4733,4357,2002,0.0939147825318954,0.0939147825318954
-4734,2002,3362,0.0961201849767339,0.0961201849767339
-4735,3362,2756,0.0936202724465644,0.0936202724465644
-4736,2756,4358,0.0928604520153806,0.0928604520153806
-4738,4359,3874,0.0985792493705747,0.0985792493705747
-4740,4360,4361,0.589746493190754,0.589746493190754
-4742,501,1385,0.0995647502781281,0.0995647502781281
-4745,4363,4364,0.205829363021429,0.205829363021429
-4746,4364,4365,0.0921122756854079,0.0921122756854079
-4747,4365,4366,0.00988128080256074,0.00988128080256074
-4748,4366,4367,0.0897681081567516,0.0897681081567516
-4749,4367,4368,0.098598628932225,0.098598628932225
-4750,4368,4369,0.0959412440063823,0.0959412440063823
-4751,4369,4370,0.102131783313602,0.102131783313602
-4752,4370,783,0.172155062898013,0.172155062898013
-4753,783,4373,0.095162556755669,0.095162556755669
-4754,4373,4374,0.0961947364240104,0.0961947364240104
-4755,4374,2746,0.0976874440589729,0.0976874440589729
-4756,2746,4375,0.105035684135392,0.105035684135392
-4757,4375,4376,0.0939930714928361,0.0939930714928361
-4758,4376,4031,0.0955624767971731,0.0955624767971731
-4759,4031,4377,0.0560443290529964,0.0560443290529964
-4760,4377,1489,0.204591889958277,0.204591889958277
-4762,145,1731,0.201807709171719,0.201807709171719
-4763,1731,360,0.203461803126836,0.203461803126836
-4767,2902,2038,0.0702037411311871,0.0702037411311871
-4769,4380,4381,0.147155318321419,0.147155318321419
-4770,4381,4382,0.144957308053315,0.144957308053315
-4771,4382,4383,0.149312485085308,0.149312485085308
-4774,2688,4385,0.0765539017627299,0.0765539017627299
-4775,4385,4386,0.0705753548513159,0.0705753548513159
-4776,4386,4387,0.146933743759007,0.146933743759007
-4777,4387,4388,0.145923980731529,0.145923980731529
-4778,4388,4389,0.144339759907671,0.144339759907671
-4779,4389,4390,0.150103166473839,0.150103166473839
-4780,4390,4391,0.137983810664432,0.137983810664432
-4781,4391,4392,0.0104056356944031,0.0104056356944031
-4782,4392,4393,0.140241416108271,0.140241416108271
-4783,4393,4394,0.1481833156111,0.1481833156111
-4784,4394,4395,0.146837535132845,0.146837535132845
-4785,4395,4396,0.147176845167591,0.147176845167591
-4786,4396,4397,0.145625871999305,0.145625871999305
-4788,1072,4398,0.0934237929296376,0.0934237929296376
-4790,4399,4400,0.1229191337931,0.1229191337931
-4791,4400,4401,0.117696624021516,0.117696624021516
-4792,4401,3916,0.0730141443209756,0.0730141443209756
-4794,4402,4403,3.26030129970045,3.26030129970045
-4795,4403,1705,0.202698536609182,0.202698536609182
-4796,1705,176,0.202718600973581,0.202718600973581
-4797,176,1503,0.201219684641614,0.201219684641614
-4798,1503,4404,0.202286968554481,0.202286968554481
-4799,4404,4405,0.200141278145387,0.200141278145387
-4800,4405,4406,0.0308542467827185,0.0308542467827185
-4801,4406,4407,0.168200323230532,0.168200323230532
-4802,4407,4408,0.11307645922142,0.11307645922142
-4803,4408,4409,0.0961947310408444,0.0961947310408444
-4804,4409,4410,0.0983990775592717,0.0983990775592717
-4806,4411,4413,0.099863884884034,0.099863884884034
-4809,4415,4416,0.102810116828889,0.102810116828889
-4810,4416,4417,0.0991628298509216,0.0991628298509216
-4811,4417,4418,0.0969872745595907,0.0969872745595907
-4812,4418,4419,0.0998556913489604,0.0998556913489604
-4813,4419,4420,0.0958355207238061,0.0958355207238061
-4814,4420,1307,0.243760388907656,0.243760388907656
-4815,1307,4421,0.179135026824832,0.179135026824832
-4818,4422,477,0.0591204183570981,0.0591204183570981
-4819,477,486,0.338636165035717,0.338636165035717
-4820,486,320,0.186794052108965,0.186794052108965
-4821,320,324,0.464671835959624,0.464671835959624
-4822,324,531,0.0559979023034973,0.0559979023034973
-4823,531,534,0.263162604733165,0.263162604733165
-4825,475,530,0.435551136576821,0.435551136576821
-4826,530,393,0.115152140819887,0.115152140819887
-4827,393,4423,0.203655322253385,0.203655322253385
-4828,4423,4424,0.538171924126244,0.538171924126244
-4829,4424,4426,0.419488421877639,0.419488421877639
-4830,4426,4427,0.0323139283448777,0.0323139283448777
-4833,4428,4429,0.198930926845217,0.198930926845217
-4837,4432,4433,0.200460087837485,0.200460087837485
-4839,2920,3260,0.28373274915572,0.28373274915572
-4842,4436,726,0.0998645775500999,0.0998645775500999
-4843,726,52,0.170560718436498,0.170560718436498
-4844,52,4437,0.100090869280248,0.100090869280248
-4845,4437,3658,0.0591716781283333,0.0591716781283333
-4846,3658,4438,0.103033016475492,0.103033016475492
-4847,4438,4439,0.00533542340358722,0.00533542340358722
-4848,4439,3530,0.0426683766285225,0.0426683766285225
-4850,4440,1490,0.0653862418347059,0.0653862418347059
-4851,1490,146,0.199762763358791,0.199762763358791
-4853,1733,4441,0.200262923415945,0.200262923415945
-4855,3554,4442,0.0495302719350299,0.0495302719350299
-4856,4442,4443,0.0498850541236187,0.0498850541236187
-4857,4443,4444,0.0512856921549244,0.0512856921549244
-4858,4444,3019,0.0117591853989501,0.0117591853989501
-4860,4445,4382,0.0530835076360593,0.0530835076360593
-4861,4382,4446,0.0528074946120117,0.0528074946120117
-4863,4447,4448,0.00600839331926655,0.00600839331926655
-4865,4449,4450,0.0531891993832321,0.0531891993832321
-4866,4450,4451,0.0546720224408421,0.0546720224408421
-4867,4451,4452,0.0492877204975977,0.0492877204975977
-4868,4452,4453,0.0555740263590881,0.0555740263590881
-4869,4453,4454,0.0508522899950145,0.0508522899950145
-4870,4454,4455,0.0539540438907939,0.0539540438907939
-4871,4455,4456,0.05278127500741,0.05278127500741
-4872,4456,4457,0.0520682148022883,0.0520682148022883
-4873,4457,4458,0.0535945839553328,0.0535945839553328
-4874,4458,3308,0.105299206866662,0.105299206866662
-4875,3308,4459,0.0532887340145185,0.0532887340145185
-4876,4459,4460,0.0519293867850164,0.0519293867850164
-4878,2911,4461,0.104626210772024,0.104626210772024
-4879,4461,4462,0.107626289516013,0.107626289516013
-4880,4462,4463,0.104079175744358,0.104079175744358
-4881,4463,4464,0.104771521557699,0.104771521557699
-4882,4464,4465,0.105968126634263,0.105968126634263
-6192,5399,5400,0.276164012064383,0.276164012064383
-4883,4465,4466,0.105797186557688,0.105797186557688
-4884,4466,3135,0.104882643737148,0.104882643737148
-4885,3135,3907,0.109352834062615,0.109352834062615
-4886,3907,1046,0.105412573797977,0.105412573797977
-4887,1046,4467,0.052770391738213,0.052770391738213
-4888,4467,4468,0.0520438840305316,0.0520438840305316
-4889,4468,4469,0.10568608900916,0.10568608900916
-4890,4469,4470,0.101335564568208,0.101335564568208
-4891,4470,3332,0.103121923835041,0.103121923835041
-4892,3332,4471,0.106386988921342,0.106386988921342
-4893,4471,4472,0.0168550696022494,0.0168550696022494
-4894,4472,4473,0.0917114246562582,0.0917114246562582
-4895,4473,2083,0.101916806851718,0.101916806851718
-4896,2083,4474,0.104993787286419,0.104993787286419
-4897,4474,4129,0.105139069056382,0.105139069056382
-4898,4129,4475,0.108754567624091,0.108754567624091
-4899,4475,4476,0.10144670106953,0.10144670106953
-4900,4476,4477,0.106139118962841,0.106139118962841
-4901,4477,3446,0.105344236005182,0.105344236005182
-4903,4478,4479,0.0124618097268169,0.0124618097268169
-4904,4479,4480,0.085822453683645,0.085822453683645
-4905,4480,3886,0.0198123941785865,0.0198123941785865
-4907,865,4481,0.0967884909448593,0.0967884909448593
-4909,345,4482,0.111183183932549,0.111183183932549
-4910,4483,1892,0.0285476317873184,0.0285476317873184
-4912,4360,4484,0.465117334225162,0.465117334225162
-4913,4484,4485,0.0326010116755978,0.0326010116755978
-4915,4486,4487,0.175931100170174,0.175931100170174
-4916,4487,4489,0.100342363380826,0.100342363380826
-4917,4489,4490,0.161656025882071,0.161656025882071
-4918,4490,4491,0.0905242566324277,0.0905242566324277
-4919,4491,1950,0.169005169872083,0.169005169872083
-4920,1950,4492,0.126063150124326,0.126063150124326
-4924,4081,3762,0.180617937803326,0.180617937803326
-4926,2559,4495,0.0875396307338273,0.0875396307338273
-4927,4495,4496,0.0902282586364627,0.0902282586364627
-4928,4496,4497,0.0878475091612825,0.0878475091612825
-4929,4497,4498,0.266301743580547,0.266301743580547
-4930,180,1708,0.203431976552675,0.203431976552675
-4931,1708,4499,0.201230804203475,0.201230804203475
-4932,4499,1575,0.27729796539772,0.27729796539772
-4933,1575,4500,0.182259795470885,0.182259795470885
-4934,4501,4502,0.199005560216138,0.199005560216138
-4935,4502,4503,0.153202263597584,0.153202263597584
-4937,4504,4505,0.176923776962641,0.176923776962641
-4938,4505,1315,0.176127860687443,0.176127860687443
-4939,1315,1371,0.176782045374234,0.176782045374234
-4940,1371,4506,0.0626491861453163,0.0626491861453163
-4941,4506,4507,0.0851767549198192,0.0851767549198192
-4943,3035,4508,0.210570172682267,0.210570172682267
-4945,54,4510,0.19332295953062,0.19332295953062
-4946,4510,3640,0.0466160975278989,0.0466160975278989
-4948,4511,3531,0.0618894465423491,0.0618894465423491
-4949,3531,4512,0.0905408166059636,0.0905408166059636
-4951,3926,707,0.0755598922064861,0.0755598922064861
-4952,707,4513,0.0978688769552162,0.0978688769552162
-4953,4513,4514,0.0992771410926943,0.0992771410926943
-4954,4514,4188,0.135836888761709,0.135836888761709
-4955,4188,2514,0.135033448601963,0.135033448601963
-4956,2514,4515,0.13515296788921,0.13515296788921
-4957,4515,4516,0.136409392488761,0.136409392488761
-4959,4517,4518,0.0356088442137805,0.0356088442137805
-4960,4518,4519,0.0503802448307333,0.0503802448307333
-4961,4519,4520,0.127581150438839,0.127581150438839
-4962,4520,4521,0.132742519290442,0.132742519290442
-4963,4521,4522,0.13263462094456,0.13263462094456
-4964,4522,1243,0.132622916068163,0.132622916068163
-4965,1243,4523,0.132744954601011,0.132744954601011
-4966,4523,2724,0.131940306625131,0.131940306625131
-4967,2724,4524,0.125887507119952,0.125887507119952
-4968,4524,4525,0.0073166618478819,0.0073166618478819
-4970,4526,4527,0.188224997765616,0.188224997765616
-4971,4527,3419,0.20066865963842,0.20066865963842
-4973,4528,4529,0.132643815391647,0.132643815391647
-4974,4529,4288,0.134447795927953,0.134447795927953
-4975,4288,4530,0.0675286789518799,0.0675286789518799
-4976,4530,4531,0.0681514911729941,0.0681514911729941
-4978,1833,2628,0.0976402650867344,0.0976402650867344
-4980,4532,4428,0.101312368020336,0.101312368020336
-4981,4428,4533,0.0998335149833254,0.0998335149833254
-4982,4533,4534,0.1027774706977,0.1027774706977
-4984,4535,1833,0.103500237720645,0.103500237720645
-4986,4536,4537,0.0953225774659935,0.0953225774659935
-4988,4538,4539,0.19878482816443,0.19878482816443
-4989,4539,2830,0.201604542004037,0.201604542004037
-4990,2830,1438,0.197694612690532,0.197694612690532
-4991,1438,4540,0.179002123409013,0.179002123409013
-4993,4541,25,0.138059623303707,0.138059623303707
-4994,25,4542,0.0645746983944002,0.0645746983944002
-4995,4542,2964,0.0670651945252806,0.0670651945252806
-4999,4545,4546,0.142258977482996,0.142258977482996
-5001,4547,115,0.110830423505847,0.110830423505847
-5003,4548,4549,0.0776585367690646,0.0776585367690646
-5004,4549,4550,0.199094650034446,0.199094650034446
-5005,4550,4551,0.100232131513911,0.100232131513911
-5007,4552,2292,0.132777862181536,0.132777862181536
-5008,2292,4553,0.0918166647273585,0.0918166647273585
-5009,4553,2534,0.18135507208955,0.18135507208955
-5011,2627,4554,0.0924500575644084,0.0924500575644084
-5012,4554,4555,0.10983037862614,0.10983037862614
-5014,4523,4556,0.135380005592348,0.135380005592348
-5015,4556,4557,0.134346145402708,0.134346145402708
-5016,4557,4558,0.133189336887005,0.133189336887005
-5017,4558,1680,0.13514752705788,0.13514752705788
-5018,1680,4559,0.137419251565084,0.137419251565084
-5020,4560,4064,0.13135456684589,0.13135456684589
-5021,4064,4561,0.134278993416053,0.134278993416053
-5023,4101,4562,0.159933235501875,0.159933235501875
-5025,4563,4564,0.407964486856081,0.407964486856081
-5026,4565,2188,0.10962848253063,0.10962848253063
-17150,4780,4781,0.199841658014134,0.199841658014134
-5028,4566,687,0.202530686471354,0.202530686471354
-5029,687,1982,0.159069792202276,0.159069792202276
-5030,1982,1967,0.0383650278893233,0.0383650278893233
-5033,4567,1928,0.199711508236703,0.199711508236703
-5034,1928,4568,0.201653602761609,0.201653602761609
-5035,4568,3272,0.202185746700204,0.202185746700204
-5036,3272,4569,0.20093413075273,0.20093413075273
-5037,4569,85,0.20339775981857,0.20339775981857
-5038,85,3521,0.203998373883698,0.203998373883698
-5039,3521,4262,0.200473333246826,0.200473333246826
-5040,4262,4570,0.200485802986416,0.200485802986416
-5041,4570,4571,0.201223720769428,0.201223720769428
-5042,4571,4572,0.205786578364508,0.205786578364508
-5043,4572,4573,0.200686081138238,0.200686081138238
-5044,4573,4574,0.200311699167283,0.200311699167283
-5045,4575,4576,0.13275170286213,0.13275170286213
-5046,4576,4011,0.136238719327193,0.136238719327193
-5049,4578,3382,0.130912952312419,0.130912952312419
-5050,3382,4579,0.10420964387947,0.10420964387947
-5051,4579,4580,0.100328081358343,0.100328081358343
-5053,4581,4582,0.100688559836452,0.100688559836452
-5054,4582,1104,0.099555514740453,0.099555514740453
-5055,1104,4583,0.100465419279427,0.100465419279427
-5056,4583,4584,0.100511332021349,0.100511332021349
-5057,4584,4585,0.0999153218838928,0.0999153218838928
-5059,3498,4586,0.198271673699608,0.198271673699608
-5060,4586,4587,0.203313884946152,0.203313884946152
-5062,4588,3598,0.162446986671654,0.162446986671654
-5065,4590,4591,0.145581982651648,0.145581982651648
-20699,10909,10894,0.00288177410229764,0.00288177410229764
-5066,4591,4592,0.145302049591696,0.145302049591696
-5067,4592,2013,0.147364635735888,0.147364635735888
-5068,2013,4593,0.147376079792043,0.147376079792043
-5069,4593,4594,0.146031742389181,0.146031742389181
-5071,4595,4596,0.179128666689522,0.179128666689522
-5072,4596,4597,0.0491363059718978,0.0491363059718978
-5073,4597,4598,0.0534283507033442,0.0534283507033442
-5074,4598,4599,0.051162571237203,0.051162571237203
-5076,1025,3894,0.103299911807114,0.103299911807114
-5077,3894,4600,0.113012549862716,0.113012549862716
-5078,4600,4601,0.103445240313361,0.103445240313361
-5079,4601,4602,0.110216736617757,0.110216736617757
-5080,4602,4603,0.098537605440947,0.098537605440947
-5081,4603,4604,0.10689939615188,0.10689939615188
-5082,4604,4605,0.104556664577465,0.104556664577465
-5083,4605,4606,0.106796784548208,0.106796784548208
-5084,4606,2884,0.106044347623682,0.106044347623682
-5085,2884,4607,0.118270695339941,0.118270695339941
-6370,5524,5525,0.0492521789985846,0.0492521789985846
-5087,4608,4609,0.117800444995037,0.117800444995037
-5088,4609,4610,0.102641376464428,0.102641376464428
-5089,4610,4611,0.0494099001663831,0.0494099001663831
-5090,4611,4612,0.0461096147761951,0.0461096147761951
-5091,4612,4613,0.102709817700352,0.102709817700352
-5092,4613,4614,0.107788478157863,0.107788478157863
-5093,4614,4615,0.106309381819152,0.106309381819152
-5095,4618,4619,0.107514865026302,0.107514865026302
-5096,4619,4620,0.109618128547838,0.109618128547838
-5098,4621,4622,0.0890723635550207,0.0890723635550207
-5100,4623,4522,0.133190665745901,0.133190665745901
-5102,4624,4625,0.133658094916269,0.133658094916269
-5103,4625,4626,0.133656501053085,0.133656501053085
-5104,4626,1679,0.135152153872346,0.135152153872346
-5105,1679,4627,0.135024432224219,0.135024432224219
-5106,4627,2458,0.13515140493347,0.13515140493347
-5107,2458,3226,0.138004027692966,0.138004027692966
-5108,3226,4628,0.134323473833378,0.134323473833378
-5110,4629,4630,0.135446542572512,0.135446542572512
-19829,9519,10649,0.210072579992032,0.210072579992032
-5113,4632,4633,0.0947313767183171,0.0947313767183171
-5115,4634,4635,0.0557913419625853,0.0557913419625853
-5116,4635,4636,0.0662366225916723,0.0662366225916723
-5117,4636,4637,0.113593419326123,0.113593419326123
-5120,4639,4640,0.132773960128622,0.132773960128622
-5121,4640,2488,0.134241502580257,0.134241502580257
-5122,2488,2829,0.133449886794901,0.133449886794901
-5123,2829,1437,0.199500232175966,0.199500232175966
-5124,1437,4641,0.151025004831673,0.151025004831673
-5126,4642,114,0.107737280643715,0.107737280643715
-5127,114,4643,0.05007218616811,0.05007218616811
-5129,4644,4645,0.207043620739087,0.207043620739087
-5130,4645,1842,0.100003312332805,0.100003312332805
-5131,1842,2639,0.103345313678593,0.103345313678593
-5132,2639,4646,0.199597531872746,0.199597531872746
-5133,4646,4647,0.110338949764664,0.110338949764664
-5134,4647,4648,0.0862326024249021,0.0862326024249021
-5135,4648,4649,0.00885483385456902,0.00885483385456902
-5136,4649,4650,0.198772614686204,0.198772614686204
-5138,275,4651,0.385379364010995,0.385379364010995
-5139,4651,4652,0.41471692527459,0.41471692527459
-5140,4652,4653,0.0539741907357585,0.0539741907357585
-5141,4653,4654,0.022194548523775,0.022194548523775
-5142,4654,4206,0.207869157343365,0.207869157343365
-5144,4655,4656,0.134281006104493,0.134281006104493
-5145,4656,2404,0.0664009097985413,0.0664009097985413
-5146,2404,4287,0.0661523414774278,0.0661523414774278
-5147,4287,4657,0.134479579019433,0.134479579019433
-5149,4658,4659,0.0841530151799317,0.0841530151799317
-5150,4659,23,0.134991372812694,0.134991372812694
-5152,4098,4660,0.191146561014702,0.191146561014702
-5153,4660,4661,0.201619149588839,0.201619149588839
-5154,4661,4662,0.406108499193961,0.406108499193961
-5155,1948,2564,0.13210280054913,0.13210280054913
-5157,4663,388,0.102051980712047,0.102051980712047
-5159,1442,4664,0.0822712120832148,0.0822712120832148
-5160,4664,4665,0.119816357959701,0.119816357959701
-5161,4665,4666,0.204097543225869,0.204097543225869
-5162,4666,4667,0.203014171650501,0.203014171650501
-5164,4668,1869,0.212544115775742,0.212544115775742
-5165,1869,4183,0.200120502606903,0.200120502606903
-5167,4669,2615,0.177891060007606,0.177891060007606
-5169,4670,4671,0.124038366426802,0.124038366426802
-5171,2421,3232,0.143042998317255,0.143042998317255
-5173,4672,2028,0.132076698976753,0.132076698976753
-5174,2028,4673,0.145972981302679,0.145972981302679
-5175,4673,4674,0.125161327150552,0.125161327150552
-5177,3368,4675,0.102054188376367,0.102054188376367
-5178,4675,3714,0.0982241705421038,0.0982241705421038
-5179,3714,4676,0.103510692140635,0.103510692140635
-5181,4677,4678,0.0648734285683964,0.0648734285683964
-5182,4678,615,0.177689539069832,0.177689539069832
-5183,615,4679,0.176110549937417,0.176110549937417
-5184,4679,4680,0.173776320124656,0.173776320124656
-5186,4681,4682,0.184513059882878,0.184513059882878
-5187,4682,4685,0.175211932943401,0.175211932943401
-5189,4686,4687,0.349232193394911,0.349232193394911
-5191,1357,4688,0.13277378561117,0.13277378561117
-5193,4689,4690,0.459634230640815,0.459634230640815
-5194,4691,4692,0.0991279407871357,0.0991279407871357
-5195,4692,4693,0.0976485109623955,0.0976485109623955
-5197,4694,4695,0.0991197857977998,0.0991197857977998
-5198,4695,4696,0.10132403770971,0.10132403770971
-5199,4696,4697,0.0991849406088648,0.0991849406088648
-5201,1637,4698,0.104258284661182,0.104258284661182
-5202,4698,4215,0.0991281021081487,0.0991281021081487
-5203,4215,4699,0.0976569662788289,0.0976569662788289
-5204,4699,195,0.10058858208642,0.10058858208642
-5205,195,2924,0.0991416985641161,0.0991416985641161
-5206,2924,4700,0.0991366648288655,0.0991366648288655
-5207,4700,1462,0.100582700478246,0.100582700478246
-5208,1462,4701,0.102418321557774,0.102418321557774
-5212,4704,1872,0.0821525251365273,0.0821525251365273
-17295,10015,3501,0.20024191652091,0.20024191652091
-5214,1445,4705,0.199727367553687,0.199727367553687
-5215,4705,4706,0.203375496003776,0.203375496003776
-5216,4706,4707,0.201909493723453,0.201909493723453
-5218,4708,403,0.0454257390325356,0.0454257390325356
-5219,403,314,0.0562503326449317,0.0562503326449317
-5220,314,4709,0.11119492664509,0.11119492664509
-5222,4711,4170,0.194203357035268,0.194203357035268
-5223,4170,4712,0.208127290131148,0.208127290131148
-5224,4712,4713,0.198927723766577,0.198927723766577
-5225,4713,4714,0.204935128047674,0.204935128047674
-5226,4714,4715,0.188520271439654,0.188520271439654
-5227,4715,3793,0.199712422815397,0.199712422815397
-5228,3793,4716,0.152617432717184,0.152617432717184
-5229,4716,944,0.17742675257367,0.17742675257367
-5230,944,2228,0.183696049186415,0.183696049186415
-5231,2228,4717,0.162619098965448,0.162619098965448
-5232,4717,4718,0.189722276081874,0.189722276081874
-5233,4718,4719,0.171945095410338,0.171945095410338
-5234,4719,4720,0.177429725627003,0.177429725627003
-5235,4720,4721,0.102690706769844,0.102690706769844
-5236,4721,4722,0.0746285232074726,0.0746285232074726
-5237,4722,668,0.00411462210691817,0.00411462210691817
-5238,668,4723,0.00380364497345728,0.00380364497345728
-5240,4724,4604,0.175355420651263,0.175355420651263
-5242,1146,875,0.136296969384937,0.136296969384937
-5244,4463,2783,0.133890793284356,0.133890793284356
-5245,2783,4725,0.132805963492264,0.132805963492264
-5246,4725,4726,0.129702593554695,0.129702593554695
-5247,4726,4727,0.147549019452937,0.147549019452937
-5249,4728,4729,0.134556994040934,0.134556994040934
-5250,4729,4730,0.00403637583696172,0.00403637583696172
-5251,4730,4731,0.00537071495727797,0.00537071495727797
-5252,4731,4732,0.135502150823282,0.135502150823282
-5253,4732,4733,0.139193822038205,0.139193822038205
-5254,4733,820,0.139638598300339,0.139638598300339
-5255,820,3561,0.13948292881931,0.13948292881931
-5256,3561,4734,0.140172337301063,0.140172337301063
-5257,4734,4339,0.137170074560425,0.137170074560425
-5258,4339,4735,0.138982548276464,0.138982548276464
-5259,4735,3054,0.142752059367152,0.142752059367152
-5260,3054,4736,0.133100340642693,0.133100340642693
-5261,4736,4737,0.00492593525024253,0.00492593525024253
-5263,4738,3350,0.0528651873534889,0.0528651873534889
-5264,3350,4739,0.10426363885095,0.10426363885095
-5265,4739,4740,0.102034414473958,0.102034414473958
-14766,5462,7420,0.173120091654239,0.173120091654239
-5266,4740,2059,0.102862063735102,0.102862063735102
-5267,2059,2645,0.103513208640623,0.103513208640623
-5268,2645,4111,0.104240888550753,0.104240888550753
-5270,4741,4742,0.102769926646245,0.102769926646245
-5271,4742,4743,0.104240916363933,0.104240916363933
-5272,4743,3452,0.105180194746781,0.105180194746781
-5273,3452,4744,0.10036641032569,0.10036641032569
-5274,4744,3882,0.105711927066125,0.105711927066125
-5275,3882,845,0.10371038656759,0.10371038656759
-5276,845,4745,0.104689829390385,0.104689829390385
-5277,4745,4746,0.0469848225431211,0.0469848225431211
-5279,2610,4747,0.106209148179485,0.106209148179485
-5280,4747,4748,0.0529916423937814,0.0529916423937814
-5282,4749,4750,0.0385383772070312,0.0385383772070312
-5283,4750,966,0.102580898845139,0.102580898845139
-5285,990,4751,0.0998368598850094,0.0998368598850094
-5286,4751,4752,0.0507426333200071,0.0507426333200071
-5287,4752,4753,0.0483650078238011,0.0483650078238011
-5288,4753,1987,0.0507354905741477,0.0507354905741477
-5289,1987,4754,0.0483663202205498,0.0483663202205498
-5290,4754,446,0.051479549664384,0.051479549664384
-5291,446,4712,0.0483577654581108,0.0483577654581108
-5292,4712,4755,0.101297109225192,0.101297109225192
-5293,4755,4756,0.0117741801721385,0.0117741801721385
-5294,4756,4757,0.0826634733388868,0.0826634733388868
-5295,4757,4758,0.0342509974874732,0.0342509974874732
-5296,4758,4759,0.0175268141449879,0.0175268141449879
-5297,4759,4760,0.0234785463070149,0.0234785463070149
-5298,4760,4761,0.0484972333709921,0.0484972333709921
-5299,4761,3126,0.0271800985558075,0.0271800985558075
-5300,3126,3148,0.0183600177870361,0.0183600177870361
-5301,3148,3143,0.0330468719768483,0.0330468719768483
-5302,3143,4762,0.0646645186035183,0.0646645186035183
-5303,4762,3915,0.0595606911380279,0.0595606911380279
-5304,3915,1052,0.123917065152439,0.123917065152439
-5305,1052,4399,0.111768087862579,0.111768087862579
-5306,4399,4763,0.0469346079446244,0.0469346079446244
-5308,4764,4765,0.103730937833073,0.103730937833073
-5311,3155,4767,0.101587564129846,0.101587564129846
-5312,4767,4768,0.101450282305199,0.101450282305199
-5313,4768,4769,0.102136172096814,0.102136172096814
-5314,4769,4770,0.0492382919352757,0.0492382919352757
-5316,4771,4772,0.100332506519832,0.100332506519832
-5317,4772,4773,0.0490390048099826,0.0490390048099826
-5318,4773,989,0.0495269165196006,0.0495269165196006
-5320,4774,4775,0.110656269548842,0.110656269548842
-5321,4775,4776,0.0922568863786424,0.0922568863786424
-5322,4776,4777,0.0968744294941002,0.0968744294941002
-5323,4777,4778,0.0933681364009737,0.0933681364009737
-5324,4778,2017,0.096243154582377,0.096243154582377
-5325,2017,2007,0.0302079551181684,0.0302079551181684
-5326,2007,4779,0.0612998845077431,0.0612998845077431
-5327,4779,2763,0.0939372654248904,0.0939372654248904
-5328,2763,4782,0.0939831368366747,0.0939831368366747
-5329,4782,2267,0.0946761779636641,0.0946761779636641
-5330,2267,3596,0.0957452269737562,0.0957452269737562
-5332,4783,2096,0.0938496563543502,0.0938496563543502
-5333,2096,4784,0.0942585077375453,0.0942585077375453
-5334,4784,4785,0.0947863905236846,0.0947863905236846
-5335,4785,2332,0.0940516760171392,0.0940516760171392
-6607,5694,5695,0.0154325675938591,0.0154325675938591
-5337,4089,4787,0.198005363606862,0.198005363606862
-5339,4788,4789,0.404049086255387,0.404049086255387
-5340,4790,119,0.0976422064224313,0.0976422064224313
-5341,119,4791,0.0958834096516534,0.0958834096516534
-5342,4791,2312,0.0465244099907656,0.0465244099907656
-5344,4792,2484,0.133450471266853,0.133450471266853
-5345,2484,2823,0.13353766665554,0.13353766665554
-5346,2823,1414,0.132023734494372,0.132023734494372
-5347,1414,1354,0.131894209152808,0.131894209152808
-5348,1354,4793,0.0769784662870068,0.0769784662870068
-5350,4794,4795,0.0387509077758481,0.0387509077758481
-5351,4795,2952,0.134935498636386,0.134935498636386
-5352,2952,4796,0.136197421914805,0.136197421914805
-5353,4796,4797,0.129998438382796,0.129998438382796
-5354,4797,4798,0.134935065412598,0.134935065412598
-5356,2635,4799,0.200962590925039,0.200962590925039
-5357,4799,4800,0.183883066303689,0.183883066303689
-5358,4801,4802,0.0508168176081005,0.0508168176081005
-5359,4802,4516,0.0829526060571819,0.0829526060571819
-6631,5709,5710,0.263510763458761,0.263510763458761
-5360,4516,4803,0.133849874797103,0.133849874797103
-5361,4803,4804,0.135491260752817,0.135491260752817
-5363,4805,1674,0.127474088546245,0.127474088546245
-5364,1674,4806,0.138137679733803,0.138137679733803
-5366,4807,2455,0.134491411129426,0.134491411129426
-5367,2455,3223,0.138294178425788,0.138294178425788
-5369,4808,4809,0.133134706345954,0.133134706345954
-5370,4809,4810,0.135569856870466,0.135569856870466
-5371,4810,4811,0.134368341783309,0.134368341783309
-5372,4811,4812,0.133035455825063,0.133035455825063
-5374,4813,4814,0.201931453578911,0.201931453578911
-5376,123,4815,0.0586808902574419,0.0586808902574419
-5377,1608,1158,0.0531893778682351,0.0531893778682351
-5378,1158,4816,0.0522853387259307,0.0522853387259307
-5379,4816,4817,0.0528559175260399,0.0528559175260399
-5380,4817,4818,0.0526139267336242,0.0526139267336242
-5382,4819,4820,0.146802081972091,0.146802081972091
-5383,4820,4821,0.146390170205012,0.146390170205012
-5384,4821,4822,0.0767990953688077,0.0767990953688077
-5386,3289,4824,0.0733337823028737,0.0733337823028737
-5387,4824,4825,0.151650147757225,0.151650147757225
-5389,97,3502,0.20326475820455,0.20326475820455
-5390,3502,4826,0.200021830134173,0.200021830134173
-5391,4826,4827,0.204558997826367,0.204558997826367
-5392,4827,4828,0.201476703732084,0.201476703732084
-5394,4829,4830,0.558813274805265,0.558813274805265
-5395,3635,1894,0.33996915967689,0.33996915967689
-5396,1894,4831,0.234959433855918,0.234959433855918
-5397,4831,3288,0.0548366602436518,0.0548366602436518
-5399,3879,4832,0.175154251791819,0.175154251791819
-5400,4832,3070,0.175288290924905,0.175288290924905
-5402,4833,4834,0.239573627081124,0.239573627081124
-5404,3962,4835,0.197156843459588,0.197156843459588
-5405,4835,4836,0.094417767822886,0.094417767822886
-5406,4836,388,0.087554257922167,0.087554257922167
-5407,388,1384,0.157773442883539,0.157773442883539
-5408,1384,4837,0.0895725883825947,0.0895725883825947
-5409,4837,325,0.282856295391869,0.282856295391869
-6684,2175,5744,0.101148378971839,0.101148378971839
-5410,325,4838,0.0837092029011689,0.0837092029011689
-5411,4838,4840,0.0963811879451104,0.0963811879451104
-5412,4840,4841,0.421707851811283,0.421707851811283
-5415,1486,144,0.196859858102641,0.196859858102641
-5417,2194,4843,0.069400098080988,0.069400098080988
-5418,4843,4844,0.128982538897387,0.128982538897387
-5420,4845,4846,0.127385402005959,0.127385402005959
-5421,4846,4847,0.0485354577138893,0.0485354577138893
-5422,4847,2197,0.0570536883887032,0.0570536883887032
-5423,2197,2198,0.0030293307914236,0.0030293307914236
-5425,2191,4848,0.228805525488878,0.228805525488878
-5427,4281,2319,0.149466526420244,0.149466526420244
-5428,2319,4849,0.264070561759483,0.264070561759483
-5430,4850,4851,0.124106376215018,0.124106376215018
-5432,4852,4853,0.107373531206162,0.107373531206162
-5433,4853,4854,0.108589473424165,0.108589473424165
-5434,4854,4855,0.105767467639199,0.105767467639199
-5435,4855,4856,0.0608956612626877,0.0608956612626877
-5436,4856,4857,0.0536676140413411,0.0536676140413411
-5438,4858,4859,0.053767328384899,0.053767328384899
-5439,4859,4860,0.0517270733374725,0.0517270733374725
-5440,4860,4861,0.0506527251945452,0.0506527251945452
-5441,4861,4862,0.0500931909858678,0.0500931909858678
-5442,4862,4863,0.0473439516711298,0.0473439516711298
-5444,4864,4865,0.0521797446029276,0.0521797446029276
-17093,9466,677,0.17846620541914,0.17846620541914
-17094,677,3719,0.359015096413943,0.359015096413943
-5446,4866,4867,0.0492134016241179,0.0492134016241179
-5447,4867,4868,0.0506066180898924,0.0506066180898924
-5448,4868,4869,0.0483319487475015,0.0483319487475015
-5449,4869,4870,0.0507611555520018,0.0507611555520018
-5450,4870,980,0.0494869052239766,0.0494869052239766
-5451,980,4871,0.0481249293188332,0.0481249293188332
-5452,4871,4872,0.0462779203242365,0.0462779203242365
-20332,10741,10746,0.00836528320993219,0.00836528320993219
-5453,4872,4873,0.0504026300689218,0.0504026300689218
-5454,4873,4874,0.0485554829183078,0.0485554829183078
-5455,4874,4875,0.0534696334958417,0.0534696334958417
-6731,5782,5783,0.00425137254991275,0.00425137254991275
-5456,4875,4876,0.0484412552758981,0.0484412552758981
-5458,4877,4717,0.0471074620934606,0.0471074620934606
-5459,4717,4878,0.132709338239974,0.132709338239974
-5461,4879,3888,0.0983476297531957,0.0983476297531957
-5462,3888,1018,0.103492590132028,0.103492590132028
-5463,1018,4880,0.0514136092144711,0.0514136092144711
-5464,4880,4881,0.0525893579522226,0.0525893579522226
-5465,4881,3721,0.0533162444253223,0.0533162444253223
-5466,3721,4882,0.0519823122660099,0.0519823122660099
-5467,4882,4883,0.0522344210852062,0.0522344210852062
-5468,4883,4884,0.0505876398657049,0.0505876398657049
-5469,4884,3336,0.0998762512001326,0.0998762512001326
-5470,3336,4885,0.0991185753255084,0.0991185753255084
-5471,4885,4886,0.0963539908668941,0.0963539908668941
-5472,4886,4887,0.0885379825241657,0.0885379825241657
-5473,4887,4888,0.0119373214867398,0.0119373214867398
-5474,4888,2056,0.0843994384439808,0.0843994384439808
-5475,2056,4889,0.0133131298111966,0.0133131298111966
-5476,4889,2662,0.0974967707832978,0.0974967707832978
-5477,2662,4135,0.0954371783119999,0.0954371783119999
-5479,4890,4891,0.0937877451974264,0.0937877451974264
-5480,4891,4892,0.0948153596322219,0.0948153596322219
-5482,3459,4893,0.0478001833146321,0.0478001833146321
-5484,4894,4895,0.0479027082737571,0.0479027082737571
-5485,4895,4896,0.0478122905377956,0.0478122905377956
-5486,4896,859,0.0923773172496592,0.0923773172496592
-5487,859,454,0.0453886692992681,0.0453886692992681
-5488,454,4897,0.0453208554339034,0.0453208554339034
-5489,4897,458,0.0453479211780813,0.0453479211780813
-5492,4899,4900,0.0139467367099566,0.0139467367099566
-5493,4900,4901,0.0360421538971705,0.0360421538971705
-5494,4901,4902,0.0578381423218813,0.0578381423218813
-5495,4902,4903,0.00552719826630604,0.00552719826630604
-5496,4903,4904,0.0875768226675012,0.0875768226675012
-5497,4904,4905,0.0943606682528015,0.0943606682528015
-5498,4905,4906,0.0967192189659533,0.0967192189659533
-5499,4906,4907,0.098185525305783,0.098185525305783
-5501,4908,2748,0.100541646868693,0.100541646868693
-5502,2748,4909,0.0966275722613029,0.0966275722613029
-5503,4909,4910,0.0992689355907326,0.0992689355907326
-5504,4910,4911,0.101479918551735,0.101479918551735
-6779,5822,3617,0.0484295076881561,0.0484295076881561
-5505,4911,4912,0.0969181343296834,0.0969181343296834
-5507,2121,4913,0.0979459294550903,0.0979459294550903
-5508,4913,4914,0.0979869433285632,0.0979869433285632
-5509,4914,4915,0.197888030311115,0.197888030311115
-5510,3113,4916,0.205521796352519,0.205521796352519
-5511,4916,4917,0.213014583006008,0.213014583006008
-5514,1222,4919,0.098914174918745,0.098914174918745
-5516,4920,1622,0.0585646429204787,0.0585646429204787
-5517,1622,4921,0.122620409777708,0.122620409777708
-5518,4921,4922,0.218423462474676,0.218423462474676
-5520,2815,4923,0.167710746898946,0.167710746898946
-5521,4923,4924,0.0980438120983448,0.0980438120983448
-5523,4677,4925,0.0746274432259007,0.0746274432259007
-5525,4926,617,0.0797365701263369,0.0797365701263369
-5526,617,4927,0.125187481931903,0.125187481931903
-5527,4927,4928,0.0778528067673226,0.0778528067673226
-5528,4928,4929,0.199074396611122,0.199074396611122
-5532,4932,4933,0.00438034032424269,0.00438034032424269
-5533,4933,4934,0.0884200199820011,0.0884200199820011
-5534,4934,4935,0.245891005874257,0.245891005874257
-5535,4935,4936,0.142250751986944,0.142250751986944
-5536,4936,4937,0.0173695104401488,0.0173695104401488
-5538,4938,4939,0.203545296385478,0.203545296385478
-5540,1358,4940,0.12982829991663,0.12982829991663
-5543,4079,2536,0.319784261068233,0.319784261068233
-5545,4926,616,0.0701041786984163,0.0701041786984163
-5546,616,4942,0.177022653633518,0.177022653633518
-5547,4942,4943,0.172063039899941,0.172063039899941
-5549,4944,4945,0.149558307265757,0.149558307265757
-5550,4945,3715,0.0517838841978355,0.0517838841978355
-5551,3715,4948,0.104024626392335,0.104024626392335
-5552,4948,4949,0.174823058982553,0.174823058982553
-5553,4949,2616,0.177668474307762,0.177668474307762
-5554,2616,4950,0.0535070014349516,0.0535070014349516
-5555,4950,4951,0.124049062817869,0.124049062817869
-5556,4951,4952,0.174777210980769,0.174777210980769
-5557,4952,4953,0.127620790205472,0.127620790205472
-5558,4953,4954,0.0551759306609038,0.0551759306609038
-5559,4954,4955,0.176133032867453,0.176133032867453
-5560,4955,4956,0.177512737206305,0.177512737206305
-5562,4406,4957,0.277669971565855,0.277669971565855
-5564,4958,4959,0.199658223163124,0.199658223163124
-5566,1598,1655,0.160087686125488,0.160087686125488
-5568,4960,1592,0.199275601482479,0.199275601482479
-5569,1592,1643,0.201203252625689,0.201203252625689
-5571,4961,4369,0.0888591183295397,0.0888591183295397
-5572,4369,1450,0.193863730230332,0.193863730230332
-5573,1450,4962,0.20633144077854,0.20633144077854
-5575,4963,4964,0.865026893272847,0.865026893272847
-5577,4966,4413,0.196777109156883,0.196777109156883
-5578,4413,4967,0.224682445917882,0.224682445917882
-5579,4967,4304,0.221012468473467,0.221012468473467
-5582,4969,4970,0.107069922554974,0.107069922554974
-5583,4970,4972,0.0948495530272937,0.0948495530272937
-5586,4269,4973,0.080198786030782,0.080198786030782
-5587,4974,4767,0.0973607348320062,0.0973607348320062
-5588,4767,4975,0.179413565332346,0.179413565332346
-5589,4975,4976,0.169917329199621,0.169917329199621
-5590,4976,4977,0.181948721536683,0.181948721536683
-5591,4977,3805,0.200239828466703,0.200239828466703
-5592,3805,4978,0.152216995314545,0.152216995314545
-5594,3620,4979,0.203157103314032,0.203157103314032
-5595,4979,2366,0.112909559408727,0.112909559408727
-5596,2366,4147,0.176980531073324,0.176980531073324
-5597,4147,4980,0.0231632311908037,0.0231632311908037
-5599,4981,4982,0.122490029160582,0.122490029160582
-5600,4982,4983,0.198021379234554,0.198021379234554
-5602,4831,3290,0.14433688220634,0.14433688220634
-5604,4248,1783,0.203809923376497,0.203809923376497
-5605,1783,4984,0.197266471488896,0.197266471488896
-5606,4984,4985,0.203487572214077,0.203487572214077
-5607,4985,4986,0.197825547248631,0.197825547248631
-5608,4986,4987,2.41542068401941,2.41542068401941
-5610,4989,4990,0.0962172324904451,0.0962172324904451
-5611,4990,3077,0.102766134165042,0.102766134165042
-5613,4991,322,0.0217232354992756,0.0217232354992756
-5614,322,4992,0.0357866971477297,0.0357866971477297
-5615,4992,4993,0.0111993418256192,0.0111993418256192
-5618,4994,3114,0.0796924849623814,0.0796924849623814
-5619,3114,4995,0.20745656668227,0.20745656668227
-5621,4996,4997,0.202175143533063,0.202175143533063
-5622,4997,4998,0.201486340865611,0.201486340865611
-5623,4998,4999,0.201289887939002,0.201289887939002
-5624,4999,5000,0.201274447612783,0.201274447612783
-5625,5000,5001,0.402211090441065,0.402211090441065
-5627,1058,5002,0.0523412516567849,0.0523412516567849
-5628,5002,5003,0.185331167798599,0.185331167798599
-5629,5003,3655,0.0518833582791727,0.0518833582791727
-5632,5004,4344,0.139169147250759,0.139169147250759
-5633,4344,5005,0.13717907888566,0.13717907888566
-5634,5005,3044,0.136502893019444,0.136502893019444
-5635,3044,5006,0.140687498507325,0.140687498507325
-5636,5006,5007,0.0045870406114538,0.0045870406114538
-5637,5007,5008,0.137903992793689,0.137903992793689
-5638,5008,1165,0.1390388743026,0.1390388743026
-5640,885,4470,0.139218366547603,0.139218366547603
-5641,4470,2792,0.134293285442621,0.134293285442621
-5642,2792,5009,0.131431211174063,0.131431211174063
-5644,5012,739,0.391173244940122,0.391173244940122
-5645,739,1559,0.139743785900176,0.139743785900176
-5646,1559,4275,0.141288921951359,0.141288921951359
-5647,4275,5013,0.120791048813674,0.120791048813674
-5648,5013,5014,0.0105624832499152,0.0105624832499152
-5649,5014,5015,0.0438951959332696,0.0438951959332696
-5650,5015,5016,0.160752036464104,0.160752036464104
-5652,5017,2345,0.117820938280592,0.117820938280592
-5654,4151,1536,0.0491815160552347,0.0491815160552347
-5655,1536,4765,0.126517768209698,0.126517768209698
-5656,4765,5019,0.175921623374803,0.175921623374803
-5657,5019,5020,0.0764689744574068,0.0764689744574068
-5658,5020,5021,0.102480731304504,0.102480731304504
-5659,5021,1190,0.167860102396295,0.167860102396295
-5660,1190,5022,0.022286088803945,0.022286088803945
-5661,5022,3787,0.1996828431131,0.1996828431131
-5662,3787,5023,0.154628071522294,0.154628071522294
-5687,5040,1763,0.201152967219908,0.201152967219908
-5663,5023,2252,0.333559522830682,0.333559522830682
-5664,2252,5024,0.0290309763494638,0.0290309763494638
-5665,5024,4884,0.148258019557603,0.148258019557603
-5666,4884,5025,0.194698119191853,0.194698119191853
-5667,5025,5026,0.176313474196241,0.176313474196241
-5668,5026,5027,0.192373972114261,0.192373972114261
-5669,5027,679,0.169442185038323,0.169442185038323
-5672,5029,4596,0.157086480064782,0.157086480064782
-5674,5030,5031,0.105448542276863,0.105448542276863
-5677,5032,5034,0.00520403492524916,0.00520403492524916
-5678,5034,5035,0.00442576451440448,0.00442576451440448
-5679,5035,5036,0.135764863246336,0.135764863246336
-5681,5037,813,0.139038307562208,0.139038307562208
-5682,813,3554,0.152271167865336,0.152271167865336
-5684,5038,5039,0.16037248823512,0.16037248823512
-5686,2368,5040,0.131780679502724,0.131780679502724
-5689,5041,5042,0.178235693488978,0.178235693488978
-5690,5042,663,0.00303458618342364,0.00303458618342364
-5691,663,5043,0.17896901951739,0.17896901951739
-5692,5043,4608,0.175810797673871,0.175810797673871
-5693,4608,5044,0.116588664300191,0.116588664300191
-5694,5044,5045,0.0312349930548565,0.0312349930548565
-5695,5045,3670,0.147012417470316,0.147012417470316
-5697,5046,4162,0.0660609059196111,0.0660609059196111
-5698,4162,4771,0.262084611870375,0.262084611870375
-5699,4771,5047,0.17859412824458,0.17859412824458
-5700,5047,5048,0.1691727396202,0.1691727396202
-5701,5048,5049,0.184472749838431,0.184472749838431
-5702,5049,3801,0.20027318311003,0.20027318311003
-5703,3801,5050,0.154503416019497,0.154503416019497
-5704,5050,932,0.176703352691921,0.176703352691921
-5706,2217,4867,0.160601247675141,0.160601247675141
-5707,4867,5051,0.19278749199245,0.19278749199245
-5708,5051,5052,0.171738832244774,0.171738832244774
-5709,5052,5053,0.125039053144726,0.125039053144726
-5710,5053,5054,0.0536646579213684,0.0536646579213684
-5712,2413,5055,0.0539797182371141,0.0539797182371141
-5713,5055,5056,0.0555511846145791,0.0555511846145791
-5714,5056,5057,0.0564985233788716,0.0564985233788716
-5715,5058,5059,0.0116997793337229,0.0116997793337229
-5716,5059,369,0.121769364056454,0.121769364056454
-5717,369,1558,0.13936986171661,0.13936986171661
-5718,1558,738,0.139138948896028,0.139138948896028
-5719,738,5060,0.392796141218442,0.392796141218442
-5721,5061,5062,0.12142771399357,0.12142771399357
-5722,5062,5063,0.0553958184996893,0.0553958184996893
-5723,5063,4434,0.0566894209705876,0.0566894209705876
-5724,4434,2921,0.313688166061769,0.313688166061769
-5726,5062,422,0.127478280907992,0.127478280907992
-5727,422,5063,0.108364291033736,0.108364291033736
-5729,5066,5067,0.177224259300569,0.177224259300569
-5730,5067,1319,0.176633232309172,0.176633232309172
-5731,1319,1375,0.177680959479223,0.177680959479223
-5732,1375,5068,0.0602164425054291,0.0602164425054291
-5733,5068,288,0.02427348670764,0.02427348670764
-5734,288,5069,0.0611513015273674,0.0611513015273674
-5735,5069,4693,0.113806398942027,0.113806398942027
-5736,4693,5070,0.156397394554719,0.156397394554719
-5738,1493,182,0.220724132280051,0.220724132280051
-5739,182,1710,0.202718600976859,0.202718600976859
-5742,5072,5073,0.0235981208081862,0.0235981208081862
-5743,5073,5074,0.173346209176791,0.173346209176791
-5744,5074,5075,0.183560584904857,0.183560584904857
-5746,5076,5077,0.201201481229781,0.201201481229781
-5747,5077,5078,0.196158089713223,0.196158089713223
-5750,5080,304,0.450334409862505,0.450334409862505
-5755,5083,4179,0.23271473726582,0.23271473726582
-5757,5084,5085,0.100586570089845,0.100586570089845
-5758,5085,3712,0.0974495496468689,0.0974495496468689
-5759,3712,5088,0.107190885250137,0.107190885250137
-5761,1840,2612,0.176114771519943,0.176114771519943
-5762,2612,5089,0.0532850041931226,0.0532850041931226
-5763,5089,5090,0.123805391077944,0.123805391077944
-5764,5090,5091,0.0921824286504112,0.0921824286504112
-5765,5091,5092,0.0849604613604367,0.0849604613604367
-5767,5093,4077,0.0433656831085181,0.0433656831085181
-5768,4077,5094,0.807132686207363,0.807132686207363
-5769,5092,5095,0.184721084541763,0.184721084541763
-5770,5095,5096,0.112121546650621,0.112121546650621
-5771,5096,5097,0.012405493892182,0.012405493892182
-12067,8534,8532,0.0417307390941294,0.0417307390941294
-5774,5099,5100,0.195348601056539,0.195348601056539
-5775,5100,5101,1.61385249170336,1.61385249170336
-5776,4334,5102,0.201130889411283,0.201130889411283
-5778,5103,2576,0.52830768269949,0.52830768269949
-5782,1145,874,0.139433776255124,0.139433776255124
-5783,874,4462,0.13822164303959,0.13822164303959
-5784,4462,2782,0.134807869792579,0.134807869792579
-5786,5108,5109,0.136531475414142,0.136531475414142
-5787,5110,5111,0.166792389966844,0.166792389966844
-5788,5111,5112,0.0444779706577198,0.0444779706577198
-5789,5113,4169,0.194541086455447,0.194541086455447
-5790,4169,4754,0.20739031390672,0.20739031390672
-5791,4754,5114,0.19819923300798,0.19819923300798
-5792,5114,5115,0.205574207946515,0.205574207946515
-5793,5115,5116,0.18969176296687,0.18969176296687
-5795,3795,5117,0.153449380032665,0.153449380032665
-5796,5117,942,0.178860285004076,0.178860285004076
-5797,942,2226,0.181510674241125,0.181510674241125
-5798,2226,4876,0.162456954471732,0.162456954471732
-5799,4876,5118,0.192077540660028,0.192077540660028
-5800,5118,5119,0.169639680241679,0.169639680241679
-5801,5119,5120,0.176431836448169,0.176431836448169
-5805,5123,5124,0.138482206224941,0.138482206224941
-5807,5125,5126,0.196467690434778,0.196467690434778
-5809,5127,5128,0.177236972666439,0.177236972666439
-5810,5128,666,0.00411429224620583,0.00411429224620583
-5811,666,5129,0.00398081510277296,0.00398081510277296
-5812,5129,5130,0.0219503048251099,0.0219503048251099
-5813,5130,5131,0.152662411900591,0.152662411900591
-5814,5131,4605,0.174323615227633,0.174323615227633
-5815,4605,3691,0.233536002014651,0.233536002014651
-5816,3691,5132,0.0578224768050087,0.0578224768050087
-5817,4901,5133,0.0573209620432963,0.0573209620432963
-5819,5134,5135,0.102452742724465,0.102452742724465
-5820,5135,5136,0.101180875593513,0.101180875593513
-5821,5136,5137,0.0993172550227887,0.0993172550227887
-5822,5137,5138,0.0973174615516026,0.0973174615516026
-5823,5138,5139,0.0592813821516456,0.0592813821516456
-5824,5139,5140,0.0572628386692297,0.0572628386692297
-5825,5140,5141,0.0908568563064313,0.0908568563064313
-5826,5141,5142,0.108696465338082,0.108696465338082
-5827,5142,5143,0.117446225438567,0.117446225438567
-5828,5143,5144,0.115052510861077,0.115052510861077
-5831,2118,5146,0.132113404680538,0.132113404680538
-5832,5146,5147,0.0733188328504862,0.0733188328504862
-5833,5147,5148,0.0348417204507369,0.0348417204507369
-5860,3449,5168,0.101446764740706,0.101446764740706
-5835,4903,5149,0.0928559279225574,0.0928559279225574
-5836,5149,5150,0.101009488468598,0.101009488468598
-5837,5150,5151,0.101494340144734,0.101494340144734
-12222,8597,8598,0.00932829170104997,0.00932829170104997
-12223,8598,8599,0.0244824521093208,0.0244824521093208
-5838,5151,5152,0.100261540674961,0.100261540674961
-5839,5152,5153,0.221241395423211,0.221241395423211
-5840,5153,2236,0.0908651857276488,0.0908651857276488
-5841,2236,5154,0.10116756602451,0.10116756602451
-5842,5154,5155,0.114191873365342,0.114191873365342
-5843,5155,5156,0.113038208940698,0.113038208940698
-5844,5156,2119,0.121856512679973,0.121856512679973
-5845,2119,5157,0.125333022212683,0.125333022212683
-5846,5157,5158,0.121389833666029,0.121389833666029
-5847,5158,5159,0.0390946612702668,0.0390946612702668
-5850,5160,2133,0.195466658548015,0.195466658548015
-5854,5163,2476,0.202535777887142,0.202535777887142
-5856,5164,5165,0.0156138568041909,0.0156138568041909
-5857,5165,5166,0.100589160353206,0.100589160353206
-5858,5166,5167,0.104247833927165,0.104247833927165
-5859,5167,3449,0.104250422099089,0.104250422099089
-5861,5168,3879,0.102808830950679,0.102808830950679
-5862,3879,841,0.103522696858037,0.103522696858037
-5863,841,5169,0.102719682704035,0.102719682704035
-5864,5169,5170,0.0474110701835865,0.0474110701835865
-5866,5171,5172,0.106685417852495,0.106685417852495
-5867,5172,5173,0.0515553847760644,0.0515553847760644
-5868,5173,4988,0.0505202363313306,0.0505202363313306
-17163,5107,1802,0.195280530173469,0.195280530173469
-5869,4988,962,0.105015490507221,0.105015490507221
-5870,962,4141,0.100506431839732,0.100506431839732
-5871,4141,3161,0.101307790482977,0.101307790482977
-5872,3161,3620,0.0948143449717999,0.0948143449717999
-5873,3620,1826,0.102953991217456,0.102953991217456
-5874,1826,4334,0.0954488426398559,0.0954488426398559
-5876,5174,1763,0.050455869495655,0.050455869495655
-5877,1763,4616,0.0477367574799653,0.0477367574799653
-5878,4616,5175,0.0514444022852647,0.0514444022852647
-5879,5175,4306,0.0486177089369888,0.0486177089369888
-5880,4306,994,0.0512355770161431,0.0512355770161431
-5881,994,4309,0.0460747606120818,0.0460747606120818
-5882,4309,2915,0.0558782384698847,0.0558782384698847
-5883,2915,2916,0.0205535416898751,0.0205535416898751
-5909,5190,5191,0.0526195895778432,0.0526195895778432
-5887,587,588,0.0168822192889414,0.0168822192889414
-5888,588,5177,0.110837670707715,0.110837670707715
-5889,5177,1399,0.106464576541899,0.106464576541899
-5890,1399,5178,0.00837287829367045,0.00837287829367045
-5891,5178,5179,0.0973274399582508,0.0973274399582508
-5892,5179,5180,0.0713882284598403,0.0713882284598403
-5893,5180,3386,0.0465173628433736,0.0465173628433736
-5894,3386,5181,0.0466294338105993,0.0466294338105993
-5895,5181,5182,0.0461505269276214,0.0461505269276214
-5896,5182,2801,0.0476762891770853,0.0476762891770853
-5897,2801,5183,0.0462906353191723,0.0462906353191723
-5898,5183,5184,0.0462689908237556,0.0462689908237556
-5899,5184,5185,0.0466469950505128,0.0466469950505128
-5900,5185,5186,0.0471146492559741,0.0471146492559741
-5901,5186,5187,0.045278465180898,0.045278465180898
-5902,5187,1570,0.0464406557272166,0.0464406557272166
-5903,1570,1095,0.0464745881593838,0.0464745881593838
-5904,1095,5188,0.0475893065083787,0.0475893065083787
-7153,6059,6060,0.0479619125752321,0.0479619125752321
-5905,5188,5189,0.0454253204645735,0.0454253204645735
-5906,5189,1538,0.0460968804258839,0.0460968804258839
-5907,1538,3854,0.04697776477365,0.04697776477365
-5908,3854,5190,0.0530473283120516,0.0530473283120516
-5911,5192,5193,0.0515193353777817,0.0515193353777817
-5913,5194,5195,0.0687779636933597,0.0687779636933597
-5914,5195,5090,0.141994718426853,0.141994718426853
-5915,5090,5196,0.112634336237225,0.112634336237225
-5916,5196,5197,0.0575743623042855,0.0575743623042855
-5917,5197,4671,0.100935765794822,0.100935765794822
-5918,4671,4951,0.0999693670841652,0.0999693670841652
-5919,4951,5198,0.0511858126232579,0.0511858126232579
-5921,5199,5200,0.0499779255146796,0.0499779255146796
-5922,5200,5201,0.0499920394458099,0.0499920394458099
-5923,5201,5202,0.0457134833999458,0.0457134833999458
-5924,5202,5203,0.0421294446780762,0.0421294446780762
-5925,5203,3957,0.137188173752203,0.137188173752203
-5926,3957,5204,0.0640931318030062,0.0640931318030062
-5927,5204,5205,0.0544857674041209,0.0544857674041209
-5928,5205,5206,0.0521757463337926,0.0521757463337926
-5929,5207,5208,0.0487730947754618,0.0487730947754618
-5930,5208,5209,0.0493635031974476,0.0493635031974476
-5932,5211,5212,0.207489392195287,0.207489392195287
-5933,5212,4646,0.099390326989904,0.099390326989904
-5935,3645,4555,0.0986517427687235,0.0986517427687235
-5937,5213,5214,0.322259629928437,0.322259629928437
-5938,5215,5216,0.143730822686287,0.143730822686287
-5939,5216,5217,0.0599126619694891,0.0599126619694891
-5940,5217,5218,0.202016907937226,0.202016907937226
-5942,5219,5220,0.186576382334646,0.186576382334646
-5944,5221,5222,0.13343391197395,0.13343391197395
-5945,5222,2558,0.200662474351154,0.200662474351154
-5946,2558,5224,0.208372800213582,0.208372800213582
-5947,5225,4431,0.102067442103011,0.102067442103011
-5948,4431,3711,0.0989108306469789,0.0989108306469789
-5949,3711,5226,0.107183313746265,0.107183313746265
-5950,5226,1839,0.179335285582576,0.179335285582576
-17165,4242,3547,0.202237742052361,0.202237742052361
-5951,1839,2611,0.178227308228011,0.178227308228011
-5952,2611,5195,0.176210949140518,0.176210949140518
-20492,10836,10813,0.00305693422510609,0.00305693422510609
-7198,6089,1755,0.0565523921918465,0.0565523921918465
-18301,5526,5737,0.156444459924747,0.156444459924747
-5957,4512,5230,0.200430868604248,0.200430868604248
-5959,5231,5232,0.20240814685365,0.20240814685365
-5960,5232,5233,0.200177276698155,0.200177276698155
-5961,5233,5234,0.403649470879027,0.403649470879027
-5962,3278,3181,0.152742056397443,0.152742056397443
-5964,3927,3703,0.0675866941557576,0.0675866941557576
-5965,3703,708,0.0999635221991015,0.0999635221991015
-5966,708,5235,0.0981118109963614,0.0981118109963614
-5967,5235,5236,0.0989915986442654,0.0989915986442654
-5968,5236,4189,0.135714784882046,0.135714784882046
-5969,4189,2515,0.133468058331593,0.133468058331593
-5970,2515,5237,0.135326951582466,0.135326951582466
-5971,5237,4803,0.135895734874124,0.135895734874124
-5972,4803,5238,0.136371570616542,0.136371570616542
-5973,5238,5239,0.126834347813211,0.126834347813211
-5974,5239,5240,0.133492367602304,0.133492367602304
-5975,5240,4624,0.131817065741689,0.131817065741689
-7224,4702,6106,0.102350270818551,0.102350270818551
-5979,2725,5242,0.133090700331069,0.133090700331069
-5981,5243,5244,0.0777207800874593,0.0777207800874593
-5982,5244,5245,0.710188326706697,0.710188326706697
-5983,3974,5246,0.196425810260379,0.196425810260379
-5984,5246,3422,0.201357225192724,0.201357225192724
-5986,3423,5247,0.0491810142725505,0.0491810142725505
-5987,5247,5248,0.0477450735797267,0.0477450735797267
-5989,5249,5250,0.055676102895211,0.055676102895211
-5990,5250,5251,0.140244564447974,0.140244564447974
-5991,5251,5252,0.170294636723478,0.170294636723478
-5993,5253,5254,0.106323677730181,0.106323677730181
-5994,5254,5108,0.109212547805518,0.109212547805518
-5995,5108,4725,0.103272467122344,0.103272467122344
-5996,4725,5255,0.103742512264204,0.103742512264204
-5997,5255,5256,0.105340810076794,0.105340810076794
-5999,5257,3136,0.108092936006134,0.108092936006134
-6000,3136,3908,0.107682657630117,0.107682657630117
-7243,6117,6118,0.0967566510311658,0.0967566510311658
-6001,3908,1048,0.108571568461532,0.108571568461532
-6002,1048,5258,0.101973343920372,0.101973343920372
-6003,5258,5259,0.106357911571636,0.106357911571636
-6005,5260,5009,0.0315381518095178,0.0315381518095178
-6006,5009,3333,0.108118604625977,0.108118604625977
-6007,3333,5261,0.119315074925742,0.119315074925742
-6008,5261,5263,0.0963665691070474,0.0963665691070474
-6009,5263,5264,0.0432816561908272,0.0432816561908272
-6010,5264,2085,0.0535379351296007,0.0535379351296007
-6011,2085,5265,0.105640004427027,0.105640004427027
-6012,5265,4130,0.106366490545515,0.106366490545515
-6013,4130,5266,0.109451940113279,0.109451940113279
-6014,5266,5267,0.101101610243622,0.101101610243622
-6018,5269,5270,0.0982982274574071,0.0982982274574071
-6019,5270,804,0.0991956500472809,0.0991956500472809
-6020,804,5271,0.0978879869631794,0.0978879869631794
-6021,5271,5272,0.0909649766992318,0.0909649766992318
-6022,5272,5273,0.0146836193769648,0.0146836193769648
-6024,5274,1956,0.174868207801427,0.174868207801427
-6027,5275,5276,0.0506368419660478,0.0506368419660478
-6028,5276,4990,0.0537681631666927,0.0537681631666927
-6029,4990,5277,0.102832227368728,0.102832227368728
-6030,5277,5278,0.0856095541145101,0.0856095541145101
-6032,1548,4268,0.202455793335308,0.202455793335308
-6033,4268,283,0.117344693446838,0.117344693446838
-6035,4141,5279,0.202925527060843,0.202925527060843
-6036,5279,2364,0.110547560275979,0.110547560275979
-6037,2364,4146,0.176928363643229,0.176928363643229
-6038,4146,5281,0.187030458155785,0.187030458155785
-6039,5281,5282,0.011246856594195,0.011246856594195
-6041,5283,2870,0.194705331985994,0.194705331985994
-6043,5285,5286,0.301111320410511,0.301111320410511
-6044,5287,5288,0.185724938270304,0.185724938270304
-6045,5288,5289,0.213285003773079,0.213285003773079
-6047,5290,5291,0.13629389839255,0.13629389839255
-6048,5291,5292,0.13355771854799,0.13355771854799
-6049,5292,4013,0.133867532403999,0.133867532403999
-6052,5294,3384,0.128421314744864,0.128421314744864
-6053,3384,5295,0.104229219478348,0.104229219478348
-6054,5295,3817,0.102592362577248,0.102592362577248
-6056,5296,5297,0.0990440053907464,0.0990440053907464
-6057,5297,5298,0.00501097787172802,0.00501097787172802
-6058,5298,5299,0.26852367463784,0.26852367463784
-6059,5299,5300,0.02711052781377,0.02711052781377
-6060,5300,5301,0.101042477184366,0.101042477184366
-6061,5301,5302,0.0980158544732548,0.0980158544732548
-6062,5302,5303,0.68853335666363,0.68853335666363
-6063,4532,3739,0.10058657036035,0.10058657036035
-6064,3739,5305,0.101344660556636,0.101344660556636
-6065,5305,1342,0.202678391855073,0.202678391855073
-6067,5306,4700,0.20166419460726,0.20166419460726
-6068,4700,5307,0.201175175307418,0.201175175307418
-6069,5307,5308,0.201920176537304,0.201920176537304
-6070,5308,5309,0.201920207593883,0.201920207593883
-6071,5309,777,0.201196100270561,0.201196100270561
-6072,777,5310,0.185040940142678,0.185040940142678
-6073,5310,5311,0.201942415647541,0.201942415647541
-6074,5311,5312,0.206000886771111,0.206000886771111
-7322,6161,6162,0.200977808302969,0.200977808302969
-6077,1729,5313,0.145417053241999,0.145417053241999
-6079,5314,5315,0.262924523321611,0.262924523321611
-6080,5316,3497,0.142809169887552,0.142809169887552
-6082,2903,5317,0.0402215187360589,0.0402215187360589
-6083,5317,5318,0.00632191300841853,0.00632191300841853
-6084,5318,5319,0.00945274881783772,0.00945274881783772
-6085,5319,5320,0.102488283152376,0.102488283152376
-6086,5320,5321,0.105737259840933,0.105737259840933
-6087,5321,5322,0.104280118546109,0.104280118546109
-6088,5322,5323,0.105008595801197,0.105008595801197
-6089,5323,5324,0.107079302112312,0.107079302112312
-6090,5324,3311,0.104784168499708,0.104784168499708
-6091,3311,5325,0.104972132929345,0.104972132929345
-6093,5328,5329,0.148443179384572,0.148443179384572
-6094,5329,4320,0.122968314186663,0.122968314186663
-6095,4320,5331,0.133138685881437,0.133138685881437
-6096,5331,5332,0.129500346452113,0.129500346452113
-6097,5332,5072,0.094543402764425,0.094543402764425
-6098,5072,5333,0.0140267468815188,0.0140267468815188
-7348,5506,4458,0.146478928082641,0.146478928082641
-6099,5333,5334,0.0971985352126134,0.0971985352126134
-6100,5334,5335,0.0675695345311337,0.0675695345311337
-6101,5335,5336,0.135628949553031,0.135628949553031
-6102,5336,5337,0.134096180080561,0.134096180080561
-6103,5337,5338,0.121603742223712,0.121603742223712
-6104,5338,5339,0.288999775625269,0.288999775625269
-6105,5339,5340,0.295278488962845,0.295278488962845
-6106,5340,5341,0.386769671992271,0.386769671992271
-6107,5341,5342,0.199175415622423,0.199175415622423
-18500,9718,6670,0.0335166183519053,0.0335166183519053
-6108,272,2532,0.233490999842372,0.233490999842372
-6109,2532,2534,0.010275790210419,0.010275790210419
-6111,5343,5344,0.134883731263317,0.134883731263317
-6112,5344,2487,0.132908396505932,0.132908396505932
-6113,2487,2828,0.130466466605355,0.130466466605355
-6114,2828,1436,0.203164250472258,0.203164250472258
-6115,1436,5345,0.151025004833817,0.151025004833817
-6117,5346,5347,0.17552323432827,0.17552323432827
-6118,5347,3107,0.175398997422213,0.175398997422213
-6119,3107,5348,0.192385063711178,0.192385063711178
-6121,1515,5349,0.354712199012844,0.354712199012844
-6123,4219,5350,0.184992548254205,0.184992548254205
-6124,5350,5351,0.809194581386362,0.809194581386362
-6125,3828,5352,0.158319505042179,0.158319505042179
-6127,3683,5353,0.00756991430853718,0.00756991430853718
-6128,5353,5354,0.0600900021718448,0.0600900021718448
-6129,5354,5355,0.0486030977669072,0.0486030977669072
-6130,5355,5356,0.00770962942235081,0.00770962942235081
-6132,5357,5358,0.0529187112553076,0.0529187112553076
-6133,5358,5359,0.0513821813874635,0.0513821813874635
-6134,5359,5360,0.0534444522847469,0.0534444522847469
-6135,5360,5361,0.0503260757639254,0.0503260757639254
-6137,5362,5363,0.199678713236371,0.199678713236371
-6139,4554,5364,0.257952059435159,0.257952059435159
-6141,2203,5365,0.125513593247199,0.125513593247199
-6142,5365,5366,0.121103405669087,0.121103405669087
-6143,5366,5367,0.118905793541669,0.118905793541669
-6144,5367,5368,0.110432655754222,0.110432655754222
-7394,6208,6209,0.0520019237828089,0.0520019237828089
-6145,5368,4924,0.050653673780936,0.050653673780936
-6146,4924,5369,0.0113612305905717,0.0113612305905717
-6148,5370,5371,0.0511886893302135,0.0511886893302135
-6149,5371,3733,0.0547546687048594,0.0547546687048594
-6150,3733,5372,0.0739604711312813,0.0739604711312813
-6151,5372,5373,0.0333758188249575,0.0333758188249575
-6152,5373,5374,0.0326832624474652,0.0326832624474652
-6153,5374,4487,0.0687015455014252,0.0687015455014252
-6155,5375,5376,0.083676019608772,0.083676019608772
-6157,5377,5378,0.539527941615599,0.539527941615599
-6158,5379,5380,0.024339909926927,0.024339909926927
-6159,5380,5381,0.0572545808576417,0.0572545808576417
-6161,5382,5383,0.0919429478923695,0.0919429478923695
-6162,5383,4632,0.0667555867186957,0.0667555867186957
-6163,4632,4638,0.073630878201174,0.073630878201174
-6164,4638,4551,0.135095610306562,0.135095610306562
-6165,4551,5384,0.293762175707744,0.293762175707744
-6167,2098,5385,0.176238767515036,0.176238767515036
-6168,5385,3108,0.175113982885218,0.175113982885218
-6169,3108,5386,0.213105615274275,0.213105615274275
-6170,5386,5387,0.16568697132589,0.16568697132589
-6171,5387,5388,0.0444779706577198,0.0444779706577198
-6173,1958,3829,0.172873649500925,0.172873649500925
-6174,3829,3827,0.0048313839727239,0.0048313839727239
-6175,3827,5389,0.152170039924714,0.152170039924714
-6176,5389,547,0.0103214739502372,0.0103214739502372
-6177,547,3259,0.110383801281946,0.110383801281946
-6178,3259,3297,0.0174353644977756,0.0174353644977756
-6180,4220,5391,0.40468883776866,0.40468883776866
-6181,1473,5392,0.374922653008132,0.374922653008132
-6182,5392,2947,0.18613051410303,0.18613051410303
-6184,5393,5394,0.133683449538656,0.133683449538656
-6185,5394,5395,0.00436494876438714,0.00436494876438714
-6186,5395,5396,0.00413948116283948,0.00413948116283948
-6187,5396,5397,0.135591162545584,0.135591162545584
-6188,5397,5398,0.140883972058497,0.140883972058497
-6189,5398,823,0.138673141914839,0.138673141914839
-6190,823,3564,0.136111333534187,0.136111333534187
-6191,3564,5399,0.14331239683406,0.14331239683406
-6193,5400,3028,0.141885844467344,0.141885844467344
-7436,5227,5219,0.0266079784612615,0.0266079784612615
-6195,5401,5402,0.00584885314190653,0.00584885314190653
-6196,5402,5403,0.138593356569714,0.138593356569714
-6197,5403,1157,0.139497033685325,0.139497033685325
-6198,1157,878,0.139538816070218,0.139538816070218
-6199,878,4466,0.138604668182001,0.138604668182001
-6200,4466,2786,0.1346682214983,0.1346682214983
-6201,2786,5257,0.131712815882714,0.131712815882714
-6202,5257,5404,0.212033227364557,0.212033227364557
-6203,5404,5405,0.140381205630714,0.140381205630714
-6204,5405,5406,0.175882952103236,0.175882952103236
-6206,4761,5407,0.0777628340765697,0.0777628340765697
-6207,5407,5411,0.121860688460736,0.121860688460736
-6208,5411,5412,0.203436645645446,0.203436645645446
-6211,5413,3128,0.197988223180436,0.197988223180436
-6213,5414,5415,0.127346625489507,0.127346625489507
-6214,5415,5416,0.202431697844534,0.202431697844534
-6216,5417,5418,0.0360920642856509,0.0360920642856509
-18249,10283,10284,0.0379598203284706,0.0379598203284706
-6217,5418,5419,0.175688258529037,0.175688258529037
-6218,5419,5420,0.176513424391556,0.176513424391556
-6219,5420,671,0.183363162969023,0.183363162969023
-6220,671,5421,0.00332688246962709,0.00332688246962709
-6221,5421,5422,0.175194594065608,0.175194594065608
-6222,5422,4601,0.174116514777802,0.174116514777802
-6223,4601,5423,0.141050765485302,0.141050765485302
-6225,2950,5424,0.133468479991587,0.133468479991587
-6226,5425,3096,0.198372842511786,0.198372842511786
-6227,3096,3206,0.203187034114148,0.203187034114148
-6228,3206,5426,0.199398136177365,0.199398136177365
-6229,5426,1916,0.200785704053696,0.200785704053696
-6231,5427,5428,0.208049356186156,0.208049356186156
-6232,5428,5429,0.195358366621449,0.195358366621449
-6233,5429,5430,0.0822508872394256,0.0822508872394256
-6234,5431,3740,0.099853044127537,0.099853044127537
-6235,3740,5432,0.079904711368683,0.079904711368683
-6236,5432,5433,0.0177357578673254,0.0177357578673254
-6237,5433,1299,0.160881213225809,0.160881213225809
-6238,1299,1344,0.0431325120453993,0.0431325120453993
-6239,1344,5434,0.202930771593003,0.202930771593003
-6240,5434,5435,0.195937805328833,0.195937805328833
-6241,5435,4701,0.00964060014055181,0.00964060014055181
-6242,4701,5436,0.088911763330732,0.088911763330732
-6243,5436,5437,0.105079205678488,0.105079205678488
-6244,5437,5438,0.0943047001329777,0.0943047001329777
-6245,5438,5439,0.100620360394738,0.100620360394738
-6246,5439,5440,0.0146794154501444,0.0146794154501444
-6247,5440,4965,0.086276226710605,0.086276226710605
-6248,4965,5441,0.10739345579216,0.10739345579216
-6249,5441,5442,0.0951717377148208,0.0951717377148208
-6250,5442,5443,0.0976857174224503,0.0976857174224503
-6252,779,5444,0.0823735255229089,0.0823735255229089
-6253,5444,5445,0.102122427250782,0.102122427250782
-6254,5445,4958,0.133513290288167,0.133513290288167
-6255,4958,5446,0.0684224753039321,0.0684224753039321
-6256,5446,5447,0.00769468892365438,0.00769468892365438
-6257,5447,5448,0.199639504943165,0.199639504943165
-6258,5448,1501,0.201263981115328,0.201263981115328
-6259,1501,174,0.201029338652354,0.201029338652354
-6261,1704,1730,0.0545082426213867,0.0545082426213867
-6262,1730,5451,0.146076957823045,0.146076957823045
-6263,5451,5452,1.20615427321132,1.20615427321132
-6265,5456,5457,0.107171013555617,0.107171013555617
-6266,5457,5458,0.0551341429674013,0.0551341429674013
-6267,5458,5459,0.053860211885536,0.053860211885536
-6268,5459,5460,0.109859438734606,0.109859438734606
-6269,5460,5461,0.104952215686531,0.104952215686531
-6270,5461,5462,0.0537660564474852,0.0537660564474852
-6271,5462,5463,0.0468001440268365,0.0468001440268365
-6273,5464,5465,0.0487076064705391,0.0487076064705391
-6274,5465,5466,0.096682643717806,0.096682643717806
-6275,5466,5052,0.0976295695745084,0.0976295695745084
-6276,5052,5467,0.0498503558842522,0.0498503558842522
-6277,5467,5468,0.0500897185974344,0.0500897185974344
-6279,5223,978,0.0483462615206691,0.0483462615206691
-6280,978,5469,0.0500186833718628,0.0500186833718628
-6281,5469,5470,0.0466179289686935,0.0466179289686935
-6282,5470,5471,0.0496889709391185,0.0496889709391185
-6283,5471,5472,0.0500395303728477,0.0500395303728477
-6284,5472,4947,0.0500649255411997,0.0500649255411997
-6285,4947,5119,0.0486069729184005,0.0486069729184005
-6286,5119,5473,0.0497694572157541,0.0497694572157541
-6287,5473,4719,0.0482501223288259,0.0482501223288259
-6288,4719,5474,0.0825694493004343,0.0825694493004343
-6289,5474,5475,0.013401399089124,0.013401399089124
-6290,5475,5476,0.103889728134339,0.103889728134339
-6291,5476,5419,0.103815153646491,0.103815153646491
-6292,5419,5477,0.109635415021011,0.109635415021011
-6294,3890,1020,0.105962717150938,0.105962717150938
-6295,1020,5478,0.052027246508575,0.052027246508575
-6296,5478,5479,0.0524872333525023,0.0524872333525023
-6297,5479,3719,0.052252544610622,0.052252544610622
-6298,3719,5480,0.0538013756911254,0.0538013756911254
-6299,5480,5481,0.0436600330786078,0.0436600330786078
-6300,5481,5482,0.00837974421686285,0.00837974421686285
-14763,7162,4611,0.176903840452458,0.176903840452458
-6301,5482,5026,0.040489278057912,0.040489278057912
-6302,5026,3338,0.107876149200874,0.107876149200874
-6303,3338,5483,0.0990429074228521,0.0990429074228521
-6304,5483,5484,0.0966066822218646,0.0966066822218646
-6305,5484,5485,0.085086759759281,0.085086759759281
-6306,5485,5486,0.0169728889677259,0.0169728889677259
-6307,5486,2067,0.0825646387998858,0.0825646387998858
-6309,5487,2667,0.0866869262626222,0.0866869262626222
-6310,2667,2664,0.00897895817052901,0.00897895817052901
-6311,2664,4137,0.0908182867369719,0.0908182867369719
-6312,4137,5488,0.0965705527653259,0.0965705527653259
-6313,5488,5489,0.0942751679467969,0.0942751679467969
-6314,5489,5490,0.0959916716400224,0.0959916716400224
-6315,5490,3461,0.0933212956911074,0.0933212956911074
-6316,3461,5491,0.0467923341231575,0.0467923341231575
-6317,5491,5492,0.0479894648111637,0.0479894648111637
-6318,5492,5493,0.094030978726141,0.094030978726141
-6319,5493,861,0.0920531787302436,0.0920531787302436
-6320,861,5494,0.092346282981082,0.092346282981082
-6321,5494,5495,0.091117734759624,0.091117734759624
-20501,10824,10839,0.0279151158292869,0.0279151158292869
-6323,5496,5497,0.0512308809047994,0.0512308809047994
-6324,5497,5498,0.0547050066584288,0.0547050066584288
-6325,5498,5499,0.0532065647068504,0.0532065647068504
-6326,5499,5500,0.0520026026999989,0.0520026026999989
-6327,5500,5501,0.0600453089722235,0.0600453089722235
-6328,5501,5502,0.0451373924487277,0.0451373924487277
-7588,6319,6320,0.0874047970677394,0.0874047970677394
-6330,5503,5504,0.0512021800904844,0.0512021800904844
-6331,5504,5505,0.0535897595927606,0.0535897595927606
-6332,5505,5506,0.0503264318858696,0.0503264318858696
-6333,5506,5507,0.0549843628648472,0.0549843628648472
-6334,5507,3309,0.0521587927419047,0.0521587927419047
-6335,3309,5508,0.0557422576502987,0.0557422576502987
-6336,5508,5509,0.0498065817995712,0.0498065817995712
-6338,5510,5511,0.10273263586878,0.10273263586878
-6339,5511,5512,0.103095987250104,0.103095987250104
-6340,5512,3020,0.0125186689867189,0.0125186689867189
-6341,3020,5513,0.0466432236195876,0.0466432236195876
-6342,5513,4381,0.0509815437370977,0.0509815437370977
-6344,5514,5515,0.103259680904514,0.103259680904514
-6345,5515,3934,0.0990266173550878,0.0990266173550878
-6346,3934,5516,0.10122291130851,0.10122291130851
-6347,5516,3707,0.107162793104657,0.107162793104657
-6348,3707,717,0.101965718351369,0.101965718351369
-6349,717,5517,0.10489500722876,0.10489500722876
-6350,5517,5518,0.0880249775504832,0.0880249775504832
-6352,5519,4201,0.0955388621117037,0.0955388621117037
-6353,4201,1068,0.10398483351111,0.10398483351111
-6354,1068,2504,0.101881809876575,0.101881809876575
-6355,2504,5520,0.10295538196753,0.10295538196753
-6356,5520,1231,0.0964004159007037,0.0964004159007037
-6357,1231,4809,0.0995624903271375,0.0995624903271375
-6358,4809,2176,0.101169164261142,0.101169164261142
-6359,2176,5521,0.102032335854251,0.102032335854251
-6360,5521,348,0.0731550647240869,0.0731550647240869
-6361,348,351,0.0329026304601732,0.0329026304601732
-6363,5522,4629,0.122115753805888,0.122115753805888
-6364,4629,1258,0.132003632804436,0.132003632804436
-6366,377,4544,0.0548661978897115,0.0548661978897115
-6367,4544,2700,0.136738193723685,0.136738193723685
-6368,2700,5523,0.130559333935347,0.130559333935347
-6371,5525,1133,0.0486624445582808,0.0486624445582808
-6372,1133,5526,0.0510752177714687,0.0510752177714687
-6373,5526,5527,0.0534768474459495,0.0534768474459495
-6374,5527,3849,0.0993499397911337,0.0993499397911337
-20247,6972,10718,0.0278784612667637,0.0278784612667637
-6375,3849,5528,0.0502810849564127,0.0502810849564127
-6376,5528,5529,0.0506206995449551,0.0506206995449551
-6378,3432,5530,0.0954898525843842,0.0954898525843842
-6379,5530,1409,0.0985492973952367,0.0985492973952367
-6380,1409,5531,0.102140021124127,0.102140021124127
-6381,5531,3995,0.106588318724824,0.106588318724824
-6382,3995,5532,0.089989655098645,0.089989655098645
-6383,5532,5533,0.0940983975381981,0.0940983975381981
-6384,5533,3749,0.102559803256087,0.102559803256087
-6385,3749,5534,0.132377311804748,0.132377311804748
-6388,2028,5536,0.103552176267271,0.103552176267271
-6391,3402,5538,0.101285303038309,0.101285303038309
-6392,5538,5539,0.0982612440798091,0.0982612440798091
-6393,5539,5540,0.104203916508807,0.104203916508807
-6394,5540,5541,0.0994909347746214,0.0994909347746214
-6395,5541,5542,0.0496866830167122,0.0496866830167122
-6396,5542,1115,0.0483270289965061,0.0483270289965061
-6397,1115,5543,0.0505090974663915,0.0505090974663915
-6398,5543,5544,0.051466523607823,0.051466523607823
-6399,5544,5545,0.0509771831188889,0.0509771831188889
-18369,6894,6889,0.0506808956189271,0.0506808956189271
-6400,5545,3837,0.0484293465449961,0.0484293465449961
-6402,5546,5547,0.0572465530818606,0.0572465530818606
-6403,5547,4036,0.051041556606541,0.051041556606541
-6404,4036,5548,0.0609619584955507,0.0609619584955507
-6405,1878,4178,0.0543518295000293,0.0543518295000293
-6406,4178,5549,0.0885356562805968,0.0885356562805968
-6408,1863,2630,0.0954187587481574,0.0954187587481574
-6409,2630,2609,0.0942841337329746,0.0942841337329746
-6410,2609,5207,0.106776685868403,0.106776685868403
-6411,5207,5191,0.0702035466323056,0.0702035466323056
-6412,5191,5550,0.105689823753241,0.105689823753241
-6414,5551,5552,0.13548002915508,0.13548002915508
-6415,5552,5553,0.0682592832885596,0.0682592832885596
-6416,5553,19,0.0650116042038798,0.0650116042038798
-6417,19,2991,0.133631170313494,0.133631170313494
-6418,2991,5554,0.0524731372315077,0.0524731372315077
-6419,5554,1882,0.0490816557393864,0.0490816557393864
-6420,1882,5555,0.0508829391590993,0.0508829391590993
-6421,5555,5556,0.0494818870663145,0.0494818870663145
-6422,5556,5557,0.0511609921162368,0.0511609921162368
-6423,5557,5558,0.0498069369814246,0.0498069369814246
-6424,5558,5559,0.0494751154031395,0.0494751154031395
-6425,5559,5560,0.0510095826256232,0.0510095826256232
-18695,5978,4055,0.196460738141722,0.196460738141722
-6426,5560,5561,0.100658038986824,0.100658038986824
-6427,5561,5562,0.100189919501299,0.100189919501299
-6428,5562,5243,0.0999621826427635,0.0999621826427635
-6429,5243,5563,0.0514845629022423,0.0514845629022423
-6430,5563,5564,0.0509507800422364,0.0509507800422364
-6431,5564,5565,0.0506384299937204,0.0506384299937204
-6432,5565,5566,0.0502094012018427,0.0502094012018427
-6433,5566,5567,0.0352773306402212,0.0352773306402212
-6434,5567,1696,0.0663073245001768,0.0663073245001768
-6435,1696,5568,0.200475700974595,0.200475700974595
-6436,5568,2444,0.175243279627828,0.175243279627828
-6438,5569,5570,0.150878938410471,0.150878938410471
-6439,5570,5571,0.0520399442807291,0.0520399442807291
-6440,5571,5572,0.00805055351559969,0.00805055351559969
-6441,5572,5573,0.0547971824088202,0.0547971824088202
-6442,5573,5529,0.0419651880906561,0.0419651880906561
-6443,5529,5574,0.00738334312936163,0.00738334312936163
-6444,5574,5575,0.0892116998808573,0.0892116998808573
-6445,5575,5576,0.0587189734757016,0.0587189734757016
-6446,5576,5577,0.143444822058071,0.143444822058071
-6447,5577,5578,0.0305007791534936,0.0305007791534936
-6448,5578,5579,0.0181914980281834,0.0181914980281834
-6449,5579,5580,0.150469022298562,0.150469022298562
-6450,5580,5581,0.204922214354376,0.204922214354376
-6451,5581,5582,0.0983186744589269,0.0983186744589269
-6452,5582,1433,0.108782481382419,0.108782481382419
-6453,1433,5583,0.123482673613688,0.123482673613688
-6454,5583,5584,0.0754033254163114,0.0754033254163114
-6455,5584,5585,0.194791277181441,0.194791277181441
-6456,5585,5586,0.0533068649535537,0.0533068649535537
-6457,5586,2555,0.14827848293408,0.14827848293408
-6458,2555,5587,0.408042656170713,0.408042656170713
-6459,5588,5589,0.135112968623698,0.135112968623698
-6460,5589,5590,0.203702085134274,0.203702085134274
-6461,5590,5591,0.207620262278034,0.207620262278034
-6462,5591,4585,0.131035476997682,0.131035476997682
-6463,4585,5592,0.072769358589151,0.072769358589151
-6464,5592,5593,0.0625746572307696,0.0625746572307696
-6465,5593,5301,0.137225765514935,0.137225765514935
-6467,5594,5595,0.274145349571988,0.274145349571988
-6468,5595,5596,0.205443804135366,0.205443804135366
-6469,5596,5597,0.121926623756206,0.121926623756206
-6470,5597,5598,0.202580256912195,0.202580256912195
-6472,4361,5599,0.206258701511779,0.206258701511779
-6474,5600,5601,0.168149469233138,0.168149469233138
-6476,2625,5205,0.166253482314503,0.166253482314503
-6502,5622,5516,0.138783948073856,0.138783948073856
-6477,5205,5602,0.15603138237828,0.15603138237828
-6478,5602,5603,0.0341829476854199,0.0341829476854199
-6479,5603,5604,0.162233690102157,0.162233690102157
-6480,5604,5605,0.176890418224524,0.176890418224524
-6481,5605,5606,0.121703194532156,0.121703194532156
-6482,5606,5609,0.0547747917576354,0.0547747917576354
-6483,5609,5610,0.177274555583034,0.177274555583034
-6484,5610,5611,0.0562757523743122,0.0562757523743122
-6485,5611,5381,0.0971287684245127,0.0971287684245127
-6486,5381,5370,0.0242294178668139,0.0242294178668139
-6487,5370,5612,0.177146422666141,0.177146422666141
-6488,5612,5613,0.176947014024794,0.176947014024794
-6489,5613,5614,0.177715418603807,0.177715418603807
-6490,5614,5615,0.0918268918834614,0.0918268918834614
-6491,5615,5616,0.00795060277662081,0.00795060277662081
-6493,5617,5618,0.0159556400855116,0.0159556400855116
-6496,5619,5620,0.132547309025511,0.132547309025511
-6497,5620,1667,0.132931219459218,0.132931219459218
-6498,1667,5621,0.138273532739947,0.138273532739947
-6499,5621,2448,0.13601631946961,0.13601631946961
-6500,2448,3238,0.136726308588665,0.136726308588665
-6501,3238,5622,0.14083949408811,0.14083949408811
-6503,5516,5623,0.135704638458681,0.135704638458681
-6504,5623,5624,0.00588469429500613,0.00588469429500613
-6505,5624,5625,0.115900802279231,0.115900802279231
-6506,5625,5626,0.19877742240622,0.19877742240622
-6507,5626,110,0.101954628240396,0.101954628240396
-6508,110,2818,0.0990079626838536,0.0990079626838536
-6509,2818,1419,0.203073935940985,0.203073935940985
-6510,1419,5627,0.11954884298017,0.11954884298017
-6511,2917,5628,0.0366435746314918,0.0366435746314918
-6513,3710,5629,0.104723848956837,0.104723848956837
-6514,5629,5630,0.0524718119166661,0.0524718119166661
-6515,5630,5631,0.0523604583661445,0.0523604583661445
-6516,5631,963,0.102688945741692,0.102688945741692
-6519,2898,5632,0.0542316769914945,0.0542316769914945
-6520,5632,5633,0.0508977749431617,0.0508977749431617
-6521,5633,5634,0.106035617894042,0.106035617894042
-6522,5634,4734,0.104599442261749,0.104599442261749
-6524,5635,5399,0.0949731678048623,0.0949731678048623
-6525,5399,5636,0.053273863098243,0.053273863098243
-6526,5636,5637,0.0532054766684841,0.0532054766684841
-6527,5637,3901,0.105282590951624,0.105282590951624
-6528,3901,1038,0.105350981348288,0.105350981348288
-6530,5638,5639,0.103436146317209,0.103436146317209
-6531,5639,5004,0.104923546637106,0.104923546637106
-6532,5004,3324,0.10200854500581,0.10200854500581
-20515,10842,6731,0.00724303302685487,0.00724303302685487
-6533,3324,5640,0.105949384946318,0.105949384946318
-6534,5640,5641,0.102726616753478,0.102726616753478
-6535,5641,2075,0.105470656717315,0.105470656717315
-6536,2075,2672,0.106385362776241,0.106385362776241
-6537,2672,4122,0.107308593371936,0.107308593371936
-6538,4122,5642,0.107983920400391,0.107983920400391
-6539,5642,5643,0.0919555733248638,0.0919555733248638
-7832,6456,349,0.0697483782641925,0.0697483782641925
-6540,5643,5644,0.101410180701687,0.101410180701687
-6541,5644,3470,0.100777601888944,0.100777601888944
-6542,3470,5645,0.101863251928372,0.101863251928372
-6543,5645,3873,0.0981959903542781,0.0981959903542781
-6544,3873,849,0.100085165894781,0.100085165894781
-6546,1400,5646,0.00898751016812899,0.00898751016812899
-6547,5646,5647,0.190632434837625,0.190632434837625
-6548,5647,3388,0.011727623160982,0.011727623160982
-6549,3388,5648,0.0568259028608414,0.0568259028608414
-6550,5648,5649,0.00637619061562419,0.00637619061562419
-6551,5649,5650,0.0463019954871414,0.0463019954871414
-6552,5650,2800,0.0477133812275841,0.0477133812275841
-6553,2800,5651,0.0470719166287448,0.0470719166287448
-6554,5651,5652,0.0458325636837201,0.0458325636837201
-6555,5652,5653,0.046653544202397,0.046653544202397
-6556,5653,5654,0.0464726377537293,0.0464726377537293
-6557,5654,5655,0.0469344544346564,0.0469344544346564
-6558,5655,2751,0.046215112991852,0.046215112991852
-6559,2751,1096,0.0461039483088431,0.0461039483088431
-6560,1096,5656,0.0452023576254509,0.0452023576254509
-6561,5656,5657,0.0460150379661812,0.0460150379661812
-6562,5657,1539,0.0464321875423527,0.0464321875423527
-6563,1539,3855,0.0473472190950861,0.0473472190950861
-6565,4485,345,0.22138299033862,0.22138299033862
-6566,345,5661,0.163308085042962,0.163308085042962
-6567,5661,5662,0.065819748510902,0.065819748510902
-6568,5661,5663,0.0801840013229962,0.0801840013229962
-6569,3287,5665,0.0688755620206119,0.0688755620206119
-6570,5665,5666,0.0427865432685629,0.0427865432685629
-6571,5666,523,0.0741847082758752,0.0741847082758752
-6572,523,5667,0.0513515905827488,0.0513515905827488
-6573,5667,597,0.0787762757947461,0.0787762757947461
-6574,597,4825,0.152733980621547,0.152733980621547
-6576,2530,1931,0.0607754389242505,0.0607754389242505
-6578,5668,5669,0.20518077925237,0.20518077925237
-6580,5670,2976,0.052930873102536,0.052930873102536
-6582,5671,5672,0.0669604143503768,0.0669604143503768
-6583,5672,3722,0.0539771509338677,0.0539771509338677
-6584,3722,5673,0.103203771462203,0.103203771462203
-6585,5673,5674,0.175725539559539,0.175725539559539
-6587,5675,5676,0.204879915807757,0.204879915807757
-6588,5677,5678,0.00677682168687122,0.00677682168687122
-6589,5678,1665,0.0567234226799308,0.0567234226799308
-6590,1665,5679,0.122659531226911,0.122659531226911
-6592,5680,5681,0.862768870925976,0.862768870925976
-6593,5682,5683,0.164927546324728,0.164927546324728
-6594,5683,4367,0.0355730578333277,0.0355730578333277
-6595,4367,1448,0.193853665061985,0.193853665061985
-6596,1448,5688,0.205590441563944,0.205590441563944
-6598,5689,5690,0.100594816308247,0.100594816308247
-6599,5690,5691,0.0991234853564762,0.0991234853564762
-6601,5438,5692,0.211107914724763,0.211107914724763
-6602,5692,4415,0.193109246091061,0.193109246091061
-6603,4415,5693,0.226139344299967,0.226139344299967
-6606,4323,5694,0.0859068688818743,0.0859068688818743
-6608,5695,5696,0.0748977449692987,0.0748977449692987
-6609,5696,5073,0.0868839085552243,0.0868839085552243
-6610,5073,5333,0.0187220275557185,0.0187220275557185
-6612,5697,1590,0.201198112839976,0.201198112839976
-18141,10274,10269,0.134684266769083,0.134684266769083
-6613,1590,1640,0.20125093456728,0.20125093456728
-6615,5698,5699,0.200385663675414,0.200385663675414
-6617,5700,5701,0.196514919519562,0.196514919519562
-6618,5701,5248,0.110632746994,0.110632746994
-6619,5248,5702,0.0945616875172071,0.0945616875172071
-6620,5702,1685,0.205454867561864,0.205454867561864
-6621,1685,5703,0.206063854698429,0.206063854698429
-6622,5703,2430,0.199691165132387,0.199691165132387
-6623,2430,5704,0.202603259150386,0.202603259150386
-6625,4504,4050,0.176201016140026,0.176201016140026
-6626,4050,5707,0.173108439499024,0.173108439499024
-6628,1851,2587,0.179402678295732,0.179402678295732
-6630,5708,5709,0.275624196707738,0.275624196707738
-6632,5710,5711,0.261275347332411,0.261275347332411
-6634,5712,5713,0.0444779706577198,0.0444779706577198
-6635,5714,5715,0.183336097782058,0.183336097782058
-6636,5715,5716,0.203064462732684,0.203064462732684
-6638,5717,5718,0.153081250432522,0.153081250432522
-6639,5718,5719,0.011675447758709,0.011675447758709
-6641,1422,5720,0.117935613657917,0.117935613657917
-6643,5721,5722,0.194099197890973,0.194099197890973
-6644,5722,2542,0.201930616083342,0.201930616083342
-6645,2542,5723,0.411877202316789,0.411877202316789
-6646,5724,624,0.116891424974631,0.116891424974631
-6648,5725,5726,0.225973303098124,0.225973303098124
-6649,5726,3656,0.0613034024300807,0.0613034024300807
-6651,5727,5728,0.116763945302488,0.116763945302488
-6652,3634,5729,0.249262670016259,0.249262670016259
-6653,5729,5730,0.0886979206005476,0.0886979206005476
-6654,5730,5731,0.061003880318824,0.061003880318824
-6655,5731,3294,0.169569384240282,0.169569384240282
-6657,5730,5729,0.0886979206005476,0.0886979206005476
-18322,2543,7478,0.411854888798545,0.411854888798545
-6660,716,5733,0.106180030125168,0.106180030125168
-6661,5733,5734,0.0889628078792179,0.0889628078792179
-6663,5735,5736,0.0499420076759338,0.0499420076759338
-6664,5736,1132,0.0480445960055664,0.0480445960055664
-6665,1132,5737,0.0493807651843696,0.0493807651843696
-6666,5737,5738,0.0542607296398929,0.0542607296398929
-6667,5738,3848,0.102653360815707,0.102653360815707
-6668,3848,5739,0.0481952973910705,0.0481952973910705
-6669,5739,5570,0.0504068578554883,0.0504068578554883
-6671,5740,5741,0.102055279401325,0.102055279401325
-6672,5741,3933,0.103350213888063,0.103350213888063
-6675,5742,4200,0.0968208569301817,0.0968208569301817
-6676,4200,4193,0.0357662020116287,0.0357662020116287
-6677,4193,1067,0.0660115016724451,0.0660115016724451
-6678,1067,2520,0.0682249892032966,0.0682249892032966
-6679,2520,2503,0.0444235862340648,0.0444235862340648
-6680,2503,5743,0.0929237526477458,0.0929237526477458
-6681,5743,1230,0.097564382820973,0.097564382820973
-6682,1230,4808,0.0974618272678182,0.0974618272678182
-6683,4808,2175,0.100974351727253,0.100974351727253
-6685,5744,5745,0.139227813146129,0.139227813146129
-20421,10782,10783,0.171335167034037,0.171335167034037
-6686,5745,4628,0.122998125096167,0.122998125096167
-6687,4628,378,0.0772242252157125,0.0772242252157125
-6688,378,1257,0.0550380704812319,0.0550380704812319
-6689,1257,4543,0.132381944494249,0.132381944494249
-6690,4543,2715,0.0724896248395526,0.0724896248395526
-7972,6547,5411,0.11011441218455,0.11011441218455
-6691,2715,2699,0.0727973179644107,0.0727973179644107
-6692,2699,5748,0.121810190364873,0.121810190364873
-6696,5750,5751,0.00763183841002978,0.00763183841002978
-6697,5751,5752,0.692257458082336,0.692257458082336
-6698,2026,4672,0.134236367930218,0.134236367930218
-6699,4672,5753,0.102239429594337,0.102239429594337
-6700,5753,5754,0.100506379378587,0.100506379378587
-6702,5755,5756,0.2002287044093,0.2002287044093
-6704,5757,5758,0.173042563926175,0.173042563926175
-6706,5759,744,0.063721377479395,0.063721377479395
-6707,744,1562,0.141424652289019,0.141424652289019
-6708,1562,5760,0.139452228533295,0.139452228533295
-6709,5760,5761,0.121153404070921,0.121153404070921
-6710,5761,5762,0.0103214683330101,0.0103214683330101
-6711,5762,5763,0.04652452941841,0.04652452941841
-6712,5764,5765,0.155984788161682,0.155984788161682
-6716,5767,5768,0.200784793626825,0.200784793626825
-6743,3756,5769,0.0494129956173261,0.0494129956173261
-7994,6557,2764,0.0940480727939324,0.0940480727939324
-6717,5768,5772,0.846413211947238,0.846413211947238
-6718,5772,517,0.0606861281340196,0.0606861281340196
-6719,517,5773,0.188473310975888,0.188473310975888
-6721,5774,5775,0.0796153059223016,0.0796153059223016
-6722,5775,5776,0.00646390558051832,0.00646390558051832
-6723,5776,3007,0.1066159594542,0.1066159594542
-6724,3007,5777,0.100407769542541,0.100407769542541
-6725,5777,4393,0.00579135202620092,0.00579135202620092
-6726,4393,5778,0.102044175747327,0.102044175747327
-6727,5778,5779,0.107668499777307,0.107668499777307
-6728,5779,5780,0.108043382155599,0.108043382155599
-6729,5780,5781,0.101222003009649,0.101222003009649
-6730,5781,5782,0.103527244594317,0.103527244594317
-6733,5784,5785,0.0519740547318723,0.0519740547318723
-6734,5785,5786,0.0540518378903488,0.0540518378903488
-6735,5786,5787,0.105403398355375,0.105403398355375
-6736,5787,5788,0.0515636589786252,0.0515636589786252
-6737,5788,5789,0.0542361941294726,0.0542361941294726
-6738,5789,1159,0.0519632563805573,0.0519632563805573
-6739,1159,1609,0.055296326623055,0.055296326623055
-6742,5791,3756,0.0502859716725157,0.0502859716725157
-6744,5769,5792,0.0505152652453619,0.0505152652453619
-6745,5792,5793,0.0487326254633791,0.0487326254633791
-6746,5793,5794,0.0492772484970981,0.0492772484970981
-6747,5794,5795,0.0490197084274457,0.0490197084274457
-6748,5795,4008,0.0494402902066907,0.0494402902066907
-6749,4008,5796,0.0498144967732103,0.0498144967732103
-6750,5796,5797,0.0492676243070722,0.0492676243070722
-6751,5797,5798,0.0496699296957128,0.0496699296957128
-6752,5798,1392,0.0490530110641543,0.0490530110641543
-6753,1392,5799,0.0511729331725758,0.0511729331725758
-6755,5800,5801,0.0504747882864981,0.0504747882864981
-6756,5801,2540,0.0519704512694329,0.0519704512694329
-6758,5802,5803,0.0134893781959873,0.0134893781959873
-6759,5803,5804,0.0651761990637723,0.0651761990637723
-6760,5804,5805,0.00867856878189995,0.00867856878189995
-6761,5805,5806,0.145096674327765,0.145096674327765
-6762,5806,5807,0.146807263740651,0.146807263740651
-6763,5807,5808,0.0971857772299024,0.0971857772299024
-8041,6591,5218,0.10367384999594,0.10367384999594
-6766,5810,5811,0.146768415759705,0.146768415759705
-6768,1701,5812,0.0556890737408001,0.0556890737408001
-6769,5812,5813,0.0500299056894462,0.0500299056894462
-6770,5813,572,0.048773855210923,0.048773855210923
-6771,572,4985,0.0488849816155661,0.0488849816155661
-6772,4985,5815,0.0487728428614096,0.0487728428614096
-6773,5815,5816,0.0486567223604475,0.0486567223604475
-6774,5816,5817,0.0490027802416811,0.0490027802416811
-6775,5817,5819,0.0533578755133891,0.0533578755133891
-6776,5819,5820,0.0539390556466382,0.0539390556466382
-6778,5821,5822,0.0489941039004867,0.0489941039004867
-6780,3617,5823,0.0506292858836976,0.0506292858836976
-6781,5823,5824,0.0500724300001191,0.0500724300001191
-6782,5824,5825,0.0499880884355422,0.0499880884355422
-6783,5825,5099,0.0484306981291016,0.0484306981291016
-6784,5099,5826,0.0978349213689401,0.0978349213689401
-8066,6604,2108,0.411848469661871,0.411848469661871
-6786,3484,5827,0.0514683137992155,0.0514683137992155
-6787,5827,5828,0.0484135897290906,0.0484135897290906
-6789,5829,3698,0.0457527085543311,0.0457527085543311
-6790,3698,5705,0.0484471809833024,0.0484471809833024
-6791,5705,4572,0.0515108919391295,0.0515108919391295
-6792,4572,5830,0.105767692426024,0.105767692426024
-6793,5830,5831,0.0553912495449553,0.0553912495449553
-6794,5831,5832,0.0496407969110197,0.0496407969110197
-6795,5832,5833,0.0474198419855964,0.0474198419855964
-6796,5833,5834,0.0495588851512039,0.0495588851512039
-6797,5834,5835,0.0489032950107884,0.0489032950107884
-6798,5835,2741,0.0480512246257303,0.0480512246257303
-6800,5836,5232,0.0488850197079726,0.0488850197079726
-6801,5232,5837,0.0498079610709467,0.0498079610709467
-6802,5837,3174,0.0480709718129458,0.0480709718129458
-6803,3174,5838,0.0510747433773575,0.0510747433773575
-6804,5838,4999,0.0480555922075882,0.0480555922075882
-8084,6614,6615,0.0939591856631224,0.0939591856631224
-6805,4999,5839,0.0491139247433474,0.0491139247433474
-6806,5839,731,0.0513728158017048,0.0513728158017048
-18529,9525,9153,0.0559524577768326,0.0559524577768326
-6807,731,5840,0.100363141472313,0.100363141472313
-6810,4683,1528,0.0512242368793757,0.0512242368793757
-6811,1528,5087,0.0490096920376181,0.0490096920376181
-6812,5087,5841,0.0531197353238214,0.0531197353238214
-6813,5841,5011,0.0514391840217863,0.0514391840217863
-6814,5011,1747,0.0499193361712115,0.0499193361712115
-6815,1747,5608,0.0521168381912245,0.0521168381912245
-6816,5608,5842,0.0474458476070982,0.0474458476070982
-6817,5842,5449,0.0516188826793533,0.0516188826793533
-6818,5449,5428,0.0497563082276933,0.0497563082276933
-6819,5428,5390,0.0522374705433985,0.0522374705433985
-6820,5390,5843,0.0480447601658553,0.0480447601658553
-6822,5844,5845,0.0146913941785162,0.0146913941785162
-6823,5845,1699,0.184528247922268,0.184528247922268
-6824,1699,5846,0.0932680068963059,0.0932680068963059
-6825,5846,5847,0.0932852372069282,0.0932852372069282
-6826,5847,3120,0.098410300465854,0.098410300465854
-6827,3120,5848,0.0905968964383526,0.0905968964383526
-6828,5848,5849,0.19461602791519,0.19461602791519
-8104,239,6631,0.0428753899381976,0.0428753899381976
-6830,5850,5851,0.0206820775273506,0.0206820775273506
-6833,1635,5853,0.0933590693142476,0.0933590693142476
-6834,5853,5854,0.015431953306933,0.015431953306933
-6835,5854,4213,0.0860217230993429,0.0860217230993429
-6836,4213,5855,0.0995731813164872,0.0995731813164872
-6837,5855,192,0.102944368273924,0.102944368273924
-6838,192,2922,0.0977156398673512,0.0977156398673512
-6840,5305,1460,0.094441811393562,0.094441811393562
-6841,1460,5433,0.104542660065313,0.104542660065313
-6843,5856,1868,0.210287860037949,0.210287860037949
-6844,1868,4186,0.189585415099738,0.189585415099738
-6846,5432,5857,0.104903215241116,0.104903215241116
-6847,5857,5858,0.105720950651237,0.105720950651237
-6848,5858,5859,0.105743888331652,0.105743888331652
-6849,5859,4421,0.104252361029944,0.104252361029944
-6852,5861,5862,0.0519463280728807,0.0519463280728807
-6853,5862,5863,0.0520746976816124,0.0520746976816124
-6854,5863,5864,0.053223022054701,0.053223022054701
-6855,5864,4317,0.0510499917933612,0.0510499917933612
-8127,6232,6642,0.179146147134138,0.179146147134138
-6857,5865,4505,0.0514748271562017,0.0514748271562017
-6858,4505,3608,0.0515275362522861,0.0515275362522861
-6859,3608,5866,0.050240952107019,0.050240952107019
-6860,5866,5867,0.0507479546434346,0.0507479546434346
-6861,5867,5067,0.0521453287858806,0.0521453287858806
-6862,5067,5868,0.051338093574988,0.051338093574988
-6863,5868,5869,0.0516032507649761,0.0516032507649761
-6864,5869,5870,0.0504748368648883,0.0504748368648883
-6865,5870,5871,0.0517263613465763,0.0517263613465763
-6866,5871,5872,0.102624635673,0.102624635673
-6867,5872,3299,0.100255573957512,0.100255573957512
-6869,5873,5874,0.0663164411935832,0.0663164411935832
-6870,5874,5875,0.0488050085545576,0.0488050085545576
-6871,5875,5876,0.702184603750594,0.702184603750594
-6874,4525,5880,0.0113022768719971,0.0113022768719971
-6875,5880,5881,0.00806516295239482,0.00806516295239482
-6876,5881,5882,0.0293119532501538,0.0293119532501538
-6877,5882,5883,0.0236481545130312,0.0236481545130312
-6878,5883,5884,0.0171068759325808,0.0171068759325808
-6879,5884,5885,0.034181660212992,0.034181660212992
-6880,5885,5887,0.100387180512852,0.100387180512852
-6882,4433,5888,0.29159089003557,0.29159089003557
-6883,5888,4667,0.102395884967111,0.102395884967111
-6885,1334,1389,0.100271016747699,0.100271016747699
-6886,1389,5889,0.10737593920352,0.10737593920352
-6887,5889,5890,0.105882607972477,0.105882607972477
-6888,5890,4707,0.0969202900217867,0.0969202900217867
-6889,4707,5891,0.0993764614715991,0.0993764614715991
-6890,5891,5892,0.0973957865151901,0.0973957865151901
-6891,5892,5894,0.0203600085186263,0.0203600085186263
-6893,5697,5895,0.0355610028885881,0.0355610028885881
-6894,5895,5896,0.0640153359599377,0.0640153359599377
-6896,4960,5897,0.0913255616395888,0.0913255616395888
-6897,5897,766,0.157641216727225,0.157641216727225
-6898,766,5898,0.395381245817633,0.395381245817633
-6899,5898,5899,0.0981801741162947,0.0981801741162947
-6900,5899,5900,0.174689811260162,0.174689811260162
-6902,2304,156,0.331433636002878,0.331433636002878
-6903,156,1720,0.249409879986366,0.249409879986366
-6904,1720,5901,0.152027484629828,0.152027484629828
-6906,5902,5903,1.05455714042968,1.05455714042968
-6907,491,5904,0.0146888160266615,0.0146888160266615
-6908,5904,5905,0.0975979556077691,0.0975979556077691
-6910,5906,5907,0.0945117172125904,0.0945117172125904
-6911,5907,5908,0.096024253167286,0.096024253167286
-6913,1999,3359,0.0933322730569792,0.0933322730569792
-6914,3359,2753,0.0957031890234733,0.0957031890234733
-6915,2753,5909,0.0964098595755736,0.0964098595755736
-6916,5909,2279,0.103797892128295,0.103797892128295
-6917,2279,3601,0.0979307072208472,0.0979307072208472
-6918,3601,5910,0.101687049589159,0.101687049589159
-6919,5910,2134,0.103076736979193,0.103076736979193
-6920,2134,5911,0.0994872973933105,0.0994872973933105
-6921,5911,5912,0.098205073412404,0.098205073412404
-6944,5930,5931,0.00713304879374381,0.00713304879374381
-6922,5912,5913,1.00880972234204,1.00880972234204
-6923,5914,3921,0.0830806742363044,0.0830806742363044
-6924,3921,1014,0.0989804018365723,0.0989804018365723
-6925,1014,5915,0.0998222515540108,0.0998222515540108
-6926,5915,5916,0.104139822117371,0.104139822117371
-6927,5916,5023,0.0793768943130485,0.0793768943130485
-6929,5917,5918,0.112165266092601,0.112165266092601
-6930,5918,5919,0.108065845165718,0.108065845165718
-6931,5919,5920,0.0537421133423824,0.0537421133423824
-6932,5920,5921,0.0547683090118863,0.0547683090118863
-6933,5921,5922,0.0617512871216813,0.0617512871216813
-6934,5922,5923,0.0505486132029595,0.0505486132029595
-6935,5923,5924,0.0485674117985671,0.0485674117985671
-6936,5924,5925,0.00910751947845144,0.00910751947845144
-6937,5925,3160,0.040672974998317,0.040672974998317
-6938,3160,5926,0.0119123696733134,0.0119123696733134
-6939,5926,5927,0.0422638247579918,0.0422638247579918
-6940,5927,5928,0.00946046354749371,0.00946046354749371
-6941,5928,4978,0.0392608349230605,0.0392608349230605
-6942,4978,5929,0.00830374951839601,0.00830374951839601
-6943,5929,5930,0.04322033436118,0.04322033436118
-12307,8642,8643,0.0298175315684779,0.0298175315684779
-6945,5931,5932,0.0454758802600548,0.0454758802600548
-6946,5932,5933,0.0473060152011751,0.0473060152011751
-6947,5933,5934,0.0496187677804403,0.0496187677804403
-6948,5934,5935,0.0504477908402203,0.0504477908402203
-6949,5935,5050,0.0515402266931002,0.0515402266931002
-6950,5050,5687,0.0468197679026621,0.0468197679026621
-6953,5453,982,0.0502364246424336,0.0502364246424336
-6954,982,5937,0.0968891441459385,0.0968891441459385
-6955,5937,5938,0.0503259455718068,0.0503259455718068
-6956,5938,5939,0.0502893520356679,0.0502893520356679
-6957,5939,3129,0.0485573864514234,0.0485573864514234
-6958,3129,5117,0.0498372694791184,0.0498372694791184
-6959,5117,5941,0.0493022558846739,0.0493022558846739
-6960,5941,4716,0.0507626244890517,0.0507626244890517
-6961,4716,5942,0.142284142826663,0.142284142826663
-6963,5943,5944,0.01393899602166,0.01393899602166
-6964,5944,5945,0.364458473389243,0.364458473389243
-6965,5945,5946,0.0993153072226578,0.0993153072226578
-6966,5946,5947,0.101492282005104,0.101492282005104
-6967,5947,5948,0.101164116161519,0.101164116161519
-6968,5948,5949,0.102917574680079,0.102917574680079
-6969,5949,5950,0.099000654458151,0.099000654458151
-6970,5950,5951,0.102683540906436,0.102683540906436
-6972,5952,5145,0.0645729302199529,0.0645729302199529
-6973,5145,2119,0.0381578888853594,0.0381578888853594
-6975,5953,5954,0.100685153983508,0.100685153983508
-6976,5954,5955,0.195476970380349,0.195476970380349
-6978,5511,5956,0.144816938742182,0.144816938742182
-6979,5956,2899,0.0164641943336492,0.0164641943336492
-6981,5957,5776,0.0786471324555583,0.0786471324555583
-6982,5776,5958,0.142074016754489,0.142074016754489
-6984,5959,5960,0.119153206354199,0.119153206354199
-6985,5960,5961,0.0270871445537288,0.0270871445537288
-6986,5961,5962,0.145839788109516,0.145839788109516
-6987,5962,5963,0.00712354730707594,0.00712354730707594
-6988,5963,5964,0.140131025523345,0.140131025523345
-6989,5964,5965,0.140225597174846,0.140225597174846
-6990,5965,4943,0.0161740048379517,0.0161740048379517
-6992,5354,5966,0.0365984296224293,0.0365984296224293
-8275,6722,2311,0.00867549185460531,0.00867549185460531
-6993,5966,5967,0.107476511645453,0.107476511645453
-6994,5967,5968,0.147256677185358,0.147256677185358
-6995,5968,5969,0.146721278462678,0.146721278462678
-6996,5969,5361,0.147170892096024,0.147170892096024
-6997,5361,2684,0.148391053722383,0.148391053722383
-6999,5970,807,0.0217813759552713,0.0217813759552713
-7001,5971,4332,0.0931508534748433,0.0931508534748433
-7002,4332,5038,0.0953468172233397,0.0953468172233397
-7004,5972,5857,0.176936009900748,0.176936009900748
-7005,5857,1300,0.178425403895618,0.178425403895618
-7006,1300,5973,0.247668336727678,0.247668336727678
-7008,5974,5975,0.19695744936537,0.19695744936537
-7010,1502,4378,0.103568243200344,0.103568243200344
-7012,5976,2341,0.175343347413509,0.175343347413509
-7013,2341,5977,0.176971375987128,0.176971375987128
-7014,5977,4784,0.243234077821538,0.243234077821538
-7015,4784,5979,0.240492752461347,0.240492752461347
-7016,5979,5980,0.0330257004550899,0.0330257004550899
-7017,5980,5981,0.271622774119548,0.271622774119548
-7018,5981,5982,0.132843712894559,0.132843712894559
-7020,5983,5984,0.0865708728240205,0.0865708728240205
-7021,5984,5985,0.115162845747273,0.115162845747273
-7023,758,5986,0.228351368086018,0.228351368086018
-7026,5146,5157,0.0344312485594002,0.0344312485594002
-7027,5157,5953,0.0793791794144798,0.0793791794144798
-7028,5953,2240,0.201141072863101,0.201141072863101
-7029,2240,4913,0.204101361959596,0.204101361959596
-7031,5988,5989,0.202410682591791,0.202410682591791
-7032,5989,5990,0.204104998697393,0.204104998697393
-7033,5990,689,0.195952399265096,0.195952399265096
-7034,689,1980,0.165723809852799,0.165723809852799
-7035,1980,1965,0.0389234534803582,0.0389234534803582
-7036,1965,5991,0.211595737081182,0.211595737081182
-7037,5991,2477,0.19787541766453,0.19787541766453
-7039,5911,5992,0.199600309761125,0.199600309761125
-7040,5992,802,0.200311937766574,0.200311937766574
-7041,802,5993,0.204076160777324,0.204076160777324
-7042,5993,5994,0.207502868601311,0.207502868601311
-7043,5994,5995,0.201507936335064,0.201507936335064
-18161,10256,2170,0.118696748630409,0.118696748630409
-7044,5995,3065,0.198422916856477,0.198422916856477
-7045,3065,5996,0.187785068593932,0.187785068593932
-7048,5998,1151,0.103522476706234,0.103522476706234
-7049,1151,5999,0.201885859106491,0.201885859106491
-7050,5999,2774,0.203030941446461,0.203030941446461
-7051,2774,6000,0.200151361396455,0.200151361396455
-7053,4375,2856,0.142504312909228,0.142504312909228
-7054,2856,6001,0.0983652484533134,0.0983652484533134
-7055,6001,6002,0.0964239306891795,0.0964239306891795
-7056,6002,6003,0.098310599923513,0.098310599923513
-7057,6003,1761,0.137700629072643,0.137700629072643
-7058,1761,6004,0.100513600298964,0.100513600298964
-7059,6004,3822,0.0995871831820294,0.0995871831820294
-7060,3822,5898,0.137360760654976,0.137360760654976
-7061,5898,6005,0.132447355715672,0.132447355715672
-7063,1597,1654,0.133194225128182,0.133194225128182
-7064,1654,6006,0.125247640008909,0.125247640008909
-7065,6006,4209,0.0896990215886268,0.0896990215886268
-7067,6007,200,0.0969312782671765,0.0969312782671765
-7069,6008,6009,0.237519218216988,0.237519218216988
-7071,6010,700,0.202130694041649,0.202130694041649
-7072,700,6011,0.200920157017241,0.200920157017241
-7074,1752,6012,0.41064210801689,0.41064210801689
-7076,6013,898,0.069285729612221,0.069285729612221
-7079,5168,6014,0.173942254032852,0.173942254032852
-7080,6014,2356,0.178647695597581,0.178647695597581
-7081,2356,4157,0.173431342052579,0.173431342052579
-7082,4157,4744,0.174265758482508,0.174265758482508
-7083,4744,6015,0.17586665041424,0.17586665041424
-7084,6015,6017,0.166030537226764,0.166030537226764
-7085,6017,1206,0.168368552768231,0.168368552768231
-7086,1206,6018,0.0222310506019077,0.0222310506019077
-7087,6018,3777,0.199517083270274,0.199517083270274
-7088,3777,6019,0.15332994885881,0.15332994885881
-7089,6019,956,0.176955920540622,0.176955920540622
-7090,956,6020,0.174665514088028,0.174665514088028
-7091,6020,4894,0.161958937862416,0.161958937862416
-7092,4894,6021,0.18390531780345,0.18390531780345
-7093,6021,5492,0.174079428498661,0.174079428498661
-7094,5492,6022,0.20029370655809,0.20029370655809
-7096,3037,6023,0.213499262828813,0.213499262828813
-7098,3578,5645,0.141952777714747,0.141952777714747
-8369,876,4464,0.138360134725968,0.138360134725968
-7100,4359,4350,0.0475473932483631,0.0475473932483631
-7101,4350,1533,0.0507609705805194,0.0507609705805194
-7102,1533,6024,0.087689125787215,0.087689125787215
-7103,6024,3036,0.0935380351023268,0.0935380351023268
-7105,2396,6026,0.14381066174273,0.14381066174273
-7107,1270,4534,0.202622361744701,0.202622361744701
-7108,4534,6027,0.199229442979025,0.199229442979025
-7110,6028,6029,0.912875631293974,0.912875631293974
-7112,1075,2498,0.0816070075181441,0.0816070075181441
-7113,2498,6030,0.0415787253165096,0.0415787253165096
-7114,6030,6031,0.0433303737265817,0.0433303737265817
-7116,6032,6033,0.0508682336735258,0.0508682336735258
-7117,6033,1215,0.0487831269807967,0.0487831269807967
-7118,1215,6034,0.0505678656124617,0.0505678656124617
-7119,6034,4787,0.0490298276079548,0.0490298276079548
-7120,4787,6035,0.0502099740409632,0.0502099740409632
-7121,6035,2168,0.0503125854793333,0.0503125854793333
-7122,2168,6036,0.0482434584483166,0.0482434584483166
-17215,8403,8420,0.200752773596098,0.200752773596098
-7123,6036,6037,0.0486536038515005,0.0486536038515005
-7125,6038,6039,0.0499795151912972,0.0499795151912972
-7126,6039,6040,0.0491412278477837,0.0491412278477837
-7127,6040,6041,0.0497771068440158,0.0497771068440158
-7128,6041,6042,0.0494653664650395,0.0494653664650395
-7129,6042,4660,0.0491491990718702,0.0491491990718702
-7130,4660,6043,0.0497609288638681,0.0497609288638681
-7131,6043,1290,0.0489747324983769,0.0489747324983769
-7133,6044,4562,0.0495973986652376,0.0495973986652376
-7134,4562,6045,0.0489640905184848,0.0489640905184848
-7135,6045,6046,0.0491691479666822,0.0491691479666822
-7136,6046,6047,0.0507578186257211,0.0507578186257211
-7137,6047,2730,0.0500913644840885,0.0500913644840885
-7138,2730,6048,0.0486937991070737,0.0486937991070737
-7139,6048,6049,0.0563508416708434,0.0563508416708434
-7140,6049,6050,0.0543668616299433,0.0543668616299433
-7141,6050,3755,0.049786406684993,0.049786406684993
-7142,3755,6051,0.0495857892809515,0.0495857892809515
-7143,6051,6052,0.0496881410470813,0.0496881410470813
-7144,6052,6053,0.0491149994031363,0.0491149994031363
-18545,5563,7539,0.0787059485791879,0.0787059485791879
-7145,6053,6054,0.0498540025598143,0.0498540025598143
-7146,6054,6055,0.0489875409651698,0.0489875409651698
-7147,6055,4007,0.0499802866726516,0.0499802866726516
-7148,4007,6056,0.0488162842829032,0.0488162842829032
-7149,6056,6057,0.0489359547659716,0.0489359547659716
-7150,6057,6058,0.0509862761511403,0.0509862761511403
-7151,6058,1391,0.0507897478531174,0.0507897478531174
-7152,1391,6059,0.0484575520219378,0.0484575520219378
-7154,6060,6061,0.051268887373703,0.051268887373703
-7155,6061,3440,0.0523540538479921,0.0523540538479921
-7156,3440,6062,0.0526542821957606,0.0526542821957606
-7157,6062,5722,0.0500652354639954,0.0500652354639954
-7158,5722,6063,0.0491749564449066,0.0491749564449066
-7159,6063,6064,0.0490553316653512,0.0490553316653512
-7160,6064,6065,0.0504053225202572,0.0504053225202572
-7161,6065,6066,0.0491577785316978,0.0491577785316978
-7162,6066,6067,0.0500917004504544,0.0500917004504544
-7163,6067,6068,0.0487330457346556,0.0487330457346556
-7164,6068,6069,0.0500468552276867,0.0500468552276867
-7165,6069,1089,0.0473039342434908,0.0473039342434908
-7166,1089,6070,0.0519349767204956,0.0519349767204956
-7167,6070,6071,0.0483547253107021,0.0483547253107021
-7169,6072,3860,0.0495593243927177,0.0495593243927177
-7170,3860,6073,0.0493012970703545,0.0493012970703545
-7171,6073,5585,0.0529959751032204,0.0529959751032204
-7173,1003,5222,0.108094382628624,0.108094382628624
-7175,6074,3213,0.169273308004073,0.169273308004073
-7176,3213,6075,0.200540081035548,0.200540081035548
-7177,6075,1924,0.199718283006537,0.199718283006537
-7178,1924,6076,0.202212418704144,0.202212418704144
-7179,6076,3268,0.201184980777767,0.201184980777767
-7180,3268,6077,0.201398824177077,0.201398824177077
-7181,6077,81,0.202519482529809,0.202519482529809
-7182,81,3517,0.205035908609294,0.205035908609294
-7183,3517,4259,0.201561198640626,0.201561198640626
-7184,4259,6078,0.201877222241407,0.201877222241407
-7185,6078,6079,0.198020897047098,0.198020897047098
-7186,6079,5828,0.204359521871182,0.204359521871182
-7187,5828,6080,0.203452288011347,0.203452288011347
-7188,6080,6081,0.199577893436046,0.199577893436046
-7189,6082,4198,0.0554105901874734,0.0554105901874734
-8462,1578,6834,0.296770354889592,0.296770354889592
-7190,4198,6083,0.479532197769768,0.479532197769768
-7193,6085,3417,0.199987779646285,0.199987779646285
-7195,5561,6086,0.0785728419075768,0.0785728419075768
-7196,6086,6087,0.711200705359908,0.711200705359908
-7197,6088,6089,0.0569381576865727,0.0569381576865727
-7199,1755,4797,0.0569796757564415,0.0569796757564415
-7200,4797,6090,0.0568688820659326,0.0568688820659326
-7201,6090,2163,0.0576467707798926,0.0576467707798926
-7202,2163,6091,0.115287318699314,0.115287318699314
-7204,4029,6092,0.199820514844545,0.199820514844545
-7205,6092,3413,0.201407533266255,0.201407533266255
-7207,6093,6094,0.0604203300865654,0.0604203300865654
-7208,6094,6095,0.0494745769978518,0.0494745769978518
-7209,6095,6096,0.0926701881064251,0.0926701881064251
-7210,6096,4028,0.05825540400242,0.05825540400242
-7212,5558,6097,0.589453817263917,0.589453817263917
-7213,111,6098,0.0840698350347185,0.0840698350347185
-7214,6098,5387,0.102649580636379,0.102649580636379
-7216,6099,4834,0.0618019179836103,0.0618019179836103
-7217,4834,6100,0.103506880889302,0.103506880889302
-7218,6100,6101,0.102436270515026,0.102436270515026
-7219,6101,6102,0.0462582791506537,0.0462582791506537
-7221,5388,6103,0.0951666989097628,0.0951666989097628
-7222,6103,6104,0.103533109860882,0.103533109860882
-17793,6179,8402,0.062258154453335,0.062258154453335
-7223,6104,6105,1.01266363478673,1.01266363478673
-7226,6107,6108,0.0985711721031886,0.0985711721031886
-7227,6108,6109,0.106459269312792,0.106459269312792
-7228,6109,6110,0.106833918076069,0.106833918076069
-7229,6110,3622,0.0989181087898918,0.0989181087898918
-7230,3622,6111,0.098886772683552,0.098886772683552
-7231,6111,6112,0.0498651872917774,0.0498651872917774
-7232,6112,6113,0.0465544361472323,0.0465544361472323
-7233,6113,6114,0.048644459525012,0.048644459525012
-7234,6114,1769,0.0504837415599517,0.0504837415599517
-7235,1769,4488,0.0559949291466801,0.0559949291466801
-7236,4488,6115,0.0469382916231929,0.0469382916231929
-7237,6115,4839,0.0486148679353184,0.0486148679353184
-7239,1519,5280,0.0508144170388461,0.0508144170388461
-7240,5280,6116,0.0496680994860777,0.0496680994860777
-7241,6116,1086,0.0854394240121282,0.0854394240121282
-7244,6118,5426,0.102968153598516,0.102968153598516
-7245,5426,6119,0.101169119900675,0.101169119900675
-7246,6119,2048,0.10059076820208,0.10059076820208
-7247,2048,6120,0.0997250287478783,0.0997250287478783
-7248,6120,6121,0.100591265363907,0.100591265363907
-7249,6121,6122,0.0474195280765072,0.0474195280765072
-7250,6122,3477,0.0495243305794908,0.0495243305794908
-7251,3477,6123,0.0472960657562571,0.0472960657562571
-7252,6123,6075,0.0518212274102399,0.0518212274102399
-7253,6075,6124,0.0477720158174774,0.0477720158174774
-7254,6124,3692,0.0491494225474026,0.0491494225474026
-7255,3692,6125,0.0492733746042409,0.0492733746042409
-7256,6125,4567,0.0513179295413005,0.0513179295413005
-7257,4567,6126,0.104996585237884,0.104996585237884
-7259,6127,6128,0.202552708883543,0.202552708883543
-7260,6128,6129,0.200575382409089,0.200575382409089
-7261,6129,6130,0.200851528697639,0.200851528697639
-7263,6131,4042,0.178407205955933,0.178407205955933
-7264,4042,6132,0.176658257473219,0.176658257473219
-7265,6132,6133,0.173893747367395,0.173893747367395
-7266,6133,1832,0.00321363581065808,0.00321363581065808
-7267,1832,6134,0.0979518830790181,0.0979518830790181
-7268,6134,2577,0.0768544895315019,0.0768544895315019
-7270,2974,713,0.0553033256449361,0.0553033256449361
-7271,713,1884,0.049816225531446,0.049816225531446
-7272,1884,269,0.0489259588819734,0.0489259588819734
-7273,269,6135,0.049929244786193,0.049929244786193
-7274,6135,6095,0.0608968307992014,0.0608968307992014
-7276,1819,6136,0.206807888451467,0.206807888451467
-7278,6137,6138,0.137211297869344,0.137211297869344
-7280,6139,4576,0.0888580713995718,0.0888580713995718
-7281,4576,6140,0.134023429450374,0.134023429450374
-7282,6140,5292,0.135037120828343,0.135037120828343
-7283,5292,6141,0.134292125855752,0.134292125855752
-7285,11,6142,0.134290112908847,0.134290112908847
-7286,6142,6143,0.134379347336523,0.134379347336523
-7287,6143,6144,0.135319045428869,0.135319045428869
-7288,6144,6145,0.133823509557072,0.133823509557072
-7289,6145,6146,0.133595456488811,0.133595456488811
-7290,6146,6147,0.132813208199385,0.132813208199385
-7291,6147,6148,0.135903166352965,0.135903166352965
-7293,6149,5532,0.117263436099258,0.117263436099258
-7294,5532,6150,0.292646155170772,0.292646155170772
-7296,4069,6054,0.143532163506992,0.143532163506992
-7297,6054,5794,0.200517814130868,0.200517814130868
-7299,6151,6152,0.134234537479531,0.134234537479531
-7300,6152,2491,0.134965193585355,0.134965193585355
-7301,2491,2836,0.132191750515313,0.132191750515313
-7303,2760,6153,0.17786816992516,0.17786816992516
-7304,6153,3104,0.174733256162163,0.174733256162163
-7305,3104,6156,0.194828104098244,0.194828104098244
-7307,62,3549,0.192897189560382,0.192897189560382
-7309,191,5855,0.144500472019434,0.144500472019434
-7313,1335,6158,0.164940728280041,0.164940728280041
-7315,3709,719,0.105637457999026,0.105637457999026
-7317,3184,6159,0.175088076753778,0.175088076753778
-7318,6159,91,0.0479220492178455,0.0479220492178455
-7319,91,3527,0.203258724621779,0.203258724621779
-7320,3527,6160,0.201096029386997,0.201096029386997
-7321,6160,6161,0.201913621123293,0.201913621123293
-7323,6162,5834,0.203525395170747,0.203525395170747
-7324,5834,6163,0.200952914390398,0.200952914390398
-7326,3276,3651,0.182839298131176,0.182839298131176
-7329,6166,4285,0.103763551261197,0.103763551261197
-7331,1617,6167,0.103830241851319,0.103830241851319
-7333,6168,2159,0.117895446926253,0.117895446926253
-7334,2159,4795,0.11289998607803,0.11289998607803
-7335,4795,1226,0.113625921506999,0.113625921506999
-7337,4401,4400,0.117696624021516,0.117696624021516
-7341,2320,4278,0.147648925220672,0.147648925220672
-7342,4278,6174,0.145039413918761,0.145039413918761
-7343,6174,633,0.147839808469135,0.147839808469135
-7344,633,5324,0.144274087604939,0.144274087604939
-7345,5324,2036,0.144878759704946,0.144878759704946
-7346,2036,6175,0.146765627629388,0.146765627629388
-7347,6175,5506,0.146988764364424,0.146988764364424
-7349,4458,6176,0.146285529633972,0.146285529633972
-7350,6176,6177,0.143815084290611,0.143815084290611
-7351,6177,6178,0.149072223288683,0.149072223288683
-7352,6178,6179,0.102502676747671,0.102502676747671
-7353,6179,6180,0.0433701075577025,0.0433701075577025
-7354,6180,6181,0.146972104646326,0.146972104646326
-7355,6181,6182,0.147344314502621,0.147344314502621
-7356,6182,6183,0.145754933885852,0.145754933885852
-7357,6183,6184,0.147948446924155,0.147948446924155
-7358,6184,6185,0.145005273136899,0.145005273136899
-7359,6185,6186,0.141478743986661,0.141478743986661
-7360,6186,5784,0.0051191432185562,0.0051191432185562
-7361,5784,6187,0.145606807182671,0.145606807182671
-7362,6187,6188,0.145777030768037,0.145777030768037
-7363,6188,6189,0.147177496711371,0.147177496711371
-7365,999,4221,0.0806091686632927,0.0806091686632927
-7366,4221,6190,0.102381971527348,0.102381971527348
-7367,6190,6193,0.0984965085324321,0.0984965085324321
-7368,6193,969,0.0952400858484175,0.0952400858484175
-7369,969,6194,0.0506536388127553,0.0506536388127553
-7370,6194,5287,0.0506057613654141,0.0506057613654141
-7371,5287,3152,0.0954510374534177,0.0954510374534177
-7372,3152,4968,0.0960843478924756,0.0960843478924756
-7373,4968,6195,0.0415654887010154,0.0415654887010154
-15921,9749,9750,0.0318908811678005,0.0318908811678005
-7401,6213,6214,0.0495719593537107,0.0495719593537107
-7374,335,340,0.288826145863276,0.288826145863276
-7378,519,6197,0.0784497798176465,0.0784497798176465
-7379,6197,6198,0.0395399248279629,0.0395399248279629
-7380,6198,6199,0.019955626672929,0.019955626672929
-7382,6200,6201,0.0919482301684137,0.0919482301684137
-7383,6201,6202,0.111020276961071,0.111020276961071
-7385,4485,6203,0.0919528384362936,0.0919528384362936
-7386,6203,4199,0.0670783480641165,0.0670783480641165
-7387,4199,6204,0.129739883939344,0.129739883939344
-7388,6204,6083,0.021522983414344,0.021522983414344
-7390,1820,6205,0.059780784078693,0.059780784078693
-7391,6205,6206,0.0520794903588436,0.0520794903588436
-7392,6206,6207,0.0535277276856965,0.0535277276856965
-7393,6207,6208,0.052616435606338,0.052616435606338
-7395,6209,6210,0.054197774205049,0.054197774205049
-7396,6210,600,0.122572832169608,0.122572832169608
-7397,600,6211,0.0472521628905724,0.0472521628905724
-7398,6211,5708,0.0430357389006543,0.0430357389006543
-7399,5708,6212,0.0495085394583916,0.0495085394583916
-7400,6212,6213,0.0462483397604104,0.0462483397604104
-7402,6214,6215,0.0428153220943109,0.0428153220943109
-7403,6215,6216,0.0471000262746752,0.0471000262746752
-7404,6216,6217,0.0473822229177533,0.0473822229177533
-7405,6217,1100,0.091970261814681,0.091970261814681
-7406,1100,6218,0.0449415553049736,0.0449415553049736
-7407,6218,6219,0.0480654852744355,0.0480654852744355
-7408,6219,6221,0.0454218674668918,0.0454218674668918
-7409,6221,3858,0.0463369187822574,0.0463369187822574
-7410,3858,6222,0.0463493111972249,0.0463493111972249
-7411,6222,5594,0.0512843332286284,0.0512843332286284
-7412,5594,6223,0.0568069326737853,0.0568069326737853
-7413,6223,6224,0.0525700432289869,0.0525700432289869
-7414,6224,6225,0.0976339163821139,0.0976339163821139
-7439,6242,6243,0.0662881511283164,0.0662881511283164
-7415,6225,6226,0.598121759063317,0.598121759063317
-7416,3855,6227,0.0533569775705536,0.0533569775705536
-7417,6227,5550,0.054545728952838,0.054545728952838
-7419,6228,6229,0.0491582246006862,0.0491582246006862
-7420,6229,6230,0.632851875022697,0.632851875022697
-7421,4649,6231,0.0998318489902405,0.0998318489902405
-7423,3956,6232,0.132968901609209,0.132968901609209
-7424,6232,6233,0.0436348818689085,0.0436348818689085
-7425,6233,6234,0.0454822742996404,0.0454822742996404
-7426,6234,6235,0.049945575036802,0.049945575036802
-7427,6235,6236,0.0503304157761669,0.0503304157761669
-7428,6236,6237,0.0508263629674458,0.0508263629674458
-7429,6237,4952,0.0505868421691217,0.0505868421691217
-7430,4952,4681,0.10191805721873,0.10191805721873
-7431,4681,6238,0.099594470461032,0.099594470461032
-7432,6238,6239,0.057251122773958,0.057251122773958
-7433,6239,6240,0.108863184827896,0.108863184827896
-7434,6240,5092,0.0381385955203522,0.0381385955203522
-7435,5092,5227,0.108194428858344,0.108194428858344
-7437,5219,6241,0.0418231546106276,0.0418231546106276
-7438,6241,6242,0.0122130870650471,0.0122130870650471
-7442,1601,1657,0.147607723017958,0.147607723017958
-7444,5765,6244,0.238854062350574,0.238854062350574
-7445,6244,5899,0.278312459096762,0.278312459096762
-7446,5899,1600,0.0794217837629518,0.0794217837629518
-7448,4405,4957,0.275380198668453,0.275380198668453
-7450,4315,4502,0.0962009886521744,0.0962009886521744
-7451,4502,6245,0.0998685092157526,0.0998685092157526
-7452,6245,5078,0.0969948238046964,0.0969948238046964
-7453,5078,6246,0.102086344844989,0.102086344844989
-7454,6246,6247,0.102069890156656,0.102069890156656
-7455,6247,6248,0.0998684901150858,0.0998684901150858
-7456,6248,6249,0.099157147424293,0.099157147424293
-7457,6249,6250,0.0998927126402804,0.0998927126402804
-7459,4376,2857,0.174778525570848,0.174778525570848
-7461,1656,6251,0.113089099397014,0.113089099397014
-7462,6251,4210,0.0895877408394824,0.0895877408394824
-7463,4210,6252,0.0984078699260149,0.0984078699260149
-7464,6252,202,0.0984164433029134,0.0984164433029134
-7465,202,2930,0.0999116533304243,0.0999116533304243
-7467,5311,1467,0.0969591422712861,0.0969591422712861
-7468,1467,5446,0.104331765041419,0.104331765041419
-7470,6253,6254,0.108544830855141,0.108544830855141
-7471,6254,6255,0.0440614876081187,0.0440614876081187
-7472,6255,6256,0.10258169252724,0.10258169252724
-7473,6256,6257,0.0426791560290334,0.0426791560290334
-7474,6257,1181,0.0541704333597994,0.0541704333597994
-7476,6258,5341,0.664349456749629,0.664349456749629
-7480,1556,736,0.1281317837441,0.1281317837441
-7482,6260,6261,0.0586102720745076,0.0586102720745076
-7484,1188,6262,0.0214828666370953,0.0214828666370953
-7485,6262,3789,0.199388923153335,0.199388923153335
-7486,3789,5915,0.154872293830304,0.154872293830304
-7487,5915,6263,0.0506492890867135,0.0506492890867135
-7488,6264,2248,0.0665325760000431,0.0665325760000431
-7489,2248,4881,0.176090081583566,0.176090081583566
-7490,4881,6265,0.19613430259676,0.19613430259676
-7491,6265,5479,0.175348484443179,0.175348484443179
-7492,5479,6266,0.176845636908204,0.176845636908204
-7493,6266,6267,0.178089834743743,0.178089834743743
-7494,6267,676,0.00240181041514711,0.00240181041514711
-7495,676,6268,0.00459391026290071,0.00459391026290071
-7496,6268,6269,0.174858851790528,0.174858851790528
-7497,6269,4598,0.173764465207871,0.173764465207871
-7500,6270,6271,0.133612621428605,0.133612621428605
-7501,6271,6272,0.00412533177852682,0.00412533177852682
-7502,6272,6273,0.00367565176707242,0.00367565176707242
-7503,6273,6274,0.134146296121319,0.134146296121319
-20534,10849,10832,0.00532626442143788,0.00532626442143788
-7504,6274,6275,0.138338671785307,0.138338671785307
-7505,6275,829,0.140763564032817,0.140763564032817
-7506,829,3569,0.13985476308825,0.13985476308825
-7507,3569,5638,0.139885286720423,0.139885286720423
-7508,5638,4342,0.139394668795268,0.139394668795268
-7509,4342,6276,0.136887040523289,0.136887040523289
-7510,6276,3042,0.135179672321338,0.135179672321338
-7511,3042,6277,0.141328751765533,0.141328751765533
-7512,6277,6278,0.0048613905607292,0.0048613905607292
-7513,6278,6279,0.138461653724603,0.138461653724603
-7514,6279,1163,0.137550674895164,0.137550674895164
-7515,1163,883,0.14127337175944,0.14127337175944
-7516,883,4468,0.137815416161984,0.137815416161984
-7517,4468,2790,0.135224582480649,0.135224582480649
-7518,2790,5258,0.130698751805084,0.130698751805084
-7519,5258,6280,0.127788689349157,0.127788689349157
-7521,6281,4149,0.293690516229792,0.293690516229792
-7522,4149,4399,0.168839008279682,0.168839008279682
-7524,6202,6282,0.107543949920042,0.107543949920042
-7525,6282,6283,0.203165579542053,0.203165579542053
-7526,6283,2881,0.158375292404745,0.158375292404745
-7528,6284,6285,0.199406415880408,0.199406415880408
-7530,2831,1439,0.198717844078091,0.198717844078091
-7531,1439,6286,0.198972452931936,0.198972452931936
-7533,4103,6046,0.129598634612641,0.129598634612641
-7534,6046,6287,0.200664408696912,0.200664408696912
-7535,6287,6288,0.407763176533057,0.407763176533057
-7536,3356,6289,0.17574244534878,0.17574244534878
-7537,6289,3103,0.174022554549137,0.174022554549137
-7538,3103,6290,0.195576263268451,0.195576263268451
-7539,6290,6291,0.0184164625226683,0.0184164625226683
-7543,5848,6293,0.0908806324614032,0.0908806324614032
-7544,6293,6294,0.111642131539399,0.111642131539399
-7546,6295,6296,0.199763041133193,0.199763041133193
-7547,6297,4228,0.205146518268072,0.205146518268072
-7548,4228,6298,0.220075142380819,0.220075142380819
-7549,6299,6300,0.269225278413762,0.269225278413762
-7550,6300,6301,0.135380699238895,0.135380699238895
-7551,6301,6037,0.201685647547083,0.201685647547083
-7552,6037,4092,0.180825512734332,0.180825512734332
-8788,5909,7005,0.202308283638507,0.202308283638507
-7555,1356,1434,0.0619921139139986,0.0619921139139986
-7556,1434,1416,0.0702533335118034,0.0702533335118034
-7557,1416,2824,0.130534926760632,0.130534926760632
-7558,2824,2485,0.13649413612348,0.13649413612348
-7559,2485,6304,0.132600390611243,0.132600390611243
-7560,6304,6305,0.13375224687231,0.13375224687231
-7562,6293,6306,0.193932773048905,0.193932773048905
-7564,6307,4033,0.1068931298406,0.1068931298406
-7566,6308,1505,0.201208565153675,0.201208565153675
-7567,1505,178,0.201696340498873,0.201696340498873
-7568,178,1706,0.202420430939935,0.202420430939935
-7569,1706,6310,0.205872571954156,0.205872571954156
-7571,1393,5861,0.176199480761084,0.176199480761084
-7573,1309,5328,0.243304763536767,0.243304763536767
-17643,524,9824,0.0585508481458027,0.0585508481458027
-7575,6311,6312,0.480549704702292,0.480549704702292
-7576,4368,1449,0.194542255499986,0.194542255499986
-7577,1449,6313,0.208609985343506,0.208609985343506
-7578,6313,6314,0.103555170544593,0.103555170544593
-7579,6314,6315,0.0981349608621905,0.0981349608621905
-7581,3820,5895,0.101734690953305,0.101734690953305
-7583,6316,6317,0.456743307850688,0.456743307850688
-7584,5896,1591,0.201196573887444,0.201196573887444
-7585,1591,1642,0.201704599280981,0.201704599280981
-7587,4303,6319,0.0895876341901528,0.0895876341901528
-7589,6320,5074,0.0881249654942257,0.0881249654942257
-7590,5074,6321,0.0822356991688935,0.0822356991688935
-7592,3098,3208,0.20139821402018,0.20139821402018
-7593,3208,6120,0.199810792778826,0.199810792778826
-7594,6120,1919,0.202180610053987,0.202180610053987
-7595,1919,6322,0.202387552164505,0.202387552164505
-7596,6322,3262,0.201452153939087,0.201452153939087
-7597,3262,6323,0.198460905873661,0.198460905873661
-7599,6325,6326,0.0490995020648654,0.0490995020648654
-7600,6326,6327,0.055368676730927,0.055368676730927
-7601,6327,6328,0.0309445801475025,0.0309445801475025
-7602,6328,992,0.0695937269558986,0.0695937269558986
-7603,992,5033,0.0562459052664965,0.0562459052664965
-8836,2977,657,0.0520837064464313,0.0520837064464313
-7604,5033,6329,0.0516777216994855,0.0516777216994855
-7605,6329,5046,0.105372499364086,0.105372499364086
-7606,5046,4160,0.118696493530277,0.118696493530277
-7607,4160,6330,0.136699581092316,0.136699581092316
-7608,6330,4974,0.128955324206818,0.128955324206818
-7609,4974,4766,0.151821196012923,0.151821196012923
-7610,4766,6331,0.118237006648706,0.118237006648706
-7611,6331,6332,0.150079343538278,0.150079343538278
-7612,6332,6333,0.165501031184984,0.165501031184984
-7613,6333,6334,0.0461738747625761,0.0461738747625761
-7614,6334,6335,0.133457305058149,0.133457305058149
-7615,6335,1212,0.134967826650912,0.134967826650912
-7617,2900,6336,0.106167707809224,0.106167707809224
-7618,6336,6337,0.104928236912142,0.104928236912142
-7619,6337,4735,0.104475212628964,0.104475212628964
-7620,4735,6338,0.102406513567036,0.102406513567036
-7621,6338,6339,0.111236760215522,0.111236760215522
-7622,6339,5400,0.102611714232847,0.102611714232847
-7623,5400,6340,0.108937307551118,0.108937307551118
-7624,6340,3903,0.106714805368354,0.106714805368354
-7625,3903,1040,0.101833845648583,0.101833845648583
-7626,1040,6276,0.108458622663871,0.108458622663871
-7627,6276,6341,0.106851583282394,0.106851583282394
-7628,6341,5005,0.0997823108241272,0.0997823108241272
-7629,5005,3326,0.104184561842385,0.104184561842385
-7630,3326,6343,0.103107525114489,0.103107525114489
-7631,6343,6344,0.102577524667858,0.102577524667858
-7632,6344,2077,0.109057202290834,0.109057202290834
-7633,2077,2674,0.105238001385814,0.105238001385814
-7634,2674,4124,0.102908082653388,0.102908082653388
-7635,4124,6345,0.111237019236159,0.111237019236159
-7636,6345,6346,0.0932071004983952,0.0932071004983952
-7637,6346,6347,0.101110239024215,0.101110239024215
-7638,6347,3472,0.0998858354760893,0.0998858354760893
-7639,3472,6024,0.100184077827119,0.100184077827119
-7641,3875,6348,0.0931831682605449,0.0931831682605449
-7642,6348,851,0.00806942804368034,0.00806942804368034
-7644,6349,6350,0.122741608307903,0.122741608307903
-7646,6351,6352,0.0367221312616467,0.0367221312616467
-7648,6353,6352,0.031587926861642,0.031587926861642
-7649,6352,6353,0.031587926861642,0.031587926861642
-7651,4284,5406,0.209059343043956,0.209059343043956
-7652,5406,3139,0.106127827196287,0.106127827196287
-7653,3139,3924,0.0976499059560775,0.0976499059560775
-7654,3924,5060,0.353918950652385,0.353918950652385
-7655,5060,5012,0.0994873589954365,0.0994873589954365
-7658,6356,2071,0.094898000530225,0.094898000530225
-7659,2071,2669,0.0951372963506741,0.0951372963506741
-7660,2669,4139,0.0930605458860926,0.0930605458860926
-7661,4139,6357,0.0866508308410144,0.0866508308410144
-7662,6357,6358,0.100153967379628,0.100153967379628
-7663,6358,6359,0.094521960675225,0.094521960675225
-7664,6359,834,0.394334341459341,0.394334341459341
-7665,834,871,0.00699086459728944,0.00699086459728944
-7666,871,6360,0.0985643561678323,0.0985643561678323
-7667,6360,6361,0.0919153430634884,0.0919153430634884
-7668,6361,6362,0.0142210252134503,0.0142210252134503
-7670,6363,6250,0.198277134301598,0.198277134301598
-7671,6250,6258,0.115286899945233,0.115286899945233
-7672,6258,6364,0.0878557774552784,0.0878557774552784
-7673,6364,1498,0.200867314778576,0.200867314778576
-7675,187,5877,0.162832287710312,0.162832287710312
-7676,5877,1716,0.0499429374304698,0.0499429374304698
-7678,6365,1582,0.142378532382676,0.142378532382676
-7679,1582,6366,1.28806099537571,1.28806099537571
-7680,6367,2271,0.093525872105216,0.093525872105216
-7681,2271,6368,0.0953526699152847,0.0953526699152847
-7682,6368,6369,0.0956103425754401,0.0956103425754401
-7683,6369,2130,0.0946975078442247,0.0946975078442247
-7684,2130,5981,0.0976635368625979,0.0976635368625979
-7685,5981,6370,0.0910203235542429,0.0910203235542429
-7686,6370,2335,0.0939706612325521,0.0939706612325521
-7687,2335,6371,1.7470149025737,1.7470149025737
-7688,96,3500,0.202527213410831,0.202527213410831
-7689,3500,6372,0.200485391157046,0.200485391157046
-7690,6372,6373,0.200744473183588,0.200744473183588
-7691,6373,6374,0.203425216522523,0.203425216522523
-7692,6374,261,0.363896677888795,0.363896677888795
-7693,261,6375,0.041137585532266,0.041137585532266
-7694,6375,6376,0.527231991542063,0.527231991542063
-8934,2865,7087,0.201874708309178,0.201874708309178
-7696,6377,3069,0.174367166483664,0.174367166483664
-7697,3069,6378,0.175688037406208,0.175688037406208
-7698,6378,6379,0.195293035214527,0.195293035214527
-7700,5015,6380,0.0917013339896307,0.0917013339896307
-7702,380,6381,0.0601450697094338,0.0601450697094338
-7703,6381,3398,0.0950953426294514,0.0950953426294514
-7704,3398,6384,0.0512135480319707,0.0512135480319707
-7705,6384,6385,0.0512477474787707,0.0512477474787707
-7706,6385,6386,0.0508150751685789,0.0508150751685789
-7707,6386,6387,0.0467877396177586,0.0467877396177586
-7708,6387,6388,0.102738526459791,0.102738526459791
-7709,6388,6389,0.0502022657375815,0.0502022657375815
-7710,6389,6390,0.0495952560526731,0.0495952560526731
-7711,6390,6391,0.0506266673865361,0.0506266673865361
-7712,6391,1111,0.0484464674507555,0.0484464674507555
-7714,4654,1272,0.131229439030854,0.131229439030854
-7715,1272,6392,0.0233060632854453,0.0233060632854453
-7716,6392,4560,0.111717062627726,0.111717062627726
-7717,4560,2711,0.115276038939543,0.115276038939543
-7718,2711,6393,0.157827401374253,0.157827401374253
-7720,6394,6142,0.134287937529063,0.134287937529063
-7721,6142,4016,0.132933704994743,0.132933704994743
-7722,4016,6395,0.00906250528140326,0.00906250528140326
-7723,6395,382,0.124591902443133,0.124591902443133
-7725,5850,6396,0.00523272011597534,0.00523272011597534
-7726,6396,501,0.199511293598505,0.199511293598505
-7727,501,6397,0.217152349025227,0.217152349025227
-7728,6397,6398,0.36755359975324,0.36755359975324
-7730,3613,6399,0.21266860576331,0.21266860576331
-7732,6401,6402,0.038551456513769,0.038551456513769
-7733,6402,6403,0.01171446339475,0.01171446339475
-7735,2909,6404,0.0724414530545414,0.0724414530545414
-7736,6404,6405,0.105070094163828,0.105070094163828
-7737,6405,6174,0.106062498124406,0.106062498124406
-7738,6174,3312,0.104669820520163,0.104669820520163
-7739,3312,6406,0.105292804834109,0.105292804834109
-7741,5545,2415,0.0733757601851338,0.0733757601851338
-7743,5056,4299,0.0731858562049149,0.0731858562049149
-7745,5093,6407,0.0155546054802435,0.0155546054802435
-7747,3914,4762,0.124500033165113,0.124500033165113
-7750,6409,5773,0.332202382721644,0.332202382721644
-7752,6410,6411,0.0178672618817003,0.0178672618817003
-7754,6409,6412,0.0520862922994697,0.0520862922994697
-7756,6231,6413,0.198055274582402,0.198055274582402
-7758,6414,6415,0.189433856898839,0.189433856898839
-7759,6416,4038,0.0834324728266378,0.0834324728266378
-7761,6417,4521,0.134579982196382,0.134579982196382
-7762,4521,5240,0.13502405245006,0.13502405245006
-7763,5240,6418,0.13412336654487,0.13412336654487
-7764,6418,6419,0.133878890575632,0.133878890575632
-7765,6419,1678,0.134913237668999,0.134913237668999
-7766,1678,6421,0.134568146094945,0.134568146094945
-7767,6421,2457,0.135266114631303,0.135266114631303
-7768,2457,3225,0.138075006668938,0.138075006668938
-7769,3225,5745,0.134195295626898,0.134195295626898
-7770,5745,5522,0.132936679979251,0.132936679979251
-7771,5522,6422,0.135417328130375,0.135417328130375
-7772,6422,6423,0.137879539043021,0.137879539043021
-7776,6425,6426,0.131565838315989,0.131565838315989
-9014,7117,7118,0.0653478278832396,0.0653478278832396
-7778,2486,2825,0.134659485620958,0.134659485620958
-7779,2825,1435,0.20171777298344,0.20171777298344
-7780,1435,6427,0.150355567395556,0.150355567395556
-7782,4094,6039,0.18817564016619,0.18817564016619
-7783,6039,6428,0.201342188276825,0.201342188276825
-7784,6428,6429,0.404705192201308,0.404705192201308
-7785,6430,2403,0.202864038761159,0.202864038761159
-7786,2403,6431,0.0331723473682169,0.0331723473682169
-7787,6431,6432,0.176045966759895,0.176045966759895
-7789,6433,6434,0.0826623084672878,0.0826623084672878
-7790,6434,6435,0.102944521823956,0.102944521823956
-7791,6435,6436,0.00978588535341196,0.00978588535341196
-7793,6131,5859,0.176922247784819,0.176922247784819
-7794,5859,1306,0.176947022701008,0.176947022701008
-7795,1306,6437,0.245961882429388,0.245961882429388
-7797,4379,175,0.0949912703955897,0.0949912703955897
-7799,6438,6439,0.118265132463411,0.118265132463411
-7800,426,6440,0.136068759302944,0.136068759302944
-7801,6440,6140,0.13326442219696,0.13326442219696
-7802,6140,4012,0.134504046499466,0.134504046499466
-7803,4012,6441,0.132430300578831,0.132430300578831
-7804,6441,6442,0.13523718007968,0.13523718007968
-7805,6442,3383,0.131020837855346,0.131020837855346
-7807,6443,5593,0.101318153214668,0.101318153214668
-7809,5592,6444,0.0976166388579658,0.0976166388579658
-7810,6444,6445,0.491425863708822,0.491425863708822
-7814,2400,6448,0.282522157819803,0.282522157819803
-7817,2813,6450,0.086833012009872,0.086833012009872
-7819,6451,6452,0.0978256934477298,0.0978256934477298
-7820,6452,3935,0.102019422492613,0.102019422492613
-7821,3935,5623,0.0992172562512715,0.0992172562512715
-7823,6453,4202,0.100516365940058,0.100516365940058
-7824,4202,1069,0.100502974298411,0.100502974298411
-7825,1069,2505,0.106288157429336,0.106288157429336
-7827,6454,1236,0.0948029547901802,0.0948029547901802
-7828,1236,4810,0.0999111243280575,0.0999111243280575
-7829,4810,2177,0.101346858256007,0.101346858256007
-7830,2177,595,0.0594373309242362,0.0594373309242362
-7831,595,6456,0.0424911721972826,0.0424911721972826
-7833,349,6422,0.0713248739505624,0.0713248739505624
-7834,6422,4630,0.121079515215535,0.121079515215535
-7836,1259,376,0.0755636106904258,0.0755636106904258
-7837,376,4545,0.0608816123146845,0.0608816123146845
-7838,4545,2701,0.135701731606855,0.135701731606855
-7839,2701,6457,0.126994454068005,0.126994454068005
-7841,6458,6459,0.0454788769710747,0.0454788769710747
-7842,6459,6460,0.0496400956308302,0.0496400956308302
-7843,6460,6461,0.0515972381206,0.0515972381206
-7845,6462,6463,0.0483118204156802,0.0483118204156802
-7846,6463,1134,0.0499784066419261,0.0499784066419261
-7847,1134,6464,0.0497410465605515,0.0497410465605515
-7849,6465,6466,0.0544130408961272,0.0544130408961272
-7850,6466,3850,0.0472855484942146,0.0472855484942146
-7851,3850,6467,0.0501739162143614,0.0501739162143614
-7852,6467,5576,0.0486954285842123,0.0486954285842123
-7854,6468,4673,0.110758148850492,0.110758148850492
-7855,4673,6469,0.101963932591745,0.101963932591745
-7857,5575,6471,0.0065719182159958,0.0065719182159958
-7858,6471,6472,0.0420124186537075,0.0420124186537075
-7859,6472,6473,0.0412603655949121,0.0412603655949121
-7860,6473,6474,0.00681975388326533,0.00681975388326533
-7862,6476,3433,0.101986471383689,0.101986471383689
-7864,6477,6478,0.14533158628719,0.14533158628719
-7865,6478,6479,0.146043976986052,0.146043976986052
-7866,6479,2014,0.145258231311968,0.145258231311968
-7867,2014,6480,0.148541120069898,0.148541120069898
-7868,6480,6481,0.146497737165933,0.146497737165933
-7870,6482,6483,0.108282286689265,0.108282286689265
-7871,6483,6484,0.108491401341724,0.108491401341724
-7873,6485,6486,0.107588206878742,0.107588206878742
-7874,6486,6487,0.108152480667507,0.108152480667507
-7875,6487,6488,0.101444382501879,0.101444382501879
-7876,6488,6489,0.0964116258051976,0.0964116258051976
-7877,6489,6490,0.100996661509111,0.100996661509111
-7878,6490,6491,0.0875395650093709,0.0875395650093709
-7879,6491,5045,0.0321137501610987,0.0321137501610987
-7880,5045,6492,0.117702359393688,0.117702359393688
-7882,6493,6494,0.102121868544675,0.102121868544675
-7885,5423,6497,0.104998299985498,0.104998299985498
-7887,6498,2276,0.0954001386196214,0.0954001386196214
-7888,2276,3599,0.06824353272523,0.06824353272523
-7889,3599,6499,0.0293198911712676,0.0293198911712676
-7890,6499,6500,0.100538255640661,0.100538255640661
-7891,6500,5163,0.0991059325809468,0.0991059325809468
-7892,5163,5160,0.0380087655441681,0.0380087655441681
-7893,5160,5991,0.104706554354607,0.104706554354607
-7894,5991,6501,0.100402260808534,0.100402260808534
-7895,6501,6502,1.04365943145138,1.04365943145138
-7898,435,6505,0.0386263503887606,0.0386263503887606
-7899,6505,335,0.101999106210783,0.101999106210783
-18520,9719,10306,0.125645609854682,0.125645609854682
-7901,6506,6507,1.29783680025226,1.29783680025226
-7902,6507,5983,0.103637474886707,0.103637474886707
-7903,5983,2101,0.103292266259067,0.103292266259067
-9126,1424,7178,0.131577423131136,0.131577423131136
-7904,2101,6508,0.248902894245049,0.248902894245049
-7906,6509,6510,0.360508984578831,0.360508984578831
-7907,6510,6511,0.0349379067210739,0.0349379067210739
-7909,6512,6513,0.304262851034051,0.304262851034051
-7910,6513,6198,0.252538456966519,0.252538456966519
-7911,6198,576,0.0366939406022336,0.0366939406022336
-7912,576,6515,0.0946945974761285,0.0946945974761285
-7915,89,3525,0.202675004351493,0.202675004351493
-7916,3525,6516,0.201208326437589,0.201208326437589
-7917,6516,6517,0.125720317267139,0.125720317267139
-7919,6518,6519,0.200829668984099,0.200829668984099
-7920,6519,5832,0.202502182884777,0.202502182884777
-7921,5832,6520,0.201241567556278,0.201241567556278
-7922,6520,6521,0.396923547399649,0.396923547399649
-7923,6522,6523,0.133027344486413,0.133027344486413
-7924,6523,4230,0.0509058477475031,0.0509058477475031
-7925,4230,3627,0.095634183764131,0.095634183764131
-7926,3627,1795,0.17402508350424,0.17402508350424
-7928,6524,4175,0.0888021060703878,0.0888021060703878
-17651,395,780,0.411550362143881,0.411550362143881
-7930,6525,1780,0.0441669339202922,0.0441669339202922
-7931,1780,4371,0.0730695211007641,0.0730695211007641
-7932,4371,6527,0.0615136660388587,0.0615136660388587
-7933,6527,365,0.0331373286455635,0.0331373286455635
-7935,6528,6529,0.918393000112345,0.918393000112345
-7936,6529,6530,0.220602612202271,0.220602612202271
-7938,6531,6533,0.0857049610334614,0.0857049610334614
-7940,5175,3090,0.40371590303619,0.40371590303619
-7941,3090,3201,0.197838998920199,0.197838998920199
-7943,6407,4688,0.196571833896643,0.196571833896643
-7944,4688,4940,0.140125445900248,0.140125445900248
-7946,6170,5019,0.102773469761832,0.102773469761832
-7947,5019,3351,0.103514032973499,0.103514032973499
-7948,3351,6534,0.103149871890818,0.103149871890818
-7949,6534,6535,0.102775789327764,0.102775789327764
-9173,5349,5392,0.0859339245649361,0.0859339245649361
-7950,6535,2060,0.103192691678964,0.103192691678964
-7951,2060,2646,0.101884046964041,0.101884046964041
-7952,2646,4112,0.105519033634909,0.105519033634909
-7953,4112,6536,0.103005071327601,0.103005071327601
-7954,6536,6537,0.102995851811127,0.102995851811127
-7955,6537,6539,0.1029998815793,0.1029998815793
-7956,6539,3453,0.102546625331303,0.102546625331303
-7958,6015,3883,0.103459903316916,0.103459903316916
-7959,3883,846,0.104834602248929,0.104834602248929
-7960,846,6540,0.101388253991195,0.101388253991195
-7961,6540,6541,0.0479102302548626,0.0479102302548626
-7963,988,6542,0.0976255225844962,0.0976255225844962
-7964,6542,6543,0.0510763365802728,0.0510763365802728
-7966,6544,2318,0.0507276043625414,0.0507276043625414
-7967,2318,5114,0.0505908057304328,0.0505908057304328
-7968,5114,445,0.0485658434846568,0.0485658434846568
-7969,445,4713,0.0498146803357513,0.0498146803357513
-7970,4713,6546,0.0983637452954902,0.0983637452954902
-7971,6546,6547,0.0998347883215936,0.0998347883215936
-7973,5411,3144,0.088816521791746,0.088816521791746
-7974,3144,3916,0.112464236744585,0.112464236744585
-7976,6332,6548,0.108272865647673,0.108272865647673
-7977,6548,3156,0.104441457482765,0.104441457482765
-7978,3156,4975,0.102775440582403,0.102775440582403
-7979,4975,6549,0.100365138716245,0.100365138716245
-7980,6549,6550,0.102792800397101,0.102792800397101
-7982,6526,5047,0.0492847670519182,0.0492847670519182
-7983,5047,6551,0.0975745067522553,0.0975745067522553
-17653,9285,10141,0.0935043743671756,0.0935043743671756
-7984,6551,5065,0.0520838428726065,0.0520838428726065
-7985,5065,987,0.0487655351272014,0.0487655351272014
-7987,6552,6553,0.11141163822183,0.11141163822183
-7988,6553,6554,0.0931288050453943,0.0931288050453943
-7989,6554,6555,0.0954267012259227,0.0954267012259227
-7990,6555,6556,0.0932230978560399,0.0932230978560399
-7991,6556,2018,0.096637647678534,0.096637647678534
-7992,2018,2008,0.0302895913994428,0.0302895913994428
-7993,2008,6557,0.0614415106208342,0.0614415106208342
-7995,2764,6558,0.0940583318372542,0.0940583318372542
-7996,6558,2268,0.0933570415002435,0.0933570415002435
-7998,5192,6559,0.0436786412585742,0.0436786412585742
-7999,6559,6560,0.0106994466158069,0.0106994466158069
-8002,6562,6563,0.0505000952437127,0.0505000952437127
-8004,3018,6564,0.0487830282291943,0.0487830282291943
-8005,6564,4383,0.0508423763728808,0.0508423763728808
-8006,4383,6565,0.0576100244421376,0.0576100244421376
-8008,6566,6567,0.00412306976586438,0.00412306976586438
-8009,6567,6568,0.0539582974681531,0.0539582974681531
-8010,6568,6569,0.0519961096093482,0.0519961096093482
-8011,6569,6570,0.0542246799430147,0.0542246799430147
-8012,6570,6571,0.0518803862854092,0.0518803862854092
-17654,10141,10140,0.10337885268614,0.10337885268614
-8013,6571,6572,0.0555098728995741,0.0555098728995741
-8014,6572,6573,0.0518861583127315,0.0518861583127315
-8015,6573,6574,0.0518860343451018,0.0518860343451018
-8016,6574,6575,0.0508332520538339,0.0508332520538339
-8017,6575,6576,0.0544506518702307,0.0544506518702307
-8018,6576,6176,0.0529383120108553,0.0529383120108553
-8019,6176,6577,0.0529043310628525,0.0529043310628525
-8020,6577,3307,0.0513720664630444,0.0513720664630444
-8021,3307,6578,0.0555027664653656,0.0555027664653656
-8022,6578,6579,0.0497858933197237,0.0497858933197237
-8026,916,6582,0.0644004913493865,0.0644004913493865
-8027,6582,6583,0.0568408799781512,0.0568408799781512
-8028,6583,6584,0.122686442934717,0.122686442934717
-8029,6584,6585,0.119086225858405,0.119086225858405
-8031,4637,6586,0.0681807162053014,0.0681807162053014
-8032,6586,4550,0.0899357767109733,0.0899357767109733
-8033,4550,6587,0.293817867332518,0.293817867332518
-8034,6587,6588,0.104136881172081,0.104136881172081
-8035,6588,6589,0.0983651040648428,0.0983651040648428
-8036,6589,6129,0.0990923096855932,0.0990923096855932
-8037,6129,3972,0.0982639550962464,0.0982639550962464
-8038,3972,6590,0.099057650475641,0.099057650475641
-17935,10221,8779,0.0167456719913715,0.0167456719913715
-8039,6590,1407,0.099982611141039,0.099982611141039
-8040,1407,6591,0.096574089288832,0.096574089288832
-8042,5218,3376,0.0125708011673062,0.0125708011673062
-8043,3376,3397,0.0411038350876113,0.0411038350876113
-8044,3397,6592,0.0474630685655207,0.0474630685655207
-8045,6592,5717,0.0112629167716475,0.0112629167716475
-8046,5717,5711,0.0353931291626462,0.0353931291626462
-8049,6594,6595,0.0372589458613009,0.0372589458613009
-8051,6596,6597,0.0491446235593822,0.0491446235593822
-8052,6597,6598,0.0512739101828601,0.0512739101828601
-8053,6598,6599,0.0445968134228137,0.0445968134228137
-8054,6599,6600,0.0456401369039379,0.0456401369039379
-8055,6600,252,0.0644261415780049,0.0644261415780049
-8056,252,3949,0.0630622102110069,0.0630622102110069
-8057,3949,6601,0.0624388506180743,0.0624388506180743
-8058,6601,5610,0.057495014751868,0.057495014751868
-8059,5610,6602,0.0530621910173341,0.0530621910173341
-8060,6602,3731,0.0543021802328704,0.0543021802328704
-8061,3731,6603,0.107126213030051,0.107126213030051
-8062,6603,4486,0.0992014153017681,0.0992014153017681
-8064,302,396,0.456543205648827,0.456543205648827
-8065,396,6604,0.263692963912388,0.263692963912388
-8067,2108,5986,0.103617400145952,0.103617400145952
-8068,5986,6605,0.103377873268697,0.103377873268697
-9343,7304,2051,0.0535709121596095,0.0535709121596095
-8070,4763,6169,0.176859243925992,0.176859243925992
-8123,6640,6641,0.17629957299909,0.17629957299909
-8071,6169,6260,0.145538243855646,0.145538243855646
-8072,6260,3917,0.186355414418251,0.186355414418251
-8075,6608,6609,0.216668843775513,0.216668843775513
-8076,6609,5988,0.0945207273969085,0.0945207273969085
-8077,5988,2122,0.100941576479339,0.100941576479339
-8078,2122,6610,0.0983635555045419,0.0983635555045419
-8079,6610,6611,0.0970315915473971,0.0970315915473971
-8081,6612,6613,0.0935811526066721,0.0935811526066721
-8082,6613,2749,0.0990634268639465,0.0990634268639465
-8083,2749,6614,0.105679418235948,0.105679418235948
-8085,6615,6616,0.101635566171867,0.101635566171867
-8086,6616,6617,0.0962607674133666,0.0962607674133666
-8087,6617,6618,0.0951534169408166,0.0951534169408166
-8088,6618,6619,0.0938879229278784,0.0938879229278784
-17940,6560,10223,0.0802385671723254,0.0802385671723254
-8090,6620,6621,0.160330485968093,0.160330485968093
-8094,6623,1791,0.109097036983099,0.109097036983099
-8095,1791,3615,0.039522374569603,0.039522374569603
-8096,3615,6624,0.0738542372087066,0.0738542372087066
-8097,6624,6625,0.00831390386589708,0.00831390386589708
-8098,6625,6626,0.070757439886615,0.070757439886615
-8099,6626,6627,0.0728730586061825,0.0728730586061825
-8100,6627,5098,0.0960515227378026,0.0960515227378026
-8101,5098,6628,0.0550201636939116,0.0550201636939116
-8103,6630,239,0.0379460853943731,0.0379460853943731
-13573,9130,3,0.109013561390269,0.109013561390269
-8105,6631,6632,0.0782857815609104,0.0782857815609104
-8106,6632,6533,0.166563544591406,0.166563544591406
-8108,4496,6633,0.110872689467253,0.110872689467253
-8109,6633,2525,0.333067333185797,0.333067333185797
-8111,6530,6634,0.0105197308884475,0.0105197308884475
-9336,7300,4780,0.0501146245066156,0.0501146245066156
-8112,6634,6635,2.4458667171276,2.4458667171276
-8113,6636,3095,0.197330202512711,0.197330202512711
-8114,3095,3205,0.202310741049047,0.202310741049047
-8115,3205,6118,0.200935805580311,0.200935805580311
-8116,6118,1915,0.200185455389542,0.200185455389542
-8118,6637,5842,0.204932644380513,0.204932644380513
-8119,5842,6638,0.194625839062785,0.194625839062785
-8121,6639,3724,0.202719550339155,0.202719550339155
-8122,3724,6640,0.104515203903702,0.104515203903702
-8124,6641,2622,0.176067278462879,0.176067278462879
-8125,2622,5203,0.176917243967006,0.176917243967006
-8126,5203,6232,0.177139986115085,0.177139986115085
-8129,6643,6644,0.177268373064057,0.177268373064057
-8130,6644,6600,0.175826872766799,0.175826872766799
-8131,6600,6646,0.177773484713149,0.177773484713149
-8133,6647,6648,0.177957472274986,0.177957472274986
-8134,6648,6649,0.169816854222751,0.169816854222751
-8135,6649,6650,0.0183704581232897,0.0183704581232897
-8136,6650,6651,0.180283145370232,0.180283145370232
-8137,6651,6652,0.0228081566299403,0.0228081566299403
-8139,6653,1499,0.197154421185115,0.197154421185115
-8140,1499,188,0.204153885319108,0.204153885319108
-8141,188,5878,0.159028819712238,0.159028819712238
-8142,5878,6654,0.24236157922448,0.24236157922448
-8144,1583,6655,0.303396334779096,0.303396334779096
-8145,6656,5874,0.176427569810156,0.176427569810156
-8146,5874,6657,0.00810609260917888,0.00810609260917888
-8147,6657,6658,0.0470608013663409,0.0470608013663409
-8150,6659,6660,0.255748331282284,0.255748331282284
-8151,6661,6662,0.00688301382680834,0.00688301382680834
-8152,6662,6663,0.392909871907801,0.392909871907801
-8153,6664,1758,0.130752459577202,0.130752459577202
-8154,1758,6314,0.0908112834588078,0.0908112834588078
-8155,6314,6665,0.191679756807403,0.191679756807403
-8156,6665,763,0.155864734453911,0.155864734453911
-8157,763,6668,0.0989081569703109,0.0989081569703109
-8158,6668,1760,0.0778502447443476,0.0778502447443476
-8159,1760,6003,0.221657363761595,0.221657363761595
-8160,6003,5765,0.101345142024656,0.101345142024656
-8161,5765,4032,0.0976983696193598,0.0976983696193598
-8162,4032,6669,0.0654151166199609,0.0654151166199609
-8164,2301,1759,0.0929594689620956,0.0929594689620956
-8165,1759,150,0.2063607315498,0.2063607315498
-8166,150,1738,0.199773882802826,0.199773882802826
-8168,1953,3100,0.166887359049361,0.166887359049361
-8170,370,2529,0.0016410050164606,0.0016410050164606
-8171,2529,6670,0.0654370448512421,0.0654370448512421
-8200,6684,1172,0.140728922414785,0.140728922414785
-8172,6670,1937,0.344573874886115,0.344573874886115
-8174,6671,6672,0.176399723080376,0.176399723080376
-8176,3101,6673,0.188864615641403,0.188864615641403
-8178,4227,1805,0.201844384843532,0.201844384843532
-8179,1805,6674,0.203096969054999,0.203096969054999
-8180,6674,5847,0.205632777843381,0.205632777843381
-8181,5847,6675,0.197984723567939,0.197984723567939
-8183,6676,4226,0.190839047917349,0.190839047917349
-8185,4212,1268,0.185384243862507,0.185384243862507
-8187,6677,2875,0.129732620530101,0.129732620530101
-8188,2875,6678,0.138723736947104,0.138723736947104
-8189,6678,6679,0.13144235424121,0.13144235424121
-8190,6679,6680,0.782596772143326,0.782596772143326
-8191,3575,5642,0.141762411979774,0.141762411979774
-8192,5642,4347,0.140039066988463,0.140039066988463
-8193,4347,6345,0.13859354874742,0.13859354874742
-8194,6345,3049,0.140317315615912,0.140317315615912
-8195,3049,3024,0.0669551847418331,0.0669551847418331
-8196,3024,6681,0.0663747225163875,0.0663747225163875
-8197,6681,6682,0.00550527045183645,0.00550527045183645
-8198,6682,6683,0.122014480736259,0.122014480736259
-8199,6683,6684,0.0145554158979999,0.0145554158979999
-8201,1172,892,0.137892873302074,0.137892873302074
-8202,892,4475,0.139838739747675,0.139838739747675
-8203,4475,2777,0.135724572944392,0.135724572944392
-8204,2777,5266,0.129198654341627,0.129198654341627
-8205,5266,6685,0.122514628608539,0.122514628608539
-8206,6685,6686,0.20769100942942,0.20769100942942
-8207,6686,6357,0.202692590161251,0.202692590161251
-8208,6357,2390,0.107324644883127,0.107324644883127
-8209,2390,6687,0.139594845742255,0.139594845742255
-8210,6687,6688,0.0752686220951058,0.0752686220951058
-8211,6688,749,0.0665961818211898,0.0665961818211898
-8212,749,1567,0.140763317861176,0.140763317861176
-8213,1567,6689,0.140174033607804,0.140174033607804
-8215,6691,696,0.200953877059722,0.200953877059722
-8216,696,6692,0.202493921890496,0.202493921890496
-8218,508,6693,0.0440506867837982,0.0440506867837982
-8219,6694,1202,0.170408371052522,0.170408371052522
-8220,1202,6695,0.022095029398504,0.022095029398504
-8221,6695,3781,0.199196539116323,0.199196539116323
-8222,3781,6696,0.154646276165852,0.154646276165852
-8224,951,6697,0.162889491053556,0.162889491053556
-8225,6697,4890,0.17202029430472,0.17202029430472
-8226,4890,6698,0.182585439334225,0.182585439334225
-8227,6698,5488,0.173629132461636,0.173629132461636
-8230,6700,6701,0.054263196932367,0.054263196932367
-8231,6701,5807,0.103685962200744,0.103685962200744
-8232,5807,6702,0.106632774624389,0.106632774624389
-8233,6702,6703,0.0962060876195832,0.0962060876195832
-8234,6703,5959,0.00690380150934747,0.00690380150934747
-8235,5959,6704,0.00415729025946559,0.00415729025946559
-8236,6704,3004,0.101332185729619,0.101332185729619
-8237,3004,4395,0.106412326585027,0.106412326585027
-8238,4395,6705,0.103936208820228,0.103936208820228
-8239,6705,6706,0.108885043469445,0.108885043469445
-8240,6706,6707,0.0530572853327784,0.0530572853327784
-8241,6707,6708,0.0508918154467618,0.0508918154467618
-8242,6708,6709,0.103982459974641,0.103982459974641
-8243,6709,6710,0.100220871190445,0.100220871190445
-8244,6710,6711,0.00631643031082491,0.00631643031082491
-8245,6711,6188,0.105471969629518,0.105471969629518
-8246,6188,6712,0.0552929480053166,0.0552929480053166
-8247,6712,6713,0.051155648874288,0.051155648874288
-8249,4495,6714,0.112097289917407,0.112097289917407
-8250,6714,1079,0.0913714399600763,0.0913714399600763
-8251,1079,2524,0.245312559433029,0.245312559433029
-8253,6006,6251,0.204148069385731,0.204148069385731
-8254,6251,6715,0.203065667560916,0.203065667560916
-8256,2935,6716,0.266313303297407,0.266313303297407
-8257,6416,3741,0.135496222887927,0.135496222887927
-8258,3741,5854,0.117997896305679,0.117997896305679
-8260,2305,161,0.314948131318509,0.314948131318509
-8263,6717,3071,0.175732613824838,0.175732613824838
-8264,3071,6718,0.173767654321711,0.173767654321711
-8265,6718,6100,0.243539432543733,0.243539432543733
-8267,3290,98,0.422419964097428,0.422419964097428
-8269,4373,2854,0.205542196291208,0.205542196291208
-8271,6719,1596,0.0969388330111528,0.0969388330111528
-8273,118,6721,0.0966297992771619,0.0966297992771619
-8274,6721,6722,0.0414535753801991,0.0414535753801991
-8276,2311,6580,0.108271978342533,0.108271978342533
-8277,6580,6723,0.0197325066377101,0.0197325066377101
-8301,4041,6740,0.178573713835442,0.178573713835442
-8302,6740,1829,0.177333893618754,0.177333893618754
-8279,4433,6724,0.324356944785499,0.324356944785499
-8282,6725,6088,0.0237314605310015,0.0237314605310015
-8283,6088,4822,0.0875664870066569,0.0875664870066569
-8284,4822,6726,0.0475371228844605,0.0475371228844605
-8285,6726,4515,0.133316815943664,0.133316815943664
-8286,4515,5237,0.132189806591607,0.132189806591607
-9507,2581,5179,0.178384896285487,0.178384896285487
-8287,5237,6727,0.137381332135233,0.137381332135233
-8288,6727,6728,0.132866818946611,0.132866818946611
-8289,6728,1673,0.133389434002772,0.133389434002772
-8290,1673,6729,0.137304160443328,0.137304160443328
-8292,6730,6731,0.0127908749904874,0.0127908749904874
-8324,6753,6754,0.0516246355995179,0.0516246355995179
-8293,6731,6734,0.253997048781863,0.253997048781863
-8294,6734,6735,0.103152527560213,0.103152527560213
-8296,6736,6737,0.0131672047429292,0.0131672047429292
-8298,4636,5383,0.185495216645111,0.185495216645111
-8300,5972,4041,0.174731707729605,0.174731707729605
-8303,1829,6741,0.102538685907791,0.102538685907791
-8304,4575,6440,0.137081553799117,0.137081553799117
-8305,6440,5291,0.136014333235461,0.136014333235461
-8306,5291,6742,0.135023999424587,0.135023999424587
-8307,6742,10,0.133312225882616,0.133312225882616
-8308,10,6394,0.135032006709,0.135032006709
-8309,6394,6743,0.132451340826744,0.132451340826744
-8310,6743,6744,0.135765849385072,0.135765849385072
-8311,6744,6745,0.133823531129847,0.133823531129847
-8313,6746,6747,0.134513077577228,0.134513077577228
-8314,6747,6748,0.134201163774105,0.134201163774105
-8316,6749,1938,0.0948580215175547,0.0948580215175547
-8318,307,5887,0.0912856383131267,0.0912856383131267
-8319,5887,6750,0.00721526462075332,0.00721526462075332
-8320,6750,6751,0.0269156344716724,0.0269156344716724
-8323,6752,6753,0.0510955164610192,0.0510955164610192
-8325,6754,6755,0.0510906826304937,0.0510906826304937
-8326,6755,6756,0.0511615632316368,0.0511615632316368
-8327,6756,1661,0.0519510824904343,0.0519510824904343
-8328,1661,6758,0.0509873448397052,0.0509873448397052
-8329,6758,6759,0.0522106080921687,0.0522106080921687
-8330,6759,6760,0.0506887592311432,0.0506887592311432
-18752,5186,5654,0.105380231545906,0.105380231545906
-8331,6760,6761,0.0573063184317804,0.0573063184317804
-8333,6762,6763,0.0501245455122697,0.0501245455122697
-8334,6763,6764,0.0489376044154541,0.0489376044154541
-8337,6766,6767,0.0490039328328154,0.0490039328328154
-8338,6767,6768,0.0513498171240697,0.0513498171240697
-8339,6768,6769,0.0498709246005866,0.0498709246005866
-8341,5533,6770,0.292387787290413,0.292387787290413
-8343,2972,6771,0.121066844508317,0.121066844508317
-8344,6771,6093,0.143799158144466,0.143799158144466
-8345,6093,6772,0.01594646132934,0.01594646132934
-8346,6772,6773,0.00797333604469033,0.00797333604469033
-8347,6773,6774,0.00589372782719237,0.00589372782719237
-8349,6775,6776,0.135681018337986,0.135681018337986
-8350,6776,2490,0.131411131535027,0.131411131535027
-8351,2490,2835,0.135427320939223,0.135427320939223
-8353,4067,6052,0.133451561970317,0.133451561970317
-8354,6052,5792,0.201431723471221,0.201431723471221
-8356,6777,6778,0.137939265537406,0.137939265537406
-8358,6658,6779,0.0952206682824548,0.0952206682824548
-8359,6779,1328,0.20245506080321,0.20245506080321
-9582,1393,7408,0.0523989189771459,0.0523989189771459
-8360,1328,6780,0.24344994454685,0.24344994454685
-8362,6781,6338,0.132299767169153,0.132299767169153
-18540,10312,7538,0.710682259466036,0.710682259466036
-8363,6338,3026,0.142960379522958,0.142960379522958
-8364,3026,6782,0.131957413991529,0.131957413991529
-8365,6782,6783,0.00572653872195823,0.00572653872195823
-8366,6783,6784,0.13893806084239,0.13893806084239
-8367,6784,1155,0.138805738856212,0.138805738856212
-8368,1155,876,0.139884571461894,0.139884571461894
-8370,4464,2784,0.134142589801556,0.134142589801556
-8371,2784,5255,0.132457483790055,0.132457483790055
-8372,5255,4727,0.21307200925813,0.21307200925813
-8373,4727,5126,0.0748266761428759,0.0748266761428759
-8374,5126,6785,0.0660204248306932,0.0660204248306932
-8375,6785,4284,0.173603246809035,0.173603246809035
-8377,6786,6787,0.142696164770821,0.142696164770821
-8379,5475,6788,0.1766899367412,0.1766899367412
-8380,6788,6789,0.178262795240798,0.178262795240798
-8381,6789,669,0.0038695834466259,0.0038695834466259
-8382,669,6790,0.00298242718157566,0.00298242718157566
-8383,6790,6791,0.175654700740653,0.175654700740653
-8385,4603,6493,0.141540356779896,0.141540356779896
-8386,6493,6795,0.235592097571248,0.235592097571248
-8387,6795,6796,0.135380255100289,0.135380255100289
-8388,6796,6797,0.00458123097756658,0.00458123097756658
-8389,6797,6798,0.00459235047115107,0.00459235047115107
-8390,6798,6799,0.135291654892361,0.135291654892361
-8391,6799,6800,0.141019064418211,0.141019064418211
-8392,6800,821,0.136459904501488,0.136459904501488
-8393,821,3562,0.138377698701616,0.138377698701616
-8395,5772,516,0.0304460136124682,0.0304460136124682
-8397,6411,6801,0.0202183008206165,0.0202183008206165
-8398,6802,469,0.0770276556079661,0.0770276556079661
-8399,469,4171,0.115648628347006,0.115648628347006
-8400,4171,6803,0.135804309767261,0.135804309767261
-8401,6803,4756,0.071946790437269,0.071946790437269
-8403,6804,6805,0.127899734301329,0.127899734301329
-8405,6803,4172,0.13716080109606,0.13716080109606
-8406,4172,470,0.118198242572908,0.118198242572908
-8407,470,6806,0.0738815709398357,0.0738815709398357
-8410,6807,6808,0.0966312020179035,0.0966312020179035
-8411,6808,6809,0.078738376832051,0.078738376832051
-8412,6809,3373,0.430297684252256,0.430297684252256
-8414,6810,6811,0.203442237788957,0.203442237788957
-8415,1476,6812,0.245653934383614,0.245653934383614
-8416,6812,6813,0.412460631108446,0.412460631108446
-8418,6814,6815,0.174359151043162,0.174359151043162
-8419,6815,3109,0.176366303019304,0.176366303019304
-8420,3109,6816,0.193801807541949,0.193801807541949
-8421,6816,6817,0.0198367109802725,0.0198367109802725
-8422,6817,6104,0.210336723998741,0.210336723998741
-8424,6818,4370,0.0431318765981996,0.0431318765981996
-8426,2496,1451,0.0985317859583251,0.0985317859583251
-8427,1451,2853,0.10657030011201,0.10657030011201
-8428,2853,6819,0.0983314928072937,0.0983314928072937
-8429,6819,6665,0.0998633676523793,0.0998633676523793
-8430,6665,6820,0.100599054724802,0.100599054724802
-8431,6820,3821,0.10490937410086,0.10490937410086
-8432,3821,5897,0.102058293498771,0.102058293498771
-9656,6387,7441,0.131317068143471,0.131317068143471
-8433,5897,6821,0.102847878519627,0.102847878519627
-8435,1593,1644,0.201270216910902,0.201270216910902
-8436,1644,6822,0.105737900324602,0.105737900324602
-8437,6822,4218,0.0969375306307301,0.0969375306307301
-8438,4218,6823,0.101326281592707,0.101326281592707
-8439,6823,198,0.0969958932624718,0.0969958932624718
-8440,198,2927,0.100607212393453,0.100607212393453
-8441,2927,5309,0.0991277824360909,0.0991277824360909
-8442,5309,1465,0.0998634796625755,0.0998634796625755
-8445,1176,6825,0.181656671362534,0.181656671362534
-8447,6826,6827,0.865493060175873,0.865493060175873
-8448,3119,6828,0.283790323154486,0.283790323154486
-8450,3496,6829,0.0523352446605108,0.0523352446605108
-8451,6829,6830,0.0732524388814314,0.0732524388814314
-8452,6830,3663,0.0505681915693724,0.0505681915693724
-8453,3663,4996,0.130580462322132,0.130580462322132
-8455,6831,6247,0.199011000686174,0.199011000686174
-8456,6247,6832,0.199751548882436,0.199751548882436
-8458,1495,184,0.20195222577189,0.20195222577189
-8459,184,1712,0.203399715506048,0.203399715506048
-8460,1712,6833,0.205087968397347,0.205087968397347
-8461,6833,1578,0.200928350075194,0.200928350075194
-8463,6835,5869,0.177962583931279,0.177962583931279
-8464,5869,1321,0.176970219219333,0.176970219219333
-8465,1321,1377,0.177352733194459,0.177352733194459
-8466,1377,6836,0.0602165463968322,0.0602165463968322
-8467,6836,6837,0.0823104914192672,0.0823104914192672
-8468,6837,4694,0.116790101887087,0.116790101887087
-18756,1322,1378,0.175845021978343,0.175845021978343
-8469,4694,6838,0.160065096905242,0.160065096905242
-8470,6838,5335,0.187163981040998,0.187163981040998
-8471,5335,6839,0.265241255095212,0.265241255095212
-8473,4319,4507,0.0895898957022207,0.0895898957022207
-8474,4507,6840,0.0124803827841914,0.0124803827841914
-8475,6840,6841,0.091716588631721,0.091716588631721
-8476,6841,6842,0.00740292454463184,0.00740292454463184
-8477,6842,285,0.0146970591982782,0.0146970591982782
-8478,285,5069,0.0844368792913957,0.0844368792913957
-13551,9125,9126,0.0538488930045225,0.0538488930045225
-8479,5069,6837,0.103562524850142,0.103562524850142
-8480,6837,6843,0.0961927404969427,0.0961927404969427
-8481,6843,6844,0.0998943541512786,0.0998943541512786
-8482,6844,6845,0.102052212683234,0.102052212683234
-8483,6845,6846,0.456427940885819,0.456427940885819
-8484,6847,4419,0.193121729151288,0.193121729151288
-8485,4419,6848,0.226127592349504,0.226127592349504
-8486,6848,5329,0.136063050211474,0.136063050211474
-8488,4363,1444,0.202825103543368,0.202825103543368
-8489,1444,6849,0.200067420030691,0.200067420030691
-8490,6849,6850,0.207042581432814,0.207042581432814
-8491,6850,5890,0.198967544378973,0.198967544378973
-8493,6851,6852,0.0470486102019036,0.0470486102019036
-8494,6852,6853,0.0201453367541323,0.0201453367541323
-8495,6853,6854,0.0193839654418635,0.0193839654418635
-8496,6854,6855,0.0201881052382051,0.0201881052382051
-8497,6855,6856,0.0195037980214848,0.0195037980214848
-8498,6856,6857,0.0198459509091597,0.0198459509091597
-8499,6857,6858,0.0195037180586887,0.0195037180586887
-8500,6858,6859,0.0199058270401761,0.0199058270401761
-8501,6859,1871,0.0228399539785669,0.0228399539785669
-8504,6861,6862,0.100580939051626,0.100580939051626
-8505,6862,6863,0.206622253376394,0.206622253376394
-8506,6863,6377,0.103010255262607,0.103010255262607
-8507,6377,4832,0.10370389707419,0.10370389707419
-8508,4832,6717,0.103234622646169,0.103234622646169
-8509,6717,6864,0.103703073117676,0.103703073117676
-8510,6864,6865,0.0481477570236711,0.0481477570236711
-8512,5856,6866,0.107372117361429,0.107372117361429
-8513,6866,6867,0.050649728561771,0.050649728561771
-8514,6867,4989,0.0553571225017631,0.0553571225017631
-8515,4989,6868,0.101318948663251,0.101318948663251
-8518,6869,3823,0.172685696470764,0.172685696470764
-8520,6870,5902,0.0785311515160625,0.0785311515160625
-8521,5902,6871,0.0681549663304684,0.0681549663304684
-8522,6871,1996,0.0322361485277902,0.0322361485277902
-8523,1996,1587,0.080539505433719,0.080539505433719
-8524,1587,6872,0.0787299872144713,0.0787299872144713
-8525,6872,1652,0.0828966049530784,0.0828966049530784
-9751,2441,5738,0.170975903813153,0.170975903813153
-8528,6874,5702,0.0496353984033346,0.0496353984033346
-8529,5702,6875,0.0484896470155752,0.0484896470155752
-8530,6875,6876,0.0523105680266916,0.0523105680266916
-8531,6876,6877,0.100875098780012,0.100875098780012
-8532,6877,6878,0.0515810406741165,0.0515810406741165
-8533,6878,6879,0.0480493192441991,0.0480493192441991
-8534,6879,6532,0.0493288645061034,0.0493288645061034
-8535,6532,6880,0.0170276228852009,0.0170276228852009
-8537,1128,6881,0.0506249344560303,0.0506249344560303
-8538,6881,6882,0.0501120958003525,0.0501120958003525
-8539,6882,6883,0.0495209017571618,0.0495209017571618
-8540,6883,3846,0.0513776048731037,0.0513776048731037
-8541,3846,6884,0.0512508950828751,0.0512508950828751
-8542,6884,5564,0.0499163404494349,0.0499163404494349
-8543,5564,6885,0.0796596960320095,0.0796596960320095
-8544,6885,6886,0.709637932237075,0.709637932237075
-8545,3929,5619,0.0645570027229576,0.0645570027229576
-8546,5619,3704,0.0990278562894358,0.0990278562894358
-9775,2551,7512,0.408787216175776,0.408787216175776
-8547,3704,709,0.100036425190807,0.100036425190807
-8548,709,6887,0.100506522060904,0.100506522060904
-8549,6887,6888,0.0973098804153082,0.0973098804153082
-8550,6888,4190,0.138652686970481,0.138652686970481
-8551,4190,2516,0.130567043389136,0.130567043389136
-8552,2516,6727,0.134515842897036,0.134515842897036
-8553,6727,4804,0.136148376446663,0.136148376446663
-8555,6890,6891,0.127464290413413,0.127464290413413
-8558,4625,1248,0.132737908659339,0.132737908659339
-8560,4557,2726,0.131937670977173,0.131937670977173
-8561,2726,6892,0.133086814424956,0.133086814424956
-8562,6892,6893,0.0108053798662109,0.0108053798662109
-8564,6894,6753,0.13855912942418,0.13855912942418
-8565,6753,3977,0.202975190536315,0.202975190536315
-8567,4726,5125,0.0514216994322944,0.0514216994322944
-8569,6895,2262,0.104167713702112,0.104167713702112
-8570,2262,3612,0.100511868469799,0.100511868469799
-8571,3612,6896,0.101962634245626,0.101962634245626
-8572,6896,2111,0.0983046285910296,0.0983046285910296
-8573,2111,6000,0.10637347320659,0.10637347320659
-8574,6000,6897,0.0969032855683131,0.0969032855683131
-8575,6897,6898,1.19574032306189,1.19574032306189
-8576,3909,1049,0.101955415333633,0.101955415333633
-8577,1049,6280,0.110396580345644,0.110396580345644
-8580,4727,6902,0.104166457963925,0.104166457963925
-8581,6902,5404,0.105633279342784,0.105633279342784
-8582,5404,3137,0.103462723581867,0.103462723581867
-8583,3137,3910,0.106566211179802,0.106566211179802
-8585,6685,6904,0.1009798833353,0.1009798833353
-8586,6904,6905,0.0978861772455395,0.0978861772455395
-8588,6906,6907,0.0919209174538617,0.0919209174538617
-8589,6907,3448,0.0130685497791993,0.0130685497791993
-8590,3448,6908,0.0816132292801626,0.0816132292801626
-8591,6908,6909,0.0115722967665996,0.0115722967665996
-8592,6909,6910,0.0993816484498638,0.0993816484498638
-8593,6910,805,0.0976551438474913,0.0976551438474913
-8594,805,6911,0.0993747261569693,0.0993747261569693
-8595,6911,6912,0.089888887106785,0.089888887106785
-8596,6912,6913,0.0146747703329366,0.0146747703329366
-8598,6914,1237,0.101225406841245,0.101225406841245
-8600,4811,2178,0.0990205816012607,0.0990205816012607
-8602,596,6305,0.0508308915230223,0.0508308915230223
-8603,6305,350,0.0658146671565848,0.0658146671565848
-8604,350,6425,0.0344816945169531,0.0344816945169531
-8605,6425,6423,0.0330039992635189,0.0330039992635189
-8606,6423,5343,0.065281602891384,0.065281602891384
-8607,5343,4631,0.0645633414559121,0.0645633414559121
-8608,4631,4639,0.0344816846016407,0.0344816846016407
-8610,1260,4538,0.0975702004070908,0.0975702004070908
-8611,4538,4546,0.0337389213160247,0.0337389213160247
-8612,4546,6284,0.0652815653305245,0.0652815653305245
-8613,6284,2702,0.0682127836725729,0.0682127836725729
-8614,2702,2716,0.0295959518245788,0.0295959518245788
-8615,2716,6915,0.102272155307925,0.102272155307925
-8617,277,6916,0.0242091643473284,0.0242091643473284
-8618,6916,6917,0.127799932481727,0.127799932481727
-8620,6918,6919,0.100490474583826,0.100490474583826
-8621,6919,3936,0.103902551113693,0.103902551113693
-8623,5625,109,0.104159188317199,0.104159188317199
-9852,7555,7556,0.127428116197139,0.127428116197139
-8625,720,6920,0.107136629659166,0.107136629659166
-8626,6920,6921,0.0878190742496679,0.0878190742496679
-8627,6921,760,0.053327069779034,0.053327069779034
-8628,760,4203,0.0493954421158038,0.0493954421158038
-19719,10631,10629,0.0181769844157554,0.0181769844157554
-8629,4203,4204,0.0379739020862165,0.0379739020862165
-8630,4204,1070,0.0609601987006813,0.0609601987006813
-8631,1070,1071,0.0198138913639204,0.0198138913639204
-8632,1071,2506,0.0820743434648716,0.0820743434648716
-8634,6922,6923,0.0332474984310345,0.0332474984310345
-8635,6923,6924,0.0309457475923951,0.0309457475923951
-8636,6924,6925,0.06835161173269,0.06835161173269
-8641,2302,152,0.296479047850973,0.296479047850973
-8642,152,1739,0.201132602649999,0.201132602649999
-8643,1739,1717,0.0492912051446921,0.0492912051446921
-8645,6315,6820,0.175487833230143,0.175487833230143
-8646,6820,764,0.157172405718933,0.157172405718933
-8647,764,6004,0.389410143877071,0.389410143877071
-8648,6004,6244,0.10052021368651,0.10052021368651
-11455,8264,8265,0.215908830963319,0.215908830963319
-8649,6244,6929,0.161155152616492,0.161155152616492
-8651,6930,6931,0.00809135923630026,0.00809135923630026
-8652,6931,6869,0.0905079323611068,0.0905079323611068
-8653,6869,6932,0.702159216296169,0.702159216296169
-8654,4432,6933,0.289985249196455,0.289985249196455
-8655,6933,4666,0.0976954476351155,0.0976954476351155
-8656,4666,1333,0.0998446345260267,0.0998446345260267
-8657,1333,1388,0.0991189577824547,0.0991189577824547
-8658,1388,6935,0.105783123390058,0.105783123390058
-8659,6935,6850,0.108467199591529,0.108467199591529
-8660,6850,4706,0.0984536865396038,0.0984536865396038
-8661,4706,6936,0.0998638834924626,0.0998638834924626
-8662,6936,1757,0.0991299509071506,0.0991299509071506
-8664,2103,5985,0.0990139620475444,0.0990139620475444
-8665,5985,6937,0.103423317739921,0.103423317739921
-8666,6937,6938,0.197320023520399,0.197320023520399
-8667,6939,6940,0.0449145362146055,0.0449145362146055
-8668,6940,5016,0.051579913616047,0.051579913616047
-8670,6941,5111,0.0702390251054822,0.0702390251054822
-8671,5111,4709,0.111086762480312,0.111086762480312
-8672,4709,6805,0.12579570489738,0.12579570489738
-8673,6805,6942,0.0911912161186586,0.0911912161186586
-8674,6942,6943,0.0891583873267196,0.0891583873267196
-8675,6943,5415,0.0932705447088281,0.0932705447088281
-8676,5415,3141,0.0911590609752313,0.0911590609752313
-8677,3141,6944,0.0907415627456138,0.0907415627456138
-8678,6944,6945,0.0904253930261683,0.0904253930261683
-8679,6945,6282,0.0922034833120112,0.0922034833120112
-8680,6282,6946,0.0889556226914396,0.0889556226914396
-8681,6946,6947,0.115025423362082,0.115025423362082
-19720,10629,10630,0.00318458504180934,0.00318458504180934
-8684,4222,6948,0.095205143123347,0.095205143123347
-8685,6948,6949,0.0983217542586648,0.0983217542586648
-8686,6949,970,0.0973398284250994,0.0973398284250994
-8732,6248,6975,0.200150775141685,0.200150775141685
-8687,970,6950,0.0518030391212137,0.0518030391212137
-8688,6950,5288,0.0521176321182923,0.0521176321182923
-8689,5288,3153,0.0937167269922867,0.0937167269922867
-8690,3153,4969,0.095648805014101,0.095648805014101
-8691,4969,6951,0.121296465267735,0.121296465267735
-8717,1073,2508,0.0718764157350201,0.0718764157350201
-8692,6951,6952,0.17298014935093,0.17298014935093
-8694,2653,4114,0.0446473392844233,0.0446473392844233
-8695,4114,6503,0.0806749392848293,0.0806749392848293
-11460,8268,8269,0.0284404063889237,0.0284404063889237
-8696,6503,6953,0.0279965631557129,0.0279965631557129
-8698,6779,1327,0.149226176774822,0.149226176774822
-8700,4207,6955,0.0359776758472589,0.0359776758472589
-8701,6955,6956,0.0798254305300323,0.0798254305300323
-8702,4494,6957,0.0178038045740406,0.0178038045740406
-8703,6957,6958,0.00431775087438634,0.00431775087438634
-8704,6958,2148,0.120300859607691,0.120300859607691
-8705,2148,6960,0.151431823224066,0.151431823224066
-8706,6960,6961,0.22023318510828,0.22023318510828
-8707,6961,6962,0.137151335408755,0.137151335408755
-8708,6962,6963,0.0242055632480646,0.0242055632480646
-8709,6963,2150,0.0925314192010664,0.0925314192010664
-8710,2150,6964,0.068609567754435,0.068609567754435
-8712,6808,6965,0.180937589294771,0.180937589294771
-8713,6966,761,0.0469463147130834,0.0469463147130834
-8714,761,4205,0.0748160898012537,0.0748160898012537
-8715,4205,4398,0.0770157906569643,0.0770157906569643
-8716,4398,1073,0.0796290264805075,0.0796290264805075
-8746,6967,5689,0.127751851222379,0.127751851222379
-8719,271,2710,0.601401594481822,0.601401594481822
-11825,321,7799,0.115552151499094,0.115552151499094
-8720,2710,6969,0.136362355996719,0.136362355996719
-8721,6969,6742,0.135618421861975,0.135618421861975
-8722,6742,6141,0.132822121773709,0.132822121773709
-8723,6141,4014,0.136061285283967,0.136061285283967
-8724,4014,6970,0.13345730315891,0.13345730315891
-8725,6970,6971,0.133022272157071,0.133022272157071
-8726,6971,6972,0.0472485991851602,0.0472485991851602
-8727,6972,3385,0.0819883397602158,0.0819883397602158
-8729,6959,6973,0.0390638293285452,0.0390638293285452
-19721,10630,10622,0.0559555137804764,0.0559555137804764
-8731,6974,6248,0.201212600703242,0.201212600703242
-8733,6975,1496,0.201553427836696,0.201553427836696
-8734,1496,185,0.202686112287629,0.202686112287629
-8735,185,1713,0.204711477509581,0.204711477509581
-8736,1713,6976,0.201975316682274,0.201975316682274
-8737,6976,1579,0.167005027356132,0.167005027356132
-8738,1579,6977,0.309934492691155,0.309934492691155
-8739,1105,5871,0.176266848523138,0.176266848523138
-8740,5871,1323,0.177439022365804,0.177439022365804
-8741,1323,1379,0.176412320749863,0.176412320749863
-8742,1379,6978,0.0608448771470547,0.0608448771470547
-8744,6843,4695,0.114533137035158,0.114533137035158
-11961,2694,6570,0.292174399102456,0.292174399102456
-8745,4695,6967,0.15860414860374,0.15860414860374
-8747,5689,5336,0.153402847395547,0.153402847395547
-8749,6979,6980,0.0492417429246164,0.0492417429246164
-8750,6980,6981,0.0330798745582329,0.0330798745582329
-8751,6981,6982,0.110138574841473,0.110138574841473
-8756,6986,6701,0.0557097589480938,0.0557097589480938
-8757,6701,6987,0.145037158424782,0.145037158424782
-8759,6988,648,0.139238555969963,0.139238555969963
-8760,648,683,0.0653158999110773,0.0653158999110773
-8761,683,6989,0.0669742957793313,0.0669742957793313
-8762,6989,1988,0.0901527916408211,0.0901527916408211
-8763,1988,1972,0.0388238770836602,0.0388238770836602
-8764,1972,4588,0.104222260658419,0.104222260658419
-8765,4588,4594,0.0293535516568484,0.0293535516568484
-8766,4594,6498,0.0726584855189905,0.0726584855189905
-8767,6498,6481,0.0601855426433911,0.0601855426433911
-8768,6481,2470,0.141630886586724,0.141630886586724
-10003,6678,7628,0.0924131784678609,0.0924131784678609
-8771,6991,2401,0.344415463633539,0.344415463633539
-8772,2401,6992,0.121260728440928,0.121260728440928
-8773,6992,6604,0.426798504146684,0.426798504146684
-8774,6604,6993,0.0779497578426637,0.0779497578426637
-8775,6993,6994,0.328092841207435,0.328092841207435
-8776,6994,6997,0.409387625139532,0.409387625139532
-8777,6997,6998,0.0280465218891248,0.0280465218891248
-8778,6998,6999,0.240899685742567,0.240899685742567
-8780,7001,7002,0.172502393042501,0.172502393042501
-8781,7002,2338,0.177215228547836,0.177215228547836
-8782,2338,7003,0.175043780881437,0.175043780881437
-8783,7003,4782,0.243888745485023,0.243888745485023
-8784,4782,6558,0.132880580598771,0.132880580598771
-8785,6558,7004,0.106726338328234,0.106726338328234
-8787,2471,5909,0.20581191299575,0.20581191299575
-8789,7005,797,0.197387527656916,0.197387527656916
-10028,5604,7642,0.0520984767564003,0.0520984767564003
-8790,797,7006,0.203747525811746,0.203747525811746
-8793,7007,7008,0.196982052931457,0.196982052931457
-8794,7008,3062,0.205201724322207,0.205201724322207
-8795,3062,7009,0.184895139192435,0.184895139192435
-8796,7009,7010,0.0217892666308482,0.0217892666308482
-8798,7011,7012,0.200694925007541,0.200694925007541
-8799,7012,6367,0.0706060127631708,0.0706060127631708
-8800,6367,7013,0.13113311504647,0.13113311504647
-8801,7013,5949,0.203040029193448,0.203040029193448
-11962,6570,4451,0.149457420972406,0.149457420972406
-8802,5949,5141,0.190833355605879,0.190833355605879
-8804,2236,4909,0.189094446681925,0.189094446681925
-8805,4909,6613,0.199822606976101,0.199822606976101
-8806,6613,7014,0.196131290300381,0.196131290300381
-8807,7014,7015,0.207545863379423,0.207545863379423
-10052,7653,1099,0.0482102658012733,0.0482102658012733
-8809,4072,6057,0.192026411520301,0.192026411520301
-20532,10847,10848,0.0340308021704454,0.0340308021704454
-8810,6057,5797,0.200508266391225,0.200508266391225
-8812,7016,7017,0.20408918142509,0.20408918142509
-8813,7017,6590,0.201086157953578,0.201086157953578
-8814,6590,7018,0.202602619918689,0.202602619918689
-8816,7019,4577,0.129538344988774,0.129538344988774
-8817,4577,6441,0.138680608354748,0.138680608354748
-8818,6441,5293,0.134070515766336,0.134070515766336
-8819,5293,6970,0.13449026404854,0.13449026404854
-8820,6970,13,0.134902446032247,0.134902446032247
-8822,7020,382,0.124884712447894,0.124884712447894
-8823,382,7021,0.135229787557418,0.135229787557418
-8824,7021,7022,0.132193897477211,0.132193897477211
-8826,7023,7024,0.137222417835135,0.137222417835135
-8827,7024,7025,0.130431649234377,0.130431649234377
-8828,7025,7026,0.138849105164774,0.138849105164774
-8830,6206,7027,0.182945185531037,0.182945185531037
-8831,7027,7028,0.175756239821697,0.175756239821697
-20483,10830,10831,0.0908860058291454,0.0908860058291454
-8833,7029,7030,0.203242108673725,0.203242108673725
-8834,7030,7031,0.150413392817758,0.150413392817758
-8835,7031,2977,0.0550192556799276,0.0550192556799276
-8837,657,1886,0.0454008957908892,0.0454008957908892
-8838,1886,528,0.053551482812009,0.053551482812009
-8841,6092,1889,0.0508386682559075,0.0508386682559075
-8842,1889,7033,0.0498613554304776,0.0498613554304776
-8843,7033,7034,0.00951828955857414,0.00951828955857414
-8844,7034,7035,0.036894485571684,0.036894485571684
-8845,7035,6085,0.0480584959434146,0.0480584959434146
-8847,742,4527,0.0498820470218468,0.0498820470218468
-8848,4527,7036,0.0491481642660053,0.0491481642660053
-8849,7036,5246,0.0491592800418928,0.0491592800418928
-8850,5246,7037,0.0481362905740046,0.0481362905740046
-8851,7037,7038,0.0454453697348376,0.0454453697348376
-8852,7038,7039,0.0963504134151864,0.0963504134151864
-8853,7039,7040,0.0519319872070824,0.0519319872070824
-8854,7040,1663,0.0497523111621545,0.0497523111621545
-8855,1663,7041,0.0529510578680093,0.0529510578680093
-8856,7041,7042,0.0505381295725577,0.0505381295725577
-8857,7042,7043,0.0514848181594461,0.0514848181594461
-8858,7043,7044,0.0741692266458179,0.0741692266458179
-8861,7046,2493,0.132768776448504,0.132768776448504
-20533,10817,10849,0.0041587253937853,0.0041587253937853
-8864,2531,1932,0.0596099109005186,0.0596099109005186
-8865,1932,7047,0.205921914653592,0.205921914653592
-8867,7048,4043,0.179136537042624,0.179136537042624
-8868,4043,7049,0.176989263158491,0.176989263158491
-8869,7049,7050,0.100459005094488,0.100459005094488
-8871,7051,5531,0.109415807818528,0.109415807818528
-8872,5531,7052,0.29371056329192,0.29371056329192
-8874,7053,6824,0.0545745509742182,0.0545745509742182
-8875,6824,2424,0.081950775026488,0.081950775026488
-8876,2424,7054,0.050315704306832,0.050315704306832
-8877,7054,3228,0.0836964212853156,0.0836964212853156
-8879,4957,4034,0.0947298154946536,0.0947298154946536
-8881,7055,5863,0.174726781940175,0.174726781940175
-8882,5863,1311,0.179868913340571,0.179868913340571
-8883,1311,7056,0.241558820409428,0.241558820409428
-8885,7057,1506,0.131503726493835,0.131503726493835
-8886,1506,7058,0.131454642278669,0.131454642278669
-8888,1059,7059,0.104267738567829,0.104267738567829
-10122,3779,7683,0.15407703010384,0.15407703010384
-8890,4436,56,0.118965433489173,0.118965433489173
-8891,56,5316,0.100608812091724,0.100608812091724
-8892,5316,3496,0.0998861232245216,0.0998861232245216
-8893,3496,3665,0.201207219763356,0.201207219763356
-8894,3665,7060,0.199611951396181,0.199611951396181
-8895,7060,7061,0.203598851492666,0.203598851492666
-8896,7061,5840,0.200253664127546,0.200253664127546
-8897,5840,267,0.165246780486595,0.165246780486595
-8899,7062,7063,0.478103640034168,0.478103640034168
-8900,7064,5164,0.146200467670157,0.146200467670157
-8901,5164,6860,0.179928785347538,0.179928785347538
-8902,6860,7065,0.0135383927129561,0.0135383927129561
-8903,7065,2385,0.105505653234926,0.105505653234926
-8905,3637,7066,0.183542084850882,0.183542084850882
-8907,5956,7067,0.0986953923423101,0.0986953923423101
-8908,7067,3021,0.00874922983807779,0.00874922983807779
-20416,10767,10781,0.00791916641108638,0.00791916641108638
-8910,7068,4380,0.0528744797047038,0.0528744797047038
-8911,4380,7069,0.100067477522489,0.100067477522489
-8912,7069,7070,0.00503051016222424,0.00503051016222424
-8913,7070,7071,0.0533378396892988,0.0533378396892988
-8914,7071,7072,0.0517118729985249,0.0517118729985249
-8915,7072,7073,0.0528720185185965,0.0528720185185965
-8916,7073,7074,0.0524160104100909,0.0524160104100909
-8917,7074,7075,0.0591259627190951,0.0591259627190951
-8918,7075,7076,0.0472141967853771,0.0472141967853771
-8919,7076,7077,0.0523938554164358,0.0523938554164358
-8920,7077,7078,0.0519698920804767,0.0519698920804767
-18299,6996,6464,0.157978818539649,0.157978818539649
-18300,6464,5526,0.155386531700968,0.155386531700968
-8921,7078,7079,0.0533446665935528,0.0533446665935528
-8922,7079,6175,0.0539515629761608,0.0539515629761608
-8923,6175,7080,0.0522978151475426,0.0522978151475426
-19723,10628,10634,0.0467495933951474,0.0467495933951474
-8924,7080,3310,0.051621129553778,0.051621129553778
-8925,3310,7081,0.0537939712546602,0.0537939712546602
-8926,7081,7082,0.0517442194955157,0.0517442194955157
-8957,6821,767,0.155663516472162,0.155663516472162
-8928,6333,7083,0.0368397497726965,0.0368397497726965
-8930,7084,756,0.02205451477657,0.02205451477657
-8931,756,1542,0.146566188527195,0.146566188527195
-8933,7085,7086,0.470303961651379,0.470303961651379
-8936,6193,6949,0.198646201862192,0.198646201862192
-8937,6949,7088,0.203154460121287,0.203154460121287
-8938,7088,7089,0.0315254339634626,0.0315254339634626
-11963,4451,5499,0.142902063925945,0.142902063925945
-8939,1547,4267,0.203186762796229,0.203186762796229
-8940,4267,281,0.118834586231474,0.118834586231474
-8942,4988,5631,0.199717559309749,0.199717559309749
-8943,5631,2363,0.114164400355602,0.114164400355602
-8944,2363,4145,0.172388156251151,0.172388156251151
-8945,4145,4750,0.181329134759237,0.181329134759237
-8946,4750,7090,0.0742131518569267,0.0742131518569267
-8947,7090,6563,0.101353119972535,0.101353119972535
-8949,561,652,0.180277903435168,0.180277903435168
-8950,652,7091,0.1782898608686,0.1782898608686
-8951,7091,4618,0.177690137841113,0.177690137841113
-8952,4618,6484,0.148000947434632,0.148000947434632
-8953,6484,3683,0.147902463423831,0.147902463423831
-8955,7092,562,0.138318567115304,0.138318567115304
-14765,7355,5462,0.177046926118077,0.177046926118077
-8958,767,6719,0.219350766482543,0.219350766482543
-8959,6719,6005,0.0551645975375965,0.0551645975375965
-8961,7093,7094,0.0134618314671123,0.0134618314671123
-8962,7094,7095,0.0768336523164077,0.0768336523164077
-8964,4351,7096,0.187825105408858,0.187825105408858
-8966,5169,7097,0.173957232527163,0.173957232527163
-8967,7097,2358,0.178391537286392,0.178391537286392
-8968,2358,4158,0.173186099094122,0.173186099094122
-8969,4158,4745,0.175498953556533,0.175498953556533
-8970,4745,6540,0.175479189908249,0.175479189908249
-8971,6540,7098,0.165132887334241,0.165132887334241
-8974,900,4481,0.13673901951185,0.13673901951185
-8975,4481,2805,0.133564794339907,0.133564794339907
-8976,2805,5271,0.130621351715569,0.130621351715569
-8977,5271,6911,0.123597927289001,0.123597927289001
-8978,6911,7100,0.15221685519733,0.15221685519733
-8979,7100,6360,0.259362269049004,0.259362269049004
-8981,7102,704,0.204412961923,0.204412961923
-19726,10627,10635,0.0226092820114286,0.0226092820114286
-8984,7103,1210,0.168411442672594,0.168411442672594
-8985,1210,7104,0.0210253069731913,0.0210253069731913
-8986,7104,3769,0.199568149574658,0.199568149574658
-8987,3769,7105,0.154728508227155,0.154728508227155
-8988,7105,960,0.176377624617973,0.176377624617973
-8989,960,7106,0.174688777733473,0.174688777733473
-8990,7106,4897,0.160532597504136,0.160532597504136
-8991,4897,7107,0.182971792068578,0.182971792068578
-8992,7107,5494,0.175655210225522,0.175655210225522
-8994,7108,7109,0.103100291492917,0.103100291492917
-8995,7109,7110,0.101964294660044,0.101964294660044
-8998,7112,6130,0.00642185713601216,0.00642185713601216
-8999,6130,3973,0.100482235790598,0.100482235790598
-9000,3973,7018,0.0985643830580019,0.0985643830580019
-9001,7018,1404,0.0976294798550341,0.0976294798550341
-9002,1404,7113,0.0934722476940573,0.0934722476940573
-9003,7113,3377,0.114974498647875,0.114974498647875
-9004,3377,5719,0.0923374297912636,0.0923374297912636
-9006,4633,4552,0.211900461491767,0.211900461491767
-9008,7114,1219,0.0873426128412716,0.0873426128412716
-9009,1219,7115,0.154859667381265,0.154859667381265
-9011,128,4195,0.0990809801322014,0.0990809801322014
-9012,4195,2526,0.225168737431611,0.225168737431611
-9015,7118,7119,0.0484685816363468,0.0484685816363468
-9016,7119,6647,0.0431240450937402,0.0431240450937402
-9017,6647,7120,0.0651283567093235,0.0651283567093235
-9020,7121,5612,0.0589161599786899,0.0589161599786899
-9021,5612,7122,0.0519812671049742,0.0519812671049742
-9022,7122,3734,0.0556068739901258,0.0556068739901258
-9024,4852,7123,0.126059374848785,0.126059374848785
-9025,7123,7124,0.118149722641793,0.118149722641793
-9026,7124,7125,0.121835161075312,0.121835161075312
-9027,7125,7126,0.110094663779518,0.110094663779518
-9028,7126,4678,0.101155068622002,0.101155068622002
-9029,4678,4925,0.0375558738681089,0.0375558738681089
-9031,7127,5718,0.122304701667431,0.122304701667431
-9033,7129,7130,0.00755996146089403,0.00755996146089403
-11437,7984,8034,0.589388539362218,0.589388539362218
-9034,7130,7131,0.0405147672355999,0.0405147672355999
-15917,9748,9104,0.13371062185673,0.13371062185673
-9036,7132,7133,0.0505601360898234,0.0505601360898234
-9037,7133,7134,0.050337833066874,0.050337833066874
-9039,2563,2043,0.341755774769512,0.341755774769512
-9040,2043,4280,0.587618591665046,0.587618591665046
-9041,4280,2317,0.145996435168453,0.145996435168453
-9042,2317,7135,0.26875426467805,0.26875426467805
-9044,4276,6167,0.145395831525207,0.145395831525207
-9045,6167,7136,0.583394412429138,0.583394412429138
-9046,7136,7137,0.0430989040252276,0.0430989040252276
-9048,7138,7139,0.17847978963111,0.17847978963111
-9049,7139,665,0.00426988518248375,0.00426988518248375
-9050,665,7140,0.0039363004033923,0.0039363004033923
-9051,7140,7141,0.126828000444838,0.126828000444838
-9052,7141,7142,0.0463243816448395,0.0463243816448395
-9053,7142,4606,0.175854779813893,0.175854779813893
-13036,8929,8930,0.492762775909981,0.492762775909981
-9054,4606,2885,0.129583918723674,0.129583918723674
-9056,818,3559,0.139007675873083,0.139007675873083
-9057,3559,5633,0.138607438022671,0.138607438022671
-9060,5632,7143,0.0971697431213832,0.0971697431213832
-9061,7143,4337,0.0573209846859246,0.0573209846859246
-9062,4337,6336,0.137619327969477,0.137619327969477
-9063,6336,3051,0.138690015537613,0.138690015537613
-9064,3051,7144,0.13740372400277,0.13740372400277
-9065,7144,7145,0.00531536492655497,0.00531536492655497
-9066,7145,7146,0.138359891845979,0.138359891845979
-9069,873,4461,0.138000198054367,0.138000198054367
-9070,4461,2781,0.134827246932882,0.134827246932882
-9073,6941,5768,0.263560531238909,0.263560531238909
-9074,5768,7148,0.00867578094755507,0.00867578094755507
-9075,6325,4168,0.192770537182593,0.192770537182593
-9076,4168,4753,0.208190261859574,0.208190261859574
-9077,4753,6544,0.199662965025148,0.199662965025148
-9078,6544,7149,0.203286576405629,0.203286576405629
-9079,7149,7150,0.188877376950956,0.188877376950956
-9080,7150,3796,0.199750569153682,0.199750569153682
-9081,3796,5939,0.152615142478991,0.152615142478991
-9082,5939,940,0.17776127985835,0.17776127985835
-9083,940,2224,0.184599395002716,0.184599395002716
-9084,2224,4874,0.160770298676863,0.160770298676863
-9085,4874,7151,0.191866995309803,0.191866995309803
-9086,7151,5472,0.170431656658562,0.170431656658562
-9087,5472,7152,0.177051030738846,0.177051030738846
-9089,7153,7154,0.0893451644905786,0.0893451644905786
-9090,7154,6170,0.0753374734775839,0.0753374734775839
-9091,6170,4764,0.177646502224828,0.177646502224828
-9092,4764,4150,0.173084945690311,0.173084945690311
-9094,2344,7155,0.117646857783728,0.117646857783728
-9095,7155,7156,0.0188390787773898,0.0188390787773898
-9096,7156,7157,0.234434662963778,0.234434662963778
-9097,7157,7158,0.0252454738977112,0.0252454738977112
-9100,7159,7160,0.136141908223257,0.136141908223257
-9101,7160,7161,0.134175303690261,0.134175303690261
-9102,7161,5540,0.104957650418394,0.104957650418394
-9103,5540,2408,0.0972515972300324,0.0972515972300324
-9104,2408,4293,0.0986699082335262,0.0986699082335262
-9105,4293,7163,0.053830719074408,0.053830719074408
-9107,7164,7165,0.0631810706690825,0.0631810706690825
-9108,7165,2982,0.341967827784909,0.341967827784909
-9109,2982,7166,0.203801982791161,0.203801982791161
-9110,7166,7167,0.199088364823678,0.199088364823678
-9111,7167,7168,0.00801722711592813,0.00801722711592813
-9112,7168,7169,0.0420988990456398,0.0420988990456398
-9113,7169,7170,0.153973329045923,0.153973329045923
-9114,7170,6877,0.206323620437175,0.206323620437175
-9115,6877,1688,0.202556013709455,0.202556013709455
-10335,2984,7779,0.0471482180711068,0.0471482180711068
-9116,1688,7171,0.203959165094635,0.203959165094635
-9117,7171,2434,0.200457262733771,0.200457262733771
-9118,2434,7172,0.202529539970889,0.202529539970889
-9119,7172,6459,0.289084578375032,0.289084578375032
-19730,5374,10637,0.0120223368882016,0.0120223368882016
-9120,6459,7173,0.114101346723939,0.114101346723939
-9121,7173,7174,0.184116579370581,0.184116579370581
-9122,7174,7175,0.203885371802177,0.203885371802177
-9123,7175,7176,0.042345014713444,0.042345014713444
-9124,7176,7177,0.0543545796747623,0.0543545796747623
-9125,7177,1424,0.112240471555906,0.112240471555906
-9128,7179,6066,0.193267920890686,0.193267920890686
-9129,6066,2546,0.202503184194707,0.202503184194707
-9130,2546,7180,0.41050413821522,0.41050413821522
-9131,6215,7181,0.274932291342238,0.274932291342238
-9132,7181,7182,0.263103709588239,0.263103709588239
-9133,7182,7183,0.130644941399459,0.130644941399459
-9134,2594,5185,0.17867940782894,0.17867940782894
-9137,5066,4054,0.176950276628118,0.176950276628118
-9138,4054,7184,0.19508037930475,0.19508037930475
-19295,10466,10470,0.0590667450333129,0.0590667450333129
-9139,7184,1855,0.159486883286254,0.159486883286254
-9140,1855,2595,0.177991984486361,0.177991984486361
-9142,7132,7185,0.200740739267956,0.200740739267956
-9144,317,5720,0.10120960072344,0.10120960072344
-9146,7186,7178,0.0998150102985703,0.0998150102985703
-9147,7178,7187,0.0486556483534758,0.0486556483534758
-9148,7187,7188,0.0504244958733159,0.0504244958733159
-9149,7188,6720,0.0492257170939005,0.0492257170939005
-9150,6720,1139,0.0498554245278369,0.0498554245278369
-9151,1139,6900,0.0496729718772752,0.0496729718772752
-9152,6900,7189,0.0498269762893686,0.0498269762893686
-9153,7189,7190,0.0493080365100491,0.0493080365100491
-9154,7190,3869,0.0507905077365378,0.0507905077365378
-9155,3869,7191,0.0511248031667964,0.0511248031667964
-9156,7191,5583,0.0514153335527058,0.0514153335527058
-9158,6374,7192,0.0508291685906189,0.0508291685906189
-9159,7192,4828,0.0505211822659055,0.0505211822659055
-9160,4828,7193,0.0991435070786191,0.0991435070786191
-9161,7193,7194,0.0991520630524694,0.0991520630524694
-9162,7194,7195,0.0477883926406413,0.0477883926406413
-9163,7195,7196,0.0494484339552123,0.0494484339552123
-9164,7196,7197,0.0162046310747774,0.0162046310747774
-9166,7198,6674,0.0990044216409842,0.0990044216409842
-9167,6674,3118,0.097669089391913,0.097669089391913
-9168,3118,7199,0.284505571449601,0.284505571449601
-9169,7199,6008,0.094118222257641,0.094118222257641
-9170,6008,2844,0.0930401433253343,0.0930401433253343
-9171,2844,3493,0.0866696350082772,0.0866696350082772
-9172,3493,5349,0.0889131869713594,0.0889131869713594
-9174,5392,2946,0.0903397575627338,0.0903397575627338
-9175,2946,6812,0.0903546565690543,0.0903546565690543
-9176,6812,1813,0.0889131954631002,0.0889131954631002
-9179,7201,7202,0.0514316470718889,0.0514316470718889
-9180,7202,571,0.0452247620537137,0.0452247620537137
-9181,571,4984,0.0498774301127379,0.0498774301127379
-9182,4984,7203,0.0499341834444621,0.0499341834444621
-9183,7203,7204,0.048540539361363,0.048540539361363
-9184,7204,7205,0.049454954432791,0.049454954432791
-9185,7205,7206,0.0536988191890685,0.0536988191890685
-9186,7206,7207,0.0531339953218732,0.0531339953218732
-9188,7208,7209,0.0488986834694409,0.0488986834694409
-10408,7087,974,0.0520701135747565,0.0520701135747565
-9190,3616,7210,0.0490025655343953,0.0490025655343953
-9191,7210,7211,0.0492346778344629,0.0492346778344629
-9192,7211,6627,0.0474835705848566,0.0474835705848566
-9193,6627,7212,0.0259857221754392,0.0259857221754392
-9195,7213,2937,0.0797219985274474,0.0797219985274474
-9197,4927,7214,0.0675624031978383,0.0675624031978383
-9198,7214,7215,0.172837829649445,0.172837829649445
-9199,7215,7216,0.0152456900319388,0.0152456900319388
-9201,7217,7218,0.150068688599712,0.150068688599712
-9202,7218,3717,0.0523950557178934,0.0523950557178934
-9203,3717,7219,0.104026300075926,0.104026300075926
-9204,7219,7220,0.176478214187187,0.176478214187187
-9205,7220,2618,0.176744455093666,0.176744455093666
-9206,2618,7221,0.0524078444870275,0.0524078444870275
-9207,7221,5199,0.124408908082812,0.124408908082812
-9208,5199,6236,0.175254349133775,0.175254349133775
-9209,6236,7222,0.181371367707484,0.181371367707484
-9210,7222,7223,0.17624861030264,0.17624861030264
-10431,7818,3372,0.256942906695214,0.256942906695214
-9211,7223,7224,0.177882160330428,0.177882160330428
-9212,7224,6596,0.176655139096338,0.176655139096338
-9213,6596,7225,0.176764713771947,0.176764713771947
-9214,7225,7117,0.195263815592674,0.195263815592674
-9215,7117,7226,0.162883394969853,0.162883394969853
-9217,7227,7228,0.0929813395053153,0.0929813395053153
-9218,7228,7229,0.0382886967355643,0.0382886967355643
-9220,5754,5537,0.136674994706822,0.136674994706822
-9222,7230,2419,0.0601608416165443,0.0601608416165443
-9224,7231,1877,0.0370441528846065,0.0370441528846065
-9225,1877,7232,0.131692111532173,0.131692111532173
-9227,7233,7234,0.109254283787097,0.109254283787097
-9228,7234,7235,0.0988980977520615,0.0988980977520615
-9229,7235,7236,0.100150595242985,0.100150595242985
-9230,7236,7237,0.0982491727225652,0.0982491727225652
-9231,7237,7238,0.102801611377818,0.102801611377818
-9232,7238,3624,0.10072637054969,0.10072637054969
-9233,3624,7239,0.0490877236423196,0.0490877236423196
-9234,7239,7240,0.0506406047895119,0.0506406047895119
-9236,7241,7242,0.053434962453162,0.053434962453162
-9238,7243,2049,0.0999533143701506,0.0999533143701506
-9239,2049,6322,0.101276003642563,0.101276003642563
-9240,6322,7245,0.101332248433824,0.101332248433824
-9241,7245,7246,0.0464773018813961,0.0464773018813961
-9242,7246,3478,0.0519094915924,0.0519094915924
-9243,3478,7247,0.0444674652348498,0.0444674652348498
-9244,7247,6076,0.0542711695249793,0.0542711695249793
-9245,6076,7248,0.0457685619049607,0.0457685619049607
-9246,7248,3693,0.0511581578497335,0.0511581578497335
-9247,3693,7249,0.0484213428818718,0.0484213428818718
-9248,7249,4568,0.050423249762551,0.050423249762551
-9249,4568,7250,0.105671525256593,0.105671525256593
-9251,3486,5352,0.142707971743977,0.142707971743977
-9252,5352,5389,0.0672375375003041,0.0672375375003041
-9254,6807,7251,0.174038770872886,0.174038770872886
-9255,5582,7252,0.0700127444942287,0.0700127444942287
-9256,3438,7253,0.0456922323357007,0.0456922323357007
-9257,7253,5712,0.0536735809918437,0.0536735809918437
-9258,5712,7254,0.0996465050991051,0.0996465050991051
-9259,7254,7177,0.0990312619116669,0.0990312619116669
-9261,2234,5135,0.107869698056021,0.107869698056021
-9263,5150,4905,0.0686856789021931,0.0686856789021931
-9264,4905,6617,0.200618729294218,0.200618729294218
-9265,6617,7255,0.197431040074393,0.197431040074393
-9266,7255,7256,0.208183749937444,0.208183749937444
-9267,7256,645,0.141740585620374,0.141740585620374
-9268,645,7257,0.130628958724451,0.130628958724451
-9269,7257,1991,0.0908850253123808,0.0908850253123808
-9270,1991,1975,0.0373563291181619,0.0373563291181619
-9271,1975,4592,0.133760117820733,0.133760117820733
-9272,4592,6479,0.133361447138617,0.133361447138617
-9273,6479,2465,0.142787478559072,0.142787478559072
-9275,7258,905,0.276860539558146,0.276860539558146
-9276,905,7259,0.128469118479352,0.128469118479352
-9278,7260,7261,0.202325557275685,0.202325557275685
-9279,7261,7262,0.200099452464053,0.200099452464053
-9281,6555,7263,0.106048977208119,0.106048977208119
-9283,2464,5907,0.204805215249635,0.204805215249635
-9284,5907,7264,0.200064951669816,0.200064951669816
-9285,7264,792,0.198575253788857,0.198575253788857
-9286,792,7265,0.203153130979463,0.203153130979463
-20553,10855,10830,0.00226863418878014,0.00226863418878014
-9287,7265,4356,0.200718125919129,0.200718125919129
-9288,4356,7266,0.203231013450801,0.203231013450801
-9289,7266,3059,0.208369469805255,0.208369469805255
-9290,3059,7267,0.184116398047724,0.184116398047724
-9292,7268,7269,0.172274443384772,0.172274443384772
-9293,7269,7270,0.174965358395498,0.174965358395498
-9294,7270,7271,0.171051925436011,0.171051925436011
-9295,7271,4777,0.251271094456806,0.251271094456806
-9297,7272,7273,0.142786274588455,0.142786274588455
-9298,7273,7257,0.143845033730321,0.143845033730321
-9299,7257,2012,0.148104007431453,0.148104007431453
-9300,2012,7274,0.146908840218292,0.146908840218292
-9303,3209,6121,0.198338421830571,0.198338421830571
-9305,1920,7245,0.200452444306493,0.200452444306493
-9306,7245,3264,0.201454965709232,0.201454965709232
-9307,3264,7275,0.199928677430985,0.199928677430985
-9308,7275,75,0.205218774272454,0.205218774272454
-9309,75,3514,0.203667659516003,0.203667659516003
-9310,3514,4256,0.200449218475779,0.200449218475779
-9312,7276,7277,0.199018039984475,0.199018039984475
-9314,3099,7278,0.127218718588174,0.127218718588174
-9315,7279,7280,0.0142903725965103,0.0142903725965103
-9316,7280,7281,0.105207552208829,0.105207552208829
-9317,7282,7283,0.0344899807253543,0.0344899807253543
-9318,7283,221,0.0709873405596775,0.0709873405596775
-9319,221,484,0.00880336166381634,0.00880336166381634
-9320,484,7284,0.0467023879280561,0.0467023879280561
-9321,7284,7285,0.0520434565562666,0.0520434565562666
-9322,7285,7286,0.0966986010135768,0.0966986010135768
-9324,7287,7288,0.0474221057340072,0.0474221057340072
-9325,7288,7289,0.0544896557893494,0.0544896557893494
-18313,7291,7292,0.0491935106031602,0.0491935106031602
-12266,8623,8624,0.00987394368395642,0.00987394368395642
-9326,7289,7293,0.050792182381771,0.050792182381771
-9327,7293,7294,0.0490541601102182,0.0490541601102182
-9328,7294,3625,0.0491311379128154,0.0491311379128154
-9329,3625,7295,0.0500044548990436,0.0500044548990436
-9330,7295,7296,0.0493114932484129,0.0493114932484129
-9331,7296,7297,0.0492273088766844,0.0492273088766844
-9332,7297,7298,0.0497149327544833,0.0497149327544833
-9333,7298,7299,0.052416983039433,0.052416983039433
-9334,7299,1775,0.0489179547921138,0.0489179547921138
-9335,1775,7300,0.0992252392752366,0.0992252392752366
-9338,1523,7301,0.0991304181855472,0.0991304181855472
-9340,4180,7302,0.159005264658095,0.159005264658095
-9342,7303,7304,0.0508070845581107,0.0508070845581107
-9344,2051,7305,0.0464895652372381,0.0464895652372381
-9346,6323,7306,0.0487652334573382,0.0487652334573382
-9347,7306,7275,0.0511008721086019,0.0511008721086019
-9348,7275,7307,0.0472167292045061,0.0472167292045061
-9349,7307,3479,0.0519136696037329,0.0519136696037329
-9350,3479,7308,0.0469673771341736,0.0469673771341736
-9351,7308,6077,0.0514245726695928,0.0514245726695928
-9353,7309,3694,0.0517124258100223,0.0517124258100223
-9354,3694,7310,0.0465067719763774,0.0465067719763774
-9355,7310,4569,0.0489536209610463,0.0489536209610463
-9356,4569,7311,0.0489635595580148,0.0489635595580148
-9357,7311,7312,0.0558091568866214,0.0558091568866214
-9359,5166,6862,0.178524347295205,0.178524347295205
-10575,7382,7866,0.0530283440074436,0.0530283440074436
-9361,5665,7313,0.0484754519993524,0.0484754519993524
-9362,7313,7314,0.161386441141289,0.161386441141289
-9363,7314,57,0.142345062746265,0.142345062746265
-9365,3497,7315,0.199650199137315,0.199650199137315
-9366,7315,7316,0.20195222577189,0.20195222577189
-9368,7317,7318,0.0198371749129227,0.0198371749129227
-9369,7318,2347,0.132104544578518,0.132104544578518
-9370,2347,4152,0.17573096379452,0.17573096379452
-9371,4152,4739,0.172852869151079,0.172852869151079
-9372,4739,6534,0.176755786446123,0.176755786446123
-9373,6534,7319,0.165399065875657,0.165399065875657
-9376,1193,7321,0.0221951663944447,0.0221951663944447
-9377,7321,3785,0.200018254719297,0.200018254719297
-9379,6356,2387,0.110864888603468,0.110864888603468
-9380,2387,7322,0.139379472361554,0.139379472361554
-9381,7322,7323,0.046481070265731,0.046481070265731
-9382,7323,745,0.0926146092564692,0.0926146092564692
-9383,745,1563,0.142337228385207,0.142337228385207
-9384,1563,7324,0.139015648234869,0.139015648234869
-9385,7324,7325,0.121637038292373,0.121637038292373
-9387,7326,1054,0.0187920378071022,0.0187920378071022
-9388,1054,7327,0.1804815052178,0.1804815052178
-9389,7327,7328,0.200952784069958,0.200952784069958
-9390,7328,2873,0.135770477885413,0.135770477885413
-9391,2873,7329,0.140734857106897,0.140734857106897
-9392,7329,7330,0.130551116437319,0.130551116437319
-9394,3573,5641,0.135671111475822,0.135671111475822
-9395,5641,4346,0.139178472263861,0.139178472263861
-9397,6344,3047,0.139334930188281,0.139334930188281
-9398,3047,7331,0.13779347001033,0.13779347001033
-9399,7331,7332,0.00320242529462838,0.00320242529462838
-9400,7332,7333,0.124149220639337,0.124149220639337
-9401,7333,7334,0.0152895413448354,0.0152895413448354
-9402,7334,1168,0.139240705026111,0.139240705026111
-9403,1168,888,0.137184892852111,0.137184892852111
-9404,888,4473,0.140290329638987,0.140290329638987
-9405,4473,2795,0.133122605689938,0.133122605689938
-18387,8972,8990,0.0135489498420418,0.0135489498420418
-9406,2795,5263,0.132274155849312,0.132274155849312
-9408,5264,7335,0.142105114812744,0.142105114812744
-9409,7336,7337,0.0976207961374284,0.0976207961374284
-9410,7337,4886,0.157275932372423,0.157275932372423
-9411,4886,7338,0.185720302610988,0.185720302610988
-9412,7338,5484,0.174899259954025,0.174899259954025
-9413,5484,7339,0.200596009359583,0.200596009359583
-9415,7001,7340,0.179314344082203,0.179314344082203
-9416,7340,3105,0.172536320867715,0.172536320867715
-9417,3105,7341,0.196295851159965,0.196295851159965
-9418,7341,7342,0.0146987319128723,0.0146987319128723
-9419,7342,5274,0.233778976885029,0.233778976885029
-9421,61,3550,0.201334976523304,0.201334976523304
-9423,4229,1512,0.0573285646726125,0.0573285646726125
-9424,1512,1812,0.080316497766985,0.080316497766985
-9425,1812,1792,0.0864981124104349,0.0864981124104349
-9426,1792,5766,0.0789087886834876,0.0789087886834876
-9427,5766,7199,0.0992911764787047,0.0992911764787047
-9428,7199,6828,0.11119492664509,0.11119492664509
-9429,6828,5849,0.0944254133826228,0.0944254133826228
-9430,5849,6009,0.0132155676036954,0.0132155676036954
-9431,6009,6306,0.0820521132716854,0.0820521132716854
-9432,6306,7343,0.105450198242036,0.105450198242036
-9433,7343,6621,0.143519415278471,0.143519415278471
-9434,6621,7344,1.27038946039582,1.27038946039582
-9437,4173,4758,0.21160422195521,0.21160422195521
-9439,7347,7348,0.135937832662874,0.135937832662874
-9440,7348,7349,0.00392915540186096,0.00392915540186096
-9441,7349,7350,0.00435925191977174,0.00435925191977174
-9442,7350,7351,0.134680718743296,0.134680718743296
-9443,7351,7352,0.142353643667365,0.142353643667365
-9444,7352,822,0.136144392169031,0.136144392169031
-9445,822,3563,0.139511434934294,0.139511434934294
-9447,4757,6547,0.198421257470946,0.198421257470946
-9448,6547,7353,0.203512578195826,0.203512578195826
-9449,7353,7354,0.189733642798723,0.189733642798723
-9450,7354,3791,0.198902472958717,0.198902472958717
-9452,7356,1156,0.139895555737197,0.139895555737197
-9453,1156,877,0.139167763247538,0.139167763247538
-9454,877,4465,0.138362926550376,0.138362926550376
-9455,4465,2785,0.134223449290719,0.134223449290719
-9456,2785,5256,0.132255447080442,0.132255447080442
-10701,7933,7934,0.0165824928197296,0.0165824928197296
-9457,5256,6902,0.213396689593523,0.213396689593523
-9458,6902,7357,0.137952680025601,0.137952680025601
-9460,7358,7359,0.0873817304884455,0.0873817304884455
-9461,7359,5476,0.17425617170475,0.17425617170475
-9462,5476,7360,0.176755476074969,0.176755476074969
-9463,7360,7361,0.179271064370159,0.179271064370159
-9464,7361,670,0.00299320804688776,0.00299320804688776
-9465,670,7362,0.00367138449467953,0.00367138449467953
-9466,7362,7363,0.175413304982356,0.175413304982356
-9467,7363,4602,0.174300257248449,0.174300257248449
-9468,4602,6494,0.14109328269368,0.14109328269368
-9470,6339,3027,0.140999530277673,0.140999530277673
-9471,3027,7364,0.134294188280294,0.134294188280294
-9472,7364,7367,0.00539295394286677,0.00539295394286677
-9473,7367,7368,0.0958510973743428,0.0958510973743428
-9474,7369,7370,0.0190810494123846,0.0190810494123846
-9475,7370,4174,0.200419085556528,0.200419085556528
-9476,4174,4759,0.205255972403598,0.205255972403598
-9478,7371,1504,0.200818042076817,0.200818042076817
-9479,1504,177,0.202381091183512,0.202381091183512
-9481,7048,5860,0.176960295698989,0.176960295698989
-9482,5860,1308,0.177680958846967,0.177680958846967
-9483,1308,7372,0.242287040915104,0.242287040915104
-9485,7373,7374,0.0554606112260645,0.0554606112260645
-9486,7374,6759,0.139083865409791,0.139083865409791
-9487,6759,3983,0.201208667852087,0.201208667852087
-9488,3983,7042,0.200146227687253,0.200146227687253
-9489,7042,3429,0.200588668938452,0.200588668938452
-9491,7375,7376,0.134975501915893,0.134975501915893
-9492,7376,2494,0.132763759551609,0.132763759551609
-9493,2494,2841,0.125447252672452,0.125447252672452
-9495,7377,1766,0.0535653036014808,0.0535653036014808
-9496,1766,7378,0.148946577862237,0.148946577862237
-9497,7378,7379,0.151136159766357,0.151136159766357
-9498,7379,2978,0.0542010510807056,0.0542010510807056
-9500,6210,7380,0.184339220967731,0.184339220967731
-9501,7380,7381,0.177783326711723,0.177783326711723
-9503,7055,4046,0.178402656739544,0.178402656739544
-9504,4046,7382,0.177334708763743,0.177334708763743
-9505,7382,1847,0.175265460280809,0.175265460280809
-9506,1847,2581,0.177411624203835,0.177411624203835
-9508,5179,7383,0.0621659509396009,0.0621659509396009
-9510,7384,5530,0.101603812835917,0.101603812835917
-9511,5530,6476,0.0959541548395336,0.0959541548395336
-9512,6476,7385,0.197309689587966,0.197309689587966
-9514,7386,4578,0.133367493492184,0.133367493492184
-9515,4578,6442,0.135224444657643,0.135224444657643
-9516,6442,5294,0.135202388191056,0.135202388191056
-9517,5294,6971,0.132090452543352,0.132090452543352
-9519,7387,6793,0.0526421759963202,0.0526421759963202
-9520,6793,2426,0.0832334466071371,0.0832334466071371
-9521,2426,7292,0.0515611894823623,0.0515611894823623
-9522,7292,3230,0.0818841223845197,0.0818841223845197
-9523,3230,7388,0.142866769580008,0.142866769580008
-9525,7389,7390,0.203322823967769,0.203322823967769
-9529,7391,7392,0.135325738854945,0.135325738854945
-9530,7392,7393,0.132395815694125,0.132395815694125
-9531,7393,7394,0.135014881681412,0.135014881681412
-9532,7394,7395,0.132077333868835,0.132077333868835
-9535,7397,621,0.0257970801977961,0.0257970801977961
-9537,4075,6060,0.199263565882924,0.199263565882924
-9538,6060,5800,0.199550446273018,0.199550446273018
-9540,7398,3097,0.199450454556748,0.199450454556748
-9541,3097,3207,0.202536688546866,0.202536688546866
-9542,3207,6119,0.201707926741417,0.201707926741417
-9543,6119,1917,0.201109266380341,0.201109266380341
-9544,1917,7243,0.20045244430598,0.20045244430598
-9545,7243,594,0.202390514467061,0.202390514467061
-9547,7399,5843,0.208569621956493,0.208569621956493
-9549,7400,5659,0.10300363118025,0.10300363118025
-9550,5659,7401,0.0544972381418925,0.0544972381418925
-9552,6194,6950,0.191455920710939,0.191455920710939
-9553,6950,7402,0.209004541630565,0.209004541630565
-9555,4943,7403,0.0144437903083984,0.0144437903083984
-9556,7403,3000,0.101061674656442,0.101061674656442
-9558,6639,3962,0.136668682711291,0.136668682711291
-9559,3962,4361,0.121869293781819,0.121869293781819
-20411,9207,10780,0.0112983850763668,0.0112983850763668
-9561,5171,5225,0.145976272368254,0.145976272368254
-9562,5225,1866,0.0654044096593951,0.0654044096593951
-9563,1866,5084,0.0770856255669816,0.0770856255669816
-9564,5084,2809,0.113066726070966,0.113066726070966
-9565,2809,3368,0.152693063908693,0.152693063908693
-9566,3368,7404,0.0530057643448654,0.0530057643448654
-9567,7404,4944,0.0497811011847154,0.0497811011847154
-9568,4944,7405,0.0515530101953733,0.0515530101953733
-9569,7405,7217,0.0502978935844785,0.0502978935844785
-9570,7217,7406,0.0537233169488665,0.0537233169488665
-9571,7406,7407,0.0412354910733997,0.0412354910733997
-9572,6416,4212,0.100784166153009,0.100784166153009
-9573,4212,190,0.175257609965618,0.175257609965618
-9574,190,4532,0.201882877149858,0.201882877149858
-9575,4532,5431,0.198227529862783,0.198227529862783
-9576,5431,5972,0.107244272330712,0.107244272330712
-9577,5972,2255,0.104270609577454,0.104270609577454
-9578,2255,6131,0.104982960169425,0.104982960169425
-9579,6131,3998,0.104249966263654,0.104249966263654
-9580,3998,7048,0.105712541492873,0.105712541492873
-9581,7048,1393,0.105952500116488,0.105952500116488
-9583,7408,7055,0.0530917174300864,0.0530917174300864
-9584,7055,7409,0.0515249594325266,0.0515249594325266
-9585,7409,3389,0.0512512544679775,0.0512512544679775
-9586,3389,7410,0.0515249594325266,0.0515249594325266
-9587,7410,4504,0.051986836558228,0.051986836558228
-9588,4504,3539,0.0507992547126353,0.0507992547126353
-9589,3539,7411,0.0505170014633714,0.0505170014633714
-9590,7411,7412,0.0515690276546841,0.0515690276546841
-9592,5066,6400,0.0525526328752235,0.0525526328752235
-9593,6400,6835,0.0526723733629873,0.0526723733629873
-9594,6835,7413,0.0505686622438464,0.0505686622438464
-9595,7413,1105,0.0506198937481409,0.0506198937481409
-9596,1105,7414,0.0824276303743622,0.0824276303743622
-9598,3863,7415,0.0529481461592885,0.0529481461592885
-9599,7415,6656,0.0485933921065039,0.0485933921065039
-9600,6656,7416,0.0551266417503484,0.0551266417503484
-9601,7416,7417,0.698080046436177,0.698080046436177
-9602,3179,7418,0.0616464790427922,0.0616464790427922
-9603,7418,5002,0.0485639637102659,0.0485639637102659
-9604,5002,7419,0.0540110826611525,0.0540110826611525
-9605,7419,5725,0.0437502401390831,0.0437502401390831
-9606,5725,724,0.0271601591292424,0.0271601591292424
-9607,724,7059,0.100733087825974,0.100733087825974
-9608,7059,7314,0.111000885564944,0.111000885564944
-9610,7421,3610,0.212938945536276,0.212938945536276
-9611,3610,2128,0.151144951480704,0.151144951480704
-10843,154,8006,0.0789597424143419,0.0789597424143419
-9613,5998,2327,0.147931201391184,0.147931201391184
-9614,2327,7422,0.151462381546094,0.151462381546094
-9615,2016,354,0.0832039426217647,0.0832039426217647
-9616,354,2024,0.270665538753682,0.270665538753682
-9620,4944,7424,0.200356357596052,0.200356357596052
-9622,2981,7425,0.200823510551274,0.200823510551274
-9623,7425,7426,0.200629159279387,0.200629159279387
-9624,7426,7427,0.00781704540286186,0.00781704540286186
-9625,7427,7428,0.196215671376464,0.196215671376464
-9626,7428,6876,0.205224182417126,0.205224182417126
-9627,6876,1687,0.205021376956907,0.205021376956907
-9628,1687,7429,0.205696359665547,0.205696359665547
-9629,7429,2432,0.199163881347575,0.199163881347575
-9630,2432,7431,0.20247617593456,0.20247617593456
-9632,6213,7432,0.274944028390563,0.274944028390563
-9633,7432,7433,0.263513794727665,0.263513794727665
-9634,7433,6594,0.262579264502597,0.262579264502597
-9636,7254,1423,0.111990529719831,0.111990529719831
-10866,1577,8015,0.266859669077532,0.266859669077532
-9639,7434,7435,0.184117705049588,0.184117705049588
-9640,7435,7436,0.203503143312405,0.203503143312405
-9642,6593,7437,0.098508708246921,0.098508708246921
-9643,7437,7127,0.0085733378066782,0.0085733378066782
-9645,7411,4051,0.176201016140517,0.176201016140517
-9646,4051,7438,0.186623330561976,0.186623330561976
-9647,7438,1853,0.167040016171723,0.167040016171723
-9648,1853,2591,0.179034976108436,0.179034976108436
-9650,7439,6064,0.193434831975152,0.193434831975152
-9651,6064,2544,0.202007823415783,0.202007823415783
-9652,2544,7440,0.411378882387366,0.411378882387366
-9653,7129,627,0.200330694412442,0.200330694412442
-9655,18,6387,0.132089927812284,0.132089927812284
-9658,7443,7444,0.13397887621517,0.13397887621517
-9659,7444,5539,0.105571329036095,0.105571329036095
-9660,5539,2407,0.0968730605007166,0.0968730605007166
-9661,2407,4292,0.100193275722424,0.100193275722424
-9662,4292,7445,0.0505436928211805,0.0505436928211805
-9663,7445,7446,0.0548363595380854,0.0548363595380854
-9665,7447,7448,0.169947053382904,0.169947053382904
-9667,5852,1336,0.19937663187299,0.19937663187299
-9668,1336,6158,0.0597086585632686,0.0597086585632686
-9669,6158,7449,0.153340690716036,0.153340690716036
-9671,7450,4365,0.199972383812324,0.199972383812324
-9672,4365,1447,0.201108937861992,0.201108937861992
-9673,1447,7451,0.20199467881708,0.20199467881708
-9674,7451,6664,0.0985180993542889,0.0985180993542889
-9675,6664,1757,0.102800794441344,0.102800794441344
-9676,1757,3819,0.106482209599855,0.106482209599855
-9677,3819,5892,0.0976679798408968,0.0976679798408968
-9679,5332,5070,0.101261676099905,0.101261676099905
-9680,5070,6838,0.100657370443561,0.100657370443561
-9681,6838,6967,0.0976725983678986,0.0976725983678986
-9682,6967,7452,0.102800093286128,0.102800093286128
-9683,7452,7453,0.0998547767838799,0.0998547767838799
-9685,5437,7454,0.211535646678045,0.211535646678045
-9686,7454,4416,0.194570832918176,0.194570832918176
-9687,4416,7456,0.224677107455919,0.224677107455919
-9688,7456,4322,0.22100369073056,0.22100369073056
-9692,7458,7459,0.0196177061643605,0.0196177061643605
-9693,7459,7460,0.0200797614980701,0.0200797614980701
-9694,7460,7461,0.0204220717617775,0.0204220717617775
-9695,7461,7462,0.0192753952773127,0.0192753952773127
-9696,7462,7463,0.0197376280100197,0.0197376280100197
-9697,7463,1874,0.0201396312288959,0.0201396312288959
-9698,1874,7464,0.101865928676763,0.101865928676763
-9699,7464,7465,0.0516398712444199,0.0516398712444199
-9700,5894,1589,0.201207684972719,0.201207684972719
-9701,1589,1639,0.202832052664544,0.202832052664544
-9703,7466,7467,0.461510399426298,0.461510399426298
-9704,7468,7469,0.0656477480578156,0.0656477480578156
-9705,7469,7470,0.0202314805703126,0.0202314805703126
-9706,7470,7471,0.0196155905306545,0.0196155905306545
-9707,7471,7472,0.0198466389215673,0.0198466389215673
-9709,7473,7474,0.0193760769839274,0.0193760769839274
-10941,7859,4686,0.105458193161767,0.105458193161767
-16187,5815,7203,0.20368767335866,0.20368767335866
-9710,7474,7475,0.0199577496151493,0.0199577496151493
-9711,7475,1873,0.0221306450398483,0.0221306450398483
-9712,1873,7476,0.0228930859552116,0.0228930859552116
-9713,7476,7477,0.00597945379667752,0.00597945379667752
-9714,7477,7481,0.0633102446327588,0.0633102446327588
-9715,7481,7482,0.00659734634558833,0.00659734634558833
-9716,7482,7483,0.0122662226221965,0.0122662226221965
-9717,7483,7484,0.0357233876730641,0.0357233876730641
-9718,7484,4185,0.0600540815299224,0.0600540815299224
-9721,7485,4417,0.198257535408126,0.198257535408126
-9722,4417,7486,0.220999648574169,0.220999648574169
-9723,7486,4321,0.223933764288424,0.223933764288424
-9725,4364,1446,0.20650017701017,0.20650017701017
-9726,1446,7487,0.199709617072806,0.199709617072806
-9727,7487,6936,0.203411194568703,0.203411194568703
-9728,6936,5891,0.202831423382765,0.202831423382765
-9730,7488,7489,0.219847500079542,0.219847500079542
-9731,7489,7490,0.112284636925509,0.112284636925509
-9733,7491,7492,0.104975617952237,0.104975617952237
-9734,7492,7493,0.133826104897821,0.133826104897821
-9735,7493,7494,0.136182988757468,0.136182988757468
-9737,5544,2414,0.0621561786197408,0.0621561786197408
-9739,5055,4297,0.0642451197659933,0.0642451197659933
-9740,4297,7495,0.104062899405527,0.104062899405527
-9741,7495,7496,0.203687229874764,0.203687229874764
-9742,7496,2987,0.200108037782066,0.200108037782066
-9743,2987,7497,0.201819339453719,0.201819339453719
-9744,7497,7498,0.0489089257680099,0.0489089257680099
-9745,7498,7499,0.151764240821653,0.151764240821653
-9746,7499,7500,0.203024715164671,0.203024715164671
-9747,7500,6882,0.202091910987955,0.202091910987955
-9748,6882,1693,0.203443247701908,0.203443247701908
-9749,1693,7501,0.204709999833149,0.204709999833149
-9750,7501,2441,0.166684898047837,0.166684898047837
-9752,5738,5527,0.157552520143968,0.157552520143968
-9753,5527,6465,0.155770587020073,0.155770587020073
-9754,6465,7502,0.156429247159158,0.156429247159158
-9755,7502,7503,0.187478248770476,0.187478248770476
-9756,7503,7504,0.202724737429487,0.202724737429487
-10985,7367,5402,0.104549154022735,0.104549154022735
-9757,7504,1429,0.207912295088567,0.207912295088567
-9758,1429,7189,0.130843883831593,0.130843883831593
-9760,6219,7505,0.274122910361615,0.274122910361615
-9761,7505,7506,0.19636903427064,0.19636903427064
-9763,2603,5189,0.177622776028071,0.177622776028071
-9764,5189,5657,0.106425186945832,0.106425186945832
-9766,7507,7508,0.0438255563694837,0.0438255563694837
-9767,7508,4058,0.0100861958439265,0.0100861958439265
-9768,4058,7509,0.0353348287032789,0.0353348287032789
-9769,7509,7510,0.141940367411715,0.141940367411715
-9770,7510,1860,0.1765997957518,0.1765997957518
-9771,1860,2604,0.182058234750596,0.182058234750596
-9773,7511,6071,0.194146348690461,0.194146348690461
-9774,6071,2551,0.201763197291639,0.201763197291639
-9776,7513,7514,0.138564330925234,0.138564330925234
-9778,7515,686,0.203088920175274,0.203088920175274
-9779,686,1983,0.159242254447937,0.159242254447937
-9780,1983,1968,0.0374282123082397,0.0374282123082397
-9781,1968,4621,0.107323343903913,0.107323343903913
-9782,4621,6500,0.103085986769995,0.103085986769995
-9783,6500,2474,0.199627678773596,0.199627678773596
-9785,7516,2773,0.203153140061273,0.203153140061273
-9786,2773,6896,0.203229996829736,0.203229996829736
-9788,5346,7517,0.175498987947166,0.175498987947166
-9789,7517,2340,0.175921748142843,0.175921748142843
-9790,2340,7518,0.175670305695009,0.175670305695009
-9791,7518,4783,0.243270382660677,0.243270382660677
-9792,4783,7519,0.239583168661009,0.239583168661009
-9793,7519,7520,0.0339478111046773,0.0339478111046773
-9794,7520,6369,0.269882786903903,0.269882786903903
-9795,6369,7521,0.132466649716692,0.132466649716692
-9797,7522,5952,0.201032381768493,0.201032381768493
-9798,5952,5144,0.0336716082597733,0.0336716082597733
-9799,5144,5156,0.0326057448432317,0.0326057448432317
-9800,5156,2239,0.132989211721542,0.132989211721542
-9801,2239,4912,0.203447012505169,0.203447012505169
-9802,4912,6610,0.203165550596053,0.203165550596053
-18325,7524,7525,0.0423335034846442,0.0423335034846442
-9804,7523,7526,0.205397811211562,0.205397811211562
-9806,2475,5910,0.203278121280476,0.203278121280476
-9807,5910,7527,0.201064010596531,0.201064010596531
-9808,7527,800,0.20177431388955,0.20177431388955
-9809,800,7528,0.202244021720306,0.202244021720306
-9811,7529,7530,0.20077292216439,0.20077292216439
-9813,3064,7531,0.184973544349351,0.184973544349351
-9815,2632,5362,0.0801274749327823,0.0801274749327823
-9816,5362,5209,0.120994383618796,0.120994383618796
-9817,5209,6229,0.174510675248847,0.174510675248847
-9819,7532,7533,0.202574921872807,0.202574921872807
-9820,7533,7534,0.206092993605617,0.206092993605617
-9821,7534,6444,0.205010086254005,0.205010086254005
-9822,6444,5302,0.199728470714505,0.199728470714505
-9824,6656,4061,0.176855547581016,0.176855547581016
-9825,4061,7535,0.242794235361762,0.242794235361762
-9827,7536,6086,0.100844609398613,0.100844609398613
-9828,6086,7537,0.100375721785614,0.100375721785614
-9829,7537,7538,0.0511607864629355,0.0511607864629355
-9830,7538,5244,0.0495951653375039,0.0495951653375039
-9831,5244,7539,0.0519761520574234,0.0519761520574234
-9832,7539,6885,0.0502414304638419,0.0502414304638419
-9833,6885,7540,0.0499615650233233,0.0499615650233233
-9835,7541,7542,0.0351445858107267,0.0351445858107267
-9838,7544,7545,0.105704455648811,0.105704455648811
-9841,2556,7547,0.195916474446361,0.195916474446361
-9842,6224,7548,0.277797708537317,0.277797708537317
-9845,7550,7551,0.196848690524097,0.196848690524097
-9846,7551,5751,0.202697238266629,0.202697238266629
-9847,5751,7552,0.00795047859513932,0.00795047859513932
-9848,7552,7553,0.129731824653906,0.129731824653906
-9849,7553,6474,0.0638707232076661,0.0638707232076661
-9850,6474,7554,0.0334363679568542,0.0334363679568542
-20015,10180,2696,0.367929886679579,0.367929886679579
-9851,7554,7555,0.0146999916602211,0.0146999916602211
-9853,3170,7557,0.145194224111084,0.145194224111084
-9854,7557,7558,0.0835128735178232,0.0835128735178232
-9855,7558,7559,0.0585562750239905,0.0585562750239905
-9856,7559,6713,0.00611903533894709,0.00611903533894709
-9857,6713,7560,0.146921779963022,0.146921779963022
-9858,7560,5786,0.142766734982168,0.142766734982168
-9859,5786,7561,0.147333855208616,0.147333855208616
-11082,6285,2717,0.0986458045481302,0.0986458045481302
-9860,7561,7562,0.151251680669446,0.151251680669446
-9861,7562,7563,0.142846459249546,0.142846459249546
-9863,7564,3303,0.147900845771263,0.147900845771263
-9865,5316,7565,0.0511409811054889,0.0511409811054889
-9866,7565,7566,0.1490174605609,0.1490174605609
-9867,7566,3661,0.0439544289403808,0.0439544289403808
-9868,3661,3171,0.198821466322938,0.198821466322938
-9870,1541,4266,0.201902575581856,0.201902575581856
-9871,4266,280,0.117279281695443,0.117279281695443
-9873,1540,755,0.148174446133403,0.148174446133403
-9874,755,7567,0.109511008516479,0.109511008516479
-9875,7568,7569,0.504435059432168,0.504435059432168
-9876,5172,5629,0.20005288591208,0.20005288591208
-9877,5629,2361,0.11286306962317,0.11286306962317
-9878,2361,4143,0.172420177163863,0.172420177163863
-9879,4143,4747,0.180602807146659,0.180602807146659
-9880,4747,6561,0.177131591078149,0.177131591078149
-9881,6561,7570,0.0829182513004679,0.0829182513004679
-9882,7570,7571,0.0849604902234264,0.0849604902234264
-9883,7571,7572,0.039332803551206,0.039332803551206
-9885,3557,7573,0.0207104909362794,0.0207104909362794
-9886,7573,5510,0.0781175186423301,0.0781175186423301
-9887,5510,2897,0.0422469044547541,0.0422469044547541
-9889,3682,7574,0.193399178760091,0.193399178760091
-9890,7574,7575,0.146546921459533,0.146546921459533
-9891,7575,5359,0.14787210152478,0.14787210152478
-9892,5359,2682,0.147887137976142,0.147887137976142
-9893,2682,7576,0.0606198046830208,0.0606198046830208
-9895,4620,7577,0.120158924963582,0.120158924963582
-9896,7577,6702,0.146317084486212,0.146317084486212
-9897,6702,7578,0.146734472806395,0.146734472806395
-9898,7578,7579,0.145050961623328,0.145050961623328
-9899,7579,7580,0.00770297520415462,0.00770297520415462
-9900,7580,7581,0.13912090851738,0.13912090851738
-9901,7581,7582,0.0411773493232422,0.0411773493232422
-9903,2466,5908,0.205955273119341,0.205955273119341
-9904,5908,7583,0.198595406640257,0.198595406640257
-9905,7583,793,0.198805543342419,0.198805543342419
-9906,793,7584,0.20315326209993,0.20315326209993
-9907,7584,4357,0.202186223769753,0.202186223769753
-9908,4357,7585,0.201775154423619,0.201775154423619
-9910,3060,7586,0.187004558668975,0.187004558668975
-9913,7588,906,0.27600804903505,0.27600804903505
-9914,906,7589,0.12928644320394,0.12928644320394
-9916,6671,7590,0.0565797137930955,0.0565797137930955
-9917,5136,5151,0.022597397933528,0.022597397933528
-9918,5151,4906,0.0926596414619678,0.0926596414619678
-9919,4906,6616,0.200362179375123,0.200362179375123
-9920,6616,7591,0.195770799250889,0.195770799250889
-9921,7591,7592,0.206820957598552,0.206820957598552
-9925,6556,7596,0.107470441058094,0.107470441058094
-9926,7596,7597,0.0323668981715237,0.0323668981715237
-9927,7597,7598,0.201852282407455,0.201852282407455
-9928,7598,7599,0.202247125760461,0.202247125760461
-9930,7600,4778,0.250803140264124,0.250803140264124
-9932,1647,159,0.135282147606574,0.135282147606574
-9933,159,1722,0.249462326524164,0.249462326524164
-9935,6872,7601,0.692595810332122,0.692595810332122
-9938,6136,7603,0.0512178060127243,0.0512178060127243
-9939,7603,4004,0.0522781951051087,0.0522781951051087
-9941,2233,5134,0.145435815612977,0.145435815612977
-9942,5134,5149,0.0255338309274142,0.0255338309274142
-9943,5149,4904,0.0300983323579011,0.0300983323579011
-9944,4904,6618,0.200495686198041,0.200495686198041
-9945,6618,7604,0.20246265981009,0.20246265981009
-9946,7604,7605,0.201805887092512,0.201805887092512
-9948,6554,7606,0.105208061763435,0.105208061763435
-9950,7607,7608,0.199144734139014,0.199144734139014
-9951,7608,7609,0.20258734096308,0.20258734096308
-9953,2463,5906,0.205561292129907,0.205561292129907
-9954,5906,7610,0.199734725303301,0.199734725303301
-9955,7610,791,0.198807553256576,0.198807553256576
-9956,791,7612,0.203565382214395,0.203565382214395
-9957,7612,4355,0.201053666601032,0.201053666601032
-9958,4355,7613,0.202489967264216,0.202489967264216
-9959,7613,3058,0.208369032173912,0.208369032173912
-9960,3058,7614,0.183994647182619,0.183994647182619
-9961,7614,7615,0.026448194348771,0.026448194348771
-9963,1697,7616,0.173745206459615,0.173745206459615
-9964,7616,7617,0.177904510236026,0.177904510236026
-9965,7617,7618,0.1681272184952,0.1681272184952
-9966,7618,4776,0.251475825917774,0.251475825917774
-9970,3746,7622,0.0932397806145687,0.0932397806145687
-9971,7622,4665,0.0961947321638159,0.0961947321638159
-9972,4665,1332,0.102043584181961,0.102043584181961
-9973,1332,1387,0.0976513845787387,0.0976513845787387
-9974,1387,7623,0.104092676384345,0.104092676384345
-9975,7623,6849,0.109393568832939,0.109393568832939
-9976,6849,4705,0.0983852710944781,0.0983852710944781
-9977,4705,7487,0.0961948643858329,0.0961948643858329
-9978,7487,7451,0.0969202901634112,0.0969202901634112
-9979,7451,5688,0.104320933330224,0.104320933330224
-9980,5688,6313,0.0969730195141145,0.0969730195141145
-9981,6313,4962,0.100610954866441,0.100610954866441
-9982,4962,6819,0.104277744196946,0.104277744196946
-9983,6819,762,0.165411660097114,0.165411660097114
-9984,762,786,0.134384238449809,0.134384238449809
-9985,786,6001,0.286482254105535,0.286482254105535
-9986,6001,5764,0.0815255628306487,0.0815255628306487
-11219,8167,8168,0.194203872480123,0.194203872480123
-9989,1491,149,0.200485771831907,0.200485771831907
-9990,149,1737,0.201708050623858,0.201708050623858
-9992,7313,5666,0.0386975210921627,0.0386975210921627
-9993,5666,522,0.0596630213761568,0.0596630213761568
-9994,522,4824,0.183721500047411,0.183721500047411
-9996,2254,7626,0.0984544191189144,0.0984544191189144
-9998,7627,7329,0.0447853238574392,0.0447853238574392
-9999,7329,2089,0.0938827847318007,0.0938827847318007
-10000,2089,2656,0.0939761287497805,0.0939761287497805
-10001,2656,4118,0.0946147674881846,0.0946147674881846
-10002,4118,6678,0.0843387660785722,0.0843387660785722
-10004,7628,7629,0.0982828610797249,0.0982828610797249
-10006,5220,5095,0.120687418213095,0.120687418213095
-10008,7630,6413,0.109655980715331,0.109655980715331
-10009,6413,4650,0.0986378512210248,0.0986378512210248
-10010,4650,7631,0.100237060358401,0.100237060358401
-10011,7631,3646,0.0896866361421679,0.0896866361421679
-10012,3646,4536,0.103452838278423,0.103452838278423
-10013,4536,7635,0.257545536230436,0.257545536230436
-10015,7636,7637,0.0362863399636557,0.0362863399636557
-10016,7637,383,0.0504266976907422,0.0504266976907422
-10017,383,4682,0.05031361216385,0.05031361216385
-10018,4682,295,0.0506583134955018,0.0506583134955018
-10019,295,4954,0.0497648033018035,0.0497648033018035
-10021,7222,7638,0.0496667318298412,0.0496667318298412
-10022,7638,7639,0.0515292350274089,0.0515292350274089
-10023,7639,7640,0.0459421846016502,0.0459421846016502
-10024,7640,6642,0.0415805639651593,0.0415805639651593
-10026,3954,7641,0.0608839417644586,0.0608839417644586
-10027,7641,5604,0.0589168683204242,0.0589168683204242
-18697,6400,5868,0.177478717288294,0.177478717288294
-10029,7642,3727,0.0543818576839699,0.0543818576839699
-10031,1239,4813,0.0888202681133088,0.0888202681133088
-10032,4813,2165,0.138535770033239,0.138535770033239
-10034,4003,7643,0.0510385957556285,0.0510385957556285
-10035,7643,7027,0.0529371470208169,0.0529371470208169
-10036,7027,7644,0.0521180983869426,0.0521180983869426
-10037,7644,7645,0.0537600930137936,0.0537600930137936
-10038,7645,7646,0.0510719245712091,0.0510719245712091
-10039,7646,7380,0.0524231241843369,0.0524231241843369
-10041,7647,3393,0.0461297697153075,0.0461297697153075
-10043,3394,7648,0.0445992136926928,0.0445992136926928
-10044,7648,5709,0.0478831918410465,0.0478831918410465
-10045,5709,7649,0.04548718787965,0.04548718787965
-10046,7649,7432,0.0484717768195407,0.0484717768195407
-10047,7432,7650,0.0437375947901795,0.0437375947901795
-10048,7650,7181,0.0470644094329018,0.0470644094329018
-10049,7181,7651,0.0469937345825467,0.0469937345825467
-10051,7652,7653,0.0459694430265719,0.0459694430265719
-10053,1099,7654,0.0453903142377476,0.0453903142377476
-10054,7654,7505,0.0471008131744324,0.0471008131744324
-10055,7505,7655,0.0439789031058606,0.0439789031058606
-10056,7655,3857,0.0492561227403211,0.0492561227403211
-10057,3857,7656,0.0443253739114241,0.0443253739114241
-10058,7656,5595,0.054031927582118,0.054031927582118
-10059,5595,7657,0.0531350620266369,0.0531350620266369
-10060,7657,7548,0.0548032505549166,0.0548032505549166
-10061,7548,7658,0.0961567115661112,0.0961567115661112
-10063,5169,6864,0.176934896372569,0.176934896372569
-10064,6864,3072,0.175748977102837,0.175748977102837
-10065,3072,7659,0.163990749862373,0.163990749862373
-10067,3292,100,0.415519355639239,0.415519355639239
-10069,5731,3291,0.149792492427265,0.149792492427265
-10071,1152,7660,0.199718823841446,0.199718823841446
-10074,6897,7663,0.241129252553979,0.241129252553979
-13575,2,9131,0.186044551751923,0.186044551751923
-10075,7663,7664,0.101783451026811,0.101783451026811
-10076,7664,7665,0.289306992458348,0.289306992458348
-10078,6814,7666,0.176577592408465,0.176577592408465
-12084,8539,8540,0.241661980997098,0.241661980997098
-10079,7666,2342,0.176188966635474,0.176188966635474
-10080,2342,7667,0.17458351857957,0.17458351857957
-10081,7667,4785,0.245723521469374,0.245723521469374
-10082,4785,7668,0.239480958817199,0.239480958817199
-10084,5159,7669,0.0600603744377636,0.0600603744377636
-10085,7669,5954,0.140826727437097,0.140826727437097
-10086,5954,2241,0.203480008894553,0.203480008894553
-10087,2241,4914,0.201437462212311,0.201437462212311
-10088,4914,6609,0.201231500080185,0.201231500080185
-10089,6609,7670,0.19693744890168,0.19693744890168
-11324,5142,5154,0.0222389853288599,0.0222389853288599
-16191,7205,5817,0.204256012568379,0.204256012568379
-10090,7670,7671,0.205535401167156,0.205535401167156
-10092,690,1979,0.162739101905996,0.162739101905996
-10093,1979,1964,0.0397992509913644,0.0397992509913644
-10094,1964,6501,0.211697424646872,0.211697424646872
-10095,6501,2478,0.193626535181341,0.193626535181341
-10096,2478,5912,0.20926896109112,0.20926896109112
-10097,5912,7672,0.199195490528656,0.199195490528656
-10098,7672,803,0.201999137953248,0.201999137953248
-10099,803,7673,0.202608278725201,0.202608278725201
-10100,7673,7674,0.205563081575912,0.205563081575912
-10101,7674,7675,0.203265447696938,0.203265447696938
-10102,7675,3066,0.200093208772811,0.200093208772811
-10103,3066,7676,0.18728661128175,0.18728661128175
-10105,7677,6370,0.270615231348292,0.270615231348292
-10106,6370,7678,0.131279919418432,0.131279919418432
-10108,6507,7679,0.113730821063582,0.113730821063582
-10109,7679,6937,0.113695193803527,0.113695193803527
-10111,759,6605,0.202732181741343,0.202732181741343
-10113,5167,7680,0.173408491477124,0.173408491477124
-10114,7680,2354,0.177734023432563,0.177734023432563
-11350,4801,4798,0.0316348130565604,0.0316348130565604
-10116,4156,4743,0.17475749351339,0.17475749351339
-10117,4743,6539,0.176484628682033,0.176484628682033
-10118,6539,7681,0.164515462701881,0.164515462701881
-10119,7681,1204,0.1695248683934,0.1695248683934
-10120,1204,7682,0.0218451192643306,0.0218451192643306
-10121,7682,3779,0.199697518421981,0.199697518421981
-10123,7683,953,0.176289634687175,0.176289634687175
-10124,953,7684,0.174800312403385,0.174800312403385
-10125,7684,4892,0.161444055531775,0.161444055531775
-10126,4892,7685,0.184678055138444,0.184678055138444
-10127,7685,5490,0.173583753319791,0.173583753319791
-10128,5490,3022,0.0680856463383254,0.0680856463383254
-18346,1684,7686,0.206269012853702,0.206269012853702
-10129,3022,608,0.0626103319165951,0.0626103319165951
-10130,608,7687,0.0714136208255542,0.0714136208255542
-10132,751,1571,0.141098847639908,0.141098847639908
-10133,1571,7688,0.136160171060933,0.136160171060933
-10134,7688,355,0.0540631216358879,0.0540631216358879
-11381,7,8238,0.233069627316498,0.233069627316498
-10136,3031,7689,0.212052347410258,0.212052347410258
-10139,5644,4349,0.138628444284297,0.138628444284297
-10140,4349,6347,0.140074045976997,0.140074045976997
-10143,7690,7691,0.036360966917709,0.036360966917709
-13576,9131,2186,0.0494030185182178,0.0494030185182178
-10144,7691,7692,0.019090691679145,0.019090691679145
-10145,7692,7629,0.138695116564921,0.138695116564921
-10146,7629,7693,0.131928656438508,0.131928656438508
-10148,7694,7695,0.805329256404935,0.805329256404935
-10149,6359,2392,0.110097282540218,0.110097282540218
-10150,2392,7696,0.139362539585628,0.139362539585628
-10152,7697,698,0.20136290155584,0.20136290155584
-10153,698,7698,0.201586501703314,0.201586501703314
-10155,7699,894,0.281945866493957,0.281945866493957
-10156,894,4477,0.138715715492195,0.138715715492195
-10157,4477,2802,0.13960527461951,0.13960527461951
-10158,2802,5268,0.12511734550188,0.12511734550188
-10161,4794,2158,0.120027593160305,0.120027593160305
-11430,319,412,0.178792036530689,0.178792036530689
-11459,224,8268,0.046644646559722,0.046644646559722
-10165,7703,1119,0.0497953640754775,0.0497953640754775
-10166,1119,7704,0.0511005498462644,0.0511005498462644
-10167,7704,7496,0.0499039643779027,0.0499039643779027
-10168,7496,7705,0.050496479725261,0.050496479725261
-10169,7705,3842,0.0493242373326315,0.0493242373326315
-10170,3842,7706,0.0511368055077475,0.0511368055077475
-10171,7706,5553,0.0516924374908146,0.0516924374908146
-10173,5552,7707,0.497797594406761,0.497797594406761
-10174,7708,6434,0.169523036166009,0.169523036166009
-10175,6434,4659,0.115447272077866,0.115447272077866
-10176,4659,7709,0.0610101187906253,0.0610101187906253
-10177,7709,1282,0.0565434694494923,0.0565434694494923
-10178,1282,4541,0.131357223988847,0.131357223988847
-10179,4541,7710,0.132140893738002,0.132140893738002
-10180,7710,7711,0.0696094980092003,0.0696094980092003
-10181,7711,7712,0.0619159407722012,0.0619159407722012
-10183,4024,7713,0.0484316979076645,0.0484316979076645
-10184,7713,5669,0.0520933568419111,0.0520933568419111
-10185,5669,7714,0.0498366654518003,0.0498366654518003
-10186,7714,7030,0.0492177257934086,0.0492177257934086
-19495,7469,10524,0.0198269485983196,0.0198269485983196
-10188,7715,7378,0.0506230529615687,0.0506230529615687
-10189,7378,1594,0.0506283698630863,0.0506283698630863
-10190,1594,3411,0.0491667634825631,0.0491667634825631
-10191,3411,7717,0.105657808428602,0.105657808428602
-10192,7717,7718,0.0940313147486449,0.0940313147486449
-10193,5546,7719,0.0535907784173066,0.0535907784173066
-10194,7719,7720,0.0530201286004126,0.0530201286004126
-10195,7720,573,0.0448716576991108,0.0448716576991108
-10196,573,4986,0.0479600812575622,0.0479600812575622
-10197,4986,7721,0.0515371092658245,0.0515371092658245
-10198,7721,7722,0.0482855644451139,0.0482855644451139
-10199,7722,7723,0.0490137565654263,0.0490137565654263
-10200,7723,7724,0.0538141529532141,0.0538141529532141
-10201,7724,7725,0.0529684395598169,0.0529684395598169
-10202,7725,7726,0.0518724854854175,0.0518724854854175
-10203,7726,7727,0.04727777135042,0.04727777135042
-10204,7727,3618,0.0472245509762166,0.0472245509762166
-10205,3618,7728,0.0514814686878799,0.0514814686878799
-10206,7728,7729,0.0518724978816832,0.0518724978816832
-10207,7729,7730,0.0486618474944759,0.0486618474944759
-10208,7730,5100,0.0498159875736575,0.0498159875736575
-10209,5100,7731,0.0971611599806991,0.0971611599806991
-10210,7731,7732,0.0537738540349519,0.0537738540349519
-10211,7732,7733,0.048775543246574,0.048775543246574
-10213,7734,1529,0.0486197396153865,0.0486197396153865
-10214,1529,6533,0.0236551874497837,0.0236551874497837
-10216,1748,5658,0.0690555262759062,0.0690555262759062
-10217,5658,6638,0.0663249571304488,0.0663249571304488
-10220,5429,5327,0.0495383987324496,0.0495383987324496
-10221,5327,7400,0.0488963197685218,0.0488963197685218
-10223,3485,7735,0.019269671719438,0.019269671719438
-10224,7735,6080,0.0527262897841316,0.0527262897841316
-10225,6080,7736,0.0518491308674393,0.0518491308674393
-10226,7736,3699,0.0473298672855462,0.0473298672855462
-10227,3699,4573,0.0991704429707509,0.0991704429707509
-10228,4573,7737,0.1025259519958,0.1025259519958
-10229,7737,7738,0.0567267064163172,0.0567267064163172
-10230,7738,6520,0.0485788201580239,0.0485788201580239
-11562,4026,8321,0.0489622731658017,0.0489622731658017
-10232,7739,6163,0.0483379374847878,0.0483379374847878
-10233,6163,7740,0.0487487301271992,0.0487487301271992
-10234,7740,2742,0.0481924761788732,0.0481924761788732
-10236,7741,5233,0.0485076742472366,0.0485076742472366
-10237,5233,7742,0.0501847785254714,0.0501847785254714
-10238,7742,3175,0.0518961094220257,0.0518961094220257
-10239,3175,7743,0.0477088260821206,0.0477088260821206
-10240,7743,5000,0.0480456206813873,0.0480456206813873
-10241,5000,7744,0.0507496702288809,0.0507496702288809
-10242,7744,732,0.0500052182058767,0.0500052182058767
-10243,732,7062,0.0993780460470829,0.0993780460470829
-10244,7062,568,0.179642317491375,0.179642317491375
-10245,568,6375,0.221062471524952,0.221062471524952
-10246,6375,7745,0.0502032533440095,0.0502032533440095
-10247,7745,4829,0.0496813089217868,0.0496813089217868
-10248,4829,7746,0.10134770204508,0.10134770204508
-10249,7746,7747,0.19682163321823,0.19682163321823
-10250,7747,7748,0.0148866727143693,0.0148866727143693
-10251,7748,1062,0.0938295581784946,0.0938295581784946
-10252,1062,1700,0.0910684866897701,0.0910684866897701
-10254,7749,7750,0.088136254722807,0.088136254722807
-10255,7750,7751,0.0102851011578735,0.0102851011578735
-10256,7751,6675,0.0807868256992296,0.0807868256992296
-10258,5566,7541,0.078830239472867,0.078830239472867
-10259,7541,7752,0.71007082854504,0.71007082854504
-10260,7753,7754,0.0555561071332203,0.0555561071332203
-10261,7754,6755,0.141035585683202,0.141035585683202
-10262,6755,3980,0.200595577576722,0.200595577576722
-10263,3980,7039,0.198840384599884,0.198840384599884
-10264,7039,3426,0.202741409948142,0.202741409948142
-10266,6623,1789,0.083407855110509,0.083407855110509
-10267,1789,7208,0.197984235440067,0.197984235440067
-10268,7208,5821,0.204810690510051,0.204810690510051
-10269,5821,7726,0.195060536702397,0.195060536702397
-10270,7726,7755,1.41312394826698,1.41312394826698
-10271,3161,7756,0.200885724863022,0.200885724863022
-10272,7756,3082,0.196495825635974,0.196495825635974
-10273,3082,3194,0.201063950220373,0.201063950220373
-10275,6110,1901,0.201670811128578,0.201670811128578
-10277,441,5814,0.0584483555155252,0.0584483555155252
-10278,5814,5376,0.210901593054405,0.210901593054405
-10282,2638,5211,0.135802363910714,0.135802363910714
-10284,5376,7115,0.169184130655589,0.169184130655589
-10286,6686,7758,0.0966310054355491,0.0966310054355491
-10287,7758,7759,0.103268100856542,0.103268100856542
-10289,7760,7761,0.0931830345887697,0.0931830345887697
-10290,7761,870,0.209204581827195,0.209204581827195
-10292,6165,6785,0.0415827902651337,0.0415827902651337
-10293,6785,7357,0.102001818508737,0.102001818508737
-10294,7357,5405,0.112234858942921,0.112234858942921
-10295,5405,3138,0.103097089620426,0.103097089620426
-10296,3138,7762,0.00572680722694595,0.00572680722694595
-10297,6991,6399,0.078057620939779,0.078057620939779
-10299,3614,2112,0.200468732564122,0.200468732564122
-10300,2112,7766,0.09707938317328,0.09707938317328
-10301,7766,7663,0.107055697326901,0.107055697326901
-10303,869,7100,0.0985676933380822,0.0985676933380822
-11668,7785,8358,0.00862504224759753,0.00862504224759753
-10305,2502,7767,0.133821378293258,0.133821378293258
-10306,7767,4793,0.137187308277769,0.137187308277769
-10307,4793,2155,0.138619015999951,0.138619015999951
-10308,2155,6302,0.131440648996103,0.131440648996103
-10309,6302,6427,0.0971164197766542,0.0971164197766542
-10310,6427,5345,0.100480546860285,0.100480546860285
-10311,5345,4641,0.0997483726431183,0.0997483726431183
-10312,4641,1266,0.0975658909823655,0.0975658909823655
-10313,1266,4540,0.103828265337942,0.103828265337942
-10314,4540,6286,0.102716645609349,0.102716645609349
-10315,6286,2720,0.0979601908800836,0.0979601908800836
-10317,2598,5187,0.177611938217315,0.177611938217315
-10318,5187,5655,0.104799417596727,0.104799417596727
-10319,5655,7768,0.00220165954800827,0.00220165954800827
-10321,7769,6068,0.194290902090962,0.194290902090962
-10322,6068,2548,0.201654782967819,0.201654782967819
-10323,2548,7770,0.410001897212591,0.410001897212591
-10324,6390,7771,0.13140278725488,0.13140278725488
-10325,7771,7772,0.135404012160521,0.135404012160521
-10326,7772,7773,0.135386059531021,0.135386059531021
-10327,7773,5541,0.102606539353157,0.102606539353157
-10328,5541,2410,0.100544408114452,0.100544408114452
-10329,2410,4294,0.100431298726032,0.100431298726032
-10330,4294,7776,0.0501127826077893,0.0501127826077893
-10331,7776,7777,0.0533516278326779,0.0533516278326779
-10332,7777,7778,0.0636719509277386,0.0636719509277386
-10333,7778,7702,0.142867174122929,0.142867174122929
-10334,7702,2984,0.198167346423749,0.198167346423749
-10336,7779,1879,0.0577899859499687,0.0577899859499687
-10337,1879,7780,0.0975763172911078,0.0975763172911078
-10338,7780,7781,0.049615978114649,0.049615978114649
-10339,7781,7782,0.151461070035101,0.151461070035101
-10340,7782,7783,0.00828406172358757,0.00828406172358757
-10341,7783,7784,0.0408643643931965,0.0408643643931965
-10342,7784,7785,0.155195634964959,0.155195634964959
-10343,7785,6879,0.203175602967298,0.203175602967298
-10344,6879,1690,0.204417069906845,0.204417069906845
-10345,1690,7786,0.203521868851454,0.203521868851454
-10346,7786,2437,0.163479024443522,0.163479024443522
-10347,2437,2436,0.0381118302971424,0.0381118302971424
-10348,2436,5735,0.132411428624817,0.132411428624817
-10349,5735,7787,0.0686968769014223,0.0686968769014223
-10350,7787,5524,0.0876693797427073,0.0876693797427073
-10352,6462,6461,0.046218455398192,0.046218455398192
-10353,6461,7788,0.114101346725552,0.114101346725552
-10354,7788,7789,0.186352786707342,0.186352786707342
-10355,7789,7790,0.201819126377908,0.201819126377908
-10356,7790,1426,0.209991688515331,0.209991688515331
-10357,1426,7188,0.131433687737374,0.131433687737374
-10361,7791,7792,0.0221530824058495,0.0221530824058495
-10362,7792,1857,0.178051972210932,0.178051972210932
-10363,1857,2599,0.180197954723075,0.180197954723075
-10365,7793,7794,0.133052671328159,0.133052671328159
-10366,7794,7795,0.00451480555637825,0.00451480555637825
-10368,7796,316,0.0810108111113459,0.0810108111113459
-10369,316,7797,0.0132929754360195,0.0132929754360195
-10371,7798,1715,0.146657336243231,0.146657336243231
-10373,4991,5886,0.0409007612541298,0.0409007612541298
-10374,5886,7799,0.0133509392362763,0.0133509392362763
-10375,7799,6955,0.0302227835880131,0.0302227835880131
-10376,6955,120,0.355050454211798,0.355050454211798
-10378,6998,7800,0.287485052767515,0.287485052767515
-10379,7800,2107,0.0799880901292185,0.0799880901292185
-10381,7801,7330,0.0459693673262965,0.0459693673262965
-10382,7330,2069,0.0513405380116942,0.0513405380116942
-10383,2069,2090,0.0410799126461524,0.0410799126461524
-10384,2090,2665,0.0609107459124439,0.0609107459124439
-10385,2665,2657,0.0344762888596363,0.0344762888596363
-10386,2657,4120,0.0653569613260274,0.0653569613260274
-10387,4120,4119,0.025633469399215,0.025633469399215
-10388,4119,6679,0.0800230712461371,0.0800230712461371
-10389,6679,7803,0.0968450624184265,0.0968450624184265
-10390,7803,7693,0.101842612257672,0.101842612257672
-10392,4983,7804,0.15108225604362,0.15108225604362
-10393,7804,7805,0.125613899900368,0.125613899900368
-10394,7805,7806,0.243703765368195,0.243703765368195
-10395,6511,833,0.205796808568101,0.205796808568101
-10396,833,1752,0.10962713348726,0.10962713348726
-10399,7807,6997,0.603696470077293,0.603696470077293
-10401,6510,7620,0.115341473380206,0.115341473380206
-10403,1004,4224,0.0542745916357659,0.0542745916357659
-10405,7568,7808,0.0520701135747565,0.0520701135747565
-10406,7808,7085,0.0476697019408349,0.0476697019408349
-10407,7085,7087,0.0498741800030606,0.0498741800030606
-10410,7411,5866,0.177233832171644,0.177233832171644
-10411,5866,1317,0.177356465730534,0.177356465730534
-10412,1317,1373,0.176201016352257,0.176201016352257
-20226,10713,10016,0.0211937599266337,0.0211937599266337
-10413,1373,7809,0.0646527574308656,0.0646527574308656
-10414,7809,6841,0.0827327683846137,0.0827327683846137
-18362,7802,7116,0.00767249278335644,0.00767249278335644
-18363,7116,7802,0.00767249278335644,0.00767249278335644
-10416,7810,7811,0.101331501186014,0.101331501186014
-10417,7811,7812,0.10060881119881,0.10060881119881
-10418,7812,7813,0.20266387330204,0.20266387330204
-10419,7813,6245,0.198305641519059,0.198305641519059
-10420,6245,7814,0.197228200241648,0.197228200241648
-10422,1492,181,0.220815542326235,0.220815542326235
-10423,181,1709,0.205644626708499,0.205644626708499
-10424,1709,7815,0.201521495468828,0.201521495468828
-10425,7815,1576,0.244181862134779,0.244181862134779
-11867,8450,529,0.00567706315765741,0.00567706315765741
-10426,1576,7816,0.227813240625087,0.227813240625087
-10428,6320,7817,0.183577601350202,0.183577601350202
-10430,7213,7818,0.101757750903819,0.101757750903819
-10433,962,6868,0.198984557339899,0.198984557339899
-10434,6868,5277,0.0940706344008526,0.0940706344008526
-10435,5277,3079,0.10232261403939,0.10232261403939
-10437,7204,5816,0.204032094058756,0.204032094058756
-10438,5816,7722,0.196359705603447,0.196359705603447
-10439,7722,7819,1.20817529596719,1.20817529596719
-10440,4246,1785,0.204162289925295,0.204162289925295
-10441,1785,7820,0.0718319226119568,0.0718319226119568
-10442,6026,3876,0.103447229282558,0.103447229282558
-10443,3876,7821,0.100516631601798,0.100516631601798
-10444,7322,2073,0.0916901418746821,0.0916901418746821
-10445,2073,2670,0.0954589635577965,0.0954589635577965
-10446,2670,4140,0.0958506641044589,0.0958506641044589
-10447,4140,6687,0.0883798780131798,0.0883798780131798
-10448,6687,7822,0.0995993099363261,0.0995993099363261
-10449,7822,7696,0.0932435604543702,0.0932435604543702
-10450,7696,3474,0.0968263022183935,0.0968263022183935
-10451,3474,7823,0.0468407500328621,0.0468407500328621
-10452,5171,3743,0.0993415474645253,0.0993415474645253
-10454,5856,4668,0.0981986239232037,0.0981986239232037
-10455,4668,1294,0.100268721006653,0.100268721006653
-10456,1294,1367,0.0977359423737142,0.0977359423737142
-10457,1367,3189,0.105552448113217,0.105552448113217
-10458,3189,6851,0.101177318178783,0.101177318178783
-10459,6851,4702,0.101416251034793,0.101416251034793
-10460,4702,7468,0.0970718218675625,0.0970718218675625
-10461,7468,1895,0.103477998735846,0.103477998735846
-10462,1895,7824,0.0967350574153813,0.0967350574153813
-10463,7824,7233,0.101338813079015,0.101338813079015
-10464,7233,3243,0.207470752756408,0.207470752756408
-10465,3243,7282,0.19399363779074,0.19399363779074
-10466,7282,7825,0.149563284680896,0.149563284680896
-10468,2141,7826,0.157978675104427,0.157978675104427
-10469,7826,7827,0.306989543465552,0.306989543465552
-10470,7827,7828,0.364212228682904,0.364212228682904
-16042,9797,9804,0.0714393127860209,0.0714393127860209
-10475,7658,7549,0.158167365995463,0.158167365995463
-10477,5846,7750,0.200199460183562,0.200199460183562
-10479,466,7198,0.196816395654282,0.196816395654282
-10481,7268,7830,0.172430116159174,0.172430116159174
-10483,7217,7831,0.199372618146519,0.199372618146519
-10485,6256,7832,0.202992310919435,0.202992310919435
-10487,7833,4331,0.102741254079324,0.102741254079324
-10488,4331,7834,0.0526098265130649,0.0526098265130649
-10489,7834,5037,0.0501135526518646,0.0501135526518646
-10490,5037,7835,0.0494507564303858,0.0494507564303858
-10491,7835,7836,0.0506565934234891,0.0506565934234891
-10492,7836,7837,0.0500464479643974,0.0500464479643974
-10493,7837,2894,0.0524402316173641,0.0524402316173641
-10494,2894,7838,0.107557027285785,0.107557027285785
-10495,7838,7839,0.103734242634521,0.103734242634521
-10496,7839,4733,0.104796091296626,0.104796091296626
-10498,6800,7352,0.103066456507469,0.103066456507469
-10499,7352,5398,0.104939276238433,0.104939276238433
-10500,5398,7840,0.054043807018549,0.054043807018549
-10501,7840,7841,0.0495084984704332,0.0495084984704332
-10502,7841,3900,0.109926182600774,0.109926182600774
-10503,3900,1036,0.101980966587827,0.101980966587827
-10505,7842,6275,0.0499604206116259,0.0499604206116259
-10506,6275,7843,0.109041406945306,0.109041406945306
-10508,7844,7845,0.0640842858387461,0.0640842858387461
-10509,7845,1756,0.058813700126345,0.058813700126345
-10510,1756,4796,0.0566305502204531,0.0566305502204531
-10511,4796,2162,0.113835660361901,0.113835660361901
-10512,2162,7846,0.116364205137553,0.116364205137553
-10514,6135,4027,0.149896567221218,0.149896567221218
-10515,4027,7032,0.200991141471739,0.200991141471739
-10516,7032,3412,0.200534935685617,0.200534935685617
-10517,3412,7633,0.0497828282990497,0.0497828282990497
-10518,7633,5698,0.0497412906945155,0.0497412906945155
-10519,5698,7847,0.050919685731899,0.050919685731899
-10521,7425,7166,0.104570214872527,0.104570214872527
-10522,7166,7848,0.0473158420873474,0.0473158420873474
-10523,7848,7780,0.0502827033263459,0.0502827033263459
-10524,7780,1123,0.100516868229367,0.100516868229367
-10525,1123,7849,0.0509916038841254,0.0509916038841254
-10526,7849,7497,0.0507179555279218,0.0507179555279218
-10527,7497,7850,0.0492496392928742,0.0492496392928742
-10528,7850,3843,0.0492532755342339,0.0492532755342339
-10529,3843,7851,0.0511792577413519,0.0511792577413519
-10530,7851,5556,0.0504327266312592,0.0504327266312592
-10561,7757,6414,0.14886592682355,0.14886592682355
-10531,5556,7852,0.789293029376444,0.789293029376444
-10532,1618,7136,0.164980324326418,0.164980324326418
-10534,2027,5535,0.0854267701089729,0.0854267701089729
-10535,5535,6450,0.110522246345964,0.110522246345964
-10536,6450,6468,0.0325389081934527,0.0325389081934527
-10537,6468,7853,0.124455504811187,0.124455504811187
-10538,7853,7854,0.192779349126015,0.192779349126015
-10540,3713,7855,0.105701897268654,0.105701897268654
-10543,2614,7857,0.0507605301255621,0.0507605301255621
-10544,7857,5197,0.124727455067454,0.124727455067454
-10545,5197,6238,0.172240941584424,0.172240941584424
-10546,6238,7637,0.187669509666877,0.187669509666877
-10547,7637,7858,0.175500793784226,0.175500793784226
-10548,7858,7859,0.174943439798306,0.174943439798306
-10551,5368,7126,0.152826634682226,0.152826634682226
-10552,7126,614,0.179980225267387,0.179980225267387
-10553,614,7860,0.174053494498076,0.174053494498076
-10554,7860,7861,0.175067683150656,0.175067683150656
-10556,3960,5600,0.12071802041193,0.12071802041193
-10558,6724,4799,0.0913013732116182,0.0913013732116182
-10559,4799,2180,0.0880940650188129,0.0880940650188129
-10560,2180,7757,0.0839974084607818,0.0839974084607818
-10562,6414,4645,0.149015796662155,0.149015796662155
-10563,4645,1271,0.151238114292438,0.151238114292438
-10564,1271,4535,0.201873592117884,0.201873592117884
-10565,4535,7863,0.199199232202906,0.199199232202906
-10567,7864,6740,0.106132792016662,0.106132792016662
-10568,6740,2257,0.103696160263475,0.103696160263475
-10569,2257,6132,0.104845212424081,0.104845212424081
-10570,6132,4000,0.104492371103569,0.104492371103569
-10571,4000,7049,0.105765984719426,0.105765984719426
-10572,7049,1395,0.105619552065538,0.105619552065538
-10573,1395,7865,0.0532676910827188,0.0532676910827188
-12077,2695,8043,0.149120560873017,0.149120560873017
-10574,7865,7382,0.0513518590570076,0.0513518590570076
-10576,7866,3392,0.0498722666723731,0.0498722666723731
-10578,2360,5226,0.147034135602084,0.147034135602084
-10579,5226,5088,0.140218763176125,0.140218763176125
-10580,5088,2812,0.112317158065107,0.112317158065107
-10581,2812,7855,0.0589853238635922,0.0589853238635922
-10582,7855,4676,0.102566908777836,0.102566908777836
-10583,4676,4948,0.0965475772401715,0.0965475772401715
-10584,4948,7867,0.0515742481536382,0.0515742481536382
-10585,7867,7219,0.0513689618533378,0.0513689618533378
-10586,7219,7868,0.0507197202929207,0.0507197202929207
-10587,7868,5673,0.0490781046009859,0.0490781046009859
-10588,5673,7869,0.0456643057832586,0.0456643057832586
-10591,7792,7870,0.049146171652799,0.049146171652799
-10592,7870,1108,0.0521568671722949,0.0521568671722949
-10593,1108,5770,0.0506160748755952,0.0506160748755952
-10594,5770,7510,0.0513174323114612,0.0513174323114612
-10595,7510,7871,0.0508676871173128,0.0508676871173128
-10596,7871,3865,0.0498216783929082,0.0498216783929082
-10598,3866,7535,0.105586605139886,0.105586605139886
-10599,7535,7872,0.748786770151958,0.748786770151958
-10603,741,1561,0.140274508504629,0.140274508504629
-10604,1561,7876,0.139940443617856,0.139940443617856
-10605,7876,7877,0.121382404560649,0.121382404560649
-10607,3572,5640,0.141095915979936,0.141095915979936
-10608,5640,4345,0.139634312621283,0.139634312621283
-10609,4345,6343,0.13679021957376,0.13679021957376
-10610,6343,3046,0.13698802953883,0.13698802953883
-10611,3046,7878,0.138953332142948,0.138953332142948
-10612,7878,7879,0.00536944182123181,0.00536944182123181
-10613,7879,7880,0.11582084881522,0.11582084881522
-10615,7881,7882,0.0939943673024045,0.0939943673024045
-10617,4885,7883,0.18871104587798,0.18871104587798
-10618,7883,5483,0.174801190512252,0.174801190512252
-10619,5483,7884,0.200940942998637,0.200940942998637
-10620,7884,7885,0.0780811261571653,0.0780811261571653
-10621,7885,3341,0.00930901113126469,0.00930901113126469
-10624,1192,7887,0.0222318154701858,0.0222318154701858
-10625,7887,3786,0.199739451308706,0.199739451308706
-10627,7888,5967,0.106945706764055,0.106945706764055
-10628,5967,7889,0.0517538867982505,0.0517538867982505
-10629,7889,3011,0.055433069584998,0.055433069584998
-10630,3011,7890,0.0504905501442438,0.0504905501442438
-10631,7890,4389,0.0518336432467722,0.0518336432467722
-10632,4389,7891,0.106909075712535,0.106909075712535
-10633,7891,7892,0.0447272763477039,0.0447272763477039
-10634,7892,7893,0.0604871538278066,0.0604871538278066
-10635,7893,7894,0.0527248029948841,0.0527248029948841
-10636,7894,7895,0.0510420835040534,0.0510420835040534
-10637,7895,7896,0.0538542282588573,0.0538542282588573
-10638,7896,7897,0.0528352422268061,0.0528352422268061
-10640,7898,7899,0.0483963113823249,0.0483963113823249
-10641,7899,7900,0.00514045868709644,0.00514045868709644
-10642,7900,6183,0.105068526303449,0.105068526303449
-10643,6183,7563,0.106218150970674,0.106218150970674
-10646,7902,7903,0.144865462765669,0.144865462765669
-10647,7903,7904,0.00237466940700901,0.00237466940700901
-10648,7904,6985,0.0721296292058115,0.0721296292058115
-10649,6985,4820,0.0719786596117478,0.0719786596117478
-10650,4820,7905,0.147529402397198,0.147529402397198
-10651,7905,7906,0.144081069806214,0.144081069806214
-10653,3189,1870,0.209495964340019,0.209495964340019
-10654,1870,7907,0.0977397792259224,0.0977397792259224
-10655,7907,4184,0.106328113718199,0.106328113718199
-10656,4184,7908,0.403661295666813,0.403661295666813
-10657,7908,4837,0.108683081676812,0.108683081676812
-10659,7909,7910,0.270199990406442,0.270199990406442
-10660,7911,810,0.0673953106393502,0.0673953106393502
-10661,810,7912,0.0687323400006804,0.0687323400006804
-10662,7912,7913,0.136720833756656,0.136720833756656
-10666,2255,5858,0.174722136683236,0.174722136683236
-10667,5858,1305,0.178402656879188,0.178402656879188
-10668,1305,7915,0.248888691440438,0.248888691440438
-12170,8573,8574,0.0987973765101899,0.0987973765101899
-10670,6847,7916,0.0984178968171368,0.0984178968171368
-10671,7916,7485,0.0976761282305841,0.0976761282305841
-10673,7454,5692,0.103533596199028,0.103533596199028
-10674,5692,7917,0.101331500328489,0.101331500328489
-10675,7917,4966,0.0998668108920524,0.0998668108920524
-10676,4966,7918,0.102812100555259,0.102812100555259
-10677,7918,7919,0.0983963905872725,0.0983963905872725
-10678,7919,7920,0.0991546561543948,0.0991546561543948
-10679,7920,7921,0.0991411977449166,0.0991411977449166
-10680,7921,7922,0.106421383510006,0.106421383510006
-10682,7923,7924,0.106391305814005,0.106391305814005
-10684,7925,629,0.0646550267727614,0.0646550267727614
-10685,629,7926,0.00919464810452742,0.00919464810452742
-10686,7927,7928,0.0412650483746168,0.0412650483746168
-10687,7928,7929,0.155361420508855,0.155361420508855
-10688,7929,6922,0.0195376725753923,0.0195376725753923
-10689,6922,6736,0.174720460074468,0.174720460074468
-10691,7930,7931,0.0129516773904198,0.0129516773904198
-10692,7931,1511,0.391618540945239,0.391618540945239
-10693,1511,7932,0.0409032080648905,0.0409032080648905
-10694,7932,3280,0.112386881702983,0.112386881702983
-10696,4635,6586,0.185505221951206,0.185505221951206
-10698,6668,787,0.109054104365323,0.109054104365323
-10699,787,6002,0.243058044096108,0.243058044096108
-10702,7934,1008,1.1041513689359,1.1041513689359
-10704,4497,7935,0.109080059964542,0.109080059964542
-10705,7935,7936,0.375437621590472,0.375437621590472
-10706,7936,7937,0.0440200903162904,0.0440200903162904
-10708,3966,3963,0.0923048136404676,0.0923048136404676
-10710,6243,7938,0.0544857736456965,0.0544857736456965
-10711,7938,7571,0.0517149905092859,0.0517149905092859
-10712,7571,7939,0.0378829783952266,0.0378829783952266
-10714,7940,5872,0.0757028634173436,0.0757028634173436
-10715,5872,1324,0.177578299705823,0.177578299705823
-10716,1324,1380,0.1760884455939,0.1760884455939
-10717,1380,7941,0.0581557503278793,0.0581557503278793
-10718,7941,6844,0.0845562612846107,0.0845562612846107
-10719,6844,4696,0.11746862405599,0.11746862405599
-10720,4696,7452,0.157863437357233,0.157863437357233
-10722,5690,5337,0.242972143995655,0.242972143995655
-10724,7942,7943,0.14470003055266,0.14470003055266
-10725,7943,1056,0.118222446008981,0.118222446008981
-10726,1056,7944,0.0800381081986229,0.0800381081986229
-10727,7944,6249,0.201854530416454,0.201854530416454
-10728,6249,7945,0.201602089629263,0.201602089629263
-10729,7945,1497,0.20081804408168,0.20081804408168
-10730,1497,186,0.202686112287629,0.202686112287629
-10731,186,7798,0.0846089584800808,0.0846089584800808
-10732,7798,1714,0.126110593452085,0.126110593452085
-10734,7946,1580,0.141640668503246,0.141640668503246
-10735,1580,7947,0.292520501534348,0.292520501534348
-10736,7948,2142,0.372172819192242,0.372172819192242
-10738,7949,7950,0.022809009376778,0.022809009376778
-10739,7950,2916,0.200611278039498,0.200611278039498
-10741,2915,7951,0.200419085698686,0.200419085698686
-10743,7952,7953,0.0110105423016681,0.0110105423016681
-10745,7954,7631,0.201162741792968,0.201162741792968
-16610,5355,7889,0.146740030035641,0.146740030035641
-10746,7631,7955,0.197131063915064,0.197131063915064
-10748,7956,6942,0.115194637181012,0.115194637181012
-12305,8628,8641,0.0276795827309073,0.0276795827309073
-10750,4939,4687,0.409424899618544,0.409424899618544
-10751,4687,7959,0.501489716289273,0.501489716289273
-10752,7959,7960,0.103838798829226,0.103838798829226
-10753,7960,5096,0.0880537297967434,0.0880537297967434
-10754,5096,7961,0.0549628705336601,0.0549628705336601
-10756,7962,7963,0.129400960231747,0.129400960231747
-10757,7963,7964,0.0109989745271633,0.0109989745271633
-10758,7964,7093,0.177295071329975,0.177295071329975
-10759,7093,7965,0.0553949557893182,0.0553949557893182
-10760,7965,3937,0.0117544286846151,0.0117544286846151
-10761,3937,7966,0.0655333417817751,0.0655333417817751
-10762,7966,7967,0.00514903654400709,0.00514903654400709
-10763,7967,7968,0.0154207763703831,0.0154207763703831
-10764,7968,7969,0.120137734300265,0.120137734300265
-10765,7969,7970,0.0235045509998941,0.0235045509998941
-10766,7970,4938,0.199335986652222,0.199335986652222
-10768,6788,4721,0.150986476371322,0.150986476371322
-10769,4721,667,0.112227110724083,0.112227110724083
-10770,667,5130,0.0364809731603039,0.0364809731603039
-10771,5130,7141,0.148468037583607,0.148468037583607
-10772,7141,7973,0.0653535267620459,0.0653535267620459
-10773,7973,2883,0.0864280151657955,0.0864280151657955
-10774,2883,4607,0.164926871665991,0.164926871665991
-10775,4607,5044,0.166914948534143,0.166914948534143
-10776,5044,6491,0.0452504465788914,0.0452504465788914
-10777,6491,7974,0.124696259323388,0.124696259323388
-10778,7974,3674,0.0837503652675649,0.0837503652675649
-10780,7975,7976,0.0210158411356976,0.0210158411356976
-10781,7976,2348,0.132347730703915,0.132347730703915
-10782,2348,4153,0.174709468744017,0.174709468744017
-10783,4153,4740,0.173977137035244,0.173977137035244
-10784,4740,6535,0.176711434597363,0.176711434597363
-10785,6535,7977,0.164237503877208,0.164237503877208
-10787,7978,692,0.202230219594829,0.202230219594829
-10788,692,7979,0.202124611474851,0.202124611474851
-10790,7980,1194,0.168544434179807,0.168544434179807
-10791,1194,7981,0.0214611132807924,0.0214611132807924
-10793,1195,7982,0.0213718360054606,0.0213718360054606
-10794,7982,3783,0.200590566648469,0.200590566648469
-10795,3783,7983,0.155575717720948,0.155575717720948
-10797,947,7986,0.165669448326255,0.165669448326255
-10798,7986,4887,0.171543568824384,0.171543568824384
-10800,104,7987,0.0531910934067007,0.0531910934067007
-10801,7987,7283,0.14149347529597,0.14149347529597
-10803,4249,1782,0.204738067086155,0.204738067086155
-10804,1782,7202,0.196638037803866,0.196638037803866
-10805,7202,5813,0.202462167506831,0.202462167506831
-10806,5813,7720,0.198881694965003,0.198881694965003
-10831,5664,5936,0.10457956834692,0.10457956834692
-10807,7720,7988,2.41654683926542,2.41654683926542
-10808,3557,815,0.15408456375045,0.15408456375045
-10809,815,7836,0.141625491803193,0.141625491803193
-10810,7836,7989,0.137956171688053,0.137956171688053
-10811,7989,7990,0.133814544271225,0.133814544271225
-10812,7990,7991,0.00435891657982006,0.00435891657982006
-10813,7991,7992,0.00504883599617259,0.00504883599617259
-10814,7992,3667,0.218697319390466,0.218697319390466
-10818,4607,7994,0.175458215250442,0.175458215250442
-10819,7994,7995,0.17352002006779,0.17352002006779
-10820,7995,664,0.00413178605963205,0.00413178605963205
-10821,664,7998,0.00436495014442939,0.00436495014442939
-10822,7998,7999,0.17836184127639,0.17836184127639
-10824,6329,4163,0.106458655644295,0.106458655644295
-10825,4163,4772,0.262069785544738,0.262069785544738
-10826,4772,6551,0.176006441608747,0.176006441608747
-10827,6551,8001,0.169733521019883,0.169733521019883
-10828,8001,8002,0.186888519126424,0.186888519126424
-10829,8002,3800,0.199472684499289,0.199472684499289
-10830,3800,5664,0.0496163554354094,0.0496163554354094
-10832,5936,934,0.175672791884477,0.175672791884477
-10833,934,5818,0.103656977616086,0.103656977616086
-10834,5818,2219,0.0798383163598858,0.0798383163598858
-10835,2219,4869,0.163069738486709,0.163069738486709
-10836,4869,8003,0.190225091069506,0.190225091069506
-10837,8003,5468,0.173414227417019,0.173414227417019
-10838,5468,6220,0.124444185392524,0.124444185392524
-10841,5175,8005,0.198062000656316,0.198062000656316
-10844,8006,681,0.244474486801046,0.244474486801046
-10845,681,3340,0.0902358208620103,0.0902358208620103
-10847,7885,682,0.0896800723137281,0.0896800723137281
-10848,682,580,0.244861214317874,0.244861214317874
-10850,5334,6321,0.121951239816061,0.121951239816061
-10851,6321,8007,0.186507250461399,0.186507250461399
-10852,8007,8008,0.042606728375189,0.042606728375189
-10853,8008,8009,0.0463471911266823,0.0463471911266823
-10854,8009,8010,0.0102891732268637,0.0102891732268637
-10855,8010,8011,0.0998884840922572,0.0998884840922572
-10856,8011,8012,0.201197445523876,0.201197445523876
-10857,8012,6246,0.199805617134822,0.199805617134822
-10858,6246,8013,0.200864024373594,0.200864024373594
-10859,8013,2310,0.103900456751802,0.103900456751802
-10860,2310,1494,0.0983991417332815,0.0983991417332815
-10861,1494,183,0.203419998804159,0.203419998804159
-10862,183,1711,0.201968707186781,0.201968707186781
-16611,7889,9327,0.146157951939095,0.146157951939095
-10863,1711,8014,0.204806773712675,0.204806773712675
-10864,8014,6157,0.126319530562447,0.126319530562447
-10865,6157,1577,0.0829958932471693,0.0829958932471693
-10867,7968,8016,0.0140119714836204,0.0140119714836204
-10869,2294,1531,0.46192746891159,0.46192746891159
-10871,8017,1203,0.169906498983342,0.169906498983342
-10872,1203,8018,0.0221945337202718,0.0221945337202718
-10873,8018,3780,0.199572680726093,0.199572680726093
-10874,3780,8019,0.153206883868779,0.153206883868779
-10875,8019,952,0.177861736820837,0.177861736820837
-10876,952,8020,0.175149595226483,0.175149595226483
-10877,8020,4891,0.159178167143814,0.159178167143814
-10878,4891,8021,0.18577336394487,0.18577336394487
-10879,8021,5489,0.173842148316324,0.173842148316324
-10880,5489,8022,0.202303315910377,0.202303315910377
-10882,5166,8023,0.173986701720281,0.173986701720281
-10883,8023,2353,0.177612171175383,0.177612171175383
-10884,2353,4155,0.173655528353614,0.173655528353614
-10885,4155,4742,0.173355871166643,0.173355871166643
-10886,4742,6537,0.176328961502794,0.176328961502794
-10887,6537,8024,0.165303556900913,0.165303556900913
-10889,3030,3025,0.111248274146309,0.111248274146309
-10891,8025,8026,0.0640627296443105,0.0640627296443105
-10893,3576,5643,0.138707185733922,0.138707185733922
-10894,5643,4348,0.139896948951005,0.139896948951005
-10895,4348,6346,0.137784232527167,0.137784232527167
-10897,8027,697,0.20001854589906,0.20001854589906
-10898,697,8028,0.202096920971429,0.202096920971429
-10900,8029,2876,0.123948984730939,0.123948984730939
-10901,2876,7628,0.141637704476922,0.141637704476922
-10902,7628,7803,0.129093895003183,0.129093895003183
-10903,7803,8030,0.203887723487366,0.203887723487366
-10904,750,1568,0.143385969503008,0.143385969503008
-10905,1568,356,0.136646760403047,0.136646760403047
-10907,3449,6863,0.17900718937772,0.17900718937772
-10908,6863,3068,0.174598273817653,0.174598273817653
-10909,3068,8031,0.0302783785251902,0.0302783785251902
-10910,8031,3188,0.14422007961407,0.14422007961407
-10912,3499,8032,0.199010937916898,0.199010937916898
-10913,8032,8033,0.200333001057217,0.200333001057217
-10915,5667,598,0.0644126037668526,0.0644126037668526
-10916,598,58,0.177763601732474,0.177763601732474
-10919,5970,8036,0.0505810885650185,0.0505810885650185
-10920,8036,3015,0.0580577132309736,0.0580577132309736
-10921,3015,8037,0.0464238660315039,0.0464238660315039
-10922,8037,4384,0.0544799142925035,0.0544799142925035
-10923,4384,8038,0.0538947325800234,0.0538947325800234
-10924,8038,8039,0.0466438161180549,0.0466438161180549
-10925,8039,8040,0.00584498801301113,0.00584498801301113
-10926,8040,8041,0.0523763426314988,0.0523763426314988
-10927,8041,8042,0.0530979313391782,0.0530979313391782
-10928,8042,8043,0.107654120371494,0.107654120371494
-10929,8043,8044,0.0544759880197041,0.0544759880197041
-10930,8044,8045,0.0487657640583263,0.0487657640583263
-10931,8045,8046,0.0550233762997563,0.0550233762997563
-10932,8046,8047,0.0497918467778446,0.0497918467778446
-10933,8047,8048,0.0560301584180681,0.0560301584180681
-10934,8048,6177,0.0498105660603093,0.0498105660603093
-10937,8049,8050,0.0514663482815545,0.0514663482815545
-10939,5597,7545,0.109426166768049,0.109426166768049
-10940,7545,8051,0.69043474044403,0.69043474044403
-10943,4956,7224,0.100934524697699,0.100934524697699
-10944,7224,8052,0.0514703494422073,0.0514703494422073
-10945,8052,8053,0.0516967622411713,0.0516967622411713
-10946,8053,8054,0.0428181869535947,0.0428181869535947
-10947,8054,6644,0.0437760044869343,0.0437760044869343
-10948,6644,251,0.0675496864417695,0.0675496864417695
-10949,251,3950,0.064659952202738,0.064659952202738
-10950,3950,8056,0.0623263752149148,0.0623263752149148
-10951,8056,5609,0.0582215030638228,0.0582215030638228
-10952,5609,8057,0.0511983070002347,0.0511983070002347
-10953,8057,3730,0.0552226014136858,0.0552226014136858
-10954,3730,8058,0.106434809873425,0.106434809873425
-10956,5917,8060,0.0615467128621124,0.0615467128621124
-10957,8060,8061,0.0595626505884908,0.0595626505884908
-10958,8061,8062,0.120093210467761,0.120093210467761
-10960,8063,4634,0.154652934390646,0.154652934390646
-10961,4634,4549,0.20934037971115,0.20934037971115
-10962,4549,8064,0.293727880710195,0.293727880710195
-10966,5216,3396,0.0579299126969349,0.0579299126969349
-10967,3396,8065,0.0454362838279539,0.0454362838279539
-10968,8065,5710,0.0481473121637486,0.0481473121637486
-10969,5710,8066,0.0449725321072065,0.0449725321072065
-10970,8066,7433,0.0497100835030792,0.0497100835030792
-10971,7433,8069,0.0438793771122388,0.0438793771122388
-10972,8069,7182,0.0471375837035957,0.0471375837035957
-20567,10854,10857,0.225655121951984,0.225655121951984
-10973,7182,8070,0.0452974861696144,0.0452974861696144
-10974,8070,8071,0.0479228077199932,0.0479228077199932
-10975,8071,8072,0.0470353472529161,0.0470353472529161
-10976,8072,1097,0.0443841816938638,0.0443841816938638
-10978,8073,5318,0.014674630653103,0.014674630653103
-10979,5318,2905,0.0312080465120251,0.0312080465120251
-10980,2905,7145,0.104770590384922,0.104770590384922
-10981,7145,5123,0.105925863098076,0.105925863098076
-10982,5123,4737,0.104660211196924,0.104660211196924
-10983,4737,6783,0.106266768581811,0.106266768581811
-10984,6783,7367,0.10603565613408,0.10603565613408
-12610,8772,8773,0.0502119000696978,0.0502119000696978
-10987,3133,3905,0.108335751010408,0.108335751010408
-10988,3905,1043,0.106035430930181,0.106035430930181
-10989,1043,8074,0.0531930855223622,0.0531930855223622
-10990,8074,6278,0.0525006902367685,0.0525006902367685
-10991,6278,8075,0.105351603899057,0.105351603899057
-10992,8075,5007,0.100650315286722,0.100650315286722
-10993,5007,8076,0.0416106781167173,0.0416106781167173
-10995,8025,7689,0.0805451553909581,0.0805451553909581
-10996,7689,4508,0.0814563900003029,0.0814563900003029
-10997,4508,3466,0.0836603655346893,0.0836603655346893
-10998,3466,6023,0.0805527124085535,0.0805527124085535
-10999,6023,3872,0.0834734840918988,0.0834734840918988
-11000,3872,8080,0.0833038712417768,0.0833038712417768
-11002,3967,8081,0.0785869791186196,0.0785869791186196
-11004,6348,3039,0.0931730621198353,0.0931730621198353
-11005,3039,8080,0.190356710856614,0.190356710856614
-11006,8080,8082,0.0884015044030203,0.0884015044030203
-11008,6424,4647,0.0970252568524678,0.0970252568524678
-11009,4647,8083,0.151040975226462,0.151040975226462
-16204,9846,7728,0.404619504399153,0.404619504399153
-11010,4970,8084,0.141573509395187,0.141573509395187
-11012,6398,7450,0.0587460292912133,0.0587460292912133
-11013,7450,5682,0.0978645396723703,0.0978645396723703
-11014,5682,8085,0.19215729634673,0.19215729634673
-11015,8085,6825,0.00461462117405417,0.00461462117405417
-11016,6825,549,0.386380234242036,0.386380234242036
-11017,549,6259,0.219376470776871,0.219376470776871
-11018,6259,8086,0.305359073933419,0.305359073933419
-11019,8086,1485,0.202208842336051,0.202208842336051
-11023,8088,8089,0.0138986527527033,0.0138986527527033
-11024,8089,8090,0.00683010177656819,0.00683010177656819
-11025,8090,8091,0.110435202693889,0.110435202693889
-11026,7961,8092,0.198854876063874,0.198854876063874
-11028,5855,1340,0.201837936768745,0.201837936768745
-11029,1340,8094,0.205566060887405,0.205566060887405
-11030,8094,4699,0.204173926089909,0.204173926089909
-11031,4699,8095,0.200461574437924,0.200461574437924
-11032,8095,8096,0.201918867294297,0.201918867294297
-11033,8096,6823,0.198988761465987,0.198988761465987
-11034,6823,772,0.204865532850049,0.204865532850049
-11036,6007,6252,0.210749028817316,0.210749028817316
-11037,6252,8097,0.20159640654511,0.20159640654511
-11039,6091,8098,0.0302498178580294,0.0302498178580294
-11040,8098,8099,0.0194131905433523,0.0194131905433523
-11041,8099,6924,0.166900367789548,0.166900367789548
-11042,6924,8100,0.161859559583179,0.161859559583179
-11043,8100,1241,0.0380629815604356,0.0380629815604356
-11045,6980,7942,0.133638145181839,0.133638145181839
-11046,7942,5338,0.0765467348148991,0.0765467348148991
-11048,5442,7919,0.212135491175046,0.212135491175046
-11049,7919,4410,0.19312496970157,0.19312496970157
-11050,4410,8103,0.226886968788061,0.226886968788061
-11051,8103,4283,0.17035467585884,0.17035467585884
-11053,8104,7854,0.0946426330892721,0.0946426330892721
-11054,7854,8105,0.0433309511619061,0.0433309511619061
-11055,8106,6776,0.129541839197132,0.129541839197132
-11056,6776,6152,0.13334664352248,0.13334664352248
-11057,6152,3997,0.133550546612879,0.133550546612879
-11058,3997,7046,0.134234793318191,0.134234793318191
-11059,7046,7376,0.132775137258175,0.132775137258175
-11060,7376,3435,0.135417405491425,0.135417405491425
-11063,7764,5715,0.0517371191288579,0.0517371191288579
-11064,5715,8107,0.0482057757930101,0.0482057757930101
-11065,8107,7435,0.0500858095958938,0.0500858095958938
-11066,7435,8108,0.0493949795014098,0.0493949795014098
-11067,8108,7174,0.049625706970036,0.049625706970036
-11068,7174,6739,0.0493949818685724,0.0493949818685724
-11069,6739,7789,0.0481559013551591,0.0481559013551591
-11070,7789,6645,0.0506327285203027,0.0506327285203027
-11071,6645,1136,0.0491201558695857,0.0491201558695857
-11072,1136,6995,0.0494363433732341,0.0494363433732341
-11073,6995,7503,0.049590164320003,0.049590164320003
-11074,7503,8109,0.100703299932673,0.100703299932673
-11075,8109,7480,0.0534769030186113,0.0534769030186113
-11076,7480,5580,0.0516905707687601,0.0516905707687601
-11077,5580,8110,0.0497706020063474,0.0497706020063474
-11078,8110,8111,0.0487450776836639,0.0487450776836639
-11079,8111,8112,0.694365013204936,0.694365013204936
-11080,1262,4539,0.0997555409236608,0.0997555409236608
-11081,4539,6285,0.098678051142926,0.098678051142926
-11083,2717,8113,0.100251109237605,0.100251109237605
-11085,8114,8115,0.096187670432143,0.096187670432143
-11086,8115,5626,0.201348891867615,0.201348891867615
-11088,2507,8116,0.0493483893872719,0.0493483893872719
-11089,8116,1238,0.100702597753866,0.100702597753866
-11090,1238,4792,0.032813432065695,0.032813432065695
-11091,4792,4812,0.0677278405661894,0.0677278405661894
-11092,4812,2152,0.0672921980026174,0.0672921980026174
-11093,2152,2179,0.0344341477791983,0.0344341477791983
-11094,2179,6304,0.100339028034619,0.100339028034619
-11095,6304,6426,0.101616906343387,0.101616906343387
-11096,6426,5344,0.101029409154815,0.101029409154815
-11097,5344,4640,0.0949596649493475,0.0949596649493475
-11098,4640,1261,0.0990622828589398,0.0990622828589398
-11100,3674,8117,0.125664760723522,0.125664760723522
-11101,8117,8118,0.0959168081132613,0.0959168081132613
-11102,8118,8119,0.126940211454871,0.126940211454871
-11103,8119,8120,0.01117909521949,0.01117909521949
-11104,8120,2680,0.0506435066002237,0.0506435066002237
-11105,2680,7576,0.0851117723335375,0.0851117723335375
-11106,7576,7833,0.0050110745435388,0.0050110745435388
-16206,5823,7210,0.206033080289906,0.206033080289906
-11107,7833,8121,0.0770500763169566,0.0770500763169566
-11108,8121,8035,0.0465513466723509,0.0465513466723509
-11110,807,8122,0.0835494437055617,0.0835494437055617
-11111,8122,8123,0.0673397864842803,0.0673397864842803
-11112,8123,3017,0.0101257363562013,0.0101257363562013
-11114,8124,8125,0.0101518907891953,0.0101518907891953
-11115,8125,2367,0.124673068713839,0.124673068713839
-11116,2367,8126,0.113318754907998,0.113318754907998
-11117,8126,1826,0.2011636326138,0.2011636326138
-11119,8127,8128,0.150025905824831,0.150025905824831
-11121,2887,8129,0.081938792894379,0.081938792894379
-11122,8129,8130,0.106964546123147,0.106964546123147
-11123,8130,4728,0.104978647949955,0.104978647949955
-11124,4728,6795,0.108689532522494,0.108689532522494
-11125,6795,7347,0.102216150252819,0.102216150252819
-11126,7347,5393,0.105889579896167,0.105889579896167
-11127,5393,8131,0.054562518485416,0.054562518485416
-11128,8131,8132,0.0481675689920574,0.0481675689920574
-11129,8132,3895,0.109975096473535,0.109975096473535
-11130,3895,1027,0.10512607647723,0.10512607647723
-11131,1027,8133,0.0540856357592879,0.0540856357592879
-12777,8831,8832,0.188959131880304,0.188959131880304
-11133,6270,8134,0.0524343047299347,0.0524343047299347
-11134,8134,8135,0.0535628703960502,0.0535628703960502
-11136,8136,8137,0.085310565822113,0.085310565822113
-11137,8137,6283,0.0924164471878071,0.0924164471878071
-11138,6283,8138,0.0880043396162394,0.0880043396162394
-11139,8138,8139,0.093883258506383,0.093883258506383
-11140,8139,3142,0.0916816056478044,0.0916816056478044
-11141,3142,5416,0.0909467644852468,0.0909467644852468
-11142,5416,8140,0.0909305385237858,0.0909305385237858
-11144,3154,4972,0.0951253779669951,0.0951253779669951
-11145,4972,8141,0.159341748119657,0.159341748119657
-11147,8142,7088,0.0975513520982515,0.0975513520982515
-11148,7088,971,0.0957796137604222,0.0957796137604222
-11149,971,7402,0.0550171923708008,0.0550171923708008
-11150,7402,5289,0.0484207753056408,0.0484207753056408
-11152,3320,8143,0.077853024278325,0.077853024278325
-11153,8143,5756,0.0805728425443714,0.0805728425443714
-11154,5756,7328,0.0873058149168626,0.0873058149168626
-11155,7328,2087,0.0932446680916279,0.0932446680916279
-12803,4082,3763,0.178907695562899,0.178907695562899
-11158,4115,4117,0.0440125760632801,0.0440125760632801
-11159,4117,6504,0.0374084190760855,0.0374084190760855
-11160,6504,6677,0.044394894025319,0.044394894025319
-11161,6677,8029,0.0937961823239111,0.0937961823239111
-11162,8029,8144,0.0511329046048641,0.0511329046048641
-11163,8144,8145,0.0135266374241744,0.0135266374241744
-11165,4223,1001,0.0531658581374023,0.0531658581374023
-11167,4374,2855,0.170827518580558,0.170827518580558
-11169,8146,4313,0.17183605887504,0.17183605887504
-11171,5444,7921,0.207916650376417,0.207916650376417
-11172,7921,4408,0.197533961318481,0.197533961318481
-11174,8147,644,0.13870723980062,0.13870723980062
-11175,644,7273,0.132830481063153,0.132830481063153
-11176,7273,1992,0.0923486278054484,0.0923486278054484
-11177,1992,1976,0.0346172149199892,0.0346172149199892
-11178,1976,4591,0.135026001443702,0.135026001443702
-11179,4591,6478,0.132622992610531,0.132622992610531
-12836,8855,8856,0.0453127355156614,0.0453127355156614
-11180,6478,2462,0.14279254357733,0.14279254357733
-11182,8148,8149,0.201096301426274,0.201096301426274
-11183,8149,8150,0.201154462707023,0.201154462707023
-11185,2461,5905,0.204782750962282,0.204782750962282
-11186,5905,8151,0.200573430726899,0.200573430726899
-11187,8151,790,0.199941729347635,0.199941729347635
-11188,790,3583,0.202642621733606,0.202642621733606
-11189,3583,4354,0.202475015345548,0.202475015345548
-11190,4354,8152,0.200309115545572,0.200309115545572
-11191,8152,3057,0.206933046688651,0.206933046688651
-11192,3057,8153,0.186611026973769,0.186611026973769
-11194,1060,8154,0.173008298211734,0.173008298211734
-11195,8154,8155,0.177900871903465,0.177900871903465
-11196,8155,8156,0.167407375878646,0.167407375878646
-11197,8156,4775,0.251673348312152,0.251673348312152
-11198,4775,6553,0.132857734263153,0.132857734263153
-11199,6553,8157,0.106438324963657,0.106438324963657
-11201,2232,5133,0.19052148019247,0.19052148019247
-11202,5133,4902,0.0151263568070176,0.0151263568070176
-11203,4902,6619,0.197484990473566,0.197484990473566
-11205,8158,8159,0.20585122765193,0.20585122765193
-11207,8160,8161,0.016887203978,0.016887203978
-11221,106,61,0.00533283632570931,0.00533283632570931
-11222,61,65,0.207145778882675,0.207145778882675
-11224,103,8170,0.0169041191858478,0.0169041191858478
-11225,8170,8171,0.361108877807587,0.361108877807587
-11226,8171,8172,0.190446564346409,0.190446564346409
-11228,8173,8174,0.0754029121625499,0.0754029121625499
-11229,8174,8175,0.417052793540933,0.417052793540933
-11231,8176,8177,0.0299391686417842,0.0299391686417842
-11232,8177,8178,0.202215537578589,0.202215537578589
-11233,8178,8179,0.11808571362223,0.11808571362223
-11234,8179,8163,0.126818785158071,0.126818785158071
-11236,4228,8181,0.209470643186114,0.209470643186114
-11269,4227,8200,0.197818013323833,0.197818013323833
-11237,8181,65,0.190124873120192,0.190124873120192
-11238,65,8172,0.00592368117466438,0.00592368117466438
-11239,8172,8178,0.446545243407564,0.446545243407564
-12886,8876,655,0.00596005420121878,0.00596005420121878
-11242,8183,8184,0.228538005170478,0.228538005170478
-11245,8162,8186,0.154667884886688,0.154667884886688
-11246,8186,8187,0.175562487769928,0.175562487769928
-11249,3633,8188,0.0150923041998694,0.0150923041998694
-11250,8188,8189,0.270579217097142,0.270579217097142
-11251,8189,8176,0.0989590805052705,0.0989590805052705
-11253,8163,3643,0.149826975112258,0.149826975112258
-11255,8190,1804,0.201671276037755,0.201671276037755
-11257,8191,8192,0.0154162495075233,0.0154162495075233
-11258,8192,8193,0.181517364616001,0.181517364616001
-11259,8193,8194,0.180264399151985,0.180264399151985
-11261,8181,3550,0.192378625445026,0.192378625445026
-11264,8186,8197,0.16597516800592,0.16597516800592
-11265,8197,8198,0.19583924016197,0.19583924016197
-11267,8199,8197,0.123986592502342,0.123986592502342
-11271,8194,8171,0.202821007714315,0.202821007714315
-11272,8171,8195,0.195495736534207,0.195495736534207
-11273,8195,8201,0.207035429354564,0.207035429354564
-11275,8202,8174,0.0167300114490718,0.0167300114490718
-11277,8198,8167,0.130702597640292,0.130702597640292
-11278,8167,8203,0.122618976220882,0.122618976220882
-11279,8203,8204,0.327046093817032,0.327046093817032
-11280,4228,4229,0.198835732908948,0.198835732908948
-11281,4229,8205,0.301334691508365,0.301334691508365
-11282,8206,8190,0.113799565910968,0.113799565910968
-11284,8201,4227,0.0154895076655846,0.0154895076655846
-11286,8207,8200,0.0930040479254132,0.0930040479254132
-11288,8193,8184,0.208283527691618,0.208283527691618
-11316,5155,2238,0.0837223321108041,0.0837223321108041
-11289,8184,8189,0.18616179415052,0.18616179415052
-11291,3257,8208,0.321455747501831,0.321455747501831
-11293,443,8209,0.110751336507506,0.110751336507506
-11294,392,8179,0.178734728363983,0.178734728363983
-11296,8162,6291,0.216060929512084,0.216060929512084
-11297,6291,7342,0.196043159951137,0.196043159951137
-11645,8348,6433,0.104796073662296,0.104796073662296
-11299,7342,5274,0.233799434282417,0.233799434282417
-11300,61,3550,0.201334976523304,0.201334976523304
-11301,3550,4229,0.200151526253302,0.200151526253302
-11303,5279,3162,0.0990447395902117,0.0990447395902117
-11304,3162,4979,0.101293558978732,0.101293558978732
-11305,4979,8126,0.0993695918525221,0.0993695918525221
-11306,8126,4335,0.0910331896522206,0.0910331896522206
-11307,4335,8210,0.0476841899874069,0.0476841899874069
-11308,8210,5040,0.0521232799197054,0.0521232799197054
-11309,5040,8005,0.0976580173278249,0.0976580173278249
-11310,8005,4307,0.0466427658725356,0.0466427658725356
-11311,4307,995,0.052631404385892,0.052631404385892
-11313,8211,5951,0.199050744316133,0.199050744316133
-11314,5951,5143,0.0913688712241713,0.0913688712241713
-11315,5143,5155,0.025420878561629,0.025420878561629
-11317,2238,4911,0.203010994943857,0.203010994943857
-11318,4911,6611,0.201886473833407,0.201886473833407
-11319,6611,8212,0.197101479655197,0.197101479655197
-11320,8212,8213,0.206955997470903,0.206955997470903
-11323,5950,5142,0.147533492116586,0.147533492116586
-11326,2237,4910,0.20422309503448,0.20422309503448
-11327,4910,6612,0.200274596012582,0.200274596012582
-11328,6612,8215,0.196974435405611,0.196974435405611
-11329,8215,8216,0.208072957327714,0.208072957327714
-11331,7959,8217,0.0106613346433968,0.0106613346433968
-11337,289,8219,0.0101386145536838,0.0101386145536838
-11338,8219,4483,0.0263974796072716,0.0263974796072716
-11340,8220,289,0.116841869555958,0.116841869555958
-11483,8221,8222,0.0466544327533727,0.0466544327533727
-11342,8223,7906,0.0355112223964134,0.0355112223964134
-11343,7906,4187,0.0959478466054884,0.0959478466054884
-11344,4187,8224,0.108554994700497,0.108554994700497
-11345,8224,2512,0.0267513344361619,0.0267513344361619
-11346,2512,6726,0.134329958691173,0.134329958691173
-11347,6726,8226,0.0541066682112551,0.0541066682112551
-11348,8226,1754,0.0582360854290831,0.0582360854290831
-11352,8227,8228,0.0477813036978224,0.0477813036978224
-11353,8228,2164,0.0100092856224142,0.0100092856224142
-11354,2164,8229,0.117341992338054,0.117341992338054
-11355,8229,6417,0.132790064578642,0.132790064578642
-11356,6417,6925,0.066680142142332,0.066680142142332
-11357,6925,4623,0.0658013116163711,0.0658013116163711
-11358,4623,1242,0.132924383309181,0.132924383309181
-11359,1242,8230,0.117419950970456,0.117419950970456
-11360,8230,2709,0.0877593926636965,0.0877593926636965
-11361,2709,2723,0.0586886121966142,0.0586886121966142
-11362,2723,8231,0.126334352112189,0.126334352112189
-11363,8231,8232,0.00800071585537006,0.00800071585537006
-11364,8232,8233,0.00985605768408299,0.00985605768408299
-11368,8223,8219,0.0801446034429079,0.0801446034429079
-11374,8234,8235,0.161648892640997,0.161648892640997
-11375,8235,8236,0.12616333160407,0.12616333160407
-11379,4843,910,0.143586236704503,0.143586236704503
-16194,9844,7725,1.4119245996206,1.4119245996206
-11388,2064,8243,0.0180732464676321,0.0180732464676321
-11389,8243,8244,0.307196973753055,0.307196973753055
-11392,8246,3316,0.0456634204130967,0.0456634204130967
-11394,6201,6945,0.172713645832468,0.172713645832468
-11395,6945,8138,0.203649557134895,0.203649557134895
-11396,8138,2880,0.164233861501064,0.164233861501064
-11398,6200,6944,0.169916988893137,0.169916988893137
-11399,6944,8139,0.203898136987997,0.203898136987997
-11400,8139,2879,0.160611633174386,0.160611633174386
-11401,2879,6408,0.0322091251783491,0.0322091251783491
-11402,6408,6412,0.266159968303504,0.266159968303504
-11403,6412,8247,0.0505479778201866,0.0505479778201866
-11407,6190,6948,0.200111149085838,0.200111149085838
-11408,6948,8142,0.198760931377031,0.198760931377031
-11409,8142,2864,0.201908008890848,0.201908008890848
-11412,8249,8067,0.737441419701283,0.737441419701283
-11424,8079,8250,0.738983904805809,0.738983904805809
-11431,412,415,0.636538521199656,0.636538521199656
-18912,10390,10391,0.0580503615423655,0.0580503615423655
-11453,8262,8263,0.292162593230546,0.292162593230546
-11468,781,8271,0.782578824666181,0.782578824666181
-11597,8330,8331,0.0435245851176098,0.0435245851176098
-11469,8272,8270,0.782084992370784,0.782084992370784
-11471,1610,1244,0.0543175525667992,0.0543175525667992
-11472,1244,8273,0.0533400242428221,0.0533400242428221
-11473,8273,8274,0.0526029519682926,0.0526029519682926
-11474,8274,8275,0.0534350213865012,0.0534350213865012
-11476,8276,1610,0.0663295545530221,0.0663295545530221
-11478,1610,8277,0.135789656985465,0.135789656985465
-11480,7861,8278,0.0143942343868779,0.0143942343868779
-11481,8278,7581,0.0343415060903181,0.0343415060903181
-11482,7581,8221,0.0532138886249367,0.0532138886249367
-11484,8222,5964,0.00591714471910066,0.00591714471910066
-11485,5964,8279,0.00703516905841087,0.00703516905841087
-11486,8279,3001,0.0966235655424771,0.0966235655424771
-11488,8275,7561,0.103690392766705,0.103690392766705
-11489,7561,8280,0.0558620890554655,0.0558620890554655
-11490,8280,6185,0.0505017539528047,0.0505017539528047
-11493,8282,8283,0.101387037651418,0.101387037651418
-11494,8283,8284,0.102270654549379,0.102270654549379
-11495,8284,8285,0.10797805598011,0.10797805598011
-11496,8285,8286,0.106400672091098,0.106400672091098
-11497,8286,4392,0.102247824152268,0.102247824152268
-11498,4392,8287,0.0166274126542335,0.0166274126542335
-11499,8287,8288,0.0799445865529155,0.0799445865529155
-11500,8288,3008,0.023689428581565,0.023689428581565
-11501,3008,8289,0.0297886059757376,0.0297886059757376
-11505,8290,8291,0.051999610902965,0.051999610902965
-11506,8291,8292,0.0471972516257623,0.0471972516257623
-11507,8292,8293,0.00657484491051097,0.00657484491051097
-11508,8293,6184,0.103933630763566,0.103933630763566
-11509,6184,7562,0.106067817024884,0.106067817024884
-11510,7562,8294,0.105991654619724,0.105991654619724
-11512,8295,8296,0.0523765388441753,0.0523765388441753
-11522,8297,8298,0.429589849820924,0.429589849820924
-11537,6093,8302,0.0171793049902436,0.0171793049902436
-11539,8303,8304,0.00530856583912826,0.00530856583912826
-11541,2195,8305,0.128463648918522,0.128463648918522
-11543,8306,8307,0.0111673306658244,0.0111673306658244
-11545,8308,8306,0.0470759818626725,0.0470759818626725
-11547,8309,8310,0.0336302381688336,0.0336302381688336
-11549,8311,8312,0.0219555493879181,0.0219555493879181
-11550,8312,8313,0.036241706253738,0.036241706253738
-11598,8331,7782,0.0493369824555625,0.0493369824555625
-11551,8313,8314,0.0512913124797426,0.0512913124797426
-11552,8314,8315,0.107868186928524,0.107868186928524
-11553,8315,8316,0.223470506469832,0.223470506469832
-11554,8316,8317,0.211788929267968,0.211788929267968
-11555,8317,6963,0.0143636308232266,0.0143636308232266
-16197,7207,1788,0.198027086450295,0.198027086450295
-11556,6963,2151,0.0672032541987901,0.0672032541987901
-11557,2151,8318,0.127422890827039,0.127422890827039
-11563,8321,5670,0.0510922996821663,0.0510922996821663
-11564,5670,8319,0.0512128921942442,0.0512128921942442
-11565,8319,7031,0.0489988317743493,0.0489988317743493
-13192,2925,5307,0.0991225747078309,0.0991225747078309
-17794,8402,10178,0.0874671474005437,0.0874671474005437
-11583,8323,8324,0.0415122975666244,0.0415122975666244
-11585,8325,8326,0.0105737020216599,0.0105737020216599
-11586,8326,8327,0.0170186899048993,0.0170186899048993
-11587,8327,4030,0.059373245074661,0.059373245074661
-11588,4030,8328,0.00887102858910589,0.00887102858910589
-11589,8328,7033,0.192077028988682,0.192077028988682
-11590,7033,3414,0.20009224997208,0.20009224997208
-11591,3414,7634,0.0490496792565584,0.0490496792565584
-11592,7634,5699,0.0501609282125079,0.0501609282125079
-11593,5699,8329,0.0491062363102631,0.0491062363102631
-11594,8329,7426,0.0512345906571307,0.0512345906571307
-11595,7426,7167,0.100906650593457,0.100906650593457
-11596,7167,8330,0.0074706340310152,0.0074706340310152
-11601,1125,8333,0.0515421912286004,0.0515421912286004
-11602,8333,7499,0.0491232128122514,0.0491232128122514
-11603,7499,6382,0.0528674106807856,0.0528674106807856
-11604,6382,3844,0.0491757077428548,0.0491757077428548
-11605,3844,8336,0.0505763419832581,0.0505763419832581
-11606,8336,5560,0.0511234189065501,0.0511234189065501
-11607,5560,7536,0.078259792036463,0.078259792036463
-17795,10178,10179,0.00714983889336217,0.00714983889336217
-11608,7536,8337,0.710353127144862,0.710353127144862
-11615,8339,8340,0.0545607270452329,0.0545607270452329
-11616,8340,6778,0.0500886204125654,0.0500886204125654
-11617,6778,1543,0.044749974690185,0.044749974690185
-11618,1543,7913,0.0484257128218018,0.0484257128218018
-11619,7913,1232,0.0498960080732329,0.0498960080732329
-11620,1232,6138,0.0513577550981739,0.0513577550981739
-11621,6138,1234,0.0484184731965446,0.0484184731965446
-11622,1234,4025,0.049897443897038,0.049897443897038
-11624,8341,6746,0.131938356933677,0.131938356933677
-11625,6746,6146,0.134278510793599,0.134278510793599
-11626,6146,4020,0.131808341418281,0.131808341418281
-11627,4020,7024,0.13680573147125,0.13680573147125
-11628,7024,7394,0.133543322276702,0.133543322276702
-11629,7394,3403,0.129241253411212,0.129241253411212
-11631,4656,1278,0.11609492718799,0.11609492718799
-11633,4529,8342,0.13081541679387,0.13081541679387
-11634,8342,8343,0.131875462531589,0.131875462531589
-11636,1275,4561,0.135792686790169,0.135792686790169
-11637,4561,8344,0.129597362082905,0.129597362082905
-11638,8344,8345,0.132615292246902,0.132615292246902
-11654,8351,8352,0.00642310935412446,0.00642310935412446
-11656,8354,3585,0.00948998635035479,0.00948998635035479
-11658,8355,7036,0.189514043057238,0.189514043057238
-11661,3420,7662,0.0473953664812579,0.0473953664812579
-11662,7662,5701,0.051310070537927,0.051310070537927
-11663,5701,8356,0.0493288418218244,0.0493288418218244
-11664,8356,7428,0.0514646959507586,0.0514646959507586
-11665,7428,7170,0.101185693406291,0.101185693406291
-11666,7170,8357,0.0511732963069457,0.0511732963069457
-11667,8357,7785,0.0488740378204359,0.0488740378204359
-11669,8358,8359,0.0429199500385996,0.0429199500385996
-11670,8359,1126,0.0542934514543922,0.0542934514543922
-11671,1126,8361,0.0465752610792189,0.0465752610792189
-11672,8361,7500,0.0458657856618734,0.0458657856618734
-11673,7500,6383,0.0540969092476656,0.0540969092476656
-11674,6383,3845,0.0488658545954006,0.0488658545954006
-11675,3845,8362,0.0512974137325796,0.0512974137325796
-11676,8362,5562,0.0492074321979192,0.0492074321979192
-11677,5562,8363,0.0405073414501016,0.0405073414501016
-11678,8363,7537,0.0387636388049137,0.0387636388049137
-11679,7537,8364,0.709659016245144,0.709659016245144
-11680,533,532,0.177767664549368,0.177767664549368
-11681,532,8365,0.019932032746647,0.019932032746647
-11683,8366,2195,0.0764354088651933,0.0764354088651933
-11712,3383,8367,0.106809468593159,0.106809468593159
-11713,8367,8368,0.0971987897456675,0.0971987897456675
-11714,8368,8369,0.0991386674985246,0.0991386674985246
-11717,5295,6973,0.135215470337054,0.135215470337054
-11718,6973,8371,0.00923487504976077,0.00923487504976077
-11719,8371,8372,0.0216052571390285,0.0216052571390285
-11720,8372,16,0.105179593848414,0.105179593848414
-11721,16,6385,0.131720726068438,0.131720726068438
-11722,6385,8373,0.136425162652677,0.136425162652677
-11723,8373,8374,0.133357418298716,0.133357418298716
-11725,8375,5538,0.102551146645578,0.102551146645578
-11726,5538,2406,0.101276420369131,0.101276420369131
-11727,2406,4291,0.0994536245434588,0.0994536245434588
-11728,4291,8376,0.0498495835403536,0.0498495835403536
-11729,8376,8377,0.0555205772000376,0.0555205772000376
-11730,8377,7717,0.202770146499174,0.202770146499174
-11731,7717,2980,0.203558742671124,0.203558742671124
-11733,6381,7626,0.0677965571067337,0.0677965571067337
-11734,7626,8378,0.0657902652889389,0.0657902652889389
-11736,3813,8379,0.0683672879873519,0.0683672879873519
-11737,8379,7491,0.0530440410997852,0.0530440410997852
-11738,7491,3832,0.0868122883126915,0.0868122883126915
-11740,8129,8380,0.134532326319759,0.134532326319759
-11741,8380,8382,0.00458704251135175,0.00458704251135175
-11743,8383,8384,0.136207849444979,0.136207849444979
-11744,8384,7838,0.138328826392976,0.138328826392976
-11746,8385,8386,0.0871147692827014,0.0871147692827014
-11749,8389,8390,0.0947169874364547,0.0947169874364547
-19614,10514,10587,0.0689139357560502,0.0689139357560502
-11751,8391,4386,0.0534420102551264,0.0534420102551264
-11752,4386,8392,0.0520924012173649,0.0520924012173649
-11753,8392,8393,0.0473152332925311,0.0473152332925311
-11754,8393,8394,0.00593400942031918,0.00593400942031918
-11755,8394,8395,0.0526072167549377,0.0526072167549377
-11756,8395,8396,0.0535245842073366,0.0535245842073366
-11757,8396,8397,0.0520127953812383,0.0520127953812383
-11758,8397,8398,0.0525440381176666,0.0525440381176666
-11759,8398,8399,0.105725944401461,0.105725944401461
-11760,8399,8400,0.0963534079842441,0.0963534079842441
-11761,8400,8401,0.00721402202643277,0.00721402202643277
-11762,8401,8402,0.0642819932248178,0.0642819932248178
-11763,8402,6180,0.0440229088580127,0.0440229088580127
-11764,6180,3304,0.105719811244021,0.105719811244021
-11765,3304,8404,0.104473728049028,0.104473728049028
-11776,2683,5360,0.148134497863423,0.148134497863423
-11779,8408,8409,0.0170504242210171,0.0170504242210171
-11780,8409,8410,0.0301331300599118,0.0301331300599118
-11781,8410,8408,0.024630163522097,0.024630163522097
-11786,8411,7068,0.119279864672347,0.119279864672347
-11787,7068,5513,0.148575970390717,0.148575970390717
-11788,5513,4445,0.14563348668729,0.14563348668729
-11795,8413,543,0.028789081158834,0.028789081158834
-11800,8038,2689,0.14574049201504,0.14574049201504
-11801,2689,8392,0.146364813323007,0.146364813323007
-11810,8316,8410,0.0688632882143238,0.0688632882143238
-11818,8318,8421,0.163109524565458,0.163109524565458
-11820,2202,8422,0.0636527332062032,0.0636527332062032
-11827,8425,8426,0.235001983383898,0.235001983383898
-11829,8427,2187,0.0976945121262096,0.0976945121262096
-11830,2187,8428,0.113051166751879,0.113051166751879
-11832,8429,8427,0.106790392513668,0.106790392513668
-11836,8432,8433,0.316135432263608,0.316135432263608
-11838,8434,8435,0.0739062863270344,0.0739062863270344
-16014,9785,9166,0.0737839272607517,0.0737839272607517
-11840,8436,8437,0.305296163280187,0.305296163280187
-11842,8438,8439,0.0899401823641934,0.0899401823641934
-11843,8439,8440,0.0855827793815302,0.0855827793815302
-11845,8441,533,0.0890672230330435,0.0890672230330435
-11847,8325,3752,0.00830034500152871,0.00830034500152871
-11848,3752,8442,0.100105658665385,0.100105658665385
-11849,8442,6773,0.103872958239997,0.103872958239997
-11850,6773,8303,0.0295834023794743,0.0295834023794743
-11851,8303,8443,0.122024126507826,0.122024126507826
-11854,8365,8445,0.12649848699983,0.12649848699983
-11856,8445,8446,0.0774789975708123,0.0774789975708123
-11858,6522,8447,0.124835406842481,0.124835406842481
-11860,8447,4244,0.0110439553261759,0.0110439553261759
-11861,4244,1787,0.20168643392703,0.20168643392703
-11862,1787,7206,0.198352393557477,0.198352393557477
-11863,7206,5819,0.204146640542909,0.204146640542909
-11864,5819,7724,0.196992932786583,0.196992932786583
-11865,7724,8448,0.0469826616672844,0.0469826616672844
-11866,8448,8449,1.1597652413984,1.1597652413984
-15932,1178,9158,0.281206093212011,0.281206093212011
-11868,529,476,0.196533269115043,0.196533269115043
-11869,476,8451,0.00692492598385206,0.00692492598385206
-11871,8452,8450,0.118857471050118,0.118857471050118
-11873,8446,8453,0.0472361723035857,0.0472361723035857
-11875,8453,1808,0.0616092600190724,0.0616092600190724
-11876,1808,8454,0.103675532542851,0.103675532542851
-11878,8455,8452,0.0832501988122618,0.0832501988122618
-11880,8456,8455,0.0488208935536257,0.0488208935536257
-11883,1807,8456,0.0645719953824934,0.0645719953824934
-11885,8454,8460,0.0468848260297017,0.0468848260297017
-11887,8460,8461,0.191542303309411,0.191542303309411
-11888,8461,8462,0.143814933384229,0.143814933384229
-11926,8479,7578,0.0514183930388008,0.0514183930388008
-11889,8462,8312,0.0813843178601785,0.0813843178601785
-11890,8312,8463,0.108687135880293,0.108687135880293
-11891,8463,8464,0.171307568098715,0.171307568098715
-11892,8464,7962,0.138415151415673,0.138415151415673
-11894,8465,8457,0.0468050869550622,0.0468050869550622
-11899,8468,3170,0.018103312819976,0.018103312819976
-11901,8469,8466,0.0123424922846296,0.0123424922846296
-11902,8466,8311,0.0903233113904637,0.0903233113904637
-11904,8470,8469,0.0396717564170432,0.0396717564170432
-11906,8296,8273,0.152532135373756,0.152532135373756
-11907,8273,5789,0.146346014371488,0.146346014371488
-11908,5789,4816,0.144635236179438,0.144635236179438
-11909,4816,8471,0.144945711618013,0.144945711618013
-11910,8471,8472,0.00337499193971306,0.00337499193971306
-13477,9099,9096,0.0859011649600223,0.0859011649600223
-11912,8473,8474,0.141151348464777,0.141151348464777
-11913,8474,8475,0.13279343346844,0.13279343346844
-11915,1346,8475,0.0349627710606267,0.0349627710606267
-11919,8313,8477,0.0691895872331652,0.0691895872331652
-11921,4846,8478,0.326789742990523,0.326789742990523
-11923,5031,6987,0.0623597305249406,0.0623597305249406
-11924,6987,5806,0.105799056021075,0.105799056021075
-11925,5806,8479,0.0532916983351864,0.0532916983351864
-11927,7578,8480,0.0539921866859616,0.0539921866859616
-11928,8480,8481,0.0438686505947476,0.0438686505947476
-11929,8481,5961,0.00656699811047763,0.00656699811047763
-11930,5961,8482,0.00665108194893408,0.00665108194893408
-11931,8482,3003,0.0997303043018087,0.0997303043018087
-11932,3003,4396,0.10605079021574,0.10605079021574
-11933,4396,8483,0.102726296828384,0.102726296828384
-11934,8483,8484,0.00648258609012086,0.00648258609012086
-11935,8484,8485,0.100141708737386,0.100141708737386
-11936,8485,8486,0.0275311475026058,0.0275311475026058
-11937,8486,8487,0.0265062604992808,0.0265062604992808
-11938,8487,8488,0.0523458198440316,0.0523458198440316
-11939,8488,8489,0.104751027795859,0.104751027795859
-11940,8489,8490,0.0990693987095691,0.0990693987095691
-11941,8490,8491,0.00745857832944624,0.00745857832944624
-11942,8491,8492,0.0518088588950486,0.0518088588950486
-11943,8492,6189,0.054888246037165,0.054888246037165
-11945,6632,7733,0.112596009055585,0.112596009055585
-12071,8507,3552,0.071078699522552,0.071078699522552
-11946,7733,8495,2.00712592676004,2.00712592676004
-11954,6568,4449,0.147875161573861,0.147875161573861
-11955,4449,5497,0.144351276811523,0.144351276811523
-11956,5497,7071,0.14871904829256,0.14871904829256
-11958,8501,8502,0.146058647776188,0.146058647776188
-11959,8502,8397,0.148207146508282,0.148207146508282
-11960,8397,2694,0.144837053832231,0.144837053832231
-11966,4737,8503,0.0843423130679838,0.0843423130679838
-11967,8399,5455,0.141833750205801,0.141833750205801
-11968,5455,2697,0.00495891013188563,0.00495891013188563
-11969,2697,8045,0.148003641728593,0.148003641728593
-11970,8045,6573,0.144311748140391,0.144311748140391
-11971,6573,4454,0.147824934616054,0.147824934616054
-11972,4454,5502,0.144725467857806,0.144725467857806
-11973,5502,7076,0.14772137009526,0.14772137009526
-11974,7076,2033,0.146029155751578,0.146029155751578
-11975,2033,5322,0.146208700799923,0.146208700799923
-11976,5322,631,0.145784380568713,0.145784380568713
-11977,631,6404,0.147332884437086,0.147332884437086
-11978,6404,2910,0.0722929712454625,0.0722929712454625
-11980,8504,8505,0.0580359403583064,0.0580359403583064
-11981,8505,6178,0.0499592014591395,0.0499592014591395
-11982,6178,8506,0.0514685264155668,0.0514685264155668
-11983,8506,8508,0.0359450086839816,0.0359450086839816
-11985,8509,8491,0.145477011516465,0.145477011516465
-11986,8491,6711,0.147675146026861,0.147675146026861
-11987,6711,8510,0.0119577509852376,0.0119577509852376
-11999,7079,2035,0.146591134901683,0.146591134901683
-12000,2035,8511,0.144080341921709,0.144080341921709
-12001,8506,6577,0.292638121021149,0.292638121021149
-12013,8514,7905,0.14392744613234,0.14392744613234
-12014,7905,8224,0.144594704272466,0.144594704272466
-12015,8224,2513,0.0408485952047996,0.0408485952047996
-12017,8223,4514,0.129566346086565,0.129566346086565
-12018,4514,5236,0.132336483238921,0.132336483238921
-12019,5236,6888,0.137583446360535,0.137583446360535
-12020,6888,8515,0.134749292102011,0.134749292102011
-18562,2839,2837,0.0398814314105002,0.0398814314105002
-12021,8515,1670,0.131131933535458,0.131131933535458
-12022,1670,8516,0.137025514768393,0.137025514768393
-12023,8516,2451,0.140387467109701,0.140387467109701
-12024,2451,3220,0.132796169496021,0.132796169496021
-12025,3220,3241,0.0110949892633217,0.0110949892633217
-12026,3241,5742,0.122723226676881,0.122723226676881
-12027,5742,5734,0.0121046279679281,0.0121046279679281
-12028,5734,5519,0.122276751203955,0.122276751203955
-12029,5519,5518,0.0183360434030607,0.0183360434030607
-12030,5518,6453,0.115919443239594,0.115919443239594
-12031,6453,8519,0.0186206290164017,0.0186206290164017
-12032,8519,6921,0.113511395757215,0.113511395757215
-12033,6921,6966,0.278590640144845,0.278590640144845
-12034,6966,2480,0.0421290693071181,0.0421290693071181
-12035,2480,2819,0.0832464241503531,0.0832464241503531
-12036,2819,1420,0.203808019181798,0.203808019181798
-12037,1420,1350,0.0610460440330561,0.0610460440330561
-12038,1350,386,0.0313326355302306,0.0313326355302306
-12039,386,8520,0.00828931624769023,0.00828931624769023
-12041,8521,8522,0.0528158272532374,0.0528158272532374
-12042,8522,8461,0.0240744692191342,0.0240744692191342
-12045,8524,8525,0.099226587437181,0.099226587437181
-12056,6652,7968,0.116416731661103,0.116416731661103
-13645,9155,9152,0.125537210877253,0.125537210877253
-12069,3016,8123,0.0144820950034519,0.0144820950034519
-12070,8123,8507,0.0310425416681892,0.0310425416681892
-12072,3552,4443,0.0963694960086714,0.0963694960086714
-12074,8536,8537,0.125429093404429,0.125429093404429
-12075,8537,8398,0.148732331324902,0.148732331324902
-12076,8398,2695,0.143717697009194,0.143717697009194
-12078,8043,6571,0.143486226041694,0.143486226041694
-15271,8458,8538,0.130887342573391,0.130887342573391
-12079,6571,4452,0.149648787475973,0.149648787475973
-12080,4452,5500,0.142780903948531,0.142780903948531
-12081,5500,7074,0.148102852377504,0.148102852377504
-12082,7074,2032,0.145681586591459,0.145681586591459
-12086,2886,7993,0.218441304114497,0.218441304114497
-12088,8130,8541,0.134523622254369,0.134523622254369
-12089,8541,8542,0.00481474032387871,0.00481474032387871
-12090,8542,8543,0.00504824966940074,0.00504824966940074
-12091,8543,8544,0.135980275793844,0.135980275793844
-12092,8544,7839,0.139416199289129,0.139416199289129
-12093,7839,819,0.136947671655105,0.136947671655105
-12094,819,3560,0.140872852825874,0.140872852825874
-12095,3560,5634,0.139405079534224,0.139405079534224
-12096,5634,4338,0.141217557097108,0.141217557097108
-12097,4338,6337,0.135602213042785,0.135602213042785
-12098,6337,3053,0.134723773393479,0.134723773393479
-12100,3691,8545,0.139072808044494,0.139072808044494
-12101,5485,8546,0.200596752868582,0.200596752868582
-12103,4888,8547,0.185876236918155,0.185876236918155
-12104,8547,5486,0.175599681021845,0.175599681021845
-12106,4889,8548,0.187588829795577,0.187588829795577
-12107,8548,5487,0.174192187356096,0.174192187356096
-12109,8549,8550,0.0264199145705686,0.0264199145705686
-12110,8550,5477,0.172910339815493,0.172910339815493
-12111,5477,8551,0.17777655236626,0.17777655236626
-12112,8551,8552,0.179401923989104,0.179401923989104
-12114,672,8553,0.00419226671708486,0.00419226671708486
-12116,8554,4600,0.174009465824247,0.174009465824247
-12117,4600,6497,0.141315269300352,0.141315269300352
-12118,6497,3685,0.0979207012351752,0.0979207012351752
-12119,3685,8132,0.140340825489325,0.140340825489325
-12120,8132,8555,0.134412189177842,0.134412189177842
-12121,8555,8556,0.00412533177852682,0.00412533177852682
-12122,8556,8557,0.00459814794721775,0.00459814794721775
-12123,8557,8558,0.132902025218854,0.132902025218854
-12124,8558,7841,0.138710880861165,0.138710880861165
-12125,7841,825,0.140880437202465,0.140880437202465
-12126,825,3566,0.136859579672601,0.136859579672601
-12127,3566,5637,0.14457832436944,0.14457832436944
-12128,5637,4341,0.139173250387063,0.139173250387063
-12129,4341,6340,0.137021300435373,0.137021300435373
-12130,6340,8560,0.107881318168938,0.107881318168938
-12131,2245,4879,0.176153654685445,0.176153654685445
-12132,4879,7358,0.24873496630677,0.24873496630677
-12133,7358,6786,0.0656034947664249,0.0656034947664249
-12134,6786,4878,0.0544981388589161,0.0544981388589161
-12135,4878,5942,0.524256212186461,0.524256212186461
-12136,5942,8561,0.0631406553785623,0.0631406553785623
-12137,8561,3127,0.0936118840285326,0.0936118840285326
-12138,3127,3131,0.0777309112767711,0.0777309112767711
-12139,3131,5914,0.112365280295693,0.112365280295693
-12140,5914,2245,0.331560162235425,0.331560162235425
-12142,8562,2334,2.72525423343991,2.72525423343991
-12144,7677,5980,0.0954252288299854,0.0954252288299854
-12145,5980,2129,0.0933556137052187,0.0933556137052187
-12146,2129,7520,0.0952025856529876,0.0952025856529876
-12147,7520,8563,0.0935887718802941,0.0935887718802941
-12148,8563,2270,0.0947410402071955,0.0947410402071955
-12149,2270,7011,0.0942715716828769,0.0942715716828769
-12150,7011,2766,0.0940480616870089,0.0940480616870089
-12151,2766,3353,0.0940568781185638,0.0940568781185638
-12152,3353,2010,0.0938087738322925,0.0938087738322925
-12153,2010,2020,0.00116816859457691,0.00116816859457691
-12154,2020,7597,0.0929046375775443,0.0929046375775443
-12155,7597,7260,0.0977180089067193,0.0977180089067193
-12156,7260,7607,0.0981798145414121,0.0981798145414121
-12157,7607,8148,0.0984109366674247,0.0984109366674247
-12158,8148,8566,0.099556755200234,0.099556755200234
-12159,8566,8567,0.0161715318927219,0.0161715318927219
-12165,7560,8570,0.0547324150634264,0.0547324150634264
-12166,8570,6187,0.0510334947129921,0.0510334947129921
-12167,6187,8571,0.106459447476842,0.106459447476842
-12168,8571,8572,0.00500250155273319,0.00500250155273319
-12169,8572,8573,0.102179560181125,0.102179560181125
-12171,8574,8575,0.108491319350075,0.108491319350075
-12172,8575,8576,0.100542104447219,0.100542104447219
-12173,8576,8577,0.00648974428476286,0.00648974428476286
-12174,8577,4394,0.10502201579173,0.10502201579173
-12175,4394,3006,0.104610459063575,0.104610459063575
-12176,3006,5958,0.107806604319072,0.107806604319072
-12177,5958,8578,0.00423483079275732,0.00423483079275732
-12178,8578,7577,0.0996748095395635,0.0996748095395635
-12179,7577,5809,0.11590556985698,0.11590556985698
-12181,5431,4429,0.103577041627779,0.103577041627779
-12182,4429,4040,0.0675516196999984,0.0675516196999984
-12183,4040,8579,0.0337698992215471,0.0337698992215471
-12184,8579,6027,0.102046173899402,0.102046173899402
-12185,6027,7864,0.042576537412,0.042576537412
-12186,7864,7863,0.0569874056816302,0.0569874056816302
-12187,7863,1834,0.10010879574602,0.10010879574602
-12188,1834,1828,0.0220165954761323,0.0220165954761323
-12189,1828,2629,0.0778176858176647,0.0778176858176647
-12190,2629,5364,0.0924919399829741,0.0924919399829741
-12191,5364,8580,0.0666180932686517,0.0666180932686517
-12192,8580,514,0.0427668694783733,0.0427668694783733
-12193,514,8581,0.0733005757458476,0.0733005757458476
-12194,8581,411,0.0548642593724076,0.0548642593724076
-12195,411,8582,0.0193916055385274,0.0193916055385274
-12200,8463,8583,0.030501567860775,0.030501567860775
-12202,8584,8585,0.0144536004398608,0.0144536004398608
-12203,8585,8586,0.0148984012969261,0.0148984012969261
-12204,8586,8587,0.0138457363467684,0.0138457363467684
-12206,7095,8584,0.00198726095451303,0.00198726095451303
-12208,8587,8588,0.0738864008587524,0.0738864008587524
-12209,8588,8088,0.0459979828668163,0.0459979828668163
-12211,8588,8088,0.0459979828668163,0.0459979828668163
-12213,7962,8589,0.0119871256203592,0.0119871256203592
-12219,2290,8595,0.0472264457525012,0.0472264457525012
-12224,8600,6960,0.0627185145557708,0.0627185145557708
-12225,6960,8590,0.111002569075664,0.111002569075664
-12226,8590,8601,0.0399166681864525,0.0399166681864525
-12227,8601,8602,0.0122006420704012,0.0122006420704012
-12229,8602,8601,0.0122006420704012,0.0122006420704012
-12231,8605,8606,0.0364944571667735,0.0364944571667735
-12232,8606,8607,0.0128764646733806,0.0128764646733806
-12233,8607,8608,0.0546695374625623,0.0546695374625623
-12234,8608,8585,0.00588263593176519,0.00588263593176519
-12238,6350,8610,0.0529261007223787,0.0529261007223787
-12276,2459,8630,0.034376801437,0.034376801437
-12278,8630,8631,0.0429012342669158,0.0429012342669158
-12279,8631,8478,0.0881202047420162,0.0881202047420162
-12280,8478,6349,0.0631900183412494,0.0631900183412494
-12281,6349,8610,0.106156240617891,0.106156240617891
-12282,8610,8633,0.00782193502715287,0.00782193502715287
-12283,8633,8235,0.439089917447406,0.439089917447406
-13838,2963,1284,0.0976236721102847,0.0976236721102847
-12291,8488,6708,0.146276219075305,0.146276219075305
-12292,6708,8574,0.146922373978856,0.146922373978856
-12293,8574,5780,0.145168342719135,0.145168342719135
-12294,5780,8284,0.145457218481639,0.145457218481639
-12295,8284,8635,0.147985754967018,0.147985754967018
-12296,8635,7895,0.145231730226047,0.145231730226047
-12297,7895,8636,0.145188764989583,0.145188764989583
-12298,8636,8536,0.0230398310291247,0.0230398310291247
-12300,8637,8638,0.051750923168378,0.051750923168378
-12306,8641,8642,0.0388526899017529,0.0388526899017529
-12322,8647,8648,0.0689932486013888,0.0689932486013888
-12324,8409,8649,0.174821115803257,0.174821115803257
-12330,8652,8653,0.0109021010822668,0.0109021010822668
-12370,127,8676,0.0230804767650593,0.0230804767650593
-13861,1773,4425,0.0478826481852338,0.0478826481852338
-12371,8676,127,0.0230804767650593,0.0230804767650593
-12374,8678,2814,0.00715247655230442,0.00715247655230442
-12375,2814,7853,0.0872240502720576,0.0872240502720576
-12379,552,3283,0.201374804580202,0.201374804580202
-12380,3283,439,0.0140574737901418,0.0140574737901418
-12381,439,440,0.131394781189403,0.131394781189403
-12383,8680,592,0.0279554969032489,0.0279554969032489
-12386,3930,5620,0.102308093785748,0.102308093785748
-12387,5620,3705,0.100376481944534,0.100376481944534
-12388,3705,710,0.100626287480694,0.100626287480694
-12389,710,8681,0.0994362797990831,0.0994362797990831
-12390,8681,8515,0.0993120225558452,0.0993120225558452
-12391,8515,4191,0.136253535658325,0.136253535658325
-12392,4191,2517,0.134250356653895,0.134250356653895
-12393,2517,6728,0.132309702657946,0.132309702657946
-12394,6728,4805,0.136509007433592,0.136509007433592
-12395,4805,8682,0.134957701338679,0.134957701338679
-12397,8683,433,0.845576760689761,0.845576760689761
-12398,433,481,1.45081348243216,1.45081348243216
-12399,481,8684,0.52437215594792,0.52437215594792
-12401,8685,8686,0.010167997865452,0.010167997865452
-12404,4154,4741,0.172602377991032,0.172602377991032
-12405,4741,6536,0.177057900654184,0.177057900654184
-12406,6536,8687,0.165392784618956,0.165392784618956
-12408,5170,6865,0.176928364472993,0.176928364472993
-12409,6865,3073,0.175467136201966,0.175467136201966
-12410,3073,8690,0.1637299437242,0.1637299437242
-12411,8690,8160,0.0198260554201283,0.0198260554201283
-12412,8160,8691,0.0330442022067904,0.0330442022067904
-12414,8692,8693,0.174036627821078,0.174036627821078
-12415,8693,8694,0.176955606262412,0.176955606262412
-12416,8694,8695,0.169605643175659,0.169605643175659
-12417,8695,4774,0.249824848381595,0.249824848381595
-12418,4774,6552,0.130776357701309,0.130776357701309
-12419,6552,8696,0.13038749521243,0.13038749521243
-12420,8696,8566,0.0104649837792038,0.0104649837792038
-12421,8566,8697,0.196337242565984,0.196337242565984
-13908,6946,8137,0.20217075396909,0.20217075396909
-12422,8697,3765,0.201163077899324,0.201163077899324
-12423,3765,5944,0.202700667134599,0.202700667134599
-12424,5944,2231,0.203264325905827,0.203264325905827
-12425,2231,4900,0.203310133896795,0.203310133896795
-12426,4900,8699,0.223846600901437,0.223846600901437
-12427,8699,8700,0.179880034662439,0.179880034662439
-12428,8700,8701,0.204289810782798,0.204289810782798
-12429,8701,643,0.139830079927305,0.139830079927305
-12430,643,7272,0.132835494541237,0.132835494541237
-12431,7272,1993,0.110816863894031,0.110816863894031
-12432,1993,1977,0.01986880052865,0.01986880052865
-12433,1977,4590,0.131129399902762,0.131129399902762
-12434,4590,6477,0.129388315999052,0.129388315999052
-12435,6477,2460,0.143087746743813,0.143087746743813
-12436,2460,5904,0.206205054401277,0.206205054401277
-12437,5904,8702,0.200106396563715,0.200106396563715
-12438,8702,789,0.199795050779324,0.199795050779324
-12439,789,3581,0.193812626433148,0.193812626433148
-12440,3581,4353,0.211337121932246,0.211337121932246
-12441,4353,8703,0.201766897339093,0.201766897339093
-12442,8703,3056,0.204698740459713,0.204698740459713
-12443,3056,8704,0.1838941823989,0.1838941823989
-12446,902,8706,0.131578356152921,0.131578356152921
-12447,8706,2807,0.139128342169529,0.139128342169529
-12448,2807,5273,0.132055095159837,0.132055095159837
-12449,5273,6913,0.122503450982406,0.122503450982406
-12450,6913,6362,0.41302368771275,0.41302368771275
-12452,3076,3191,0.200008210348418,0.200008210348418
-12454,6107,1897,0.202849718138185,0.202849718138185
-12455,1897,7235,0.199081659570441,0.199081659570441
-12456,7235,3245,0.204781971579143,0.204781971579143
-12457,3245,8707,0.0557878826660101,0.0557878826660101
-12458,8707,7285,0.154953879613548,0.154953879613548
-12459,7285,28,0.190200511167853,0.190200511167853
-12461,7212,8708,0.0837159569795295,0.0837159569795295
-12463,8708,6525,0.0119790128871836,0.0119790128871836
-12464,6525,1779,0.0293911622529401,0.0293911622529401
-12465,1779,4372,0.0502766443311638,0.0502766443311638
-12466,4372,8710,0.0490277911002061,0.0490277911002061
-12467,8710,4684,0.0539189737855212,0.0539189737855212
-12468,4684,1527,0.0474102490920647,0.0474102490920647
-12469,1527,5107,0.0489757310519715,0.0489757310519715
-19288,10468,10469,0.0662296445612727,0.0662296445612727
-12470,5107,8711,0.0509607682871969,0.0509607682871969
-12471,8711,5064,0.0518326919728752,0.0518326919728752
-12472,5064,1746,0.0537415293364607,0.0537415293364607
-12473,1746,5607,0.04913949394522,0.04913949394522
-12474,5607,6637,0.0470345659561698,0.0470345659561698
-12475,6637,5450,0.0502526613335692,0.0502526613335692
-12477,5427,5408,0.0488836182047643,0.0488836182047643
-12478,5408,7399,0.051895578159039,0.051895578159039
-12479,7399,8712,0.1038123024378,0.1038123024378
-12481,8713,8714,0.0490473159959526,0.0490473159959526
-12482,8714,7277,0.0483828604327117,0.0483828604327117
-12483,7277,3483,0.0998765627131917,0.0998765627131917
-12484,3483,8715,0.048840271287456,0.048840271287456
-12485,8715,6079,0.0473684752554207,0.0473684752554207
-12486,6079,8716,0.055154161978582,0.055154161978582
-12487,8716,3697,0.0479069878085689,0.0479069878085689
-12488,3697,5685,0.0473941467783467,0.0473941467783467
-12489,5685,4571,0.0495504189878239,0.0495504189878239
-12490,4571,8717,0.0532110753130406,0.0532110753130406
-12495,8720,6626,0.0151124856958777,0.0151124856958777
-12496,6626,7211,0.0534737559078532,0.0534737559078532
-12497,7211,5824,0.205145340397742,0.205145340397742
-12498,5824,7729,0.196126806182622,0.196126806182622
-12499,7729,8721,1.41081273670029,1.41081273670029
-12500,8722,6630,0.00966193494482075,0.00966193494482075
-12501,6630,5826,0.0378008975972725,0.0378008975972725
-12502,5826,7731,0.193712690967488,0.193712690967488
-12503,7731,8723,1.80961969384046,1.80961969384046
-12504,1781,8722,0.107247989428491,0.107247989428491
-12506,7401,6529,0.108235119976502,0.108235119976502
-12508,4596,8724,0.16807497837827,0.16807497837827
-12509,8724,8725,0.178846116420602,0.178846116420602
-12510,8725,678,0.00426139259412424,0.00426139259412424
-12511,678,8726,0.00479379013962442,0.00479379013962442
-12512,8726,8727,0.179790579190484,0.179790579190484
-12513,8727,5480,0.174201148052584,0.174201148052584
-12514,5480,8728,0.175423920421782,0.175423920421782
-12515,8728,4882,0.196140148835561,0.196140148835561
-12516,4882,2250,0.176600887954475,0.176600887954475
-12517,2250,5916,0.3321793201224,0.3321793201224
-12519,3788,8729,0.199339438501115,0.199339438501115
-12521,1189,8730,0.167786544262905,0.167786544262905
-12522,8730,7154,0.107569635985836,0.107569635985836
-12524,8731,8732,0.130443287352145,0.130443287352145
-12526,8732,6531,0.0215721025681021,0.0215721025681021
-12527,6531,8733,0.0174468386055745,0.0174468386055745
-12551,8748,6518,0.0472889047630053,0.0472889047630053
-12552,6518,8749,0.0506856290604236,0.0506856290604236
-12548,4570,8746,0.0496686599585209,0.0496686599585209
-12549,8746,8747,0.0568130428191116,0.0568130428191116
-12528,8733,8734,4.18362578562758,4.18362578562758
-12529,6533,8735,0.0310320915845362,0.0310320915845362
-12530,8735,8733,0.0639013406897381,0.0639013406897381
-12531,8733,8736,0.0575832242503326,0.0575832242503326
-12532,8736,1744,0.0585281295770588,0.0585281295770588
-12533,1744,8737,0.0551795735412136,0.0551795735412136
-12534,8737,6634,0.0667321861738512,0.0667321861738512
-12535,6634,8738,1.14684827666039,1.14684827666039
-12536,8739,8740,0.050189520794265,0.050189520794265
-12537,8740,8741,0.0520205890853532,0.0520205890853532
-12538,8741,8742,0.0975475062746334,0.0975475062746334
-12539,8742,8743,0.0478496643069703,0.0478496643069703
-12540,8743,7276,0.0507419704012955,0.0507419704012955
-12541,7276,3482,0.0993982386954757,0.0993982386954757
-12542,3482,8744,0.05053480573854,0.05053480573854
-12543,8744,6078,0.0468212480872111,0.0468212480872111
-12544,6078,8745,0.052325451958986,0.052325451958986
-12545,8745,3696,0.0475592999209775,0.0475592999209775
-12546,3696,5684,0.0505577280347845,0.0505577280347845
-12547,5684,4570,0.0496336429817659,0.0496336429817659
-12550,8747,8748,0.0555882070947718,0.0555882070947718
-12553,8749,6161,0.0483586179330098,0.0483586179330098
-12554,6161,8750,0.0494030122591725,0.0494030122591725
-12555,8750,2739,0.0483430371417139,0.0483430371417139
-12556,2739,8751,0.0499840332207257,0.0499840332207257
-12557,8751,5230,0.0498899174438866,0.0498899174438866
-12558,5230,8752,0.0487864097624457,0.0487864097624457
-12559,8752,3172,0.0492052393668883,0.0492052393668883
-12560,3172,8753,0.048649307652154,0.048649307652154
-12561,8753,4997,0.0504970791491002,0.0504970791491002
-12562,4997,729,0.0994774482962559,0.0994774482962559
-12564,7060,7316,0.100261995636978,0.100261995636978
-12565,7316,4587,0.101339695102535,0.101339695102535
-12566,4587,8033,0.0978749879893347,0.0978749879893347
-12567,8033,6373,0.096169791555938,0.096169791555938
-12568,6373,8754,0.0556932821262755,0.0556932821262755
-12569,8754,4827,0.0506856253200211,0.0506856253200211
-12570,4827,8755,0.0976778629222165,0.0976778629222165
-12572,8756,8757,0.0483546146560771,0.0483546146560771
-12573,8757,8758,0.00678547758181753,0.00678547758181753
-12574,8758,8759,0.0425788070077018,0.0425788070077018
-12577,2375,8761,0.0800348658330501,0.0800348658330501
-12579,8761,2381,0.0565526295759939,0.0565526295759939
-12580,2381,2378,0.0732152007668199,0.0732152007668199
-12581,2378,2379,0.0407086995566738,0.0407086995566738
-12582,2379,2383,0.00264328007897714,0.00264328007897714
-12583,2383,2571,0.0689488793496812,0.0689488793496812
-12585,8761,2375,0.0800348658330501,0.0800348658330501
-12587,1510,7932,0.0417550445525859,0.0417550445525859
-12589,8764,4921,0.0107315298188712,0.0107315298188712
-12590,4921,8062,0.0635329705608418,0.0635329705608418
-12591,8062,6584,0.176700679215808,0.176700679215808
-12592,6584,5366,0.199428899537142,0.199428899537142
-12593,5366,7124,0.156701102941306,0.156701102941306
-12594,7124,612,0.178308153840751,0.178308153840751
-12595,612,1943,0.177718886558766,0.177718886558766
-12596,1943,8765,0.0553792982616949,0.0553792982616949
-12597,8765,8767,0.0568805264393287,0.0568805264393287
-12625,8778,8779,0.0386703080825578,0.0386703080825578
-12598,8767,8768,0.0596299154046411,0.0596299154046411
-12600,8217,8764,0.0348766827140038,0.0348766827140038
-12602,8769,7960,0.0121246465842421,0.0121246465842421
-12636,8782,8776,0.0415201856091735,0.0415201856091735
-12603,7960,7858,0.191569398536593,0.191569398536593
-12604,7858,384,0.0511824976047815,0.0511824976047815
-12606,4685,296,0.0500706281631231,0.0500706281631231
-12607,296,4955,0.0491810974692235,0.0491810974692235
-12608,4955,7223,0.104958162725722,0.104958162725722
-12611,8773,8774,0.043865298365945,0.043865298365945
-12612,8774,6643,0.0451313849693394,0.0451313849693394
-12613,6643,8218,0.0697309457073312,0.0697309457073312
-12614,8218,3952,0.0651671851260823,0.0651671851260823
-12616,1623,8769,0.0363096662742893,0.0363096662742893
-12618,5097,8775,0.0318529970242771,0.0318529970242771
-12622,8776,8777,0.018725243223035,0.018725243223035
-12623,8777,6243,0.106972614023441,0.106972614023441
-12624,6243,8778,0.0466697025677041,0.0466697025677041
-12626,8779,5192,0.0833353912042221,0.0833353912042221
-12627,5192,8780,0.0302234211776424,0.0302234211776424
-12628,8780,8781,0.0269541929474085,0.0269541929474085
-12629,8781,2610,0.119870657472311,0.119870657472311
-12630,2610,1838,0.176410752987704,0.176410752987704
-12631,1838,2360,0.17767880886817,0.17767880886817
-12633,3710,4430,0.0984187629622127,0.0984187629622127
-12634,4430,5171,0.100485171973402,0.100485171973402
-12638,968,8783,0.0450647850917565,0.0450647850917565
-12640,8783,6332,0.0179790401179982,0.0179790401179982
-12641,6332,8784,0.166916939377104,0.166916939377104
-12642,8784,8785,0.0824631793427953,0.0824631793427953
-12643,8785,8786,0.100743867095121,0.100743867095121
-12644,8786,3809,0.198861011407653,0.198861011407653
-12645,3809,5921,0.152448419282946,0.152448419282946
-12647,920,2206,0.198794444530698,0.198794444530698
-12648,2206,4855,0.161210664735901,0.161210664735901
-12649,4855,8787,0.176180330331867,0.176180330331867
-12650,8787,5459,0.173977209442215,0.173977209442215
-12651,5459,8788,0.179581076943561,0.179581076943561
-12652,8788,653,0.182661218967331,0.182661218967331
-12653,653,8789,0.175533060842227,0.175533060842227
-12654,8789,4615,0.178562453757686,0.178562453757686
-12655,4615,6485,0.147124798702961,0.147124798702961
-12656,6485,3681,0.150536039008347,0.150536039008347
-12658,5282,8790,0.0413354062568629,0.0413354062568629
-12660,8790,6331,0.0121138578035044,0.0121138578035044
-12662,6548,8791,0.16625102712937,0.16625102712937
-12663,8791,8792,0.184061439099574,0.184061439099574
-12664,8792,3808,0.198594245045878,0.198594245045878
-12665,3808,5923,0.153339826215406,0.153339826215406
-12666,5923,922,0.17696116360303,0.17696116360303
-12667,922,2208,0.186196659484346,0.186196659484346
-12668,2208,4857,0.160795645903838,0.160795645903838
-12669,4857,8793,0.191420788288479,0.191420788288479
-12671,5460,8794,0.176401987583553,0.176401987583553
-12672,8794,8795,0.177191749793072,0.177191749793072
-12673,8795,654,0.00549383449703672,0.00549383449703672
-12674,654,8796,0.178534682523657,0.178534682523657
-12675,8796,4614,0.177531607780329,0.177531607780329
-12676,4614,6486,0.147678461213278,0.147678461213278
-12677,6486,3679,0.150313310591357,0.150313310591357
-12681,8798,8799,0.123466110327723,0.123466110327723
-12682,8799,3186,0.00950854696516887,0.00950854696516887
-12683,3186,8800,0.0308360436433676,0.0308360436433676
-12685,8801,8802,0.231947805663281,0.231947805663281
-12686,8802,8803,0.0199646364044365,0.0199646364044365
-12687,8803,5017,0.0091876036672495,0.0091876036672495
-12692,7064,8808,0.0247148912105672,0.0247148912105672
-12693,8808,8685,0.0234885972598816,0.0234885972598816
-20809,8326,10950,0.0125120772932362,0.0125120772932362
-16680,9982,9983,0.0455494891280306,0.0455494891280306
-15872,7130,8879,0.124695897236049,0.124695897236049
-12694,8685,8023,0.100302779247875,0.100302779247875
-12696,8809,8685,0.057365793634115,0.057365793634115
-12699,8810,4109,0.100464246278784,0.100464246278784
-12700,4109,2643,0.0901887127804005,0.0901887127804005
-12702,8805,7976,0.102773783270916,0.102773783270916
-12703,7976,7318,0.104083044705694,0.104083044705694
-12704,7318,8803,0.278830952538266,0.278830952538266
-12706,8811,8812,0.108086464170563,0.108086464170563
-12707,8812,6861,0.0114665228848291,0.0114665228848291
-12709,5165,8809,0.109306863073043,0.109306863073043
-12710,8809,8808,0.0510932247106912,0.0510932247106912
-12712,8798,6379,0.100799788599422,0.100799788599422
-12713,6379,6099,0.0584802680423258,0.0584802680423258
-12714,6099,8202,0.382882462386682,0.382882462386682
-12716,8813,8173,0.0533183303572635,0.0533183303572635
-12718,8814,8815,0.0594781662619651,0.0594781662619651
-12720,8815,3633,0.0139674412080793,0.0139674412080793
-14286,6672,3115,0.0991095918198707,0.0991095918198707
-15288,8812,7065,0.0171061341992079,0.0171061341992079
-12722,3295,8191,0.195769878320479,0.195769878320479
-12723,8191,103,0.207801078913796,0.207801078913796
-12724,103,3505,0.201240848446412,0.201240848446412
-12725,3505,8816,0.20140010471513,0.20140010471513
-12726,8816,8817,0.0467910785706761,0.0467910785706761
-12727,8817,8759,0.155886707244551,0.155886707244551
-12728,8759,8818,0.0209382564173288,0.0209382564173288
-12729,8818,8819,0.0390294530141924,0.0390294530141924
-12730,8819,8820,0.0609459777309488,0.0609459777309488
-12732,7196,5844,0.199996639851393,0.199996639851393
-12733,5844,7747,0.201963345264684,0.201963345264684
-12734,7747,8821,0.660668042362938,0.660668042362938
-12737,6675,8823,0.018377691001392,0.018377691001392
-12738,8823,3121,0.0817086617793047,0.0817086617793047
-12739,3121,3122,0.0189462201356829,0.0189462201356829
-12740,3122,6294,0.0736313115214917,0.0736313115214917
-12741,6294,6295,0.0205616464638412,0.0205616464638412
-12742,6295,6620,0.098958190214706,0.098958190214706
-14308,9323,2191,0.217246414275379,0.217246414275379
-12743,6620,7343,0.0741923893812443,0.0741923893812443
-12744,7343,2845,0.101548527960204,0.101548527960204
-12745,2845,3494,0.101534987318255,0.101534987318255
-12746,3494,5350,0.0785982086314387,0.0785982086314387
-12748,4220,2948,0.0852112039835386,0.0852112039835386
-12749,2948,2949,0.056569943078372,0.056569943078372
-12750,2949,6813,0.0330539311277449,0.0330539311277449
-12751,6813,6810,0.0675878090482117,0.0675878090482117
-12752,6810,1814,0.0227606927419569,0.0227606927419569
-12753,1814,8824,0.984700828985706,0.984700828985706
-12754,8823,8825,0.40169861106651,0.40169861106651
-12779,3798,5937,0.1524274277381,0.1524274277381
-12755,8826,7748,0.668566967249301,0.668566967249301
-12756,7748,5845,0.201518653480334,0.201518653480334
-12757,5845,7197,0.200485803128442,0.200485803128442
-12758,7197,8827,0.180703533412633,0.180703533412633
-12759,8827,8760,0.0207611083367854,0.0207611083367854
-12760,8760,8828,0.203176551906279,0.203176551906279
-12761,8828,3506,0.200871002946695,0.200871002946695
-12763,8170,8192,0.20854015704238,0.20854015704238
-12764,8192,3296,0.195770030101267,0.195770030101267
-12765,3296,8183,0.100143064441761,0.100143064441761
-12766,8183,8188,0.148673984504934,0.148673984504934
-12767,8188,8813,0.0159417159428289,0.0159417159428289
-12769,2918,8829,0.0404869067666165,0.0404869067666165
-12771,8829,6328,0.00908621391699812,0.00908621391699812
-12772,6328,8830,0.0795394987314785,0.0795394987314785
-12774,4166,4751,0.202375182887314,0.202375182887314
-12775,4751,6542,0.197696304569089,0.197696304569089
-12776,6542,8831,0.204678217467742,0.204678217467742
-12778,8832,3798,0.199708223967288,0.199708223967288
-12780,5937,938,0.177624298285183,0.177624298285183
-12781,938,2222,0.185255991502605,0.185255991502605
-12782,2222,4872,0.159853083829866,0.159853083829866
-12783,4872,8834,0.191323978817286,0.191323978817286
-12787,28,8836,0.0411233276076822,0.0411233276076822
-15407,8527,8524,0.00632598868026626,0.00632598868026626
-16685,9986,9987,0.0852803879953952,0.0852803879953952
-12788,8830,4165,0.0810572303723974,0.0810572303723974
-12790,4096,6041,0.191845009601904,0.191845009601904
-12791,6041,8837,0.201496335450174,0.201496335450174
-12792,8837,8838,0.406062586796109,0.406062586796109
-12793,4086,6031,0.181162285735164,0.181162285735164
-12794,6031,6032,0.0171385466290399,0.0171385466290399
-12795,6032,8839,0.201396970557967,0.201396970557967
-12796,8839,2539,0.0036249646793062,0.0036249646793062
-12797,2539,7937,0.222367701142404,0.222367701142404
-12798,7937,8840,0.179081080346528,0.179081080346528
-12799,8520,8841,0.0687184646666591,0.0687184646666591
-12801,8841,298,0.017862044588972,0.017862044588972
-12802,298,4082,0.0176901086131869,0.0176901086131869
-12805,2560,6714,0.0892568890732451,0.0892568890732451
-12806,6714,6633,0.0879831056932755,0.0879831056932755
-12807,6633,8844,0.0442062339102578,0.0442062339102578
-12808,8844,7935,0.0446455487862746,0.0446455487862746
-12809,7935,8845,0.265612509858697,0.265612509858697
-12817,297,299,0.88607517832177,0.88607517832177
-12823,493,589,0.268896577305787,0.268896577305787
-12824,589,8850,0.33804717039653,0.33804717039653
-12826,8589,8851,0.042366080089372,0.042366080089372
-12828,8851,4936,0.0170501490589131,0.0170501490589131
-12829,4936,8509,0.143621366769105,0.143621366769105
-12831,8852,8853,0.0917176896741063,0.0917176896741063
-12832,8853,7564,0.105551904949528,0.105551904949528
-12833,7564,6182,0.105801475446669,0.105801475446669
-12834,6182,8854,0.10583574357693,0.10583574357693
-12835,8854,8855,0.00547189672663909,0.00547189672663909
-18650,1854,2593,0.177389867684494,0.177389867684494
-12837,8856,8857,0.0555847646631402,0.0555847646631402
-12838,8857,8858,0.0519115005666898,0.0519115005666898
-12839,8858,8636,0.0515833043565609,0.0515833043565609
-12840,8636,8859,0.0207966249820583,0.0207966249820583
-12844,8860,1198,0.169110109980516,0.169110109980516
-12845,1198,8861,0.0226617213022113,0.0226617213022113
-12847,8862,1200,0.170240075619945,0.170240075619945
-12848,1200,8863,0.0219879091267488,0.0219879091267488
-12850,8864,7983,0.0505037947042799,0.0505037947042799
-12851,7983,2054,0.099824917404873,0.099824917404873
-12852,2054,2660,0.101497408945607,0.101497408945607
-12853,2660,4133,0.0961563998269834,0.0961563998269834
-12855,6696,8019,0.0939673290333738,0.0939673290333738
-12856,8019,7683,0.0941529054095407,0.0941529054095407
-12857,7683,3457,0.0935091254143676,0.0935091254143676
-12858,3457,8865,0.0461569199164165,0.0461569199164165
-12859,8865,6019,0.0480340625550536,0.0480340625550536
-12860,6019,8866,0.0464697146879775,0.0464697146879775
-12861,8866,8867,0.048094543326443,0.048094543326443
-12862,8867,8868,0.0461790217746061,0.0461790217746061
-12863,8868,856,0.0449646613539359,0.0449646613539359
-12864,856,451,0.0470078764226648,0.0470078764226648
-12865,451,7105,0.0432708485882178,0.0432708485882178
-12866,7105,8869,0.0939007256947679,0.0939007256947679
-12868,8870,1196,0.168829878028139,0.168829878028139
-12869,1196,8871,0.021661446985008,0.021661446985008
-12871,4760,5407,0.0842978699895538,0.0842978699895538
-12873,4755,6546,0.199683159238461,0.199683159238461
-12874,6546,8872,0.20436535055464,0.20436535055464
-12875,8872,8873,0.188956325706579,0.188956325706579
-12876,8873,3792,0.199291485976659,0.199291485976659
-17796,10179,9318,0.114755253361823,0.114755253361823
-12877,3792,8561,0.13059037096191,0.13059037096191
-12879,5926,924,0.178374370928188,0.178374370928188
-12880,924,2210,0.187308783265319,0.187308783265319
-12881,2210,4859,0.159743099068053,0.159743099068053
-12882,4859,8874,0.192629276936053,0.192629276936053
-12883,8874,5461,0.172330101173688,0.172330101173688
-12884,5461,8875,0.177416584260724,0.177416584260724
-12885,8875,8876,0.176433616828762,0.176433616828762
-12887,655,8877,0.00413648661723727,0.00413648661723727
-12888,8877,8878,0.173943602457692,0.173943602457692
-12889,8878,4613,0.177428437243737,0.177428437243737
-12890,4613,6487,0.148280300321704,0.148280300321704
-12891,6487,3678,0.149828166583799,0.149828166583799
-12893,5929,926,0.177267011666895,0.177267011666895
-12894,926,2211,0.187019197552967,0.187019197552967
-12895,2211,4861,0.161667462022208,0.161667462022208
-12896,4861,8880,0.191414125057248,0.191414125057248
-12897,8880,5463,0.170299846109482,0.170299846109482
-12898,5463,8881,0.177990586801656,0.177990586801656
-12899,8881,8885,0.177780189019753,0.177780189019753
-12900,8885,659,0.00646246375156384,0.00646246375156384
-12901,659,8886,0.177011471342036,0.177011471342036
-12902,8886,4612,0.177005843155015,0.177005843155015
-12903,4612,6488,0.148001366258512,0.148001366258512
-12904,6488,3676,0.150380555650091,0.150380555650091
-12906,1621,8061,0.152748999526467,0.152748999526467
-12907,8061,6583,0.177490187745079,0.177490187745079
-12908,6583,5365,0.198863610387104,0.198863610387104
-12909,5365,7123,0.157919035747255,0.157919035747255
-12911,8092,8887,0.220134314041521,0.220134314041521
-12913,8887,8888,0.191841135190913,0.191841135190913
-12914,8888,967,0.0966749413586244,0.0966749413586244
-12916,5281,4980,0.256490434532314,0.256490434532314
-12917,4980,4148,0.0387618071437701,0.0387618071437701
-12918,4148,8125,0.0859291558348279,0.0859291558348279
-12919,8125,2368,0.179404398665568,0.179404398665568
-12920,2368,996,0.270881468937897,0.270881468937897
-12921,996,2914,0.0678890736084051,0.0678890736084051
-12922,2914,2917,0.0548386478267142,0.0548386478267142
-12927,8894,8895,0.135035418511701,0.135035418511701
-12929,8896,3167,0.11730986547504,0.11730986547504
-12932,8898,8899,0.10458723954588,0.10458723954588
-12971,8901,8709,0.120698197647431,0.120698197647431
-12978,8902,8903,0.00973401952734473,0.00973401952734473
-12979,8903,7902,0.144472845078957,0.144472845078957
-12980,7902,1225,0.0118169371778595,0.0118169371778595
-12982,8904,8902,0.0775029978833242,0.0775029978833242
-12984,8905,8906,0.061203121949655,0.061203121949655
-12986,8906,8907,0.00497763084611722,0.00497763084611722
-12987,8907,121,0.154154812192847,0.154154812192847
-12988,121,8904,0.0610449885391548,0.0610449885391548
-12990,8325,8908,0.013157216132198,0.013157216132198
-12992,306,8909,0.108316294946991,0.108316294946991
-12994,8328,8910,0.00899626589788406,0.00899626589788406
-12995,8910,8338,0.040824296618527,0.040824296618527
-12996,8338,6084,0.0494050923488005,0.0494050923488005
-12997,6084,8909,0.0118673496888767,0.0118673496888767
-12998,8909,743,0.0430251864291126,0.0430251864291126
-12999,743,4526,0.0484294102772242,0.0484294102772242
-13000,4526,607,0.0194349740430761,0.0194349740430761
-13001,607,8355,0.0344276469779443,0.0344276469779443
-13002,8355,3974,0.0402278696203799,0.0402278696203799
-13004,8911,2658,0.732133935065161,0.732133935065161
-13012,8915,8916,0.408272009335824,0.408272009335824
-13090,1914,6117,0.200190217467506,0.200190217467506
-13018,8922,8923,0.320042964228513,0.320042964228513
-13022,8265,8926,0.339879399665874,0.339879399665874
-13027,4265,279,0.0652387434169228,0.0652387434169228
-13029,494,8927,0.349190481522976,0.349190481522976
-13040,8104,8678,0.200106495095782,0.200106495095782
-13042,8932,8933,0.108557788789167,0.108557788789167
-13044,8677,8932,0.0500470435519063,0.0500470435519063
-13046,8933,6917,0.0967430583925215,0.0967430583925215
-13050,8936,8937,0.198244621757318,0.198244621757318
-13084,8956,8756,0.203550658006643,0.203550658006643
-13052,8938,8939,0.428260593428089,0.428260593428089
-13053,8939,8425,0.201936465504692,0.201936465504692
-13055,8939,8941,0.203022755730075,0.203022755730075
-13057,8931,8942,0.152950212219782,0.152950212219782
-13059,8943,8931,0.0786273196751871,0.0786273196751871
-19033,256,10159,0.12356745711476,0.12356745711476
-13063,8945,8946,0.104572805049419,0.104572805049419
-13067,8949,432,0.545131832456565,0.545131832456565
-13068,432,8950,0.686001065667251,0.686001065667251
-13070,8951,8949,0.0797207044078447,0.0797207044078447
-13074,8952,8953,0.195031053860659,0.195031053860659
-13076,99,3503,0.199966819322067,0.199966819322067
-13077,3503,8954,0.201518791118212,0.201518791118212
-13078,8954,8755,0.203764704692679,0.203764704692679
-13079,8755,7193,0.202942329745549,0.202942329745549
-13080,7193,7746,0.401362186865274,0.401362186865274
-13081,7746,8955,0.585986287872625,0.585986287872625
-13082,101,3504,0.19989908085758,0.19989908085758
-13083,3504,8956,0.200106829133291,0.200106829133291
-13085,8756,7194,0.202942348322105,0.202942348322105
-13087,1087,8957,0.00893112007684357,0.00893112007684357
-13088,8957,1082,0.038563824899443,0.038563824899443
-13091,6117,3204,0.200871492111254,0.200871492111254
-13092,3204,3094,0.202111971416858,0.202111971416858
-13093,3094,1749,0.143511782143127,0.143511782143127
-13096,8925,8917,0.011822810789309,0.011822810789309
-13098,8959,602,0.0536722144567161,0.0536722144567161
-13099,602,8962,0.0387695912622113,0.0387695912622113
-13100,8962,8948,0.175808350127672,0.175808350127672
-13101,8948,428,0.00954052470619231,0.00954052470619231
-13102,428,7933,0.160696268160677,0.160696268160677
-13104,8918,8924,0.012486102804665,0.012486102804665
-13105,8924,2420,0.0580706601904793,0.0580706601904793
-13108,8964,8965,0.125224497044451,0.125224497044451
-13110,8965,2192,0.356365737888712,0.356365737888712
-13135,4848,1531,0.0955193854848385,0.0955193854848385
-13111,2192,1611,0.254354724276405,0.254354724276405
-13112,1611,8852,0.0391111849621532,0.0391111849621532
-13114,8966,7934,0.183569029359489,0.183569029359489
-13116,2045,8967,0.0657780447895409,0.0657780447895409
-13119,1742,5213,0.229560371023495,0.229560371023495
-13120,5213,640,0.0648517231107158,0.0648517231107158
-14585,9392,2833,0.210508246764738,0.210508246764738
-13122,7933,8963,0.200908071446329,0.200908071446329
-13124,7934,8969,0.0906737639231845,0.0906737639231845
-13125,8969,429,0.0698124130115735,0.0698124130115735
-13126,429,8947,0.0102744112219317,0.0102744112219317
-13127,8947,8970,0.0586653743681201,0.0586653743681201
-13128,8970,601,0.102766368620144,0.102766368620144
-13157,8989,1285,0.118339572755071,0.118339572755071
-13129,601,8973,0.0999362244261846,0.0999362244261846
-13130,8973,8918,0.0326860113699392,0.0326860113699392
-13132,2193,8237,0.11471912407663,0.11471912407663
-13133,8237,8974,0.0761048371438857,0.0761048371438857
-13443,9077,4179,0.169049790102584,0.169049790102584
-13137,8974,4844,0.0408566656014099,0.0408566656014099
-13139,8975,8915,0.161267451240187,0.161267451240187
-13164,8976,8977,0.00802909585520281,0.00802909585520281
-13140,8915,8979,0.511309857046827,0.511309857046827
-13142,8950,8980,0.295444981113679,0.295444981113679
-13144,8981,8982,0.155762064195337,0.155762064195337
-14605,9398,8233,0.0099630690934953,0.0099630690934953
-13146,8983,8984,0.153794064127447,0.153794064127447
-13148,8985,8986,0.0143228031361841,0.0143228031361841
-13149,8986,8496,0.0694983470285585,0.0694983470285585
-13150,8496,398,0.120004619664384,0.120004619664384
-13151,398,8987,0.0577858842103034,0.0577858842103034
-13152,8987,637,0.099744132155093,0.099744132155093
-13153,637,6436,0.0832880379381437,0.0832880379381437
-13154,6436,21,0.0571009168797096,0.0571009168797096
-13155,21,8988,0.0791847444931621,0.0791847444931621
-13158,1285,2962,0.0719310735484076,0.0719310735484076
-13159,2962,8991,0.0186493582069224,0.0186493582069224
-13160,8991,8992,0.187353348628226,0.187353348628226
-13161,8992,8351,0.0990161897507714,0.0990161897507714
-13162,8351,8993,0.00963797122366648,0.00963797122366648
-13163,8993,8976,0.0698946708143702,0.0698946708143702
-13165,8977,8994,0.012930744273385,0.012930744273385
-13167,8451,8985,0.0708838190049254,0.0708838190049254
-13169,2877,7692,0.030123526159425,0.030123526159425
-13173,8996,8143,0.201053290850133,0.201053290850133
-13174,8143,8997,0.150730663136006,0.150730663136006
-13176,2794,5261,0.132082373792006,0.132082373792006
-13178,5853,1338,0.200417735783644,0.200417735783644
-13179,1338,8998,0.206394741682614,0.206394741682614
-13181,8998,4698,0.201909087963534,0.201909087963534
-13182,4698,8999,0.201909088033291,0.201909088033291
-13183,8999,9000,0.201186325895839,0.201186325895839
-13184,9000,6822,0.198983321230549,0.198983321230549
-13185,6822,770,0.132908321867952,0.132908321867952
-13187,1638,8999,0.102808714105755,0.102808714105755
-13188,8999,4216,0.0999229348013983,0.0999229348013983
-13189,4216,8095,0.0991443160837587,0.0991443160837587
-13190,8095,196,0.0991307294664674,0.0991307294664674
-13191,196,2925,0.0983869258474561,0.0983869258474561
-13193,5307,1463,0.0991311193927209,0.0991311193927209
-13194,1463,5437,0.103145293575034,0.103145293575034
-13196,1641,9000,0.10355145810147,0.10355145810147
-13197,9000,4217,0.0998824134603326,0.0998824134603326
-13198,4217,8096,0.0998581597847897,0.0998581597847897
-13199,8096,197,0.0983977211710877,0.0983977211710877
-13200,197,2926,0.0983895151379973,0.0983895151379973
-13201,2926,5308,0.0991337377550934,0.0991337377550934
-13202,5308,1464,0.0991224618714554,0.0991224618714554
-13203,1464,5440,0.103536651588581,0.103536651588581
-13205,201,2928,0.102050045456718,0.102050045456718
-13206,2928,5310,0.0991386153517731,0.0991386153517731
-13207,5310,1466,0.099890094841465,0.099890094841465
-13208,1466,5445,0.102288602469368,0.102288602469368
-13209,5445,9003,0.20221504164542,0.20221504164542
-13210,9003,7922,0.00954769987851559,0.00954769987851559
-13211,7922,4407,0.193513161405962,0.193513161405962
-13212,4407,9004,0.22689488985342,0.22689488985342
-13213,9004,4314,0.17109885981524,0.17109885981524
-13214,4314,4501,0.0954627697803603,0.0954627697803603
-13215,4501,7813,0.103538745444113,0.103538745444113
-13216,7813,5077,0.099141030065187,0.099141030065187
-13217,5077,8012,0.101361319209047,0.101361319209047
-13218,8012,6831,0.0984053279969797,0.0984053279969797
-13219,6831,6983,0.0507122349978986,0.0507122349978986
-13220,6983,6974,0.0492014587539049,0.0492014587539049
-13221,6974,7944,0.0815359432635548,0.0815359432635548
-13222,7944,6363,0.117492028011777,0.117492028011777
-13223,6363,6659,0.128518000967454,0.128518000967454
-13224,6659,5340,0.248378842685992,0.248378842685992
-13225,5340,9007,0.436836188101395,0.436836188101395
-13226,5447,9008,0.0954198714626642,0.0954198714626642
-13227,9008,5974,0.0150605452925665,0.0150605452925665
-13229,5443,7920,0.209496436784339,0.209496436784339
-13230,7920,4409,0.196049081122935,0.196049081122935
-13232,9009,4311,0.174051720567411,0.174051720567411
-13234,5439,7917,0.209760382857472,0.209760382857472
-13235,7917,4414,0.1967831025196,0.1967831025196
-13236,4414,9010,0.224679521512281,0.224679521512281
-13239,5435,9011,0.112718312199178,0.112718312199178
-13240,9011,7916,0.0954502097686848,0.0954502097686848
-13242,4418,9012,0.223944278058007,0.223944278058007
-13243,9012,9013,0.163728342208645,0.163728342208645
-13244,9014,9011,0.193580953488763,0.193580953488763
-13272,5331,5695,0.176288296878523,0.176288296878523
-13246,1844,2578,0.172509377214494,0.172509377214494
-13248,6839,8008,0.0576758204139334,0.0576758204139334
-13250,8009,6981,0.144663680916955,0.144663680916955
-13252,9015,6845,0.0843525238323184,0.0843525238323184
-13253,6845,4689,0.0881118827688874,0.0881118827688874
-13254,4689,4697,0.0264412698588759,0.0264412698588759
-13255,4697,7466,0.0631647371963507,0.0631647371963507
-13256,7466,9016,0.0866600751763154,0.0866600751763154
-13257,9016,7453,0.0117533037462049,0.0117533037462049
-13258,7453,2091,0.0764142388554106,0.0764142388554106
-13259,2091,5691,0.0521281816109867,0.0521281816109867
-13260,5691,5680,0.0375154291161679,0.0375154291161679
-13261,5680,6316,0.0896056080016293,0.0896056080016293
-13262,6316,4963,0.0888719448734625,0.0888719448734625
-13264,6826,5338,0.0370211552910964,0.0370211552910964
-13266,9016,9017,0.044781886028432,0.044781886028432
-13267,6842,4692,0.112329114895897,0.112329114895897
-13268,4692,5332,0.162956489748023,0.162956489748023
-13270,6840,4691,0.113830246405759,0.113830246405759
-13271,4691,5331,0.0755697574983074,0.0755697574983074
-13274,5694,6319,0.174033677833605,0.174033677833605
-13275,6319,9018,0.182109806928741,0.182109806928741
-13277,4310,7811,0.201267372547373,0.201267372547373
-13278,7811,8010,0.202389778156291,0.202389778156291
-13281,7812,5076,0.100599027218817,0.100599027218817
-13282,5076,8011,0.100623102109681,0.100623102109681
-13283,8011,6982,0.147599810375252,0.147599810375252
-13284,6982,7943,0.131458423393202,0.131458423393202
-13285,7943,3300,0.0829788157522616,0.0829788157522616
-13286,3300,5727,0.0905493512456201,0.0905493512456201
-13287,5727,5339,0.0993780908642813,0.0993780908642813
-13289,9019,9020,0.473924441922911,0.473924441922911
-13290,5441,7918,0.212183518066811,0.212183518066811
-13291,7918,4411,0.196063540031297,0.196063540031297
-13292,4411,9021,0.221019052884505,0.221019052884505
-13293,9021,4282,0.176970513595043,0.176970513595043
-13295,4326,9018,0.0881179267079727,0.0881179267079727
-13296,9018,7810,0.0594732573783121,0.0594732573783121
-13297,7810,7817,0.0279069878470498,0.0279069878470498
-13298,7817,5075,0.0895984878523876,0.0895984878523876
-13299,5075,8007,0.082290456587143,0.082290456587143
-13300,8007,6839,0.0433776365307967,0.0433776365307967
-13301,6839,6979,0.105025257907842,0.105025257907842
-14885,9012,7486,0.0983880214663299,0.0983880214663299
-13303,9003,4959,0.128621575011946,0.128621575011946
-13304,4959,9022,0.0561090389096707,0.0561090389096707
-13305,9022,9023,0.219664135455113,0.219664135455113
-13307,9024,1734,0.0339090081692689,0.0339090081692689
-13308,1734,9025,0.199586826055962,0.199586826055962
-13310,162,1723,0.148414326457229,0.148414326457229
-13312,164,1724,0.19589389224901,0.19589389224901
-13313,1724,9026,0.21539258017212,0.21539258017212
-13315,166,1725,0.23958811593923,0.23958811593923
-13316,1725,9027,0.172261015966003,0.172261015966003
-13318,168,1727,0.256304305915683,0.256304305915683
-13319,1727,8081,0.0911159242290505,0.0911159242290505
-13321,9028,9029,0.0459665066705729,0.0459665066705729
-13323,9030,9031,0.204682511562437,0.204682511562437
-13324,9031,6588,0.201464690183835,0.201464690183835
-13325,6588,7109,0.201819605073549,0.201819605073549
-13326,7109,9034,0.0380490136329461,0.0380490136329461
-13327,9035,9036,0.202787954952135,0.202787954952135
-13328,9036,6589,0.200863566889439,0.200863566889439
-13329,6589,7110,0.201074334121883,0.201074334121883
-13331,9037,9031,0.102130234291417,0.102130234291417
-13332,9031,9036,0.101294841162053,0.101294841162053
-13333,9036,6128,0.0961527434944637,0.0961527434944637
-13334,6128,3971,0.0990967592348727,0.0990967592348727
-13336,7017,1406,0.0990967592360877,0.0990967592360877
-13337,1406,7390,0.0982252697684911,0.0982252697684911
-13338,7390,5217,0.100064145492252,0.100064145492252
-13340,5377,9038,0.0981767550682586,0.0981767550682586
-13342,9041,9042,0.107883824327089,0.107883824327089
-13344,9043,9044,0.111762023714712,0.111762023714712
-13346,7805,9045,0.163613143703316,0.163613143703316
-13347,4982,9046,0.151151791011959,0.151151791011959
-13348,9046,4333,0.0931833318260777,0.0931833318260777
-13349,4333,5039,0.084348128639754,0.084348128639754
-13351,2869,9047,0.0643526028257267,0.0643526028257267
-13352,2869,5283,0.189728403936972,0.189728403936972
-13354,9048,6951,0.21054969022045,0.21054969022045
-13355,6951,8084,0.110877740512572,0.110877740512572
-13356,8084,8141,0.0381711926062465,0.0381711926062465
-13357,8141,5971,0.0998550766587588,0.0998550766587588
-13358,5971,9046,0.165019740176851,0.165019740176851
-13359,9046,7804,0.203892252907028,0.203892252907028
-13360,7804,9049,0.488623985679594,0.488623985679594
-13361,577,9048,0.0924966938169246,0.0924966938169246
-13369,9054,1743,0.0233197702600261,0.0233197702600261
-13370,1743,4270,0.277932467642318,0.277932467642318
-13371,4270,310,0.0394728122356983,0.0394728122356983
-13372,310,577,0.0535172942987349,0.0535172942987349
-13374,9055,9056,0.0694449359265994,0.0694449359265994
-13375,9056,2325,0.190938968451781,0.190938968451781
-13376,2325,4279,0.147346976573119,0.147346976573119
-13378,4286,9055,0.0222915391297905,0.0222915391297905
-13380,1349,1615,0.0587612563553368,0.0587612563553368
-13381,1615,7135,0.106001129731548,0.106001129731548
-13383,5260,9057,0.107843300513683,0.107843300513683
-13384,6952,9058,0.0875153511963366,0.0875153511963366
-13386,9058,5767,0.0813716345984657,0.0813716345984657
-13387,5767,312,0.370850163813996,0.370850163813996
-13390,9048,9052,0.36535949731556,0.36535949731556
-13394,9060,8966,0.196473660543131,0.196473660543131
-13396,9061,5080,0.358471972755657,0.358471972755657
-13397,5080,9062,0.674602285535072,0.674602285535072
-13398,9062,3176,0.289568864041751,0.289568864041751
-13399,3176,527,0.133561854308294,0.133561854308294
-18560,10318,10319,0.255397297870644,0.255397297870644
-13400,527,343,0.340886700679976,0.340886700679976
-13401,343,537,0.428322489908352,0.428322489908352
-13402,537,474,0.822980283733396,0.822980283733396
-13403,474,8438,0.152037422281902,0.152037422281902
-13407,4427,9063,0.114941491865609,0.114941491865609
-13409,9063,8912,0.118971180199303,0.118971180199303
-13413,8236,125,0.0903470808346396,0.0903470808346396
-13415,9065,9066,0.0810250214751567,0.0810250214751567
-13417,9066,7279,0.116655009841785,0.116655009841785
-13419,276,9067,0.0692041764264314,0.0692041764264314
-13500,9108,9109,0.0476133357747153,0.0476133357747153
-13421,9067,2189,0.114532021981465,0.114532021981465
-13423,9068,4553,0.327000385366346,0.327000385366346
-13425,8428,9069,0.0507531626876375,0.0507531626876375
-13426,9069,9068,0.00529520129182755,0.00529520129182755
-13428,9070,9071,0.0606488327577038,0.0606488327577038
-13430,9071,9072,0.009176031077042,0.009176031077042
-13431,9072,4642,0.175105976981708,0.175105976981708
-13432,4642,7954,0.0487370399178714,0.0487370399178714
-13433,7954,4547,0.158995972178669,0.158995972178669
-13434,4547,9073,0.292416775735491,0.292416775735491
-13436,9074,9075,0.0675438073285673,0.0675438073285673
-13438,9075,409,0.0146789910973018,0.0146789910973018
-13439,409,9076,0.0166512433271008,0.0166512433271008
-13441,4838,326,0.0588523383992881,0.0588523383992881
-13449,9081,9082,0.443932946896766,0.443932946896766
-13451,1401,9083,0.0611691476045831,0.0611691476045831
-13453,9083,6208,0.0330698135159164,0.0330698135159164
-13454,6208,7645,0.178373846931983,0.178373846931983
-13455,7645,9086,0.177258150455768,0.177258150455768
-13498,9107,3956,0.0601050509878674,0.0601050509878674
-13457,9087,9088,1.73315945419765,1.73315945419765
-13458,9088,410,0.265082533171925,0.265082533171925
-13459,410,9080,0.715047499183354,0.715047499183354
-13460,9080,9089,0.194455760903183,0.194455760903183
-13462,9089,9090,0.0550554662137945,0.0550554662137945
-13464,9091,9092,0.473459458640042,0.473459458640042
-13475,9098,9032,0.307889980671666,0.307889980671666
-13479,9090,9099,0.0142223937707519,0.0142223937707519
-13481,9100,9093,0.193628424072927,0.193628424072927
-13483,9101,9100,0.0626625130905001,0.0626625130905001
-13487,9103,346,0.140681499904037,0.140681499904037
-13522,9037,8064,0.00660497864323473,0.00660497864323473
-13489,3955,9081,0.113309674251049,0.113309674251049
-13491,6240,5091,0.078819968233945,0.078819968233945
-13493,9082,9103,0.0435368095566408,0.0435368095566408
-13494,9103,347,0.193850840943334,0.193850840943334
-13495,347,404,0.026466812116417,0.026466812116417
-13496,404,9106,0.11755875033606,0.11755875033606
-13501,9109,9107,0.387486870322022,0.387486870322022
-13503,6204,9110,0.181291651373991,0.181291651373991
-13505,9111,9112,0.0153902940291749,0.0153902940291749
-13506,9112,9101,0.137209683962048,0.137209683962048
-13508,9113,9111,0.075192531928865,0.075192531928865
-15014,455,860,0.0461629164957839,0.0461629164957839
-13510,9114,9115,0.148585418330877,0.148585418330877
-13514,8582,9116,0.0682625654668292,0.0682625654668292
-13516,9116,237,0.0139438438014188,0.0139438438014188
-13517,237,7635,0.17396601741799,0.17396601741799
-13519,7602,9073,0.102023996019348,0.102023996019348
-13521,117,9037,0.091769841511351,0.091769841511351
-13523,8064,6587,0.198394254239174,0.198394254239174
-13524,6587,5384,0.100320867880051,0.100320867880051
-13525,5384,7108,0.0976180261019357,0.0976180261019357
-13526,7108,2293,0.101160557994969,0.101160557994969
-13527,2293,9117,0.0816968455207608,0.0816968455207608
-13583,9134,9079,0.189350301331036,0.189350301331036
-13533,9118,6217,0.00293554606374767,0.00293554606374767
-13534,6217,7652,0.27452915439238,0.27452915439238
-13535,7652,8071,0.262369838158816,0.262369838158816
-13536,8071,9119,0.0614463164636613,0.0614463164636613
-13538,9118,7768,0.0286215741177868,0.0286215741177868
-13540,9121,9122,0.0549317968438626,0.0549317968438626
-13541,9122,9080,0.148946547669597,0.148946547669597
-13543,9121,4555,0.0367880997749164,0.0367880997749164
-13545,216,9123,0.047880969118268,0.047880969118268
-13547,9123,447,0.333206339887537,0.333206339887537
-13549,2999,9124,0.314861669735557,0.314861669735557
-13554,579,408,0.862576839598051,0.862576839598051
-13568,9128,9129,0.16941277010836,0.16941277010836
-13570,9124,9128,0.0550015048734635,0.0550015048734635
-13578,9132,220,0.766585324287615,0.766585324287615
-13615,7609,7262,0.111890561964914,0.111890561964914
-13579,220,566,0.637748069235424,0.637748069235424
-13587,9136,9137,0.450871833260349,0.450871833260349
-13590,8684,222,0.184496371824925,0.184496371824925
-13591,222,9140,0.487607813488587,0.487607813488587
-13593,9140,9077,0.174302500151122,0.174302500151122
-13594,9077,9141,0.280690469581891,0.280690469581891
-13596,9142,118,0.0916021886608042,0.0916021886608042
-13597,118,6721,0.0966297992771619,0.0966297992771619
-13598,6721,6722,0.0414535753801991,0.0414535753801991
-13599,6722,2311,0.00867549185460531,0.00867549185460531
-13601,6580,6723,0.0197325066377101,0.0197325066377101
-13603,9029,1240,0.0358410792262526,0.0358410792262526
-13604,1240,4790,0.0578956777475445,0.0578956777475445
-13605,4790,4814,0.0309664941935945,0.0309664941935945
-13606,4814,2156,0.0660634330770184,0.0660634330770184
-13607,2156,2166,0.00298513757197415,0.00298513757197415
-13608,2166,2183,0.165657322423627,0.165657322423627
-13609,2183,9070,0.039996230308656,0.039996230308656
-13611,3728,9143,0.0374422730466023,0.0374422730466023
-13613,3765,8150,0.099678431004031,0.099678431004031
-13614,8150,7609,0.0943510009713305,0.0943510009713305
-13616,7262,7595,0.0635463262031531,0.0635463262031531
-13617,7595,7599,0.0220206440979588,0.0220206440979588
-13618,7599,9144,0.0741982381570415,0.0741982381570415
-15078,7589,3366,0.105686563985576,0.105686563985576
-13619,9144,2022,0.0197545563564228,0.0197545563564228
-13620,2022,9147,0.0829434723735258,0.0829434723735258
-13621,9147,3355,0.0108199721778022,0.0108199721778022
-13623,9148,2768,0.0035576669192827,0.0035576669192827
-13624,2768,7013,0.0948918648713715,0.0948918648713715
-13626,2274,8214,0.00623184642483798,0.00623184642483798
-13627,8214,9149,0.0892902468185094,0.0892902468185094
-13628,9149,8211,0.0144047767787734,0.0144047767787734
-13629,8211,7521,0.0807484203861095,0.0807484203861095
-13630,7521,7522,0.0178959760293508,0.0178959760293508
-13631,7522,2132,0.0761585237127413,0.0761585237127413
-13632,2132,2117,0.0261874332320613,0.0261874332320613
-13633,2117,5982,0.0706516490311829,0.0706516490311829
-13634,5982,5987,0.0312102623276897,0.0312102623276897
-13635,5987,5148,0.0542024830967572,0.0542024830967572
-13636,5148,7678,0.00643849229968441,0.00643849229968441
-13637,7678,9150,0.0270552275766841,0.0270552275766841
-13638,9150,5159,0.0130471422397109,0.0130471422397109
-13639,5159,2336,0.0550815403379387,0.0550815403379387
-17797,9318,9592,0.0276370219250994,0.0276370219250994
-15154,9503,7694,0.0985863309924877,0.0985863309924877
-13640,2336,9151,2.70099171821299,2.70099171821299
-15853,9736,5597,0.026161521554181,0.026161521554181
-13642,327,390,0.428713460971309,0.428713460971309
-13643,390,216,1.2612581668138,1.2612581668138
-13647,4841,9156,0.020245918680072,0.020245918680072
-13653,9127,4841,0.714489743272739,0.714489743272739
-13655,9160,9161,0.0611231237623731,0.0611231237623731
-13657,9161,9162,0.0094906074947222,0.0094906074947222
-13658,9162,360,0.119259910634054,0.119259910634054
-13659,360,4441,0.0977181725107,0.0977181725107
-13660,4441,9025,0.101356058092401,0.101356058092401
-13661,9025,361,0.102083424277621,0.102083424277621
-13662,361,6661,0.148732998262686,0.148732998262686
-13663,6661,1457,0.0814814185857237,0.0814814185857237
-13664,1457,6930,0.0803380398809936,0.0803380398809936
-13665,6930,9163,0.0870015008277124,0.0870015008277124
-13666,9163,3826,0.0559780942251715,0.0559780942251715
-13667,3826,5901,0.113837481725673,0.113837481725673
-13668,5901,1650,0.336368580358266,0.336368580358266
-13669,1650,9026,0.0808050552206421,0.0808050552206421
-13670,9026,9027,0.0815322500516298,0.0815322500516298
-13671,9027,3968,0.0749133242052919,0.0749133242052919
-13672,3968,205,0.163780553378706,0.163780553378706
-13673,205,2934,0.0793233966793332,0.0793233966793332
-13674,2934,2932,0.00660572151012338,0.00660572151012338
-13675,2932,5313,0.0749133313668845,0.0749133313668845
-13676,5313,5314,0.039721686292112,0.039721686292112
-13677,5314,1472,0.0396600103919334,0.0396600103919334
-13678,1472,5451,0.159004638765101,0.159004638765101
-13679,5451,7909,0.201247264593271,0.201247264593271
-13680,7909,4403,0.196833842084677,0.196833842084677
-13681,4403,6310,0.199805236650359,0.199805236650359
-13682,6310,6311,0.0399338522027804,0.0399338522027804
-13683,6311,9019,0.0787211142615482,0.0787211142615482
-18919,10398,10391,0.0932116121589892,0.0932116121589892
-13684,9019,4301,0.0803301037321015,0.0803301037321015
-13685,4301,4499,0.100692334161908,0.100692334161908
-13686,4499,7815,0.0988002674680887,0.0988002674680887
-13687,7815,5071,0.0991802868019195,0.0991802868019195
-13688,5071,8014,0.103571412588639,0.103571412588639
-13689,8014,6833,0.0839453108807348,0.0839453108807348
-14657,9411,6735,0.143528351506247,0.143528351506247
-13691,6976,7946,0.0984345173677437,0.0984345173677437
-13692,7946,3301,0.0874467814940938,0.0874467814940938
-13693,3301,6365,0.0895995351805866,0.0895995351805866
-13694,6365,6654,0.083807023997277,0.083807023997277
-13695,6654,9165,0.68755983150845,0.68755983150845
-13696,9166,9167,0.0102840052604526,0.0102840052604526
-13698,7423,7832,0.102961269389569,0.102961269389569
-13699,7832,1182,0.0975615453999259,0.0975615453999259
-13700,1182,1359,0.100609727856237,0.100609727856237
-13701,1359,8086,0.0998738624212929,0.0998738624212929
-13702,8086,4842,0.0999569203615348,0.0999569203615348
-13703,4842,4377,0.103593486995353,0.103593486995353
-13704,4377,2859,0.305366704359361,0.305366704359361
-13705,2859,7625,0.0937028559888649,0.0937028559888649
-13706,7625,6669,0.0349417471907859,0.0349417471907859
-13707,6669,6928,0.181245567189969,0.181245567189969
-13708,6928,6929,0.056563910069816,0.056563910069816
-15200,9526,7443,0.0505254725980933,0.0505254725980933
-13710,3818,5176,0.0844451203946057,0.0844451203946057
-13711,5176,5900,0.0873882937906588,0.0873882937906588
-13712,5900,1602,0.0969475981594534,0.0969475981594534
-13713,1602,1645,0.147610823352004,0.147610823352004
-13714,1645,1658,0.00734081920779586,0.00734081920779586
-13715,1658,6715,0.113834950309784,0.113834950309784
-13717,4211,8097,0.0991353106844716,0.0991353106844716
-13719,9171,203,0.0903750729081993,0.0903750729081993
-13720,203,2931,0.102769081645998,0.102769081645998
-13721,2931,5312,0.098402268229521,0.098402268229521
-13722,5312,1469,0.0726981009727233,0.0726981009727233
-13723,1469,1468,0.023502610730772,0.023502610730772
-13724,1468,5448,0.104140699419407,0.104140699419407
-13726,3761,9166,0.069031653563667,0.069031653563667
-13728,4177,9172,0.109548350633249,0.109548350633249
-13730,9144,5946,0.201030224778112,0.201030224778112
-13731,5946,5137,0.27511296352744,0.27511296352744
-13732,5137,5152,0.0232058578864935,0.0232058578864935
-13733,5152,4907,0.10620133994029,0.10620133994029
-15464,1361,9615,0.0375616902705351,0.0375616902705351
-13734,4907,6615,0.200738818803378,0.200738818803378
-13735,6615,9173,0.1939198547813,0.1939198547813
-13736,9173,9174,0.208269220932895,0.208269220932895
-13738,9147,5947,0.203116974549126,0.203116974549126
-13740,7615,904,0.277200719177449,0.277200719177449
-13741,904,9175,0.127974248210887,0.127974248210887
-13743,7010,7421,0.0949619514323781,0.0949619514323781
-13744,7421,1142,0.0432881849429407,0.0432881849429407
-13745,1142,1147,0.0608947786947552,0.0608947786947552
-13746,1147,909,0.0792487229277921,0.0792487229277921
-13788,1669,9192,0.136278654988626,0.136278654988626
-13747,909,9176,0.125103752996271,0.125103752996271
-13748,9176,2771,0.202343174331141,0.202343174331141
-13749,2771,6895,0.198817638053719,0.198817638053719
-13753,9179,1,0.207517415173182,0.207517415173182
-13755,8437,9180,0.124967984057199,0.124967984057199
-13759,9182,4484,0.465234327006532,0.465234327006532
-13760,4484,4485,0.0326010116755978,0.0326010116755978
-13762,9183,9184,0.0646101092104256,0.0646101092104256
-13764,9185,9186,0.026977202251753,0.026977202251753
-13765,9186,9187,0.0154692834867904,0.0154692834867904
-13766,9187,6713,0.0145607005435147,0.0145607005435147
-13768,232,9188,0.0841812454433435,0.0841812454433435
-13770,9188,2561,0.00954099557633664,0.00954099557633664
-13773,8233,9190,0.00698491885871168,0.00698491885871168
-13774,9190,605,0.212601143616712,0.212601143616712
-13776,394,9191,0.174546619141482,0.174546619141482
-13779,294,4424,0.271505686802405,0.271505686802405
-13783,1892,4513,0.135635571790495,0.135635571790495
-13784,4513,5235,0.13338423256793,0.13338423256793
-13785,5235,6887,0.13498931648718,0.13498931648718
-13786,6887,8681,0.133693861256586,0.133693861256586
-13787,8681,1669,0.132070065253788,0.132070065253788
-13790,8903,8620,0.147899148341854,0.147899148341854
-13791,8620,6984,0.0740139001970076,0.0740139001970076
-13792,6984,4819,0.0711240597778575,0.0711240597778575
-13794,8514,8220,0.0695233221555377,0.0695233221555377
-13796,9193,9141,0.231480473302438,0.231480473302438
-13817,9194,8483,0.144876329810161,0.144876329810161
-13798,9193,9195,0.405940766693276,0.405940766693276
-13800,5081,9196,0.0826803218524669,0.0826803218524669
-13801,9196,7908,0.24773379383735,0.24773379383735
-13802,7908,1383,0.130538600450066,0.130538600450066
-13803,1383,4663,0.14493811446872,0.14493811446872
-13822,8286,9202,0.148093750497898,0.148093750497898
-13804,4663,9197,0.14786450905396,0.14786450905396
-13807,231,1184,0.314149545717651,0.314149545717651
-13808,1184,1364,0.114004540105804,0.114004540105804
-13810,1364,8087,0.130984174828509,0.130984174828509
-14659,939,5938,0.17856727191407,0.17856727191407
-14660,5938,3797,0.152203615831491,0.152203615831491
-13811,8087,9162,0.16050280483824,0.16050280483824
-13812,9162,9198,0.0132941963216631,0.0132941963216631
-18577,10320,10319,0.350878667314418,0.350878667314418
-20839,10930,10948,0.105680421147412,0.105680421147412
-13813,9198,9199,3.17004296851045,3.17004296851045
-17798,9592,10180,0.0765579819092659,0.0765579819092659
-13839,1284,9210,0.120028974895433,0.120028974895433
-13816,4931,9194,0.407318560179548,0.407318560179548
-13819,6705,8577,0.147047679886064,0.147047679886064
-13820,8577,5778,0.145526475675905,0.145526475675905
-13821,5778,8286,0.144657100371242,0.144657100371242
-13823,9202,9203,0.102081942931647,0.102081942931647
-13825,7891,9204,0.145701377036231,0.145701377036231
-13827,8994,9205,0.0106390736530004,0.0106390736530004
-13828,9205,8304,0.117212668938715,0.117212668938715
-13829,8304,6774,0.0328401658585753,0.0328401658585753
-13830,6774,3753,0.196045019335809,0.196045019335809
-13831,3753,8325,0.00916875381027056,0.00916875381027056
-13833,8444,9206,0.0130864665707206,0.0130864665707206
-13834,9206,9207,0.00957370688012094,0.00957370688012094
-13835,9207,9208,0.169933774193856,0.169933774193856
-13836,9208,9209,0.168302394118973,0.168302394118973
-15503,3939,5618,0.12194000294889,0.12194000294889
-13837,9209,2963,0.0205458196072096,0.0205458196072096
-13840,9210,9211,0.00588390321087397,0.00588390321087397
-13841,9211,22,0.0556252544592051,0.0556252544592051
-13842,22,6435,0.0767592442346679,0.0767592442346679
-13843,6435,636,0.0822615503744666,0.0822615503744666
-13844,636,9213,0.103246384420422,0.103246384420422
-13845,9213,535,0.0273108213340879,0.0273108213340879
-13846,535,9214,0.138573391347307,0.138573391347307
-13847,9214,8498,0.0276472257994952,0.0276472257994952
-13848,8498,8441,0.0465142466162739,0.0465142466162739
-13850,9215,8403,0.0487070540067587,0.0487070540067587
-13851,8403,1774,0.0526991311069308,0.0526991311069308
-13853,4412,9216,0.0527074152255093,0.0527074152255093
-13854,9216,4781,0.0501079093501001,0.0501079093501001
-14661,3797,9412,0.199399735185058,0.199399735185058
-13855,4781,1522,0.0511423250179406,0.0511423250179406
-13856,1522,5241,0.0480297777865987,0.0480297777865987
-13857,5241,463,0.0533178386766155,0.0533178386766155
-13859,9217,8420,0.0487543044755043,0.0487543044755043
-13860,8420,1773,0.0502154238610622,0.0502154238610622
-13862,4425,9218,0.050643583977918,0.050643583977918
-13863,9218,4823,0.0514478917449482,0.0514478917449482
-13864,4823,1521,0.0514834990326773,0.0514834990326773
-13865,1521,5262,0.0474439861374267,0.0474439861374267
-13866,5262,9219,0.0530746980864797,0.0530746980864797
-13868,6499,2472,0.199600310338802,0.199600310338802
-13870,7007,2282,0.0992844503488553,0.0992844503488553
-13872,3603,7529,0.0990493561706104,0.0990493561706104
-13873,7529,2137,0.105524175995486,0.105524175995486
-13874,2137,5994,0.104734285723653,0.104734285723653
-13875,5994,7674,0.100897460064117,0.100897460064117
-13996,5841,434,0.0624248318177171,0.0624248318177171
-13876,7674,9221,1.00510923817581,1.00510923817581
-13878,2804,5269,0.128688734978596,0.128688734978596
-13879,5269,6909,0.123348542786119,0.123348542786119
-13881,4480,5270,0.264392216770053,0.264392216770053
-13882,5270,6910,0.123553912188766,0.123553912188766
-13884,7761,6908,0.206924774668396,0.206924774668396
-13886,6907,7760,0.209013911598568,0.209013911598568
-13887,7760,9222,0.202410018751594,0.202410018751594
-13888,6905,7759,0.206351576128965,0.206351576128965
-13889,7759,6359,0.203865759483167,0.203865759483167
-13891,9223,6448,0.190233422734384,0.190233422734384
-13892,6448,6992,0.620734926195411,0.620734926195411
-13893,6992,2116,0.412221337604484,0.412221337604484
-13894,2116,7665,0.206015761732372,0.206015761732372
-13935,9237,254,0.129619446290563,0.129619446290563
-13895,7665,9224,1.85930539190202,1.85930539190202
-13896,9225,2398,0.224331288063009,0.224331288063009
-13897,2398,6361,0.106327129111224,0.106327129111224
-17281,7311,3273,0.201986093156211,0.201986093156211
-13899,6446,9223,0.123505309386589,0.123505309386589
-13901,8984,8975,0.295278766625452,0.295278766625452
-13903,8980,8981,0.155353173279186,0.155353173279186
-13905,9226,8104,0.184150710275748,0.184150710275748
-13907,9227,6946,0.038429344582371,0.038429344582371
-13912,6380,9229,0.104471273298691,0.104471273298691
-14662,9412,9300,0.189453948637121,0.189453948637121
-13916,566,9231,1.43965285379934,1.43965285379934
-13917,9136,9232,0.238873404598648,0.238873404598648
-13920,483,7284,0.0730945677376631,0.0730945677376631
-13928,278,6916,0.0415405366115252,0.0415405366115252
-13930,9235,9236,0.360270886139133,0.360270886139133
-13931,9236,2883,0.0595125074168401,0.0595125074168401
-13936,254,8324,0.235611866233999,0.235611866233999
-13938,8324,8310,0.066787627422688,0.066787627422688
-13940,8310,9241,0.146021189936251,0.146021189936251
-13944,9099,7796,0.300588795121337,0.300588795121337
-13948,9244,9113,0.144188675545464,0.144188675545464
-13950,9106,9244,0.0499156662848634,0.0499156662848634
-13952,9245,9246,0.123118530171941,0.123118530171941
-13954,405,406,0.0103894659763889,0.0103894659763889
-13955,406,9245,0.0664778537431541,0.0664778537431541
-13957,407,9033,0.137547423766831,0.137547423766831
-17289,5839,7744,0.201433070586795,0.201433070586795
-13965,9097,9248,0.39480102328572,0.39480102328572
-13966,9248,9249,0.0955291664142426,0.0955291664142426
-13968,9246,9248,0.157049002786803,0.157049002786803
-13976,3952,9252,0.0592126025244243,0.0592126025244243
-13977,9252,5605,0.0597855652504274,0.0597855652504274
-13978,5605,9253,0.0521408060475983,0.0521408060475983
-13979,9253,3728,0.0545524879363147,0.0545524879363147
-13981,7951,7949,0.019092168905179,0.019092168905179
-13983,7949,3093,0.182702780383174,0.182702780383174
-15893,9254,9255,0.183718623774573,0.183718623774573
-13984,3093,3203,0.200818235908537,0.200818235908537
-13985,3203,6116,0.201635970571119,0.201635970571119
-13986,6116,1913,0.201179241726354,0.201179241726354
-13987,1913,9219,0.201184980777767,0.201184980777767
-13988,9219,463,0.200400773809621,0.200400773809621
-13989,463,7301,0.202731579470961,0.202731579470961
-13990,7301,49,0.204762753950758,0.204762753950758
-13991,49,3548,0.19703986640102,0.19703986640102
-13992,3548,4243,0.201964288701916,0.201964288701916
-13993,4243,1803,0.208102375283595,0.208102375283595
-13994,1803,8711,0.194851559567089,0.194851559567089
-13995,8711,5841,0.20424687376631,0.20424687376631
-17660,586,8936,0.0435552950105704,0.0435552950105704
-13997,434,8731,0.0205731062854678,0.0205731062854678
-13999,3219,3112,0.203925882799295,0.203925882799295
-14000,3112,3641,0.260678130684959,0.260678130684959
-14001,3641,9256,0.0279085029397156,0.0279085029397156
-14003,9257,8801,0.0249979934697134,0.0249979934697134
-14665,4752,4167,0.209025457745472,0.209025457745472
-14005,9256,9257,0.0367111693692818,0.0367111693692818
-14007,9258,3642,0.0274131048639432,0.0274131048639432
-14008,3642,9259,0.086632322467807,0.086632322467807
-14009,9259,3111,0.171051850512145,0.171051850512145
-14010,3111,3219,0.203481486479522,0.203481486479522
-14012,7158,9258,0.038998695665846,0.038998695665846
-14014,3219,6126,0.202012344464496,0.202012344464496
-14015,6126,1929,0.202386985868189,0.202386985868189
-14016,1929,2919,0.0171463622508283,0.0171463622508283
-14017,2919,7250,0.183561589747783,0.183561589747783
-14018,7250,3274,0.20118632596822,0.20118632596822
-14019,3274,7312,0.203193267560765,0.203193267560765
-14021,9260,9157,0.0588873613464273,0.0588873613464273
-14022,9157,6253,0.473629275671798,0.473629275671798
-14023,6253,9167,0.20379925953003,0.20379925953003
-14024,9167,231,0.364607283214556,0.364607283214556
-14026,9171,2308,0.0877328075526686,0.0877328075526686
-14027,2308,167,0.314493617652356,0.314493617652356
-14030,6653,9263,0.598539344332022,0.598539344332022
-14031,5448,5975,0.113227741973857,0.113227741973857
-14032,5975,9023,0.0895901368528646,0.0895901368528646
-14033,9023,4404,0.197536219691709,0.197536219691709
-14034,4404,7371,0.107978748074207,0.107978748074207
-14035,7371,6307,0.0697549406367758,0.0697549406367758
-14036,6307,6308,0.0220857912106748,0.0220857912106748
-14037,6308,4316,0.20668661359579,0.20668661359579
-14038,4316,4503,0.0921482766473363,0.0921482766473363
-14039,4503,7814,0.109821870874264,0.109821870874264
-14040,7814,5079,0.102137328159445,0.102137328159445
-14041,5079,8013,0.0998289131041121,0.0998289131041121
-14042,8013,6832,0.10065041616734,0.10065041616734
-14043,6832,6975,0.0990932842629603,0.0990932842629603
-14044,6975,7945,0.100601003970672,0.100601003970672
-14045,7945,6364,0.097675013601381,0.097675013601381
-14049,9264,9265,0.128352927336665,0.128352927336665
-14051,3219,5061,0.0565378582983479,0.0565378582983479
-14052,5061,4916,0.0521329784642155,0.0521329784642155
-17662,488,10160,0.037999512945138,0.037999512945138
-14053,4916,5228,0.130202288917824,0.130202288917824
-14054,5228,5106,0.0572735085516971,0.0572735085516971
-14055,5106,5229,0.0124802378810982,0.0124802378810982
-14056,5229,4995,0.288542415463076,0.288542415463076
-14057,4995,9266,0.20116472075537,0.20116472075537
-14666,4167,6326,0.178657902009272,0.178657902009272
-14058,9266,7066,0.0118986523075564,0.0118986523075564
-14059,7066,3636,0.140199736242294,0.140199736242294
-14061,9266,6351,0.197550871457279,0.197550871457279
-14063,2574,5103,0.0764020591743967,0.0764020591743967
-14065,7930,1893,0.0520626532677435,0.0520626532677435
-14066,1893,2315,0.115168818798466,0.115168818798466
-14068,7341,6156,0.0983814711715662,0.0983814711715662
-14069,6156,6290,0.0991170792397538,0.0991170792397538
-14070,6290,3116,0.0983982120263374,0.0983982120263374
-14072,6673,8185,0.0325158694936318,0.0325158694936318
-14074,3188,9268,0.0244851420549388,0.0244851420549388
-14075,9268,8800,0.0276968906605859,0.0276968906605859
-14077,6718,9269,0.103071842817105,0.103071842817105
-14078,9269,8160,0.0477581921413061,0.0477581921413061
-14080,7342,3492,0.198422050793999,0.198422050793999
-14081,3492,9270,0.0991145839577047,0.0991145839577047
-17664,10161,6173,0.109897620785603,0.109897620785603
-14082,9270,5386,0.100577308895159,0.100577308895159
-14083,5386,9271,0.100588544879537,0.100588544879537
-14084,9271,6817,0.101321511979085,0.101321511979085
-14160,7023,7393,0.135757251453186,0.135757251453186
-14161,7393,9272,0.0789156635630832,0.0789156635630832
-14166,9278,7444,0.0517309727495982,0.0517309727495982
-14129,9279,9280,0.186364690747119,0.186364690747119
-14085,6817,9273,5.01601743028969,5.01601743028969
-14086,9274,6816,4.59997811614881,4.59997811614881
-14088,2943,5348,0.200890409378397,0.200890409378397
-14089,5348,3491,0.0990328236882064,0.0990328236882064
-14090,3491,2849,0.0998105211493863,0.0998105211493863
-14091,2849,7341,0.0991252344530307,0.0991252344530307
-14093,9271,6103,0.208876201356377,0.208876201356377
-14095,9270,6098,0.16565447863601,0.16565447863601
-14096,6098,9275,0.0444779706577198,0.0444779706577198
-14097,9269,6101,0.238835584318973,0.238835584318973
-17799,10180,8536,0.0726583525558809,0.0726583525558809
-14099,8294,9276,0.192103991232145,0.192103991232145
-14101,4423,9277,0.533016938094048,0.533016938094048
-14138,9282,9283,0.384483999025896,0.384483999025896
-14146,4993,9288,0.0718457938229626,0.0718457938229626
-14148,9288,471,0.0203590276008878,0.0203590276008878
-14149,471,6430,0.0161743745423695,0.0161743745423695
-14150,6430,4655,0.1348214737413,0.1348214737413
-14151,4655,1277,0.119151021074222,0.119151021074222
-14152,1277,4528,0.128606742393323,0.128606742393323
-14153,4528,9289,0.132757697104501,0.132757697104501
-14154,9289,9290,0.133347126872573,0.133347126872573
-14155,9290,9291,0.0102673262572307,0.0102673262572307
-14156,9291,6745,0.131970868855064,0.131970868855064
-14157,6745,6145,0.131356474267846,0.131356474267846
-14158,6145,4019,0.135781040149455,0.135781040149455
-14159,4019,7023,0.135014116939136,0.135014116939136
-14162,9272,3401,0.0502252760733361,0.0502252760733361
-14163,3401,9220,0.0499780107614713,0.0499780107614713
-17968,8778,10231,0.0192769916187002,0.0192769916187002
-14164,9220,8375,0.0494394335916504,0.0494394335916504
-14165,8375,9278,0.0493971533103994,0.0493971533103994
-14167,7444,9292,0.0498509119548639,0.0498509119548639
-14168,9292,7161,0.0504322249542888,0.0504322249542888
-14169,7161,9293,0.049549545616498,0.049549545616498
-14671,5473,9414,0.169600878974653,0.169600878974653
-14170,9293,7773,0.0509361632349417,0.0509361632349417
-14171,7773,9039,0.0499454477956979,0.0499454477956979
-14172,9039,1114,0.0547655871790504,0.0547655871790504
-14173,1114,9294,0.0447798115689078,0.0447798115689078
-14174,9294,7494,0.0527731793085291,0.0527731793085291
-14175,7494,9170,0.0488063990880333,0.0488063990880333
-14176,9170,3836,0.0502683027746479,0.0502683027746479
-14180,7818,2938,0.0876396467302253,0.0876396467302253
-14181,2938,6809,0.0888992165922937,0.0888992165922937
-14182,6809,1960,0.772041478396669,0.772041478396669
-17800,8536,8859,0.0293889142934455,0.0293889142934455
-14183,1960,9295,0.960771522024492,0.960771522024492
-14184,7571,9296,0.161476693063143,0.161476693063143
-14185,9296,8888,0.0634729683022204,0.0634729683022204
-14187,9297,6334,0.0129309336441387,0.0129309336441387
-14188,6334,7083,0.0225608570291498,0.0225608570291498
-14189,7083,8784,0.107920119748436,0.107920119748436
-14190,8784,8791,0.106332666658533,0.106332666658533
-14191,8791,3157,0.106749034536814,0.106749034536814
-14192,3157,4976,0.101195319793441,0.101195319793441
-14193,4976,9298,0.0996902493641346,0.0996902493641346
-14194,9298,9299,0.104226329823663,0.104226329823663
-14195,9299,6538,0.0493134523648135,0.0493134523648135
-14196,6538,5048,0.0489874238643872,0.0489874238643872
-14197,5048,8001,0.0994531494791736,0.0994531494791736
-14198,8001,985,0.0994551795792203,0.0994551795792203
-14199,985,5104,0.0491411684949994,0.0491411684949994
-14201,8831,9300,0.0488242916251385,0.0488242916251385
-14202,9300,7149,0.0497002324101769,0.0497002324101769
-14203,7149,2393,0.0492946529104208,0.0492946529104208
-14204,2393,5115,0.0502354677891233,0.0502354677891233
-14205,5115,9301,0.0497154080261439,0.0497154080261439
-14206,9301,4714,0.049399080188397,0.049399080188397
-14207,4714,8872,0.0991624253785381,0.0991624253785381
-14208,8872,7353,0.0988972303255353,0.0988972303255353
-14209,7353,5412,0.107964313206197,0.107964313206197
-14210,5412,3145,0.0906444248702148,0.0906444248702148
-14211,3145,3919,0.0988223626592478,0.0988223626592478
-18204,6875,8356,0.205977621151269,0.205977621151269
-14212,3919,3918,0.0189862588635382,0.0189862588635382
-14213,3918,1010,0.0826936905404967,0.0826936905404967
-14214,1010,6261,0.0974734196824701,0.0974734196824701
-14215,6261,8730,0.0989075877241795,0.0989075877241795
-14216,8730,7153,0.0605847994240266,0.0605847994240266
-14217,7153,5021,0.0499889577891061,0.0499889577891061
-14218,5021,9302,0.0549823108734392,0.0549823108734392
-14219,9302,3342,0.0335617577180335,0.0335617577180335
-14220,3342,3352,0.0674788037125104,0.0674788037125104
-14221,3352,7886,0.0299418452790484,0.0299418452790484
-14222,7886,7319,0.0732493043433617,0.0732493043433617
-14223,7319,7320,0.0259215863697348,0.0259215863697348
-14224,7320,7977,0.0775267077551995,0.0775267077551995
-14225,7977,7980,0.0233987016260196,0.0233987016260196
-14226,7980,2061,0.0796038188827741,0.0796038188827741
-14227,2061,8870,0.0167451229489977,0.0167451229489977
-14228,8870,2647,0.0876006586657796,0.0876006586657796
-14229,2647,8860,0.0114861984991212,0.0114861984991212
-14231,4113,8862,0.00848374045935965,0.00848374045935965
-14232,8862,8687,0.0949896568056219,0.0949896568056219
-14234,6694,8024,0.0782864986898227,0.0782864986898227
-14235,8024,8017,0.0158816052839578,0.0158816052839578
-18205,8356,10280,0.196081618210442,0.196081618210442
-14236,8017,7681,0.0911745487086236,0.0911745487086236
-14237,7681,3454,0.0980849682512979,0.0980849682512979
-14238,3454,6017,0.0971271293907499,0.0971271293907499
-14239,6017,9303,0.0906101063303862,0.0906101063303862
-14240,9303,3884,0.022021804982538,0.022021804982538
-14241,3884,9304,0.0244079810975188,0.0244079810975188
-14242,9304,852,0.0462417773626911,0.0462417773626911
-14243,852,847,0.0318832988859635,0.0318832988859635
-14244,847,9305,0.0129480432587025,0.0129480432587025
-14245,9305,7103,0.0469858120705144,0.0469858120705144
-14246,7103,7098,0.0440436114993002,0.0440436114993002
-14247,7098,8567,0.0448162532507988,0.0448162532507988
-14248,8567,8696,0.0173715559267549,0.0173715559267549
-14249,8696,8157,0.112872102261494,0.112872102261494
-14251,7606,7263,0.0986452262534628,0.0986452262534628
-14252,7263,7596,0.0935891946661749,0.0935891946661749
-14253,7596,2019,0.0979493336941006,0.0979493336941006
-14254,2019,2009,0.0254598809515577,0.0254598809515577
-14255,2009,9306,0.0651506123907477,0.0651506123907477
-14256,9306,2765,0.0942796454050606,0.0942796454050606
-14257,2765,7004,0.0945020258355606,0.0945020258355606
-14258,7004,2269,0.094510288095609,0.094510288095609
-14259,2269,3597,0.0938178496086605,0.0938178496086605
-14260,3597,7519,0.0940495689740582,0.0940495689740582
-14261,7519,2097,0.0954278502201834,0.0954278502201834
-14262,2097,5979,0.093364277402532,0.093364277402532
-14263,5979,7668,0.0947328877466294,0.0947328877466294
-14264,7668,2333,0.0940581587738673,0.0940581587738673
-14290,7340,2847,0.0976411590956878,0.0976411590956878
-14291,2847,3488,0.099134038329873,0.099134038329873
-14265,2333,9307,2.72967592410639,2.72967592410639
-14266,7939,9297,0.0419487931711618,0.0419487931711618
-14268,9308,8124,0.0322650869587369,0.0322650869587369
-14270,6489,4610,0.147433811602258,0.147433811602258
-14271,4610,9309,0.176778253451623,0.176778253451623
-14272,9309,9310,0.173976128689665,0.173976128689665
-14273,9310,661,0.00410310170227956,0.00410310170227956
-14274,661,9311,0.181937703339546,0.181937703339546
-14275,9311,9312,0.00955167864142152,0.00955167864142152
-14276,9312,5465,0.170285054650927,0.170285054650927
-14277,5465,9313,0.170744821866598,0.170744821866598
-14279,1959,9314,0.0338130460518869,0.0338130460518869
-14280,6865,9315,0.0139507857568572,0.0139507857568572
-14304,3303,9322,0.10510832723533,0.10510832723533
-14282,1952,1061,0.0629715521271105,0.0629715521271105
-14283,1061,1698,0.0954893713474356,0.0954893713474356
-14284,1698,7830,0.0914331784434328,0.0914331784434328
-14285,7830,6672,0.0912502234487567,0.0912502234487567
-14287,3115,6289,0.0998478865183477,0.0998478865183477
-14288,6289,6153,0.0969141122634902,0.0969141122634902
-14289,6153,7340,0.100591515239683,0.100591515239683
-14292,3488,5347,0.102266398355838,0.102266398355838
-14293,5347,5385,0.100999909961237,0.100999909961237
-14294,5385,2941,0.100298515709498,0.100298515709498
-14295,2941,6815,0.100200854484763,0.100200854484763
-14296,6815,9316,0.597950743493465,0.597950743493465
-14299,9318,9319,0.0328706223087289,0.0328706223087289
-14300,9319,9320,0.0460951861554719,0.0460951861554719
-14332,8959,603,0.0768028618845699,0.0768028618845699
-14301,9320,9321,0.0066600520489618,0.0066600520489618
-14302,9321,6181,0.104280480431139,0.104280480431139
-14303,6181,3303,0.107915728386056,0.107915728386056
-14305,9322,7829,0.125883411444605,0.125883411444605
-14306,7829,9323,0.0108681676592021,0.0108681676592021
-14339,5536,6469,0.142307267119589,0.142307267119589
-14309,2191,9060,0.337657954437192,0.337657954437192
-14312,8501,9324,0.0507516559976904,0.0507516559976904
-14313,9324,8418,0.0529402152835436,0.0529402152835436
-14314,8418,9204,0.0536170041098827,0.0536170041098827
-16428,9891,9892,0.0636662665142278,0.0636662665142278
-14316,9204,8416,0.0537868101405785,0.0537868101405785
-14317,8416,4388,0.0529171329453403,0.0529171329453403
-14318,4388,9325,0.0509479826022637,0.0509479826022637
-14319,9325,3012,0.0488022545854277,0.0488022545854277
-14320,3012,9326,0.0106897373905654,0.0106897373905654
-14321,9326,9327,0.0465239604768105,0.0465239604768105
-14322,9327,5968,0.0526629141875595,0.0526629141875595
-14323,5968,7574,0.106363762970419,0.106363762970419
-14324,7574,3677,0.190331060201359,0.190331060201359
-14326,604,9328,0.0383191315904674,0.0383191315904674
-14327,9328,8962,0.0878512488922689,0.0878512488922689
-14336,2420,3233,0.140764271648617,0.140764271648617
-14337,3233,5753,0.137661630591373,0.137661630591373
-14338,5753,5536,0.137436976875483,0.137436976875483
-14340,6469,8679,0.121371092902246,0.121371092902246
-14341,8679,9329,0.0309595800848719,0.0309595800848719
-20573,10860,10861,0.0279030600601915,0.0279030600601915
-14342,6914,8116,0.133600464645887,0.133600464645887
-14343,8116,2483,0.133445859176034,0.133445859176034
-14344,2483,2482,0.047686047945258,0.047686047945258
-14345,2482,2821,0.0880230568241511,0.0880230568241511
-14346,2821,1413,0.131238509050086,0.131238509050086
-14347,1413,1353,0.132733599584258,0.132733599584258
-14348,1353,7767,0.0733149237137966,0.0733149237137966
-14350,6729,2454,0.137919009046371,0.137919009046371
-14351,2454,3222,0.134234515444875,0.134234515444875
-14352,3222,5743,0.134597141931663,0.134597141931663
-14353,5743,5520,0.133175062767026,0.133175062767026
-14355,6454,6914,0.135018185869381,0.135018185869381
-14358,9331,5721,0.0487615183925519,0.0487615183925519
-14359,5721,7455,0.0500566721474228,0.0500566721474228
-14360,7455,7439,0.0502188861539984,0.0502188861539984
-14361,7439,9332,0.0497229240568787,0.0497229240568787
-14362,9332,7179,0.0495263907597367,0.0495263907597367
-14363,7179,6514,0.0494836674166392,0.0494836674166392
-14364,6514,7769,0.0494751212766029,0.0494751212766029
-14365,7769,8353,0.0493044680149371,0.0493044680149371
-14366,8353,1088,0.0496035740367965,0.0496035740367965
-14367,1088,9333,0.0494070055394434,0.0494070055394434
-18206,10280,8329,0.00812836711491393,0.00812836711491393
-14368,9333,7511,0.0493300687211978,0.0493300687211978
-14369,7511,9334,0.0505963663421883,0.0505963663421883
-14370,9334,3859,0.0512115816031079,0.0512115816031079
-14371,3859,7593,0.0500990561172611,0.0500990561172611
-14372,7593,5584,0.0522011302499861,0.0522011302499861
-14376,6393,4066,0.134479200667361,0.134479200667361
-17290,7744,10084,0.402391291558362,0.402391291558362
-14377,4066,8345,0.135023999423797,0.135023999423797
-14378,8345,9290,0.135014881750995,0.135014881750995
-14380,9290,8343,0.132811220384574,0.132811220384574
-14381,8343,4290,0.133533987407519,0.133533987407519
-14382,4290,9335,0.135902936474728,0.135902936474728
-14383,9335,3489,0.0587665939642116,0.0587665939642116
-14384,3489,7712,0.0755904198902593,0.0755904198902593
-14385,7712,27,0.134715758792357,0.134715758792357
-14386,27,2969,0.137103389587981,0.137103389587981
-14387,2969,9336,0.0109860620784292,0.0109860620784292
-14388,9336,9337,0.167759812178903,0.167759812178903
-14389,9337,9206,0.00926254133366712,0.00926254133366712
-14390,9206,8977,0.0113535458246787,0.0113535458246787
-14391,8977,8972,0.0088289433819593,0.0088289433819593
-14392,8972,3592,0.0571990081351957,0.0571990081351957
-14393,3592,9338,0.0469245704560806,0.0469245704560806
-14394,9338,9339,0.0729443531618577,0.0729443531618577
-14395,9339,8232,0.00668286428887123,0.00668286428887123
-14396,8232,9340,0.00979627303730314,0.00979627303730314
-14397,9340,9341,0.118389238398527,0.118389238398527
-14398,9341,4525,0.00524840053732967,0.00524840053732967
-14399,4525,9342,0.013599142214923,0.013599142214923
-17917,5630,5173,0.1998812615077,0.1998812615077
-14400,9342,5242,0.122003116630053,0.122003116630053
-14401,5242,6892,0.132288650893496,0.132288650893496
-14402,6892,9343,0.135024052446379,0.135024052446379
-14403,9343,1682,0.135717283468362,0.135717283468362
-14404,1682,9344,0.13652220484586,0.13652220484586
-14405,9344,9345,0.105458278319657,0.105458278319657
-14406,9345,2418,0.102009831688775,0.102009831688775
-14407,2418,3242,0.101232559655988,0.101232559655988
-14408,3242,5748,0.0982858511104491,0.0982858511104491
-14409,5748,374,0.0623624460797668,0.0623624460797668
-14410,374,5523,0.0701701821949803,0.0701701821949803
-14411,5523,6457,0.135950108709595,0.135950108709595
-14412,6457,6915,0.143043041710545,0.143043041710545
-14413,6915,8113,0.201708935806819,0.201708935806819
-14414,8113,2832,0.20096393469179,0.20096393469179
-14415,2832,9346,0.204633312594591,0.204633312594591
-14416,9346,414,0.202451705011007,0.202451705011007
-14417,414,9347,0.0102632917291373,0.0102632917291373
-14419,9348,9349,0.0562572963351917,0.0562572963351917
-14420,9349,8300,0.00966827703924115,0.00966827703924115
-14421,8300,6777,0.0385409578619094,0.0385409578619094
-14422,6777,1544,0.0462211024255861,0.0462211024255861
-14423,1544,7912,0.0490573153021717,0.0490573153021717
-14424,7912,1233,0.049290008691593,0.049290008691593
-14426,6137,1235,0.0484278864865507,0.0484278864865507
-14427,1235,4023,0.0513600630217092,0.0513600630217092
-14429,9350,6747,0.132068580931606,0.132068580931606
-14430,6747,6147,0.133962898476652,0.133962898476652
-14431,6147,4021,0.132523387247295,0.132523387247295
-14432,4021,7025,0.136778977327424,0.136778977327424
-14433,7025,7395,0.133533581691074,0.133533581691074
-14434,7395,3404,0.129273092410981,0.129273092410981
-14437,6743,6143,0.132668974575322,0.132668974575322
-14439,4017,7021,0.135416440349126,0.135416440349126
-15949,9764,9765,0.0507119344408952,0.0507119344408952
-14440,7021,2253,0.0670945211351968,0.0670945211351968
-14441,2253,7391,0.0705505249778064,0.0705505249778064
-14442,7391,8378,0.0284601613193826,0.0284601613193826
-14443,8378,9352,0.0168078916798857,0.0168078916798857
-14444,9352,9164,0.0309569561418734,0.0309569561418734
-14445,9164,3399,0.0498252251835071,0.0498252251835071
-14446,3399,9201,0.0503897904067021,0.0503897904067021
-14447,9201,8373,0.0497143012199282,0.0497143012199282
-14448,8373,9353,0.0509790068650631,0.0509790068650631
-14449,9353,7441,0.0496189650212473,0.0496189650212473
-14450,7441,7159,0.100702050774509,0.100702050774509
-14451,7159,9354,0.0494661713985568,0.0494661713985568
-14452,9354,7771,0.0505861336269105,0.0505861336269105
-14453,7771,9120,0.0493839312690347,0.0493839312690347
-14454,9120,1112,0.0512647827333792,0.0512647827333792
-14455,1112,9355,0.0498795134320378,0.0498795134320378
-14456,9355,7492,0.0488194630548967,0.0488194630548967
-14457,7492,9168,0.0520827219058429,0.0520827219058429
-14460,9356,8961,0.0504011792295747,0.0504011792295747
-14461,8961,3748,0.0493839208030821,0.0493839208030821
-14462,3748,6769,0.0968984775923487,0.0968984775923487
-14463,6769,6149,0.102435146849327,0.102435146849327
-14465,3994,7051,0.102115193238577,0.102115193238577
-14466,7051,1408,0.0946641824527164,0.0946641824527164
-14467,1408,7388,0.085462530975882,0.085462530975882
-14468,7388,7384,0.0170925061959903,0.0170925061959903
-18773,9634,9642,0.177090825598433,0.177090825598433
-14469,7384,3431,0.0989346539047275,0.0989346539047275
-14470,3431,7700,0.0518438186201772,0.0518438186201772
-14471,7700,5704,0.048946112444104,0.048946112444104
-14472,5704,9357,0.0519385112225497,0.0519385112225497
-14473,9357,7431,0.0487842422429383,0.0487842422429383
-14474,7431,9358,0.0504551193593522,0.0504551193593522
-14475,9358,7172,0.0479047859915454,0.0479047859915454
-14476,7172,6792,0.0511502123352556,0.0511502123352556
-14477,6792,7632,0.00188047440472113,0.00188047440472113
-14478,7632,7787,0.0496192518214323,0.0496192518214323
-14480,9359,8535,0.0508077855400009,0.0508077855400009
-14481,8535,6765,0.145782759028854,0.145782759028854
-14482,6765,3990,0.201170058672575,0.201170058672575
-14484,1252,9360,0.0508116162596578,0.0508116162596578
-14485,9360,2713,0.151002345273532,0.151002345273532
-14486,2713,9361,0.150151679268698,0.150151679268698
-14487,9361,9345,0.0467087251829664,0.0467087251829664
-14489,604,9362,0.304555126012675,0.304555126012675
-19303,10466,10464,0.0570509910756543,0.0570509910756543
-14490,9362,3931,0.0491525010465484,0.0491525010465484
-14491,3931,5621,0.101973762448865,0.101973762448865
-14492,5621,3706,0.101962569966911,0.101962569966911
-14493,3706,712,0.103443032392629,0.103443032392629
-14494,712,9192,0.0968373320357312,0.0968373320357312
-14495,9192,9363,0.0080975223718546,0.0080975223718546
-14496,9363,8516,0.0893732443225825,0.0893732443225825
-14497,8516,4192,0.13424362136155,0.13424362136155
-14498,4192,2518,0.136440133151325,0.136440133151325
-14499,2518,6729,0.134978640871206,0.134978640871206
-14500,6729,1227,0.0997687727623418,0.0997687727623418
-14501,1227,4806,0.0366740513167213,0.0366740513167213
-14502,4806,4807,0.0623613194343192,0.0623613194343192
-14503,4807,9364,0.0735708513932139,0.0735708513932139
-14505,2172,9365,0.10218559205586,0.10218559205586
-14506,9365,6421,0.131466128237451,0.131466128237451
-14507,6421,4627,0.133072729014262,0.133072729014262
-14508,4627,1251,0.132619751836754,0.132619751836754
-14509,1251,9366,0.0509582244384895,0.0509582244384895
-14510,9366,4559,0.0827794726054668,0.0827794726054668
-14511,4559,2712,0.0689589814233185,0.0689589814233185
-14512,2712,2728,0.0619836012735683,0.0619836012735683
-14513,2728,9367,0.087518882590742,0.087518882590742
-14514,9367,9344,0.0476225838725891,0.0476225838725891
-14515,9344,9368,0.00985438954363147,0.00985438954363147
-14516,9368,9369,0.0491094576501381,0.0491094576501381
-18778,10124,10345,0.0125614259192805,0.0125614259192805
-14517,9369,7774,0.00626697755243391,0.00626697755243391
-14518,7774,6761,0.141378168804538,0.141378168804538
-14519,6761,3985,0.199192140414955,0.199192140414955
-14521,7053,7044,0.0653254811284965,0.0653254811284965
-14522,7044,7387,0.0682830004024069,0.0682830004024069
-14523,7387,3430,0.133588924605445,0.133588924605445
-14524,3430,7686,0.0503796411863715,0.0503796411863715
-14525,7686,5703,0.0508582113883613,0.0508582113883613
-14526,5703,9370,0.0488667197641872,0.0488667197641872
-14527,9370,7429,0.0516445969542144,0.0516445969542144
-14528,7429,9371,0.0490112318671292,0.0490112318671292
-14529,9371,7171,0.0508482971319457,0.0508482971319457
-14530,7171,7624,0.0496771306838175,0.0496771306838175
-14531,7624,7786,0.0493747865229187,0.0493747865229187
-14532,7786,6545,0.0503324450079726,0.0503324450079726
-14533,6545,1130,0.0509050056370777,0.0509050056370777
-14534,1130,9372,0.0485943238040251,0.0485943238040251
-14535,9372,7501,0.0507738202300539,0.0507738202300539
-14536,7501,3847,0.101870167526128,0.101870167526128
-14537,3847,9373,0.0504389434046066,0.0504389434046066
-14538,9373,5568,0.0510557052627446,0.0510557052627446
-14539,5568,7550,0.0950790701641584,0.0950790701641584
-18779,10345,10346,0.00436025817920743,0.00436025817920743
-14540,7550,9374,0.691166878065482,0.691166878065482
-14542,9375,3750,0.0991970412293978,0.0991970412293978
-14543,3750,6775,0.030090245676364,0.030090245676364
-14544,6775,6770,0.06895159402243,0.06895159402243
-14545,6770,6151,0.0638158634824408,0.0638158634824408
-14546,6151,6150,0.0359509846886602,0.0359509846886602
-14547,6150,3996,0.0963309366011696,0.0963309366011696
-14548,3996,7052,0.102479688313932,0.102479688313932
-14549,7052,7045,0.0330120960596164,0.0330120960596164
-14550,7045,1410,0.0660204937565387,0.0660204937565387
-14551,1410,7375,0.0682166301368544,0.0682166301368544
-14552,7375,7385,0.0295959064634691,0.0295959064634691
-14553,7385,3434,0.103723384358152,0.103723384358152
-14554,3434,7763,0.0498679267683769,0.0498679267683769
-14555,7763,5714,0.0489397855227354,0.0489397855227354
-14556,5714,9376,0.0504544990745908,0.0504544990745908
-14557,9376,7434,0.0512120959316622,0.0512120959316622
-14558,7434,9377,0.0478236988076173,0.0478236988076173
-14559,9377,7173,0.0504644501870281,0.0504644501870281
-14560,7173,6757,0.0487932478126772,0.0487932478126772
-14561,6757,7788,0.0524425771479912,0.0524425771479912
-14562,7788,6629,0.0465854765801166,0.0465854765801166
-14563,6629,1135,0.050756073904441,0.050756073904441
-14564,1135,6996,0.0489590899927541,0.0489590899927541
-14565,6996,7502,0.0500614988346772,0.0500614988346772
-14566,7502,9378,0.0592142721743878,0.0592142721743878
-14567,9378,9379,0.0408406813526211,0.0408406813526211
-14568,9379,7525,0.051644217383113,0.051644217383113
-14569,7525,9380,0.00488834581127681,0.00488834581127681
-14570,9380,9381,0.0137184453378057,0.0137184453378057
-14571,9381,5577,0.0352923239739852,0.0352923239739852
-14572,5577,9382,0.0499195542635391,0.0499195542635391
-14573,9382,9383,0.00207675636441744,0.00207675636441744
-14574,9383,9384,0.047500863548095,0.047500863548095
-14575,9384,9385,0.692939297157353,0.692939297157353
-14576,9347,9386,0.0638147684012153,0.0638147684012153
-14578,9386,7985,0.00659385915044033,0.00659385915044033
-14579,7985,9389,0.0876122732807676,0.0876122732807676
-14581,9390,9391,0.0645406329993705,0.0645406329993705
-14583,9391,413,0.0102638039419597,0.0102638039419597
-14584,413,9392,0.19657163498794,0.19657163498794
-14586,2833,2489,0.134959283423391,0.134959283423391
-14587,2489,8106,0.133489509437131,0.133489509437131
-14588,8106,9375,0.13422540798818,0.13422540798818
-14589,9375,5534,0.213451017222507,0.213451017222507
-14590,5534,9356,0.201724072155003,0.201724072155003
-14591,9356,9393,0.10196574773319,0.10196574773319
-14592,9393,9359,0.100498646625457,0.100498646625457
-14593,9359,9394,0.0995312761976722,0.0995312761976722
-14594,9394,9368,0.101332513335273,0.101332513335273
-14595,9368,9395,0.0524188937894899,0.0524188937894899
-14597,7373,1659,0.103861210410172,0.103861210410172
-14598,1659,7753,0.101665764300136,0.101665764300136
-14599,7753,6893,0.102477314257262,0.102477314257262
-14600,6893,5249,0.10178809746081,0.10178809746081
-14601,5249,9396,0.145009648698155,0.145009648698155
-14602,9396,5880,0.0121536325330439,0.0121536325330439
-14603,5880,9397,0.00548191654733534,0.00548191654733534
-14606,8233,9399,0.00646043089308406,0.00646043089308406
-14607,9399,3593,0.11814466181621,0.11814466181621
-14608,3593,8990,0.0502713142680652,0.0502713142680652
-14610,8994,8444,0.0112418070839832,0.0112418070839832
-14611,8444,9400,0.0106637167987107,0.0106637167987107
-14612,9400,9401,0.175022698409133,0.175022698409133
-14613,9401,2970,0.0101077489563562,0.0101077489563562
-15358,9566,9564,0.0244609132808449,0.0244609132808449
-15359,9564,9567,0.0131773798008107,0.0131773798008107
-18780,10346,10347,0.0407216504299826,0.0407216504299826
-14614,2970,8339,0.136426769448966,0.136426769448966
-14615,8339,9348,0.135169766224191,0.135169766224191
-17064,4880,9474,0.196578675384766,0.196578675384766
-14616,9348,9402,0.134813162708373,0.134813162708373
-14618,9350,8341,0.135569890655856,0.135569890655856
-14619,8341,9291,0.132813255317002,0.132813255317002
-14620,9291,9403,0.135124075128598,0.135124075128598
-14621,9403,9351,0.135070525267418,0.135070525267418
-14622,9351,6393,0.134155373542404,0.134155373542404
-14624,9393,8920,0.0508713694865286,0.0508713694865286
-14625,8920,6767,0.14583235659915,0.14583235659915
-14626,6767,3992,0.20138079206452,0.20138079206452
-14628,9389,6049,0.0198174454501223,0.0198174454501223
-14629,6049,5790,0.202409458864074,0.202409458864074
-14630,5790,9404,0.390889741592557,0.390889741592557
-14631,9389,8000,0.0874325326194809,0.0874325326194809
-14632,8000,9390,0.00587109212749533,0.00587109212749533
-14634,9405,9387,0.104292734331338,0.104292734331338
-14643,6926,912,0.0399977157837286,0.0399977157837286
-14645,3853,9379,0.0160272455480019,0.0160272455480019
-14646,9379,8109,0.188409381404142,0.188409381404142
-14647,8109,9407,0.202174997774683,0.202174997774683
-18781,10347,10348,0.0132995316754344,0.0132995316754344
-14649,5569,7551,0.0943021955909244,0.0943021955909244
-14650,7551,9408,0.692224615113747,0.692224615113747
-14651,7543,9409,0.0534301345278006,0.0534301345278006
-14652,6725,4821,0.0796194906426482,0.0796194906426482
-14653,4821,2511,0.108135424106199,0.108135424106199
-14654,2511,8224,0.0376491716837282,0.0376491716837282
-14787,9415,9416,0.31094582672675,0.31094582672675
-14791,2891,8923,0.457832400708685,0.457832400708685
-14793,5024,3335,0.0983906046596767,0.0983906046596767
-14795,7882,7337,0.102026433082927,0.102026433082927
-14796,7337,7986,0.092185977990205,0.092185977990205
-14797,7986,2055,0.0946262859427162,0.0946262859427162
-14798,2055,2661,0.105023750774947,0.105023750774947
-14799,2661,4134,0.100547305543173,0.100547305543173
-14800,4134,6697,0.0891067622100312,0.0891067622100312
-14801,6697,8020,0.0955965901798936,0.0955965901798936
-14802,8020,7684,0.0959578997394599,0.0959578997394599
-14803,7684,3458,0.0944062286409825,0.0944062286409825
-14804,3458,9418,0.046227752797198,0.046227752797198
-14805,9418,6020,0.0461318959590008,0.0461318959590008
-14806,6020,9419,0.0476773807861996,0.0476773807861996
-19851,10660,10659,0.00933491084100046,0.00933491084100046
-14807,9419,9420,0.0464971294902911,0.0464971294902911
-14808,9420,9421,0.0470997921907546,0.0470997921907546
-14809,9421,858,0.0457230540386264,0.0457230540386264
-14810,858,453,0.0467078777528092,0.0467078777528092
-14811,453,7106,0.0457758284617094,0.0457758284617094
-14812,7106,457,0.0455135048722811,0.0455135048722811
-14813,457,9422,0.0463689143813771,0.0463689143813771
-14815,9423,9424,0.00582356405087118,0.00582356405087118
-14817,9425,6432,0.0926350815349589,0.0926350815349589
-14818,6432,4657,0.117278685803448,0.117278685803448
-14819,4657,1280,0.116593491044555,0.116593491044555
-14820,1280,4531,0.132186730302242,0.132186730302242
-14951,7670,9457,3.41600373692151,3.41600373692151
-14952,3583,7612,0.0941905477613176,0.0941905477613176
-14953,7612,7265,0.0936588343585109,0.0936588343585109
-14955,7584,2001,0.0944700456489753,0.0944700456489753
-14956,2001,3361,0.0949233780276755,0.0949233780276755
-14957,3361,2755,0.0936752171867012,0.0936752171867012
-14958,2755,7006,0.0959502415519421,0.0959502415519421
-14959,7006,2281,0.099513679348955,0.099513679348955
-14960,2281,3582,0.100891029071921,0.100891029071921
-14961,3582,7528,0.100887947066067,0.100887947066067
-14962,7528,2136,0.103412071247308,0.103412071247308
-14963,2136,5993,0.100671897064821,0.100671897064821
-14964,5993,7673,0.0999667195935639,0.0999667195935639
-14986,8886,7162,0.0452381047162121,0.0452381047162121
-14985,8878,8886,0.104437941202429,0.104437941202429
-14987,7162,9309,0.0512658726512666,0.0512658726512666
-15109,7996,6927,0.0217805821755954,0.0217805821755954
-15110,6927,5675,0.030815905152866,0.030815905152866
-14965,7673,9461,2.89733038736532,2.89733038736532
-14966,8151,7610,0.094248596661074,0.094248596661074
-15088,2328,9485,2.88346551451846,2.88346551451846
-15089,9486,3468,0.447301506508283,0.447301506508283
-15090,3468,3445,0.0309512876225537,0.0309512876225537
-15091,3445,7699,0.105014135175069,0.105014135175069
-15092,7699,9487,0.105691765273947,0.105691765273947
-15093,9487,6684,0.102061996358298,0.102061996358298
-15094,6684,4128,0.108739719526669,0.108739719526669
-15095,4128,9488,0.104836941153267,0.104836941153267
-15096,9488,2082,0.105803010632854,0.105803010632854
-15097,2082,7334,0.1052078044876,0.1052078044876
-15101,9489,2994,0.0812267643509346,0.0812267643509346
-15105,2996,4851,0.0525302115232072,0.0525302115232072
-15106,4851,7227,0.0344830493164063,0.0344830493164063
-15107,7227,2369,0.0550241369558443,0.0550241369558443
-15108,2369,7996,0.056554238974086,0.056554238974086
-16370,9877,8705,0.102117755919592,0.102117755919592
-16371,8705,9486,0.014467692878557,0.014467692878557
-16373,8076,3329,0.0677844820507112,0.0677844820507112
-16374,3329,7880,0.139626392785753,0.139626392785753
-16375,7880,7333,0.105584363104376,0.105584363104376
-16376,7333,2081,0.10500807653965,0.10500807653965
-16377,2081,2678,0.105119136499329,0.105119136499329
-16491,6692,8028,0.103532298857838,0.103532298857838
-16379,4127,6683,0.108621189217377,0.108621189217377
-16385,9881,9882,0.0163548118473388,0.0163548118473388
-16386,9882,9458,0.0203986664758761,0.0203986664758761
-16394,3281,9883,0.00468216635493236,0.00468216635493236
-16396,9884,9458,0.0218243339760988,0.0218243339760988
-16398,9883,9884,0.00648970201006769,0.00648970201006769
-16400,9885,9886,0.267423928903385,0.267423928903385
-16401,9886,9880,0.296075289776302,0.296075289776302
-16403,9878,9881,0.0274154521009071,0.0274154521009071
-16404,9881,9887,0.0188694353495207,0.0188694353495207
-16405,9887,9888,0.0187489585891175,0.0187489585891175
-19509,10534,10535,0.00388440521802765,0.00388440521802765
-16425,3407,9890,0.502103946549802,0.502103946549802
-16426,9890,3331,0.0251683632208894,0.0251683632208894
-16481,7888,3680,0.0532502584498927,0.0532502584498927
-16483,4595,8006,0.101626087251738,0.101626087251738
-16484,8006,580,0.022127419381672,0.022127419381672
-16485,580,7979,0.165894151722243,0.165894151722243
-16486,7979,9923,0.0456395565118553,0.0456395565118553
-16487,9923,2066,0.0539845223115493,0.0539845223115493
-16488,2066,2641,0.100182277305196,0.100182277305196
-16489,2641,4107,0.0977431302735631,0.0977431302735631
-16490,4107,6692,0.10418977795868,0.10418977795868
-16492,8028,7698,0.0982299872130606,0.0982299872130606
-16493,7698,3443,0.0993337912559461,0.0993337912559461
-16494,3443,6011,0.101499429536563,0.101499429536563
-16495,6011,3878,0.0977083732706848,0.0977083732706848
-16496,3878,9924,0.0991972529095445,0.0991972529095445
-16497,9924,420,0.100553893040038,0.100553893040038
-16504,8592,9925,0.120377099914021,0.120377099914021
-16505,9925,9926,0.107491921110891,0.107491921110891
-16506,9926,9927,0.123107053114174,0.123107053114174
-16517,8288,3009,0.0410924117477314,0.0410924117477314
-16519,9451,4779,0.246284579163,0.246284579163
-16520,4779,6557,0.132912762129515,0.132912762129515
-16521,6557,9306,0.107414375743234,0.107414375743234
-16523,5147,9150,0.0526798805531595,0.0526798805531595
-16527,862,703,0.202686588734239,0.202686588734239
-16528,703,9924,0.202942846886287,0.202942846886287
-16533,9141,9155,0.0471076181125112,0.0471076181125112
-16549,9936,8118,0.163748197039451,0.163748197039451
-16550,8118,4329,0.102460572786022,0.102460572786022
-16551,4329,9932,0.0509040459853039,0.0509040459853039
-16552,9932,5034,0.0506801147751554,0.0506801147751554
-16553,5034,9935,0.0507841642169636,0.0507841642169636
-16554,9935,7991,0.0519996695117493,0.0519996695117493
-16555,7991,9939,0.0501954054420559,0.0501954054420559
-16557,2889,8382,0.106173445564903,0.106173445564903
-16558,8382,8542,0.105198351895408,0.105198351895408
-16559,8542,4730,0.104923019039301,0.104923019039301
-16560,4730,6797,0.109090547930583,0.109090547930583
-16561,6797,7349,0.101581569748298,0.101581569748298
-16562,7349,5395,0.107089477151985,0.107089477151985
-16563,5395,8556,0.104796077599276,0.104796077599276
-17270,82,7309,0.202171029293651,0.202171029293651
-16564,8556,3897,0.106860413590027,0.106860413590027
-16565,3897,1030,0.106538064092827,0.106538064092827
-16566,1030,6272,0.104663636918357,0.104663636918357
-16567,6272,9940,0.0522044777389819,0.0522044777389819
-16568,9940,9941,0.0539741744852114,0.0539741744852114
-16570,5969,9942,0.0525274850765404,0.0525274850765404
-16571,9942,9943,0.0464624768491459,0.0464624768491459
-16572,9943,3013,0.00948387351005329,0.00948387351005329
-16573,3013,9944,0.0499659888588949,0.0499659888588949
-16574,9944,4387,0.0525459349585223,0.0525459349585223
-16575,4387,8415,0.053989635677053,0.053989635677053
-16576,8415,9945,0.0518942546071768,0.0518942546071768
-16577,9945,8419,0.054710567315966,0.054710567315966
-16578,8419,9946,0.0495941326709913,0.0495941326709913
-16579,9946,8502,0.0543577768356107,0.0543577768356107
-16580,8502,8537,0.0523876514778538,0.0523876514778538
-16581,8537,9591,0.106159293603162,0.106159293603162
-16582,9591,9318,0.0186755424929809,0.0186755424929809
-16584,3674,9947,0.0925100597395306,0.0925100597395306
-16585,9947,9936,0.0741653442201567,0.0741653442201567
-16586,9936,5811,0.0698256524972049,0.0698256524972049
-16587,5811,7575,0.109874082628797,0.109874082628797
-16588,7575,8407,0.0534887493842637,0.0534887493842637
-16589,8407,5969,0.0514820185730379,0.0514820185730379
-16615,5811,5357,0.148515460139762,0.148515460139762
-16616,5357,8119,0.104815937410374,0.104815937410374
-16621,9938,9956,0.0146143299800706,0.0146143299800706
-16622,9956,9957,0.0128596804561102,0.0128596804561102
-16624,9958,9959,0.0111717692412778,0.0111717692412778
-16625,9959,9960,0.00928483420505699,0.00928483420505699
-16626,9960,9938,0.0070355984277229,0.0070355984277229
-16628,9961,9962,0.526903283655783,0.526903283655783
-16630,9963,9312,1.46582798607179,1.46582798607179
-16633,9965,9966,0.00412165910041822,0.00412165910041822
-16634,9966,9967,0.0757681110838303,0.0757681110838303
-16638,9965,9957,0.0717225435233069,0.0717225435233069
-16640,9964,9958,0.0807216833328343,0.0807216833328343
-16642,9967,9956,0.0290555152245672,0.0290555152245672
-16645,565,7092,0.0721739648747923,0.0721739648747923
-16646,7092,9969,0.0060839008927764,0.0060839008927764
-16658,651,9973,0.109528403212781,0.109528403212781
-16660,3165,8089,0.106908291090671,0.106908291090671
-16662,9927,8897,0.00902355166325831,0.00902355166325831
-16663,8897,8899,0.00817755039331079,0.00817755039331079
-16665,8896,8898,0.0955954321276197,0.0955954321276197
-16666,8898,3166,0.0120380596695599,0.0120380596695599
-16726,3074,5275,0.102580698126288,0.102580698126288
-16727,5275,6866,0.0979724094285353,0.0979724094285353
-17386,5920,919,0.177782086780631,0.177782086780631
-16728,6866,5172,0.198907590330119,0.198907590330119
-16730,8563,6368,0.270917565484422,0.270917565484422
-16731,6368,9149,0.131210826087923,0.131210826087923
-16779,73,3512,0.203753724402901,0.203753724402901
-16780,3512,4254,0.201507995491671,0.201507995491671
-16781,4254,8742,0.199898657335298,0.199898657335298
-16782,8742,8713,0.201418841949,0.201418841949
-16784,3511,4252,0.198740800817733,0.198740800817733
-16785,4252,8741,0.201811596521788,0.201811596521788
-16786,8741,8712,0.201811329628688,0.201811329628688
-16794,4264,8747,0.202686112287629,0.202686112287629
-16795,8747,8718,0.200629598901607,0.200629598901607
-16797,4264,9864,0.0549036584382557,0.0549036584382557
-16798,9864,6516,0.0494449113838383,0.0494449113838383
-16799,6516,9855,0.048981731510525,0.048981731510525
-16800,9855,6160,0.0501282016561891,0.0501282016561891
-16801,6160,9852,0.0487763612951203,0.0487763612951203
-16802,9852,2738,0.0474245519497852,0.0474245519497852
-16803,2738,9267,0.050437767682916,0.050437767682916
-16804,9267,4512,0.0485383641713966,0.0485383641713966
-16805,4512,9858,0.0494525517955229,0.0494525517955229
-16807,3171,9861,0.047855446066228,0.047855446066228
-16808,9861,4996,0.0491871460939442,0.0491871460939442
-16810,728,3665,0.0984709387661759,0.0984709387661759
-16811,3665,7315,0.0976596112157836,0.0976596112157836
-16812,7315,4586,0.099898936211385,0.099898936211385
-16813,4586,8032,0.100609280081376,0.100609280081376
-16814,8032,6372,0.100607138332673,0.100607138332673
-16815,6372,10015,0.0481181392934118,0.0481181392934118
-16816,10015,4826,0.0474935217651045,0.0474935217651045
-16817,4826,8954,0.102669069502609,0.102669069502609
-16818,8954,8956,0.0962963283421786,0.0962963283421786
-16819,8956,10016,0.0513191391251647,0.0513191391251647
-16820,10016,8816,0.0499640269903021,0.0499640269903021
-16821,8816,8828,0.0154260311566384,0.0154260311566384
-16822,8828,8206,0.163758839265649,0.163758839265649
-16824,7312,87,0.200996583193063,0.200996583193063
-16825,87,3523,0.203555810471145,0.203555810471145
-16826,3523,4264,0.199602301480838,0.199602301480838
-16828,7312,3648,0.154169800390109,0.154169800390109
-16832,10017,593,0.487939330962151,0.487939330962151
-16851,8718,9866,0.0548710295017979,0.0548710295017979
-16854,9854,6162,0.0501051333475743,0.0501051333475743
-16855,6162,9851,0.0483439490024107,0.0483439490024107
-16856,9851,2740,0.0471290060929331,0.0471290060929331
-16857,2740,9863,0.0493697108471136,0.0493697108471136
-16858,9863,5231,0.0496606668462506,0.0496606668462506
-16859,5231,9857,0.0497084193128251,0.0497084193128251
-16860,9857,3173,0.0501789646371779,0.0501789646371779
-16861,3173,9860,0.0494391268160734,0.0494391268160734
-16862,9860,4998,0.0489685461673918,0.0489685461673918
-16863,4998,10023,0.0484162493280967,0.0484162493280967
-16864,10023,730,0.0507353905968115,0.0507353905968115
-16865,730,7061,0.101358904320696,0.101358904320696
-16867,8718,5830,0.204166330856198,0.204166330856198
-16868,5830,7737,0.202033972193846,0.202033972193846
-16869,7737,10024,0.307945705057077,0.307945705057077
-16870,594,7303,0.202197872623945,0.202197872623945
-16871,7303,66,0.20266387330283,0.20266387330283
-16872,66,3507,0.204877942956717,0.204877942956717
-16873,3507,233,0.199133503403233,0.199133503403233
-16874,233,8739,0.200473333247617,0.200473333247617
-16876,9203,4390,0.147691017735613,0.147691017735613
-16878,1943,10025,0.122583563426404,0.122583563426404
-16879,10025,7860,0.110082433757866,0.110082433757866
-16880,7860,4679,0.101138191051348,0.101138191051348
-16881,4679,4942,0.0999327202014087,0.0999327202014087
-16882,4942,7214,0.0998696563081419,0.0998696563081419
-16883,7214,4928,0.0376169687692631,0.0376169687692631
-16884,4928,9636,0.014060573587084,0.014060573587084
-16886,9870,1167,0.138451400347842,0.138451400347842
-16887,1167,887,0.138706454254422,0.138706454254422
-16888,887,4471,0.139683302205089,0.139683302205089
-16890,9488,1170,0.13939401140641,0.13939401140641
-16891,1170,890,0.137058995578611,0.137058995578611
-16892,890,4474,0.140851028519895,0.140851028519895
-16893,4474,2796,0.132878137732711,0.132878137732711
-16894,2796,5265,0.13228574865076,0.13228574865076
-16895,5265,10026,0.123565762779561,0.123565762779561
-16896,5633,7143,0.082551113540924,0.082551113540924
-16899,8743,4255,0.199339176026767,0.199339176026767
-16905,6305,6456,0.135927811837651,0.135927811837651
-16906,6456,5521,0.134557743068365,0.134557743068365
-16907,5521,5744,0.134669392965434,0.134669392965434
-16908,5744,3224,0.133413468985769,0.133413468985769
-16909,3224,2456,0.134335811293817,0.134335811293817
-16910,2456,9365,0.137895860915298,0.137895860915298
-16911,9365,1677,0.134681074434199,0.134681074434199
-16912,1677,10027,0.135027096454707,0.135027096454707
-16913,10027,6891,0.134223449290887,0.134223449290887
-16914,6891,5239,0.133857055503606,0.133857055503606
-16915,5239,4520,0.134947645289316,0.134947645289316
-16916,4520,8229,0.133768415422039,0.133768415422039
-16917,8229,6091,0.136267738734572,0.136267738734572
-16918,6091,7927,0.0726325260844626,0.0726325260844626
-16919,7927,7846,0.0557691009082279,0.0557691009082279
-16920,7846,9410,0.0110872018563396,0.0110872018563396
-16921,9410,6730,0.0681749492551086,0.0681749492551086
-16922,6730,10028,0.0472579211328822,0.0472579211328822
-16923,10028,2954,0.0113307920442751,0.0113307920442751
-16924,2954,10029,0.0100409346238736,0.0100409346238736
-16925,10029,6168,0.125005736653953,0.125005736653953
-16926,6168,7701,0.0662611499745025,0.0662611499745025
-16927,7701,8987,0.0202942911891754,0.0202942911891754
-16928,8987,9213,0.01474166778393,0.01474166778393
-16929,9213,7708,0.0256851882115953,0.0256851882115953
-16930,7708,10030,0.0413405317485577,0.0413405317485577
-16931,10030,10031,0.036234422910969,0.036234422910969
-16932,10031,9423,0.0490701245377313,0.0490701245377313
-16934,10027,6419,0.132846643372958,0.132846643372958
-16935,6419,4626,0.132395451164353,0.132395451164353
-16936,4626,1249,0.132966501814055,0.132966501814055
-16937,1249,4558,0.132618380312988,0.132618380312988
-16938,4558,2727,0.131821083937229,0.131821083937229
-16939,2727,9343,0.133429127887654,0.133429127887654
-16941,8228,10032,0.0522172382940556,0.0522172382940556
-16942,10032,4519,0.0809723084454978,0.0809723084454978
-16943,4519,5238,0.135835767836828,0.135835767836828
-16944,5238,6890,0.133656501060031,0.133656501060031
-16945,6890,8682,0.133080513446367,0.133080513446367
-16946,8682,10033,0.014533820296874,0.014533820296874
-16947,10033,10034,0.045058130648326,0.045058130648326
-16948,10034,10035,0.0185816236497386,0.0185816236497386
-16949,10035,1675,0.0576680457580287,0.0576680457580287
-16950,1675,9364,0.135024432224183,0.135024432224183
-16955,10039,10040,0.0721995210382621,0.0721995210382621
-16958,10037,10041,0.0717852961267022,0.0717852961267022
-16966,10043,10031,0.025182886777608,0.025182886777608
-16969,10045,10039,0.0209823477511839,0.0209823477511839
-16971,8478,9438,0.0521271400869927,0.0521271400869927
-16972,9438,8905,0.0558565070780073,0.0558565070780073
-16974,8478,4846,0.326789742990523,0.326789742990523
-17070,9465,4599,0.173875508685798,0.173875508685798
-16976,8474,1065,0.0530498075975429,0.0530498075975429
-16977,1065,1604,0.0517738709202157,0.0517738709202157
-16978,1604,2199,0.109121538786623,0.109121538786623
-16979,2199,4846,0.101668961251418,0.101668961251418
-16981,8583,10046,0.0456665785984412,0.0456665785984412
-16982,10046,8467,0.0226345136731024,0.0226345136731024
-16983,8467,9624,0.0229241644266869,0.0229241644266869
-16985,2321,10047,0.097235186001144,0.097235186001144
-16987,4279,6406,0.146870704035985,0.146870704035985
-16988,6406,635,0.144187230253749,0.144187230253749
-16989,635,5325,0.14662773102424,0.14662773102424
-16990,5325,2031,0.146219173461136,0.146219173461136
-19672,10610,10608,0.149537813443153,0.149537813443153
-16991,2031,7082,0.144853503450252,0.144853503450252
-16992,7082,5509,0.146165117461088,0.146165117461088
-16993,5509,4460,0.146698487596664,0.146698487596664
-16994,4460,6579,0.146306787683811,0.146306787683811
-16995,6579,8050,0.147127627497255,0.147127627497255
-16996,8050,998,0.0663040704360148,0.0663040704360148
-16997,998,8404,0.225438240771773,0.225438240771773
-16998,8404,9322,0.147049060577026,0.147049060577026
-16999,9322,8853,0.146215405021224,0.146215405021224
-17000,8853,7901,0.148314641191611,0.148314641191611
-17001,7901,8294,0.139664345335099,0.139664345335099
-17002,8294,8275,0.153027219017765,0.153027219017765
-17003,8275,5787,0.145945595293254,0.145945595293254
-17004,5787,4818,0.144804477618788,0.144804477618788
-17005,4818,10048,0.148574277364319,0.148574277364319
-17006,10048,10049,0.141579838501947,0.141579838501947
-17007,10049,10050,0.0340492732837983,0.0340492732837983
-17012,10052,2402,0.196242393649725,0.196242393649725
-17032,8989,10060,0.00622693936167768,0.00622693936167768
-17033,10060,10061,0.0756461423573197,0.0756461423573197
-17034,10061,2960,0.00915137839377932,0.00915137839377932
-17036,9211,23,0.0239583762029722,0.0239583762029722
-17042,1225,7845,0.140995210775646,0.140995210775646
-17043,7845,6089,0.129051193087075,0.129051193087075
-17044,6089,8226,0.135326560563343,0.135326560563343
-17107,6692,328,0.0434519039634918,0.0434519039634918
-17046,1226,8903,0.113651762618459,0.113651762618459
-17048,10065,6628,1.29415946940766,1.29415946940766
-17050,10066,4340,0.062140618563636,0.062140618563636
-17051,4340,5636,0.138107358521106,0.138107358521106
-17052,5636,3565,0.143998480732308,0.143998480732308
-17053,3565,824,0.136450026224328,0.136450026224328
-17054,824,7840,0.139827641423356,0.139827641423356
-17055,7840,10067,0.139718785770158,0.139718785770158
-17056,10067,8131,0.276864248380317,0.276864248380317
-17058,2251,4883,0.177313835055438,0.177313835055438
-17059,4883,9473,0.195033286388948,0.195033286388948
-17060,9473,5482,0.176110607852179,0.176110607852179
-17187,10072,4065,0.107057267328692,0.107057267328692
-17188,4065,8344,0.135746766447532,0.135746766447532
-17189,8344,9289,0.134278993416053,0.134278993416053
-17190,9289,8342,0.133553201715071,0.133553201715071
-17191,8342,4289,0.132478531756059,0.132478531756059
-17192,4289,8346,0.0683305663670944,0.0683305663670944
-17193,8346,9426,0.0684183152680821,0.0684183152680821
-17194,9426,3584,0.0602567059919197,0.0602567059919197
-17195,3584,7710,0.0737335540738928,0.0737335540738928
-17196,7710,26,0.134781615428443,0.134781615428443
-17197,26,2966,0.136258381357618,0.136258381357618
-17256,4853,9479,0.17362135223772,0.17362135223772
-17257,9479,5456,0.178335939458279,0.178335939458279
-17258,5456,10081,0.171904914212928,0.171904914212928
-17259,10081,9468,0.0143846440391869,0.0143846440391869
-17260,9468,651,0.173171640777506,0.173171640777506
-17261,651,9463,0.177611656329381,0.177611656329381
-17262,9463,4619,0.178590206270819,0.178590206270819
-17263,4619,6483,0.145677633501431,0.145677633501431
-17264,6483,5356,0.195804224423801,0.195804224423801
-17272,3269,7248,0.202454633754466,0.202454633754466
-17273,7248,1925,0.201278474909205,0.201278474909205
-17274,1925,6124,0.199550873736161,0.199550873736161
-17275,6124,3214,0.201694321030812,0.201694321030812
-17277,8746,4263,0.201096167532594,0.201096167532594
-17278,4263,3522,0.200484985070532,0.200484985070532
-17279,3522,86,0.203786942061633,0.203786942061633
-17280,86,7311,0.202274691239897,0.202274691239897
-17313,8120,4330,0.101819432050732,0.101819432050732
-17314,4330,9933,0.0499862309964707,0.0499862309964707
-17315,9933,5036,0.0532026214375408,0.0532026214375408
-17316,5036,9934,0.0508858224299175,0.0508858224299175
-17317,9934,7989,0.0496485523816978,0.0496485523816978
-17318,7989,10087,0.0512786229284607,0.0512786229284607
-17319,10087,2893,0.052637962933787,0.052637962933787
-17320,2893,8384,0.104983198266762,0.104983198266762
-17321,8384,8544,0.106333933974543,0.106333933974543
-17322,8544,4732,0.104863197448763,0.104863197448763
-17323,4732,6799,0.109607467159477,0.109607467159477
-17325,7351,5397,0.105666168592591,0.105666168592591
-17326,5397,10067,0.0531956914071383,0.0531956914071383
-17327,10067,8558,0.0516135381916136,0.0516135381916136
-17328,8558,3899,0.109335032698536,0.109335032698536
-17329,3899,1035,0.101631825737619,0.101631825737619
-17330,1035,10070,0.0547697896222192,0.0547697896222192
-17331,10070,6274,0.051631982755097,0.051631982755097
-17332,6274,10071,0.0521047224845183,0.0521047224845183
-17333,10071,10088,0.0548081026494783,0.0548081026494783
-17334,10088,581,0.115692672611639,0.115692672611639
-17335,581,3544,1.0812915383048,1.0812915383048
-17336,3544,10089,0.426746641833072,0.426746641833072
-17337,10089,8702,0.015131733429425,0.015131733429425
-17338,8702,8151,0.097451189179214,0.097451189179214
-17340,1827,3084,0.201158270757163,0.201158270757163
-17341,3084,3196,0.201063388532037,0.201063388532037
-17342,3196,6111,0.203191571447184,0.203191571447184
-17343,6111,1904,0.198857964292004,0.198857964292004
-17344,1904,7240,0.195269710490606,0.195269710490606
-17345,7240,3253,0.196518038239943,0.196518038239943
-17347,10090,3086,0.200629327787617,0.200629327787617
-17348,3086,3198,0.202620201680719,0.202620201680719
-17349,3198,6113,0.202237159025195,0.202237159025195
-17350,6113,1907,0.200888583811516,0.200888583811516
-17351,1907,7242,0.194884252844044,0.194884252844044
-17352,7242,9217,0.00483789456398776,0.00483789456398776
-17353,9217,3256,0.188566052149982,0.188566052149982
-17354,3256,9215,0.0119202066492219,0.0119202066492219
-17355,9215,7298,0.204144558375252,0.204144558375252
-17356,7298,41,0.19415380637197,0.19415380637197
-17357,41,3541,0.205611824864656,0.205611824864656
-17358,3541,4237,0.201941106279095,0.201941106279095
-17359,4237,1797,0.206450634390855,0.206450634390855
-17360,1797,6524,0.103413068253841,0.103413068253841
-17377,9185,10092,0.0314361336881962,0.0314361336881962
-17384,10093,10094,0.234828178944131,0.234828178944131
-17401,4251,8740,0.200540582414647,0.200540582414647
-17403,10096,4253,0.402448073126268,0.402448073126268
-17404,4253,71,0.405085488859101,0.405085488859101
-17409,7246,3265,0.200993245572831,0.200993245572831
-17410,3265,7307,0.200743622516842,0.200743622516842
-17411,7307,77,0.204688793990349,0.204688793990349
-17413,10097,10082,0.0500367848211035,0.0500367848211035
-17415,10098,10099,0.0500389645311151,0.0500389645311151
-17416,10099,10082,0.0162280043989145,0.0162280043989145
-17418,10100,10101,0.0207018118679025,0.0207018118679025
-17430,10092,10048,0.0309885486655971,0.0309885486655971
-17431,10048,8614,0.0518778938210734,0.0518778938210734
-17432,8614,8472,0.0531907688732488,0.0531907688732488
-17433,8472,1066,0.0523689032311119,0.0523689032311119
-17434,1066,1606,0.051557001219416,0.051557001219416
-17435,1606,8366,0.139200065042292,0.139200065042292
-17437,6713,10092,0.0743345743256074,0.0743345743256074
-17441,3193,3081,0.201349842824614,0.201349842824614
-17442,3081,10108,0.178416289777232,0.178416289777232
-17444,3193,6109,0.202397968765167,0.202397968765167
-17445,6109,1899,0.201875824929032,0.201875824929032
-17446,1899,7237,0.199007784951822,0.199007784951822
-17447,7237,3247,0.203972993087409,0.203972993087409
-17449,10109,7288,0.156689817874906,0.156689817874906
-17450,7288,33,0.190916174685026,0.190916174685026
-17451,33,3532,0.205910894729705,0.205910894729705
-17452,3532,6522,0.0640042155752525,0.0640042155752525
-17454,3078,3192,0.201894846275699,0.201894846275699
-17455,3192,6108,0.201673919779454,0.201673919779454
-17456,6108,1898,0.20260827746412,0.20260827746412
-17457,1898,7236,0.20276033286578,0.20276033286578
-17458,7236,3246,0.202520180127379,0.202520180127379
-17459,3246,10110,0.0550544054800148,0.0550544054800148
-17460,10110,7286,0.154666066923182,0.154666066923182
-17461,7286,29,0.190176683040096,0.190176683040096
-17463,1900,7238,0.196467409698081,0.196467409698081
-17464,7238,3249,0.197271278467775,0.197271278467775
-17465,3249,7293,0.215893772854934,0.215893772854934
-17466,7293,35,0.191661158901488,0.191661158901488
-17467,35,3534,0.208592623812739,0.208592623812739
-17468,3534,6523,0.163291338158479,0.163291338158479
-17470,10108,5278,0.0774622106782589,0.0774622106782589
-17471,5278,3080,0.101220750760019,0.101220750760019
-17472,3080,3193,0.201400503113628,0.201400503113628
-17474,5940,471,0.312751802930415,0.312751802930415
-18580,7765,5716,0.0511772806374418,0.0511772806374418
-17491,10112,10093,0.359402757134602,0.359402757134602
-17492,10093,10113,0.194903624807864,0.194903624807864
-17493,10113,2201,0.0582804268216835,0.0582804268216835
-17494,2201,10114,0.186967502007765,0.186967502007765
-17495,10114,8390,0.0733141120559894,0.0733141120559894
-17496,8390,10115,0.462273198293161,0.462273198293161
-17498,9631,400,0.267469433354519,0.267469433354519
-17531,10127,4931,0.0143150280274793,0.0143150280274793
-17499,400,10116,0.288854082427149,0.288854082427149
-17500,10116,10117,0.226779392941661,0.226779392941661
-17539,8982,8937,0.19614593492264,0.19614593492264
-17501,10117,10118,0.252256323985904,0.252256323985904
-17502,10118,8413,0.301706026949727,0.301706026949727
-17504,10094,9835,0.207906613588927,0.207906613588927
-17542,10131,10132,0.234004969584105,0.234004969584105
-17547,8426,8983,0.15801309875704,0.15801309875704
-17550,10130,10134,0.614829488291655,0.614829488291655
-17551,7135,4849,0.106906878995063,0.106906878995063
-17552,4849,915,0.103932392061615,0.103932392061615
-17553,915,2299,0.103080430089244,0.103080430089244
-17554,2299,10137,0.014910815675823,0.014910815675823
-17556,10137,9054,0.0810396295718394,0.0810396295718394
-17558,10138,6943,0.064892686762443,0.064892686762443
-17559,6943,8140,0.201702874937987,0.201702874937987
-17560,8140,10139,0.469612869716675,0.469612869716675
-17562,7137,211,0.0939410437080962,0.0939410437080962
-17563,211,480,0.0535285680999835,0.0535285680999835
-17598,6899,5259,0.128421696790864,0.128421696790864
-17566,8539,10140,0.135369629803794,0.135369629803794
-17568,10141,10142,0.0931846548427409,0.0931846548427409
-17575,10147,10148,0.0907607828573939,0.0907607828573939
-17576,10148,9823,0.350917184183612,0.350917184183612
-17577,9823,9805,0.0148959688810153,0.0148959688810153
-17578,9805,10149,0.0247571116201832,0.0247571116201832
-17579,10149,8243,0.229215025506836,0.229215025506836
-17580,8243,9502,0.0511227471188157,0.0511227471188157
-17581,9502,7326,0.0563854594047154,0.0563854594047154
-17582,7326,5762,0.0999481200631645,0.0999481200631645
-17583,5762,7873,0.0518041802099649,0.0518041802099649
-17584,7873,10150,0.102000136506063,0.102000136506063
-17585,10150,5014,0.098101103191891,0.098101103191891
-17586,5014,5058,0.089850875454823,0.089850875454823
-18718,7866,4048,0.178217561946718,0.178217561946718
-17587,5058,10151,0.211959888507267,0.211959888507267
-17589,215,9282,0.125167866609679,0.125167866609679
-17591,213,9816,0.299047510838406,0.299047510838406
-17593,9229,9826,0.176982927136907,0.176982927136907
-17595,6940,10152,0.0583015149781026,0.0583015149781026
-18120,6030,10257,0.0455676937571294,0.0455676937571294
-17597,5060,6899,0.402535335538281,0.402535335538281
-17599,5259,2791,0.130368767280199,0.130368767280199
-17600,2791,4469,0.135446736738612,0.135446736738612
-17601,4469,884,0.138505584507757,0.138505584507757
-17602,884,1164,0.139078051750381,0.139078051750381
-17603,1164,9871,0.139057579408235,0.139057579408235
-17604,9871,8075,0.138249096495162,0.138249096495162
-17605,8075,10153,0.00462704346608534,0.00462704346608534
-17606,10153,3043,0.14110788802663,0.14110788802663
-17607,3043,6341,0.135895639019006,0.135895639019006
-17608,6341,4343,0.137400774019599,0.137400774019599
-17609,4343,5639,0.138956387861239,0.138956387861239
-17610,5639,3570,0.141821620771527,0.141821620771527
-17611,3570,830,0.137661147763222,0.137661147763222
-17612,830,7843,0.140550687821679,0.140550687821679
-17613,7843,10088,0.137593188904098,0.137593188904098
-17614,10088,9941,0.137660243266343,0.137660243266343
-17615,9941,8135,0.139584464123887,0.139584464123887
-17616,8135,3690,0.141707714550209,0.141707714550209
-17617,3690,4596,0.241404416022683,0.241404416022683
-17619,5016,3319,0.0948083090873271,0.0948083090873271
-17620,3319,8996,0.0798486506362173,0.0798486506362173
-17621,8996,7874,0.0190759275307072,0.0190759275307072
-17622,7874,5755,0.0623471034770475,0.0623471034770475
-17623,5755,5758,0.0361266791563275,0.0361266791563275
-17624,5758,7327,0.0520708883616353,0.0520708883616353
-17626,5016,10154,0.164101634929309,0.164101634929309
-17627,10155,2882,0.710681950052773,0.710681950052773
-17629,8136,6947,0.130119100803365,0.130119100803365
-17630,6947,10156,0.0163542378359644,0.0163542378359644
-17631,10156,10157,0.00955659663824098,0.00955659663824098
-17632,10157,10158,0.00677541465471327,0.00677541465471327
-17633,10158,10152,0.00293705056146173,0.00293705056146173
-17634,10152,6939,0.0371287028604903,0.0371287028604903
-17636,3318,10150,0.0438638328395073,0.0438638328395073
-17714,9945,8394,0.147641485758692,0.147641485758692
-17659,10160,586,0.405583280940818,0.405583280940818
-17672,10163,8930,0.930392444069162,0.930392444069162
-17675,9053,10164,0.0371557833436508,0.0371557833436508
-17693,2913,2780,0.0748123840669465,0.0748123840669465
-17694,2780,7147,0.116677483921202,0.116677483921202
-17696,9056,10047,0.141134759881648,0.141134759881648
-17698,7147,5254,0.0284105210258417,0.0284105210258417
-17699,5254,10166,0.132906284217118,0.132906284217118
-17701,6403,10167,0.108541157226703,0.108541157226703
-17703,6403,6401,0.049228330409525,0.049228330409525
-17705,10168,10169,0.0501555453420122,0.0501555453420122
-17707,10047,10169,0.0474349977604191,0.0474349977604191
-17708,10169,9056,0.0939811582148226,0.0939811582148226
-17710,9947,3675,0.0669754214474556,0.0669754214474556
-17712,9204,9945,0.144775125391256,0.144775125391256
-17715,8394,2691,0.147869553829969,0.147869553829969
-17716,2691,8040,0.145836065451416,0.145836065451416
-17717,8040,6567,0.144877875233717,0.144877875233717
-17718,6567,4448,0.14778294563884,0.14778294563884
-17719,4448,8414,0.0749502518363333,0.0749502518363333
-17720,8414,5496,0.069451420913351,0.069451420913351
-17721,5496,7070,0.148876703091943,0.148876703091943
-17722,7070,2040,0.14567151330703,0.14567151330703
-17723,2040,8073,0.130264739930752,0.130264739930752
-17725,8076,3328,0.0639927694114461,0.0639927694114461
-17728,7879,7332,0.105697567981392,0.105697567981392
-17730,2080,2677,0.104069678874741,0.104069678874741
-17731,2677,4126,0.107112553379611,0.107112553379611
-17732,4126,6682,0.108353172096875,0.108353172096875
-17734,7925,5320,0.0826824039230849,0.0826824039230849
-17735,5320,2041,0.146468953410165,0.146468953410165
-17736,2041,7072,0.146479190259677,0.146479190259677
-17737,7072,5498,0.148482454254276,0.148482454254276
-17738,5498,4450,0.145207190897223,0.145207190897223
-17739,4450,6569,0.147094399400618,0.147094399400618
-17740,6569,8042,0.145385409804858,0.145385409804858
-17741,8042,2693,0.146247210391541,0.146247210391541
-17742,2693,8396,0.145676314519276,0.145676314519276
-17743,8396,9946,0.148129197746433,0.148129197746433
-17744,9946,9324,0.145860656071838,0.145860656071838
-17745,9324,10171,0.0856023563285992,0.0856023563285992
-17746,10171,7893,0.060719319188507,0.060719319188507
-17747,7893,10172,0.145992330998255,0.145992330998255
-17749,8285,5779,0.146744468691812,0.146744468691812
-17750,5779,8575,0.145685998707777,0.145685998707777
-17752,6706,10173,0.0983542102154105,0.0983542102154105
-17754,8485,10174,0.145917669946454,0.145917669946454
-17755,10174,4934,0.364858401137942,0.364858401137942
-17757,8073,5319,0.0151134525874084,0.0151134525874084
-17758,5319,2906,0.0542680076543073,0.0542680076543073
-17760,9487,1173,0.143948575233632,0.143948575233632
-17761,1173,893,0.138648954033686,0.138648954033686
-17762,893,4476,0.138420042799995,0.138420042799995
-17763,4476,2799,0.139158608638433,0.139158608638433
-17764,2799,5267,0.125667753140422,0.125667753140422
-17765,5267,6904,0.122725840536987,0.122725840536987
-17766,6904,7758,0.206944002479267,0.206944002479267
-17767,7758,6358,0.203735904589123,0.203735904589123
-17768,6358,2391,0.110758482838084,0.110758482838084
-17769,2391,7822,0.137036631860385,0.137036631860385
-17771,9877,903,0.274330614761652,0.274330614761652
-17772,903,9481,0.129817379023696,0.129817379023696
-17775,5984,2102,0.100487934544075,0.100487934544075
-17776,2102,6508,0.243143603771944,0.243143603771944
-17778,6993,399,0.279873647693424,0.279873647693424
-17779,399,10175,0.059173942672277,0.059173942672277
-17780,10175,6196,0.0719242777998184,0.0719242777998184
-17782,6196,10175,0.0719242777998184,0.0719242777998184
-17784,10175,10177,0.187235722056553,0.187235722056553
-17789,998,8512,0.0641582208600105,0.0641582208600105
-17790,8512,3305,0.0698159988608895,0.0698159988608895
-17802,9953,10171,0.0758245915635617,0.0758245915635617
-17803,10171,8417,0.0691188092256886,0.0691188092256886
-17804,8417,7892,0.0154287387029138,0.0154287387029138
-17805,7892,9203,0.0639309073349984,0.0639309073349984
-17844,5741,5515,0.1393794725611,0.1393794725611
-17807,998,2698,0.471311768879255,0.471311768879255
-17809,2563,997,0.102700798846865,0.102700798846865
-17811,9490,10181,0.787839518624737,0.787839518624737
-17813,10182,10183,0.017972037737444,0.017972037737444
-17814,8277,10182,0.0269375538426571,0.0269375538426571
-17824,10189,9815,0.381548994115635,0.381548994115635
-17826,10190,2445,0.108497544218855,0.108497544218855
-17827,2445,3235,0.140113229632804,0.140113229632804
-17828,3235,5740,0.13721905173768,0.13721905173768
-17829,5740,5514,0.142685575827079,0.142685575827079
-17830,5514,6451,0.135469883258712,0.135469883258712
-17831,6451,6918,0.118104639956123,0.118104639956123
-17832,6918,8114,0.200145379388081,0.200145379388081
-17841,10191,2446,0.12170288352426,0.12170288352426
-17842,2446,3236,0.138990302772576,0.138990302772576
-17843,3236,5741,0.138828799197264,0.138828799197264
-17845,5515,6452,0.137212079229824,0.137212079229824
-17846,6452,6919,0.118102418388258,0.118102418388258
-17847,6919,8115,0.204539971673672,0.204539971673672
-17848,8115,2817,0.195950897476267,0.195950897476267
-17850,1418,10192,0.0403415193863986,0.0403415193863986
-17854,10196,10197,0.298773764193864,0.298773764193864
-17858,10197,10201,0.0878537760845695,0.0878537760845695
-17859,10202,292,0.12590153135235,0.12590153135235
-17860,292,10203,0.0920635687067585,0.0920635687067585
-17862,8296,912,0.421752257927472,0.421752257927472
-17863,912,7280,0.346969669094077,0.346969669094077
-17865,7279,911,0.343598202777143,0.343598202777143
-17866,911,8296,0.421457000722742,0.421457000722742
-17899,10211,10209,0.112127267328736,0.112127267328736
-17868,10204,293,0.122668884457017,0.122668884457017
-17870,7280,10204,0.11154380602626,0.11154380602626
-17872,7280,10202,0.113468069847095,0.113468069847095
-17874,10203,305,0.0245172766294025,0.0245172766294025
-17876,10205,9191,0.0917966102805814,0.0917966102805814
-17877,9191,9065,0.0437309955207218,0.0437309955207218
-17879,305,7972,0.0096955565592884,0.0096955565592884
-17880,7972,289,0.0364664216753188,0.0364664216753188
-17882,291,10205,0.0247656280633611,0.0247656280633611
-17884,5356,3010,0.0411976507153233,0.0411976507153233
-17885,3010,9955,0.055133452370554,0.055133452370554
-17887,4390,9202,0.103596100254428,0.103596100254428
-17888,9202,10172,0.106228487315193,0.106228487315193
-17889,10172,8635,0.104885206719794,0.104885206719794
-17890,8635,10207,0.0526738998782486,0.0526738998782486
-17891,10207,8290,0.0540408904782361,0.0540408904782361
-17893,10181,10208,0.34674805442663,0.34674805442663
-17895,9277,9062,0.54179107306149,0.54179107306149
-17897,10209,10210,0.15255018083046,0.15255018083046
-17901,9277,10208,0.265946775924501,0.265946775924501
-17902,10208,10211,0.215451375996435,0.215451375996435
-17904,4431,5085,0.143171262303537,0.143171262303537
-17905,5085,2810,0.11012443165944,0.11012443165944
-17906,2810,4675,0.158582360684903,0.158582360684903
-17908,10212,9184,0.112885017008347,0.112885017008347
-17909,9184,10213,0.167377068446941,0.167377068446941
-18960,10410,7220,0.0501782415904674,0.0501782415904674
-17922,6563,8888,0.042430320182906,0.042430320182906
-18662,7647,10214,0.0701815380438801,0.0701815380438801
-17924,6563,9296,0.044068382651895,0.044068382651895
-17926,10215,7090,0.0147548324313622,0.0147548324313622
-17928,10216,4749,0.0152354550229313,0.0152354550229313
-17930,7570,10217,0.020843135953545,0.020843135953545
-17931,10217,10218,0.00309719141124637,0.00309719141124637
-17932,10218,10219,0.0172058483004327,0.0172058483004327
-17933,10219,10220,0.0101474090092483,0.0101474090092483
-17934,10220,10221,0.0360135260366549,0.0360135260366549
-17972,4922,2816,0.0400924263132539,0.0400924263132539
-17974,2816,6585,0.00731734573972315,0.00731734573972315
-17975,6585,5367,0.200230086509337,0.200230086509337
-17976,5367,7125,0.155428268463703,0.155428268463703
-17977,7125,613,0.178580861083004,0.178580861083004
-17978,613,10025,0.175711834233665,0.175711834233665
-17979,10025,5802,0.173776139007193,0.173776139007193
-17981,10240,4687,0.0705066389488715,0.0705066389488715
-17983,4687,4687,0.000550727458732684,0.000550727458732684
-17984,4687,4687,0.000550727458732684,0.000550727458732684
-18009,8002,984,0.100041012213977,0.100041012213977
-17985,4687,10240,0.0700034048729296,0.0700034048729296
-18666,5656,5188,0.106406434125344,0.106406434125344
-17988,7225,10241,0.0510702903225008,0.0510702903225008
-17989,10241,10242,0.042886354540747,0.042886354540747
-17990,10242,10243,0.00251406456949564,0.00251406456949564
-17991,10243,10244,0.0456685462506317,0.0456685462506317
-17992,10244,6646,0.0418628731234282,0.0418628731234282
-17993,6646,10245,0.0664019508555837,0.0664019508555837
-17994,10245,3947,0.060646848519195,0.060646848519195
-17995,3947,5379,0.0623892176423501,0.0623892176423501
-17997,1213,10080,0.0402726084737909,0.0402726084737909
-17998,10080,10246,0.108362052771117,0.108362052771117
-17999,10246,10095,0.0546330327153493,0.0546330327153493
-18000,10095,8786,0.0549646837479,0.0549646837479
-18001,8786,8792,0.105830391023483,0.105830391023483
-18002,8792,3158,0.105240490373796,0.105240490373796
-18159,4090,6035,0.19402761072914,0.19402761072914
-18003,3158,4977,0.10185576028858,0.10185576028858
-18004,4977,10247,0.0996051433548501,0.0996051433548501
-18005,10247,9657,0.103966153648075,0.103966153648075
-18006,9657,6607,0.0489689324196462,0.0489689324196462
-18007,6607,5049,0.0497044916016373,0.0497044916016373
-18008,5049,8002,0.0987213073079673,0.0987213073079673
-18010,984,5105,0.0497125648622764,0.0497125648622764
-18011,5105,8832,0.0485496698653307,0.0485496698653307
-18012,8832,9412,0.0501680163419149,0.0501680163419149
-18013,9412,7150,0.0490112280018507,0.0490112280018507
-18014,7150,2798,0.0490643527188194,0.0490643527188194
-18015,2798,5116,0.0499797709026575,0.0499797709026575
-18016,5116,9330,0.049524695482998,0.049524695482998
-18017,9330,4715,0.0504823610322626,0.0504823610322626
-18018,4715,8873,0.0985202776506121,0.0985202776506121
-18019,8873,7354,0.0991107696717597,0.0991107696717597
-18020,7354,5413,0.108951695628557,0.108951695628557
-18022,8149,8697,0.098981334337126,0.098981334337126
-18023,8697,10248,0.0156545770448285,0.0156545770448285
-18025,10248,7104,0.0902072497093339,0.0902072497093339
-18026,7104,449,0.046531670732617,0.046531670732617
-18027,449,854,0.0445732430501775,0.0445732430501775
-18028,854,10249,0.0446596776858281,0.0446596776858281
-18029,10249,9698,0.0482515561513205,0.0482515561513205
-18030,9698,10250,0.0474036186605965,0.0474036186605965
-18031,10250,6018,0.047797038051314,0.047797038051314
-18032,6018,10251,0.0473952539943275,0.0473952539943275
-18033,10251,3455,0.0464887102201997,0.0464887102201997
-18034,3455,7682,0.0950045363584629,0.0950045363584629
-19711,10628,10629,0.0313669947000456,0.0313669947000456
-18035,7682,8018,0.0938092255843609,0.0938092255843609
-18036,8018,6695,0.0944228486315978,0.0944228486315978
-18037,6695,4132,0.0905761672491303,0.0905761672491303
-18727,7644,9832,0.176300161007389,0.176300161007389
-18729,6212,7649,0.275730709453964,0.275730709453964
-18038,4132,8863,0.0309494848264702,0.0309494848264702
-18039,8863,2633,0.0676202306028496,0.0676202306028496
-18040,2633,8861,0.0311034897002001,0.0311034897002001
-18041,8861,2052,0.0676910103216562,0.0676910103216562
-18042,2052,8871,0.0313177900642343,0.0313177900642343
-18043,8871,7982,0.067271802615166,0.067271802615166
-18044,7982,7981,0.0326778162339826,0.0326778162339826
-18045,7981,7321,0.0976461329299173,0.0976461329299173
-18046,7321,7887,0.0987923725207189,0.0987923725207189
-18047,7887,3343,0.0990941084892765,0.0990941084892765
-18048,3343,5022,0.0986991080291596,0.0986991080291596
-18049,5022,8729,0.0995709770506032,0.0995709770506032
-18050,8729,6262,0.0984844587143486,0.0984844587143486
-18051,6262,1012,0.100435040495632,0.100435040495632
-18052,1012,3920,0.0983845018704443,0.0983845018704443
-18053,3920,3146,0.0986126436689597,0.0986126436689597
-18054,3146,5413,0.0895267655685447,0.0895267655685447
-18056,7083,10246,0.183851267240735,0.183851267240735
-19713,10624,10625,0.048946191319968,0.048946191319968
-18057,10246,3811,0.198873820859187,0.198873820859187
-18058,3811,5919,0.153816946395634,0.153816946395634
-18059,5919,918,0.176756350909337,0.176756350909337
-18060,918,2205,0.200653782293274,0.200653782293274
-18061,2205,4854,0.158832380963048,0.158832380963048
-18062,4854,9478,0.174098421618631,0.174098421618631
-18063,9478,5457,0.176480352381434,0.176480352381434
-18065,10252,9243,0.056682383190515,0.056682383190515
-18067,9110,10252,0.0330932350677699,0.0330932350677699
-18069,10253,6203,0.215345161639468,0.215345161639468
-18071,9115,10254,0.0491155354462148,0.0491155354462148
-18075,10254,10255,0.0642041289943666,0.0642041289943666
-18076,10255,10253,0.0461489416178021,0.0461489416178021
-18077,10253,9108,0.280904320228077,0.280904320228077
-18106,4661,10263,0.0487469518611321,0.0487469518611321
-18107,10263,1291,0.0497384845482417,0.0497384845482417
-18108,1291,10264,0.0496989025904687,0.0496989025904687
-18109,10264,4563,0.0505706606603651,0.0505706606603651
-18110,4563,10265,0.0486836289638941,0.0486836289638941
-18111,10265,6287,0.0497296125808977,0.0497296125808977
-18112,6287,10135,0.0504212055729903,0.0504212055729903
-18113,10135,2731,0.0489350482169507,0.0489350482169507
-18114,2731,6420,0.048465461986869,0.048465461986869
-18115,6420,5790,0.0578817224647719,0.0578817224647719
-18117,8844,10266,0.374943168729483,0.374943168729483
-18166,2719,9346,0.101115603929332,0.101115603929332
-18167,9346,9392,0.0111914858812043,0.0111914858812043
-18168,9392,3751,0.0968414516342271,0.0968414516342271
-18169,3751,10278,0.0782538471461698,0.0782538471461698
-18175,4073,6058,0.198316836648763,0.198316836648763
-18176,6058,5798,0.200796475018558,0.200796475018558
-18197,6750,5252,0.185979531851002,0.185979531851002
-18198,5252,3974,0.035323188020151,0.035323188020151
-18200,9357,2431,0.202519432604137,0.202519432604137
-18201,2431,9370,0.199383622965617,0.199383622965617
-18202,9370,1686,0.206118508992277,0.206118508992277
-18203,1686,6875,0.204292305654176,0.204292305654176
-18588,6666,1137,0.0495387040987843,0.0495387040987843
-18589,1137,6968,0.0501615414722825,0.0501615414722825
-18590,6968,7504,0.0501273333828588,0.0501273333828588
-18591,7504,9407,0.0988444534637431,0.0988444534637431
-18592,9407,7479,0.0538727285881741,0.0538727285881741
-18593,7479,5581,0.0510099428615072,0.0510099428615072
-18594,5581,10328,0.0992130715738959,0.0992130715738959
-18595,10328,10329,0.693578278671619,0.693578278671619
-18597,1845,2579,0.175048810960168,0.175048810960168
-18598,2579,5177,0.17911429796522,0.17911429796522
-18599,5177,10332,0.0225943601934419,0.0225943601934419
-18604,6211,7648,0.275618961394926,0.275618961394926
-18605,7648,8065,0.262676196305861,0.262676196305861
-18711,2590,5183,0.178568260386205,0.178568260386205
-18712,5183,5651,0.104244503206479,0.104244503206479
-18747,6210,10338,0.0125158344567017,0.0125158344567017
-18748,10338,10206,0.0559739547988456,0.0559739547988456
-18749,10206,10338,0.0559739547988456,0.0559739547988456
-18751,2596,5186,0.177768815603995,0.177768815603995
-18758,2588,5182,0.176322049262719,0.176322049262719
-18759,5182,5650,0.106248688527315,0.106248688527315
-18765,10339,10341,0.0322810460432902,0.0322810460432902
-18767,4492,10342,0.0173161946805903,0.0173161946805903
-18768,10342,10341,0.00848220864637094,0.00848220864637094
-18770,5616,10343,0.00845077111169589,0.00845077111169589
-18771,10343,10344,0.0509950035054565,0.0509950035054565
-18772,10344,9634,0.100553817919852,0.100553817919852
-18950,6234,7639,0.179364622734642,0.179364622734642
-18789,10350,10131,1.72659496196287,1.72659496196287
-18791,10210,10350,0.0784105528331039,0.0784105528331039
-18793,9064,10351,0.108141289805084,0.108141289805084
-18795,10351,8944,0.165792281012932,0.165792281012932
-18797,8946,8970,0.101566925839608,0.101566925839608
-18805,431,8911,0.368100622266312,0.368100622266312
-18807,8935,10353,0.0653020622045421,0.0653020622045421
-18865,217,6354,0.250152442533131,0.250152442533131
-18867,10372,10373,0.00433033984408308,0.00433033984408308
-18809,2956,8964,0.839971785186466,0.839971785186466
-18811,10353,8914,0.0131507104865587,0.0131507104865587
-18813,10354,8436,0.0634565167907247,0.0634565167907247
-18815,8440,10354,0.130317184994069,0.130317184994069
-18818,8431,4422,0.07184295360215,0.07184295360215
-18820,8435,10355,0.137076541565926,0.137076541565926
-18825,9181,10356,0.159461421615407,0.159461421615407
-18827,10357,10358,0.20146281055654,0.20146281055654
-18829,9180,10359,0.028613707454695,0.028613707454695
-18833,10360,10361,0.0535066603860974,0.0535066603860974
-18835,10361,10362,0.0845690343766548,0.0845690343766548
-18836,10362,9179,0.0218653086870073,0.0218653086870073
-19605,10512,10584,0.0688213399515618,0.0688213399515618
-20576,10864,10865,0.0279630258161778,0.0279630258161778
-18838,10363,8434,0.438288246661524,0.438288246661524
-18840,8433,10364,0.0515496120111284,0.0515496120111284
-18842,10365,10363,0.0256601639624377,0.0256601639624377
-18844,10364,10365,0.0354783965202197,0.0354783965202197
-18848,10367,8387,0.416611762681733,0.416611762681733
-18850,10366,10367,0.0267687636085769,0.0267687636085769
-18852,10368,10369,0.0527715034881913,0.0527715034881913
-18854,10370,10368,0.0348446889076446,0.0348446889076446
-18856,10371,10370,0.031482834490968,0.031482834490968
-18858,9836,10370,0.0328670117804623,0.0328670117804623
-18921,10399,10400,0.0895277934361984,0.0895277934361984
-18922,10400,10401,0.16717380860502,0.16717380860502
-18923,10402,10383,0.0291115464827756,0.0291115464827756
-18924,10383,10403,0.0309778660865677,0.0309778660865677
-18925,10403,10390,0.0429604527526701,0.0429604527526701
-18927,10404,10405,0.0626862314087788,0.0626862314087788
-18930,10406,10405,0.108269005965165,0.108269005965165
-18932,1241,6737,0.0570520014832054,0.0570520014832054
-18934,8100,6923,0.164900679548878,0.164900679548878
-18936,6923,8099,0.163064822440362,0.163064822440362
-18938,7928,8098,0.0730856765280865,0.0730856765280865
-18940,4039,4644,0.0827836448037734,0.0827836448037734
-18943,10407,7448,0.103189406011465,0.103189406011465
-19852,10659,3379,0.102335766847439,0.102335766847439
-18945,4142,10108,0.0206474020512083,0.0206474020512083
-18947,5674,2620,0.178145491343884,0.178145491343884
-18948,2620,5201,0.177501253416424,0.177501253416424
-18949,5201,6234,0.174487220572856,0.174487220572856
-18951,7639,8773,0.176238488140281,0.176238488140281
-18952,8773,8053,0.178917033730472,0.178917033730472
-18953,8053,6598,0.176988972177145,0.176988972177145
-18954,6598,10243,0.175681180141988,0.175681180141988
-18956,1841,7856,0.0582284853716934,0.0582284853716934
-18957,7856,4669,0.101085168807405,0.101085168807405
-18979,1764,4509,0.0491583937075752,0.0491583937075752
-18980,4509,4971,0.0991296803100638,0.0991296803100638
-18981,4971,1516,0.0482432726972035,0.0482432726972035
-18982,1516,5304,0.0536166306041211,0.0536166306041211
-18983,5304,7951,0.0505628420768163,0.0505628420768163
-18984,7951,7950,0.0124795676036534,0.0124795676036534
-18985,7950,1083,0.0132964314605761,0.0132964314605761
-18986,1083,8958,0.019091432638578,0.019091432638578
-18987,8958,1750,0.0565301426139895,0.0565301426139895
-18988,1750,6636,0.100698502633469,0.100698502633469
-18989,6636,5425,0.0992142460676437,0.0992142460676437
-18990,5425,7398,0.100582854167636,0.100582854167636
-18992,5674,10413,0.0446816032988726,0.0446816032988726
-18993,10413,6641,0.0419959523464037,0.0419959523464037
-18994,6641,3958,0.140215488391596,0.140215488391596
-18997,9265,10213,0.108979878639585,0.108979878639585
-19957,10683,10676,0.203409384148671,0.203409384148671
-18998,10213,9182,0.221716360786737,0.221716360786737
-18999,9182,4360,0.00485021965067944,0.00485021965067944
-19000,4360,6082,0.123504109096694,0.123504109096694
-19240,10459,8221,0.147319836582293,0.147319836582293
-19002,1269,4533,0.203350040591983,0.203350040591983
-19003,4533,8579,0.198512187124204,0.198512187124204
-19005,1841,2613,0.177111353706323,0.177111353706323
-19006,2613,10414,0.0530626159965885,0.0530626159965885
-19007,10414,5196,0.124494794308613,0.124494794308613
-19008,5196,6239,0.171651899926933,0.171651899926933
-19010,4186,4182,0.0154308679587021,0.0154308679587021
-19011,4182,3367,0.101326829934178,0.101326829934178
-19012,3367,3370,0.0389167828857067,0.0389167828857067
-19013,3370,10415,0.0493793417329401,0.0493793417329401
-19014,10415,7424,0.0519282840216647,0.0519282840216647
-19015,7424,10416,0.0508505433229276,0.0508505433229276
-19016,10416,7831,0.0497300351350067,0.0497300351350067
-19017,7831,9197,0.188452322853961,0.188452322853961
-19019,5549,10417,0.0198343104325793,0.0198343104325793
-19020,10417,2562,0.366597076665755,0.366597076665755
-19021,2562,9783,0.236171353579108,0.236171353579108
-19022,9783,9781,0.00643634199106272,0.00643634199106272
-19958,10676,10668,0.135367639799285,0.135367639799285
-19023,9781,9160,0.00367738923970995,0.00367738923970995
-19025,9156,9260,0.0939135311905937,0.0939135311905937
-19040,10419,435,0.0296899237003876,0.0296899237003876
-19042,6361,6912,0.413025051484806,0.413025051484806
-19043,6912,5272,0.122458972713872,0.122458972713872
-19044,5272,2806,0.132101617817113,0.132101617817113
-19045,2806,9480,0.135002111088791,0.135002111088791
-19046,9480,901,0.134968752710231,0.134968752710231
-19048,9486,9873,0.018915562611857,0.018915562611857
-19049,9873,3055,0.182137362251337,0.182137362251337
-19050,3055,9669,0.205422822851571,0.205422822851571
-19051,9669,4352,0.202508200405289,0.202508200405289
-19052,4352,7924,0.0557579828978423,0.0557579828978423
-19053,7924,7923,0.106391305814005,0.106391305814005
-19054,7923,3580,0.0580075342624614,0.0580075342624614
-19055,3580,788,0.184224770380015,0.184224770380015
-19056,788,10089,0.199795465587569,0.199795465587569
-19057,10089,491,0.20084069572648,0.20084069572648
-19058,491,489,0.205477824650125,0.205477824650125
-19059,489,4589,0.272976340428597,0.272976340428597
-19060,4589,1978,0.12991989572877,0.12991989572877
-19061,1978,1994,0.0147512164813181,0.0147512164813181
-19062,1994,705,0.187141061542779,0.187141061542779
-19063,705,642,0.0623803538473296,0.0623803538473296
-19064,642,10422,0.140896965982946,0.140896965982946
-19067,9469,4898,0.180547202392339,0.180547202392339
-19068,4898,4899,0.0469687370152221,0.0469687370152221
-19069,4899,9422,0.11449972298661,0.11449972298661
-19070,9422,2230,0.0888113879114828,0.0888113879114828
-19071,2230,961,0.0851419553312056,0.0851419553312056
-19072,961,5943,0.118166848545009,0.118166848545009
-19073,5943,8869,0.0594604755013997,0.0594604755013997
-19074,8869,3766,0.149125823202066,0.149125823202066
-19075,3766,10248,0.200641473563849,0.200641473563849
-19076,10248,1211,0.0471365210908597,0.0471365210908597
-19077,1211,8567,0.147435833594552,0.147435833594552
-19078,8567,6541,0.161851618274563,0.161851618274563
-19079,6541,4746,0.176177241775495,0.176177241775495
-19081,4159,2359,0.17021782028236,0.17021782028236
-19082,2359,9694,0.178145500592375,0.178145500592375
-19083,9694,5170,0.174004040417809,0.174004040417809
-19085,6362,6447,0.0914589915157797,0.0914589915157797
-19086,6447,2399,0.0149004167256546,0.0149004167256546
-19087,2399,9454,0.2205749898237,0.2205749898237
-19089,519,831,0.121986604363099,0.121986604363099
-19090,831,10147,0.141772461765667,0.141772461765667
-19091,10147,10428,0.0119979325853114,0.0119979325853114
-19093,8145,9501,0.0198122134799104,0.0198122134799104
-19094,9501,1751,0.0440125388452957,0.0440125388452957
-19095,1751,6012,0.168131959250809,0.168131959250809
-19096,6012,832,0.205336624614562,0.205336624614562
-19097,832,518,0.168135736431663,0.168135736431663
-19098,518,6513,0.0279910233322091,0.0279910233322091
-19099,6513,10419,0.0139795197071191,0.0139795197071191
-19102,10049,8612,0.0522928783615643,0.0522928783615643
-19103,8612,8474,0.0521996072275175,0.0521996072275175
-19142,5220,8777,0.146640601075408,0.146640601075408
-19105,10430,10358,0.245136281681027,0.245136281681027
-19108,5628,9568,0.110078124608504,0.110078124608504
-19110,8421,10357,0.296407311680596,0.296407311680596
-19114,2386,9558,0.0348995825647377,0.0348995825647377
-19115,9558,8798,0.125658984531748,0.125658984531748
-19120,8185,9450,0.339524971346509,0.339524971346509
-19121,9450,8690,0.0176125961717604,0.0176125961717604
-19122,8690,7659,0.0477249226862614,0.0477249226862614
-19123,7659,6718,0.103225505465316,0.103225505465316
-19125,2190,8128,0.151455687504874,0.151455687504874
-19126,8128,7827,0.106341251390527,0.106341251390527
-19127,7827,10432,0.221434541654845,0.221434541654845
-19128,10432,6961,0.0131395719721806,0.0131395719721806
-19129,6961,10433,0.0134328380462519,0.0134328380462519
-19130,10433,10434,0.0869062764565781,0.0869062764565781
-19131,10434,8597,0.00983583049657532,0.00983583049657532
-19132,8597,10435,0.0222534876112211,0.0222534876112211
-19134,10050,3168,0.0821216282435351,0.0821216282435351
-19141,7961,5220,0.0901667996290929,0.0901667996290929
-19144,8388,10437,0.320984694668417,0.320984694668417
-19146,10437,6962,0.186002986440568,0.186002986440568
-19147,6962,10438,0.0184374963317956,0.0184374963317956
-19148,10438,1881,0.209774050468257,0.209774050468257
-19149,1881,8569,0.224745848084877,0.224745848084877
-19150,8569,9988,0.0831717180377924,0.0831717180377924
-19151,9988,8477,0.0648356679758423,0.0648356679758423
-19152,8477,8463,0.0835421546655635,0.0835421546655635
-19960,9517,10684,0.210192276965542,0.210192276965542
-19154,8800,8811,0.31904932389546,0.31904932389546
-19162,10428,3871,0.0534454265709194,0.0534454265709194
-19163,3871,840,0.0992542187222657,0.0992542187222657
-19164,840,4272,0.128018795895479,0.128018795895479
-19166,9283,10439,0.0445989165425857,0.0445989165425857
-19168,10440,9282,0.395349042842448,0.395349042842448
-19170,7136,2300,0.0954980884416659,0.0954980884416659
-19171,2300,6804,0.197911548357853,0.197911548357853
-19173,7956,8539,0.0718200140953678,0.0718200140953678
-19174,8539,9282,0.0117697082839477,0.0117697082839477
-19176,10442,1349,0.0573473302810492,0.0573473302810492
-19178,10443,8521,0.0309849382045455,0.0309849382045455
-19180,10151,10440,0.0401979143660666,0.0401979143660666
-19182,10439,5059,0.220890379574485,0.220890379574485
-19183,5059,5013,0.0908635547178716,0.0908635547178716
-19184,5013,3349,0.0925982666666752,0.0925982666666752
-19185,3349,7877,0.0609717199349519,0.0609717199349519
-19186,7877,5761,0.0981025803398981,0.0981025803398981
-19187,5761,7325,0.0996396951750833,0.0996396951750833
-19961,10684,10674,0.204298559687633,0.204298559687633
-19188,7325,2064,0.0938077886809335,0.0938077886809335
-20575,10863,10864,0.0111548544892698,0.0111548544892698
-19189,2064,2650,0.094440127839499,0.094440127839499
-19801,7638,6235,0.180302575380181,0.180302575380181
-19190,2650,10444,0.141197448312795,0.141197448312795
-19191,10444,9821,0.0323105619062287,0.0323105619062287
-19192,9821,9822,0.0144436267959073,0.0144436267959073
-19193,9822,3476,0.28088366035949,0.28088366035949
-19194,3476,10445,0.0704996285836985,0.0704996285836985
-19195,10445,10428,0.0905303391563005,0.0905303391563005
-19197,10167,10442,0.0431387292722099,0.0431387292722099
-19199,8408,8568,0.191490020507546,0.191490020507546
-19200,8568,10012,0.119004756390235,0.119004756390235
-19335,8631,10474,0.189944426919074,0.189944426919074
-19201,10012,8461,0.097400081996938,0.097400081996938
-19203,4275,3348,0.0888431357806069,0.0888431357806069
-19204,3348,7876,0.0640319779657538,0.0640319779657538
-19205,7876,5760,0.0967358830871852,0.0967358830871852
-19206,5760,7324,0.101239369924108,0.101239369924108
-19207,7324,2063,0.0946165731852714,0.0946165731852714
-19208,2063,2649,0.0935569331707932,0.0935569331707932
-19209,2649,4105,0.0971375052394303,0.0971375052394303
-19210,4105,6689,0.0855494277301445,0.0855494277301445
-19211,6689,356,0.101026474697068,0.101026474697068
-19212,356,7688,0.0921469063041614,0.0921469063041614
-19213,7688,3475,0.0946165920204556,0.0946165920204556
-19215,6939,9228,0.0827641347919428,0.0827641347919428
-19216,9228,6380,0.0767643689707359,0.0767643689707359
-19217,6380,5058,0.0447215279971903,0.0447215279971903
-19219,5015,3318,0.0976390934138488,0.0976390934138488
-19221,7829,10449,0.170073568021036,0.170073568021036
-19222,9276,9490,0.227893235973284,0.227893235973284
-19224,5808,10450,0.0444182254226453,0.0444182254226453
-19228,10452,10453,0.00899294746602318,0.00899294746602318
-19262,561,8788,0.108355823884287,0.108355823884287
-19264,10465,10081,0.106367191723871,0.106367191723871
-19265,10081,9467,0.08060964495203,0.08060964495203
-19376,8634,10174,0.107642527980188,0.107642527980188
-19283,1943,10467,0.139113140483037,0.139113140483037
-19284,10467,1941,0.145058671955531,0.145058671955531
-19309,10472,10450,0.0244300101434338,0.0244300101434338
-19310,10450,6986,0.0907684588887198,0.0907684588887198
-19311,6986,649,0.0550434251335652,0.0550434251335652
-19312,649,9973,0.0116984093357102,0.0116984093357102
-19313,9973,6700,0.0127993614182147,0.0127993614182147
-20578,10796,10801,0.065843170036926,0.065843170036926
-19315,5030,10465,0.0131766099040461,0.0131766099040461
-19316,10465,339,0.0452586039857602,0.0452586039857602
-19317,339,10468,0.0402192785877108,0.0402192785877108
-19318,10468,1941,0.0852977829408983,0.0852977829408983
-19319,1941,610,0.177606555639393,0.177606555639393
-19320,610,4852,0.177691892562915,0.177691892562915
-19321,4852,2203,0.156985921773534,0.156985921773534
-19324,5917,1620,0.152034755665853,0.152034755665853
-19325,1620,1212,0.201729915857126,0.201729915857126
-19326,1212,8782,0.0140233440789759,0.0140233440789759
-19336,4837,9074,0.0183273901669081,0.0183273901669081
-19338,9315,9317,0.0726807266351068,0.0726807266351068
-19339,9317,8692,0.104147766047402,0.104147766047402
-19341,9315,1952,0.0315809029571794,0.0315809029571794
-19343,10140,10142,0.0644750868788433,0.0644750868788433
-19344,10142,10475,0.0151531719907858,0.0151531719907858
-19345,10475,7137,0.053510410167183,0.053510410167183
-19347,480,9282,0.132450958735296,0.132450958735296
-19348,9282,10138,0.0564427245863012,0.0564427245863012
-19350,8464,10476,0.175984833399768,0.175984833399768
-19352,10047,5253,0.112186249238367,0.112186249238367
-19353,5253,2320,0.0249537355545513,0.0249537355545513
-19355,10166,6401,0.0992919669903468,0.0992919669903468
-19359,10479,9948,0.0516511853374245,0.0516511853374245
-19360,9948,8509,0.0517093587612889,0.0517093587612889
-19362,6189,10479,0.146782090008868,0.146782090008868
-19387,10455,5805,0.0524139320350963,0.0524139320350963
-19364,10047,10168,0.0607581388382602,0.0607581388382602
-19365,10168,10480,0.0679196955639713,0.0679196955639713
-19366,10480,6401,0.0390713513194924,0.0390713513194924
-19367,6401,10481,0.052200136280437,0.052200136280437
-19368,10481,6166,0.221487121294822,0.221487121294822
-19369,6166,4284,0.1514940030025,0.1514940030025
-19371,2320,2779,0.107781391844326,0.107781391844326
-20580,10867,10868,0.0137448223074376,0.0137448223074376
-20581,10868,10869,0.0278742902489333,0.0278742902489333
-19372,2779,2913,0.05305189541044,0.05305189541044
-19374,8509,9595,0.106794270102757,0.106794270102757
-19375,9595,8634,0.102427753876907,0.102427753876907
-19377,10174,10482,0.096139738297761,0.096139738297761
-19378,10482,9194,0.00978224253563326,0.00978224253563326
-19380,4397,3002,0.108243017625134,0.108243017625134
-19381,3002,10484,0.0989194559777293,0.0989194559777293
-19382,10484,5962,0.00617092845740214,0.00617092845740214
-19383,5962,10485,0.00542857584263607,0.00542857584263607
-19384,10485,10459,0.0472755549262459,0.0472755549262459
-19385,10459,7579,0.0528643874539915,0.0528643874539915
-19429,7287,32,0.190572580502828,0.190572580502828
-19386,7579,10455,0.0523778989124976,0.0523778989124976
-19423,10488,7294,0.0690612889349745,0.0690612889349745
-19424,7294,36,0.192538942320683,0.192538942320683
-19388,5805,10462,0.081956103355699,0.081956103355699
-19389,10462,8768,0.0169741195442503,0.0169741195442503
-19391,6189,9950,0.0503550239981861,0.0503550239981861
-19392,9950,7557,0.0535053183585621,0.0535053183585621
-19393,7557,9952,0.0524048074288428,0.0524048074288428
-19394,9952,10429,0.0135095901515659,0.0135095901515659
-19396,10479,9627,0.0675900234291702,0.0675900234291702
-19400,3201,6115,0.203275445399412,0.203275445399412
-19401,6115,1910,0.199619230795837,0.199619230795837
-19402,1910,9218,0.202850123370343,0.202850123370343
-19403,9218,9216,0.20345414072247,0.20345414072247
-19404,9216,7300,0.200631055524996,0.200631055524996
-19405,7300,45,0.202263602143448,0.202263602143448
-19406,45,3545,0.200651259904661,0.200651259904661
-19407,3545,4239,0.201942446714699,0.201942446714699
-19408,4239,1800,0.2054130837632,0.2054130837632
-19409,1800,8710,0.197537787183869,0.197537787183869
-19410,8710,6527,0.132676718293593,0.132676718293593
-19695,8145,9492,0.255789380087541,0.255789380087541
-19697,10419,10619,0.294868097569216,0.294868097569216
-19806,10411,7868,0.176421872480467,0.176421872480467
-19698,10619,10620,0.511264415982815,0.511264415982815
-19699,6199,496,0.110329672635447,0.110329672635447
-19700,496,10419,0.128549351195957,0.128549351195957
-19704,10623,10624,0.299844457035978,0.299844457035978
-19705,10624,10625,0.048946191319968,0.048946191319968
-19706,10625,10626,0.0564187161790662,0.0564187161790662
-19707,10626,10627,0.261222980592435,0.261222980592435
-19717,10626,10634,0.247667737296111,0.247667737296111
-19925,10679,9511,0.20648099094332,0.20648099094332
-19926,9511,4579,0.132833459370163,0.132833459370163
-19930,10680,10673,0.208792718350027,0.208792718350027
-19931,10673,7131,0.201766496696079,0.201766496696079
-19933,626,10681,0.1702021482017,0.1702021482017
-19934,5672,10665,0.0500710082270115,0.0500710082270115
-19935,10665,7218,0.0509007134728753,0.0509007134728753
-19937,252,10245,0.178490785331426,0.178490785331426
-19938,10245,7120,0.17638987203806,0.17638987203806
-19939,7120,9641,0.177259535907282,0.177259535907282
-19944,10675,10682,0.203454780542957,0.203454780542957
-19945,10682,9518,0.211007495388792,0.211007495388792
-19946,9518,4583,0.129742461291969,0.129742461291969
-19948,10646,7221,0.050795229275335,0.050795229275335
-19949,7221,10672,0.0490058421037179,0.0490058421037179
-19950,10672,4950,0.0520761745786515,0.0520761745786515
-19954,10414,5089,0.112638269786332,0.112638269786332
-19956,9520,10683,0.208034746403896,0.208034746403896
-19992,10649,10664,0.050141841785608,0.050141841785608
-19993,10664,10683,0.0505455538112256,0.0505455538112256
-19994,10683,5590,0.0494937724947863,0.0494937724947863
-19995,5590,10661,0.0507309659863408,0.0507309659863408
-19996,10661,7533,0.0505856564507496,0.0505856564507496
-19997,7533,10689,0.686347942133366,0.686347942133366
-19998,8645,2200,0.0278160442123186,0.0278160442123186
-20003,2200,10693,0.020138493184414,0.020138493184414
-20004,10693,10443,0.00475150856262823,0.00475150856262823
-20006,8461,9621,0.0222962026291256,0.0222962026291256
-20007,9621,10690,0.0515741214544805,0.0515741214544805
-20026,9466,8724,0.0514719719174867,0.0514719719174867
-20027,8724,5029,0.0566937822140094,0.0566937822140094
-20028,5029,4595,0.0969267875718062,0.0969267875718062
-20030,5321,630,0.142142547339574,0.142142547339574
-20031,630,2908,0.116052443784823,0.116052443784823
-20039,10696,5549,0.959761090863438,0.959761090863438
-20040,5549,9172,0.201153438061066,0.201153438061066
-20042,140,1484,0.198676673012775,0.198676673012775
-20043,1484,3760,0.212665318664513,0.212665318664513
-20044,3760,4181,0.394425022611864,0.394425022611864
-20045,4181,7302,0.250045496408828,0.250045496408828
-20046,7302,9078,0.0121023798774685,0.0121023798774685
-419,418,419,0.0843359701726921,0.0843359701726921
-20049,9127,9931,0.188027723664679,0.188027723664679
-20051,9189,10417,0.27289630775387,0.27289630775387
-20052,10417,10698,0.903351534370563,0.903351534370563
-20055,5803,10456,0.063915425232113,0.063915425232113
-20056,10456,8278,0.0463525975312068,0.0463525975312068
-20057,8278,7582,0.0531670184257572,0.0531670184257572
-20586,10860,10865,0.0197306093936785,0.0197306093936785
-20058,7582,10460,0.0605194201118807,0.0605194201118807
-20059,10460,5965,0.08096413889014,0.08096413889014
-20060,5965,7403,0.00793698029885246,0.00793698029885246
-20061,7403,7216,0.100604138655543,0.100604138655543
-20062,7216,2998,0.041051117053356,0.041051117053356
-20064,4930,9632,0.0194691711485179,0.0194691711485179
-20066,8788,8794,0.107030125953622,0.107030125953622
-20067,8794,8875,0.105785558321332,0.105785558321332
-20068,8875,7355,0.0541942506273543,0.0541942506273543
-20069,7355,8881,0.0482515848497253,0.0482515848497253
-20070,8881,7128,0.0482774346717123,0.0482774346717123
-20071,7128,9311,0.0491067830497851,0.0491067830497851
-20072,9311,9658,0.100701059147573,0.100701059147573
-20073,9658,5054,0.0949533068688616,0.0949533068688616
-20074,5054,5041,0.0261633102483298,0.0261633102483298
-20075,5041,6318,0.0238469793810048,0.0238469793810048
-20077,8004,7999,0.0412811844037432,0.0412811844037432
-20078,7999,5161,0.00972594837361757,0.00972594837361757
-20079,5161,976,0.0450966381773304,0.0450966381773304
-20080,976,9235,0.0690703393173828,0.0690703393173828
-20081,9235,8835,0.0284556853366966,0.0284556853366966
-20082,8835,7138,0.0744435936983682,0.0744435936983682
-20083,7138,7152,0.0242079619729824,0.0242079619729824
-20084,7152,5018,0.0530487604133438,0.0530487604133438
-20085,5018,5127,0.027179522018167,0.027179522018167
-20086,5127,5120,0.017329383802427,0.017329383802427
-20087,5120,9413,0.051025645765313,0.051025645765313
-20088,9413,4720,0.0442143222009164,0.0442143222009164
-20089,4720,6788,0.103544897956421,0.103544897956421
-20090,6788,7360,0.101885712989061,0.101885712989061
-20091,7360,5420,0.104686903511504,0.104686903511504
-20092,5420,8551,0.104297582912284,0.104297582912284
-20093,8551,3891,0.113854917229397,0.113854917229397
-20094,3891,1021,0.10275177677768,0.10275177677768
-20095,1021,10069,0.0524825810706004,0.0524825810706004
-20096,10069,6266,0.0519011168646154,0.0519011168646154
-20097,6266,8727,0.107637396904871,0.107637396904871
-20098,8727,5027,0.0851589615138914,0.0851589615138914
-20099,5027,3339,0.11913667157964,0.11913667157964
-20100,3339,7884,0.0947347804724537,0.0947347804724537
-20101,7884,7339,0.0992406279882494,0.0992406279882494
-20588,10840,3589,0.00659451799404467,0.00659451799404467
-20102,7339,7978,0.0297388680985265,0.0297388680985265
-20103,7978,8546,0.0509861753484279,0.0509861753484279
-20105,2065,2068,0.0539613780445048,0.0539613780445048
-20106,2068,2651,0.0458462130492323,0.0458462130492323
-20107,2651,2668,0.0527824371940605,0.0527824371940605
-20108,2668,4106,0.0471315276476818,0.0471315276476818
-20109,4106,4138,0.0531150768123695,0.0531150768123695
-20110,4138,6691,0.0513109258939151,0.0513109258939151
-20111,6691,6699,0.049849518680298,0.049849518680298
-20112,6699,8027,0.0540642003294053,0.0540642003294053
-20113,8027,8022,0.0351680439773276,0.0351680439773276
-20114,8022,7697,0.0642576699742132,0.0642576699742132
-20116,7687,3442,0.0653852338257918,0.0653852338257918
-20117,3442,3465,0.0302046503739114,0.0302046503739114
-20118,3465,10643,0.044572996690839,0.044572996690839
-20119,10643,6010,0.0210253210935206,0.0210253210935206
-20120,6010,6022,0.0302819861909932,0.0302819861909932
-20121,6022,3877,0.0720170103408001,0.0720170103408001
-20122,3877,9699,0.0188604413742797,0.0188604413742797
-20123,9699,862,0.0931148831029757,0.0931148831029757
-20124,862,7102,0.0867114852734781,0.0867114852734781
-20125,7102,10422,0.0971484542236891,0.0971484542236891
-20126,10422,8701,0.0148135271633134,0.0148135271633134
-20127,8701,8159,0.0903601598115808,0.0903601598115808
-20128,8159,8147,0.0485272097981868,0.0485272097981868
-20129,8147,7605,0.046972846594418,0.046972846594418
-20130,7605,7256,0.0980906813073136,0.0980906813073136
-20131,7256,7592,0.0949493294075893,0.0949493294075893
-20132,7592,2011,0.0535765472330524,0.0535765472330524
-20133,2011,9174,0.0440404642371946,0.0440404642371946
-20134,9174,10644,0.101018897202585,0.101018897202585
-20135,10644,2752,0.0964161425505398,0.0964161425505398
-12318,2500,2501,0.00534847597168918,0.00534847597168918
-20137,6988,7015,0.0469900401605619,0.0469900401605619
-20138,7015,2275,0.0506564830109395,0.0506564830109395
-20139,2275,8216,0.0480971521401402,0.0480971521401402
-20140,8216,3600,0.0492447661071067,0.0492447661071067
-20141,3600,8213,0.0494471155350359,0.0494471155350359
-20142,8213,7515,0.0477024371424333,0.0477024371424333
-20143,7515,7526,0.0508405166895622,0.0508405166895622
-20144,7526,4566,0.0460266764289813,0.0460266764289813
-20145,4566,2124,0.0528615774272691,0.0528615774272691
-20146,2124,5990,0.094672374588883,0.094672374588883
-20147,5990,7671,0.0990838490707958,0.0990838490707958
-20179,10247,9298,0.182738392624498,0.182738392624498
-20180,9298,6549,0.169619845811395,0.169619845811395
-20182,4768,6330,0.178054483343927,0.178054483343927
-20183,6330,9308,0.0134883336553362,0.0134883336553362
-20148,7671,10702,3.41813541281698,3.41813541281698
-20149,425,10112,0.0131850564749253,0.0131850564749253
-20186,8247,10155,0.516700602330837,0.516700602330837
-20187,10155,3322,0.265485774934506,0.265485774934506
-20188,3322,10706,0.131436234594263,0.131436234594263
-20189,10139,10705,0.06021736831636,0.06021736831636
-20195,8510,10708,0.0176825351734809,0.0176825351734809
-20197,10708,8571,0.116072750239478,0.116072750239478
-20199,5783,8281,0.147480988666932,0.147480988666932
-20200,8281,8293,0.145093730312322,0.145093730312322
-20201,8293,7900,0.146177040292133,0.146177040292133
-20202,7900,8854,0.145687210047232,0.145687210047232
-20203,8854,9321,0.148905174298523,0.148905174298523
-20206,8401,5454,0.142235461954992,0.142235461954992
-20207,5454,8504,0.00556744232684514,0.00556744232684514
-20208,8504,8047,0.149428079475645,0.149428079475645
-20209,8047,6575,0.142472133135735,0.142472133135735
-20210,6575,4456,0.146389787991077,0.146389787991077
-20211,4456,5504,0.146266130363807,0.146266130363807
-20264,10722,5574,0.00764881869126048,0.00764881869126048
-20317,10737,10730,0.156440332314784,0.156440332314784
-20319,10738,10739,0.00846222116823016,0.00846222116823016
-20570,10858,10856,0.341000703608857,0.341000703608857
-20572,10859,10860,0.0100014874858022,0.0100014874858022
-20784,10945,10292,0.00633905697400916,0.00633905697400916
-321,153,154,0.039197729386179,0.039197729386179
-18675,1570,2751,0.10523982327052,0.10523982327052
-20591,10795,10802,0.0763744143850755,0.0763744143850755
-20216,632,6405,0.146056665643101,0.146056665643101
-20217,6405,4277,0.144766275996567,0.144766275996567
-20218,4277,2913,0.0337236702585465,0.0337236702585465
-20250,9384,8111,0.200921327710714,0.200921327710714
-20251,8111,10328,0.204798818746646,0.204798818746646
diff --git a/src/bd_dijkstra/tester/ways2data b/src/bd_dijkstra/tester/ways2data
deleted file mode 100755
index ba2da17..0000000
--- a/src/bd_dijkstra/tester/ways2data
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-sub Usage {
-    die "Usage: ways2data tab ways.txt\n";
-}
-
-my $tab   = shift @ARGV || Usage();
-my $wfile = shift @ARGV || Usage();
-
-open(IN, $wfile) || die "Failed to open '$wfile' for read : $!\n";
-
-print <<EOF;
-
-drop table if exists $tab cascade;
-create table $tab (
-    id integer not null primary key,
-    source integer,
-    target integer,
-    cost float8,
-    reverse_cost float8
-);
-
-copy table $tab (id, source, target, cost, reverse_cost) from stdin;
-EOF
-
-while (my $x = <IN>) {
-    $x =~ s/,/\t/g;
-    print $x;
-}
-print "\\.\n";
-
-close(IN);
diff --git a/src/common/doc/convenience/flip_edges.rst b/src/common/doc/convenience/flip_edges.rst
deleted file mode 100644
index 92d98a6..0000000
--- a/src/common/doc/convenience/flip_edges.rst
+++ /dev/null
@@ -1,91 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_flip_edges:
-
-pgr_flipEdges
-==============================================================================
-
-.. index::
-        single: pgr_flipEdges(ga geometry[])
-        module: common
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_flipEdges`` - 
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-The function returns:
-
-  - ``geometry[]`` An array of the input geometries with the geometries flipped end to end such that the geometries are oriented as a path from start to end.
-
-.. code-block:: sql
-
-        geometry[] pgr_flipEdges(ga geometry[])
-
-
-Description
------------------------------------------------------------------------------
-
-Given an array of linestrings that are supposedly connected end to end like the results of a route, check the edges and flip any end for end if they do not connect with the previous seegment and return the array with the segments flipped as appropriate.
-
-.. rubric:: Parameters
-
-:ga: ``geometry[]`` An array of geometries, like the results of a routing query.
-
-.. warning::
-
-    * No checking is done for edges that do not connect.
-    * Input geometries MUST be LINESTRING or MULTILINESTRING.
-    * Only the first LINESTRING of a MULTILINESTRING is considered.
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-        select st_astext(e) from (select unnest(pgr_flipedges(ARRAY[
-        'LINESTRING(2 1,2 2)'::geometry,
-        'LINESTRING(2 2,2 3)'::geometry,
-        'LINESTRING(2 2,2 3)'::geometry,
-        'LINESTRING(2 2,3 2)'::geometry,
-        'LINESTRING(3 2,4 2)'::geometry,
-        'LINESTRING(4 1,4 2)'::geometry,
-        'LINESTRING(3 1,4 1)'::geometry,
-        'LINESTRING(2 1,3 1)'::geometry,
-        'LINESTRING(2 0,2 1)'::geometry,
-        'LINESTRING(2 0,2 1)'::geometry]::geometry[])) as e) as foo;
-              st_astext
-        ---------------------
-         LINESTRING(2 1,2 2)
-         LINESTRING(2 2,2 3)
-         LINESTRING(2 3,2 2)
-         LINESTRING(2 2,3 2)
-         LINESTRING(3 2,4 2)
-         LINESTRING(4 2,4 1)
-         LINESTRING(4 1,3 1)
-         LINESTRING(3 1,2 1)
-         LINESTRING(2 1,2 0)
-         LINESTRING(2 0,2 1)
-        (10 rows)
-
-
-See Also
------------------------------------------------------------------------------
-
diff --git a/src/common/doc/convenience/index.rst b/src/common/doc/convenience/index.rst
deleted file mode 100644
index d4a3935..0000000
--- a/src/common/doc/convenience/index.rst
+++ /dev/null
@@ -1,44 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _convenience_functions:
-
-Convenience Functions
-===============================================================================
-
-The following functions are general purpose convenience functions that might
-be useful when building a larger application or handling input from say an
-Ajax handler.
-
-  -  :ref:`pgr_point_to_edgenode` - convert a point geometry to a ``vertex_id`` based on closest edge.
-  -  :ref:`pgr_flip_edges` - flip the edges in an array of geometries so the connect end to end.
-  -  :ref:`pgr_text_to_points` - convert a string of ``x,y;x,y;...`` locations into point geometries.
-  -  :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
-
-Distance Matrix Functions
-===============================================================================
-
-These function my be helpful when you need to create or manipulate distance matricies, like for TSP or VRP related problems.
-
- - :ref:`pgr_points_to_dmatrix` - Create a distance matrix from an array of points.
- - :ref:`pgr_vids_to_dmatrix` - Create a distance matrix from an array of ``vertix_id``.
- - :ref:`pgr_vids_to_dmatrix2` - Create a distance matrix from an array of ``vertix_id``.
-
-.. toctree::
-  :hidden:
-
-  pgr_pointToEdgeNode - convert a point geometry to a ``vertex_id`` based on closest edge. <point_to_edgenode>
-  pgr_flipEdges - flip the edges in an array of geometries so the connect end to end. <flip_edges>
-  pgr_textToPoints - convert a string of ``x,y;x,y;...`` locations into point geometries. <text_to_points>
-  pgr_pointsToVids - convert an array of point geometries into ``node_id``s. <points_to_vids>
-
-  pgr_pointsToDMatrix - Create a distance matrix from an array of points. <points_to_dmatrix>
-  pgr_vidsToDMatrix - Create a distance matrix from an array of ``vertix_id``. <vids_to_dmatrix>
-  pgr_vidsToDMatrix - Create a distance matrix from an array of ``vertix_id``. <vids_to_dmatrix2>
-
diff --git a/src/common/doc/convenience/point_to_edgenode.rst b/src/common/doc/convenience/point_to_edgenode.rst
deleted file mode 100644
index cfbc266..0000000
--- a/src/common/doc/convenience/point_to_edgenode.rst
+++ /dev/null
@@ -1,83 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_point_to_edgenode:
-
-pgr_pointToEdgeNode
-==============================================================================
-
-.. index::
-        single: pgr_pointToEdgeNode(edges text, pnt geometry, tol float8)
-        module: common
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_pointToEdgeNode`` - Converts a point to a ``vertex_id`` based on closest edge.
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-The function returns:
-
-  - ``integer`` that is the vertex id of the closest edge in the ``edges`` table within the ``tol`` tolerance of ``pnt``. The vertex is selected by projection the ``pnt`` onto the edge and selecting which vertex is closer along the edge.
-
-.. code-block:: sql
-
-        integer pgr_pointToEdgeNode(edges text, pnt geometry, tol float8)
-
-
-Description
------------------------------------------------------------------------------
-
-Given an table ``edges`` with a spatial index on ``the_geom`` and a point geometry search for the closest edge within ``tol`` distance to the edges then compute the projection of the point onto the line segment and select source or target based on whether the projected point is closer to the respective end and return the source or target value.
-
-.. rubric:: Parameters
-
-The function accepts the following parameters:
-
-:edges: ``text`` The name of the edge table or view. (may contain the schema name AS well).
-:pnt: ``geometry`` A point geometry object in the same SRID as ``edges``.
-:tol: ``float8`` The maximum search distance for an edge.
-
-.. warning::
-
-    If no edge is within tol distance then return -1
-
-The ``edges`` table must have the following columns:
-
-    * ``source``
-    * ``target``
-    * ``the_geom``
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-        select pgr_pointtoedgenode('edge_table', 'POINT(2 0)'::geometry, 0.02);
-        pgr_pointtoedgenode
-        -------------------
-                         1
-        (1 row)
-
-The example uses the :ref:`sampledata` network.
-
-See Also
------------------------------------------------------------------------------
-
-* :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
-
diff --git a/src/common/doc/convenience/points_to_dmatrix.rst b/src/common/doc/convenience/points_to_dmatrix.rst
deleted file mode 100644
index 4a933a5..0000000
--- a/src/common/doc/convenience/points_to_dmatrix.rst
+++ /dev/null
@@ -1,94 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_points_to_dmatrix:
-
-pgr_pointsToDMatrix
-==============================================================================
-
-.. index::
-        single: pgr_pointsToDMatrix(pnts geometry[], OUT dmatrix double precision[], OUT ids integer[])
-        module: common
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_pointsToDMatrix`` - Creates a distance matrix from an array of points.
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-Create a distance symetric distance matrix suitable for TSP using Euclidean distances based on the st_distance(). You might want to create a variant of this the uses st_distance_sphere() or st_distance_spheriod() or some other function.
-
-The function returns:
-
-  - ``record`` - with two fields as describe here
-        * :dmatrix: ``float8[]`` - the distance matrix suitable to pass to pgrTSP() function.
-        * :ids: ``integer[]`` - an array of ids for the distance matrix.
-
-.. code-block:: sql
-
-        record pgr_pointsToDMatrix(pnts geometry[], OUT dmatrix double precision[], OUT ids integer[])
-
-
-Description
------------------------------------------------------------------------------
-
-.. rubric:: Paramters
-
-:pnts: ``geometry[]`` - An array of point geometries.
-
-.. warning::
-
-    The generated matrix will be symmetric as required for pgr_TSP.
-
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-        select unnest(dmatrix) from pgr_pointsToDMatrix(
-            pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0)
-        ) limit 8;
-              unnest
-        ------------------
-                        0
-                        1
-          1.4142135623731
-                        2
-         2.23606797749979
-         2.82842712474619
-                        3
-         2.23606797749979
-        (8 rows)
-
-        select ids from pgr_pointstodmatrix(
-            pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0)
-        );
-                ids
-        -------------------
-         {1,2,3,4,5,6,7,8}
-        (1 row)
-
-
-
-See Also
------------------------------------------------------------------------------
-
-* :ref:`pgr_vids_to_dmatrix` - convert a point geometry to the closest vertex_id of an edge..
-* :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
-
diff --git a/src/common/doc/convenience/points_to_vids.rst b/src/common/doc/convenience/points_to_vids.rst
deleted file mode 100644
index 70d52cf..0000000
--- a/src/common/doc/convenience/points_to_vids.rst
+++ /dev/null
@@ -1,81 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_points_to_vids:
-
-pgr_pointsToVids
-==============================================================================
-
-.. index::
-        single: pgr_pointsToVids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
-        module: common
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_pointsToVids`` - Converts an array of point geometries into vertex ids.
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-Given an array of point geometries and an edge table and a max search tol distance the function converts points into vertex ids using pgr_pointtoedgenode().
-
-The function returns:
-
-  - ``integer[]`` - An array of ``vertex_id``.
-
-.. code-block:: sql
-
-        integer[] pgr_pointsToVids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
-
-
-Description
------------------------------------------------------------------------------
-
-.. rubric:: Paramters
-
-:pnts: ``geometry[]`` - An array of point geometries.
-:edges: ``text`` - The edge table to be used for the conversion.
-:tol: ``float8`` - The maximum search distance for locating the closest edge.
-
-.. warning::
-
-    You need to check the results for any vids=-1 which indicates if failed to locate an edge.
-
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-        select * from pgr_pointstovids(
-            pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0),
-            'edge_table'
-            -- tol is not specified, so we use the default of 0.01
-        );
-          pgr_pointstovids
-        --------------------
-         {1,2,3,5,4,9,10,6}
-        (1 row)
-
-This example uses the :ref:`sampledata` network.
-
-
-See Also
------------------------------------------------------------------------------
-
-* :ref:`pgr_point_to_edgenode` - convert a point geometry to the closest vertex_id of an edge..
-
diff --git a/src/common/doc/convenience/text_to_points.rst b/src/common/doc/convenience/text_to_points.rst
deleted file mode 100644
index 824fde1..0000000
--- a/src/common/doc/convenience/text_to_points.rst
+++ /dev/null
@@ -1,81 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_text_to_points:
-
-pgr_textToPoints
-==============================================================================
-
-.. index::
-        single: pgr_textToPoints(pnts text, srid integer DEFAULT(4326))
-        module: common
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_textToPoints`` - Converts a text string of the format "x,y;x,y;x,y;..." into and array of point geometries.
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-Given a text string of the format "x,y;x,y;x,y;..." and the srid to use, split the string and create and array point geometries. 
-
-The function returns:
-
-  - 
-
-.. code-block:: sql
-
-        integer pgr_textToPoints(pnts text, srid integer DEFAULT(4326))
-
-
-Description
------------------------------------------------------------------------------
-
-.. rubric:: Paramters
-
-:pnts: ``text`` A text string of the format "x,y;x,y;x,y;..." where x is longitude and y is latitude if use values in lat-lon.
-:srid: ``integer`` The SRID to use when constructing the point geometry. If the paratmeter is absent it defaults to ``SRID:4326``.
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-        select st_astext(g) from (
-            select unnest(
-                pgr_texttopoints('0,0;1,1;1,0;0,1;1,4;1,5;0,4;0,5', 0)
-            ) as g
-        ) as foo;
-          st_astext
-         ------------
-          POINT(0 0)
-          POINT(1 1)
-          POINT(1 0)
-          POINT(0 1)
-          POINT(1 4)
-          POINT(1 5)
-          POINT(0 4)
-          POINT(0 5)
-         (8 rows)
-                  
-
-
-See Also
------------------------------------------------------------------------------
-
-* :ref:`pgr_point_to_edgenode` - convert a point geometry to a ``node_id`` based on closest edge.
-* :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
diff --git a/src/common/doc/convenience/vids_to_dmatrix.rst b/src/common/doc/convenience/vids_to_dmatrix.rst
deleted file mode 100644
index 6f7ca47..0000000
--- a/src/common/doc/convenience/vids_to_dmatrix.rst
+++ /dev/null
@@ -1,102 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_vids_to_dmatrix:
-
-pgr_vidsToDMatrix
-==============================================================================
-
-.. index::
-        single: pgr_vidsToDMatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1), OUT dmatrix double precision[], OUT ids integer[])
-        module: common
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_vidsToDMatrix`` - Creates a distances matrix from an array of ``vertex_id``.
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-This function takes an array of ``vertex_id``, the original array of points used to generate the array of ``vertex_id``, an edge table name and a tol. It then computes kdijkstra() distances for each vertex to all the other vertices and creates a symmetric distance matrix suitable for TSP. The pnt array and the tol are used to establish a BBOX for limiting selection of edges. The extents of the points is expanded by tol.
-
-The function returns:
-
-  - ``record`` - with two fields as describe here
-        * :dmatrix: ``float8[]`` - the distance matrix suitable to pass to pgrTSP() function.
-        * :ids: ``integer[]`` - an array of ids for the distance matrix.
-                  
-
-.. code-block:: sql
-
-        record pgr_vidsToDMatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1), OUT dmatrix double precision[], OUT ids integer[])
-
-
-Description
------------------------------------------------------------------------------
-
-.. rubric:: Paramters
-
-:vids: ``integer[]`` - An array of ``vertex_id``.
-:pnts: ``geometry[]`` - An array of point geometries that approximates the extents of the ``vertex_id``.
-:edges: ``text`` - The edge table to be used for the conversion.
-:tol: ``float8`` - The amount to expand the BBOX extents of ``pnts`` when building the graph.
-
-.. warning::
-
-    * we compute a symmetric matrix because TSP requires that so the distances are better the Euclidean but but are not perfect
-    * kdijkstra() can fail to find a path between some of the vertex ids. We to not detect this other than the cost might get set to -1.0, so the dmatrix shoule be checked for this as it makes it invalid for TSP
-
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-This example shows how this can be used in the context of feeding the results into pgr_tsp() function. We convert a text string of ``x,y;x,y;...`` into and array of points, then convert that into an array ``vertex_id``, then create a distance matrix that gets feed into ``pgr_tsp()`` that returns the final result.
-
-.. code-block:: sql
-
-    select * from pgr_tsp(
-        (select dmatrix::float8[]
-           from pgr_vidstodmatrix(
-                    pgr_pointstovids(
-                        pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0),
-                        'edge_table'),
-                    pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0),
-                    'edge_table')
-        ),
-        1
-    );
-     seq | id
-    -----+----
-       0 |  1
-       1 |  3
-       2 |  7
-       3 |  5
-       4 |  4
-       5 |  2
-       6 |  6
-       7 |  0
-    (8 rows)
-
-This example uses the :ref:`sampledata` network.
-
-
-See Also
------------------------------------------------------------------------------
-
-* :ref:`pgr_text_to_points` - Create an array of points from a text string.
-* :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
-
diff --git a/src/common/doc/convenience/vids_to_dmatrix2.rst b/src/common/doc/convenience/vids_to_dmatrix2.rst
deleted file mode 100644
index b3bc755..0000000
--- a/src/common/doc/convenience/vids_to_dmatrix2.rst
+++ /dev/null
@@ -1,101 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_vids_to_dmatrix2:
-
-pgr_vidsToDMatrix
-==============================================================================
-
-.. index::
-        single: pgr_vidsToDMatrix(IN sql text, IN vids integer[], IN directed boolean, IN has_reverse_cost boolean, IN want_symmetric boolean, OUT dmatrix double precision[])
-        module: kdijkstra
-
-
-Name
-------------------------------------------------------------------------------
-
-``pgr_vidsToDMatrix`` - Creates a distances matrix from an array of ``vertex_id``.
-
-
-Synopsis
-------------------------------------------------------------------------------
-
-This function takes an array of ``vertex_id``, a ``sql`` statement to select the edges, and some boolean arguments to control the behavior. It then computes kdijkstra() distances for each vertex to all the other vertices and creates a distance matrix suitable for TSP.
-
-The function returns:
-
-    * :dmatrix: ``float8[]`` - the distance matrix suitable to pass to pgr_TSP() function.
-
-.. code-block:: sql
-
-        pgr_vidsToDMatrix(IN sql text, IN vids integer[], IN directed boolean, IN has_reverse_cost boolean, IN want_symmetric boolean, OUT dmatrix double precision[])
-
-
-
-Description
------------------------------------------------------------------------------
-
-.. rubric:: Paramters
-
-:sql: ``text`` - A SQL statement to select the edges needed for the solution.
-:vids: ``integer[]`` - An array of ``vertex_id``.
-:directed: ``boolean`` - A flag to indicate if the graph is directed.
-:has_reverse_cost: ``boolean`` - A flag to indicate if the SQL has a column ``reverse_cost``.
-:want_symmetric: ``boolean`` - A flag to indicate if you want a symmetric or asymmetric matrix. You will need a symmetric matrix for pgr_TSP(). If the matriix is asymmetric, the then the cell(i,j) and cell(j,i) will be set to the average of those two cells except if one or the other are -1.0 then it will take the value of the other cell. If both are negative they will be left alone.
-
-.. warning::
-
-    * kdijkstra() can fail to find a path between some of the vertex ids. We to not detect this other than the cost might get set to -1.0, so the dmatrix shoule be checked for this as it makes it invalid for TSP
-
-
-.. rubric:: History
-
-* New in version 2.1.0
-
-
-Examples
------------------------------------------------------------------------------
-
-This example shows how this can be used in the context of feeding the results into pgr_tsp() function. We convert a text string of ``x,y;x,y;...`` into and array of points, then convert that into an array ``vertex_id``, then create a distance matrix that gets feed into ``pgr_tsp()`` that returns the final result.
-
-.. code-block:: sql
-
-    select * from pgr_tsp(
-        (select dmatrix::float8[]
-           from pgr_vidstodmatrix(
-                    'select id, source, target, cost, reverse_cost from edge_table',
-                    pgr_pointstovids(
-                        pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0),
-                        'edge_table'),
-                    true, true, true) as dmatrix
-        ),
-        1
-    );
-     seq | id
-    -----+----
-       0 |  1
-       1 |  0
-       2 |  6
-       3 |  3
-       4 |  7
-       5 |  5
-       6 |  4
-       7 |  2
-    (8 rows)
-
-This example uses the :ref:`sampledata` network.
-
-
-See Also
------------------------------------------------------------------------------
-
-* :ref:`pgr_vids_to_dmatrix` -  - Creates a distances matrix from an array of ``vertex_id``.
-* :ref:`pgr_text_to_points` - Create an array of points from a text string.
-* :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
-
diff --git a/src/common/doc/functions/analyze_graph.rst b/src/common/doc/functions/analyze_graph.rst
deleted file mode 100644
index efcd596..0000000
--- a/src/common/doc/functions/analyze_graph.rst
+++ /dev/null
@@ -1,376 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_analyze_graph:
-
-pgr_analyzeGraph
-===============================================================================
-
-.. index:: 
-	single: pgr_analyzeGraph(text,double precision,text,text,text,text,text)
-	module: common
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_anlizeGraph`` — Analyzes the network topology.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The function returns:
-
-  - ``OK`` after the analysis has finished.
-  - ``FAIL`` when the analysis was not completed due to an error. 
-
-.. code-block:: sql
-
-	varchar pgr_analyzeGraph(text edge_table, double precision tolerance, 
-                           text the_geom:='the_geom', text id:='id',
-                           text source:='source',text target:='target',text rows_where:='true')
-
-Description
--------------------------------------------------------------------------------
-
-.. rubric:: Prerequisites
-
-The  edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table <edge_table>_vertices_pgr that stores the vertices information.
-
-  - Use :ref:`pgr_createVerticesTable <pgr_create_vert_table>` to create the vertices table.
-  - Use :ref:`pgr_createTopology <pgr_create_topology>` to create the topology and the vertices table. 
-
-.. rubric:: Parameters
-
-The analyze graph function accepts the following parameters:
-
-:edge_table: ``text`` Network table name. (may contain the schema name as well)
-:tolerance: ``float8`` Snapping tolerance of disconnected edges. (in projection unit)
-:the_geom: ``text``  Geometry column name of the network table. Default value is ``the_geom``.  
-:id: ``text``  Primary key column name of the network table. Default value is ``id``. 
-:source: ``text`` Source column name of the network table. Default value is ``source``.
-:target: ``text``  Target column name of the network table.  Default value is ``target``. 
-:rows_where: ``text``   Condition to select  a subset or rows.  Default value is ``true`` to indicate all rows.
-
-The function returns:
-
-  - ``OK`` after the analysis has finished.
-
-    * Uses the vertices table: <edge_table>_vertices_pgr.
-    * Fills completly the ``cnt`` and ``chk`` columns of the vertices table.
-    * Returns the analysis of the section of the network defined by  ``rows_where``
-
-  - ``FAIL`` when the analysis was not completed due to an error. 
-
-    * The vertices table is not found.
-    * A required column of the Network table is not found or is not of the appropriate type.
-    * The condition is not well formed.
-    * The names of source , target or id are the same.
-    * The SRID of the geometry could not be determined.
-
-
-.. rubric:: The Vertices Table
-
-The vertices table can be created with :ref:`pgr_createVerticesTable <pgr_create_vert_table>` or :ref:`pgr_createTopology <pgr_create_topology>`
-
-The structure of the vertices table is:
-
-:id: ``bigint`` Identifier of the vertex.
-:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. 
-:chk: ``integer``  Indicator that the vertex might have a problem. 
-:ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`.
-:eout: ``integer`` Number of vertices in the edge_table that reference this vertex as outgoing. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`. 
-:the_geom: ``geometry`` Point geometry of the vertex.
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-Usage when the edge table's columns MATCH the default values:
--------------------------------------------------------------------------------
- 
-.. rubric:: The simplest way to use pgr_analyzeGraph is: 
-
-.. code-block:: sql
-
-	 SELECT  pgr_create_topology('edge_table',0.001);
-	 SELECT  pgr_analyzeGraph('edge_table',0.001);
-
-.. rubric:: When the arguments are given in the order described in the parameters:
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target');
-
-We get the same result as the simplest way to use the function.
-
-.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``id`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``the_geom`` is passed to the function as the id column. 
- | ``SELECT  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target');``
- | ERROR: Can not determine the srid of the geometry "id" in table public.edge_table
-
-.. rubric:: When using the named notation
-
-The order of the parameters do not matter:
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
-
-Parameters defined with a default value can be ommited, as long as the value matches the default:
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source');
-
-.. rubric:: Selecting rows using rows_where parameter
-
-Selecting rows based on the id. Displays the analysis a the section of the network.
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
-
-Selecting the rows where the geometry is near the geometry of row with ``id`` =5 .
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
-
-Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
-
-.. code-block:: sql
-
-        DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ;
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-
-
-
-Usage when the edge table's columns DO NOT MATCH the default values:
--------------------------------------------------------------------------------
- 
-For the following table
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS mytable;
-	CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , the_geom AS mygeom FROM edge_table);
-	SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt');
-
-.. rubric:: Using positional notation: 
-
-The arguments need to be given in the order described in the parameters:
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt');
-
-.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``gid`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``mygeom`` is passed to the function as the id column.
- | ``SELECT  pgr_analyzeGraph('mytable',0.001,'gid','mygeom','src','tgt');``
- | ERROR: Can not determine the srid of the geometry "gid" in table public.mytable
-
-
-.. rubric:: When using the named notation
-
-The order of the parameters do not matter:
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
-
-In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.
-
-
-.. rubric:: Selecting rows using rows_where parameter
-
-Selecting rows based on the id.
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
-
-Selecting the rows WHERE the geometry is near the geometry of row with ``id`` =5 .
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-
-Selecting the rows WHERE the geometry is near the place='myhouse' of the table ``othertable``. (note the use of quote_literal)
-
-.. code-block:: sql
-
-        DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 'myhouse'::text AS place, st_point(2.5,2.5) AS other_geom) ;
-	SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
-                 rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
-
-.. code-block:: sql
-
-	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-                 rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
-
-
-
-Examples
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-	SELECT  pgr_create_topology('edge_table',0.001);
-	SELECT pgr_analyzeGraph('edge_table', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 2
-	NOTICE:                            Dead ends: 7
-	NOTICE:  Potential gaps found near dead ends: 1
-	NOTICE:               Intersections detected: 1
-	NOTICE:                      Ring geometries: 0
-	
-	 pgr_analizeGraph 
-	--------------------
-	 OK
-	(1 row)
-
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 0
-	NOTICE:                            Dead ends: 4
-	NOTICE:  Potential gaps found near dead ends: 0
-	NOTICE:               Intersections detected: 0
-	NOTICE:                      Ring geometries: 0
-
-	 pgr_analizeGraph 
-	--------------------
-	 OK
-	(1 row)
-
-	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id >= 10');
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id >= 10')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 2
-	NOTICE:                            Dead ends: 8
-	NOTICE:  Potential gaps found near dead ends: 1
-	NOTICE:               Intersections detected: 1
-	NOTICE:                      Ring geometries: 0
-	
-	 pgr_analizeGraph 
-	--------------------
-	 OK
-	(1 row)
-
-	-- Simulate removal of edges
-	SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17');
-	SELECT pgr_analyzeGraph('edge_table', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 0
-	NOTICE:                            Dead ends: 3
-	NOTICE:  Potential gaps found near dead ends: 0
-	NOTICE:               Intersections detected: 0
-	NOTICE:                      Ring geometries: 0
-	
-	 pgr_analizeGraph 
-	--------------------
-	 OK
-	(1 row)
-    SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17');
-    NOTICE:  PROCESSING:
-    NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','id <17')
-    NOTICE:  Performing checks, pelase wait .....
-    NOTICE:  Creating Topology, Please wait...
-    NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
-    NOTICE:  Rows with NULL geometry or NULL id: 0
-    NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
-    NOTICE:  ----------------------------------------------
-	
-	 pgr_analizeGraph 
-	--------------------
-	 OK
-	(1 row)
-
-    SELECT pgr_analyzeGraph('edge_table', 0.001);
-    NOTICE:  PROCESSING:
-    NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
-    NOTICE:  Performing checks, pelase wait...
-    NOTICE:  Analyzing for dead ends. Please wait...
-    NOTICE:  Analyzing for gaps. Please wait...
-    NOTICE:  Analyzing for isolated edges. Please wait...
-    NOTICE:  Analyzing for ring geometries. Please wait...
-    NOTICE:  Analyzing for intersections. Please wait...
-    NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-    NOTICE:                    Isolated segments: 0
-    NOTICE:                            Dead ends: 3
-    NOTICE:  Potential gaps found near dead ends: 0
-    NOTICE:               Intersections detected: 0
-    NOTICE:                      Ring geometries: 0
-	
-	 pgr_analizeGraph 
-	--------------------
-	 OK
-	(1 row)
-                         
-
-The examples use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`topology`  for an overview of a topology for routing algorithms.
-* :ref:`pgr_analyze_oneway` to analyze directionality of the edges.
-* :ref:`pgr_createVerticesTable <pgr_create_vert_table>` to reconstruct the vertices table based on the source and target information.
-* :ref:`pgr_nodeNetwork <pgr_node_network>` to create nodes to a not noded edge table.
-
diff --git a/src/common/doc/functions/analyze_oneway.rst b/src/common/doc/functions/analyze_oneway.rst
deleted file mode 100644
index 2318d7e..0000000
--- a/src/common/doc/functions/analyze_oneway.rst
+++ /dev/null
@@ -1,139 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_analyze_oneway:
-
-pgr_analyzeOneway
-===============================================================================
-
-.. index:: 
-	single: pgr_analyzeOneway(text,text[],text[],text[],text[],text,text,text,boolean)
-	module: common
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_analyzeOneway`` — Analyzes oneway Sstreets and identifies flipped segments.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-This function analyzes oneway streets in a graph and identifies any flipped segments. 
-
-.. code-block:: sql
-
-	text pgr_analyzeOneway(geom_table text, 
-			       text[] s_in_rules, text[] s_out_rules, 
-                               text[] t_in_rules, text[] t_out_rules, 
-			       text oneway='oneway', text source='source', text target='target',
-			       boolean two_way_if_null=true);
-
-
-Description
--------------------------------------------------------------------------------
-
-The analyses of one way segments is pretty simple but can be a powerful tools to identifying some the potential problems created by setting the direction of a segment the wrong way. A node is a `source` if it has edges the exit from that node and no edges enter that node. Conversely, a node is a `sink` if all edges enter the node but none exit that node. For a `source` type node it is logically impossible to exist because no vehicle can exit the node if no vehicle and enter the node. Lik [...]
-
-So why do we care if the are not feasible? Well if the direction of an edge was reversed by mistake we could generate exactly these conditions. Think about a divided highway and on the north bound lane one segment got entered wrong or maybe a sequence of multiple segments got entered wrong or maybe this happened on a round-about. The result would be potentially a `source` and/or a `sink` node.
-
-So by counting the number of edges entering and exiting each node we can identify both `source` and `sink` nodes so that you can look at those areas of your network to make repairs and/or report the problem back to your data vendor.
-
-.. rubric:: Prerequisites
-
-The  edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table <edge_table>_vertices_pgr that stores the vertices information.
-
-  - Use :ref:`pgr_createVerticesTable <pgr_create_vert_table>` to create the vertices table.
-  - Use :ref:`pgr_createTopology <pgr_create_topology>` to create the topology and the vertices table. 
-
-.. rubric:: Parameters
-
-:edge_table: ``text`` Network table name. (may contain the schema name as well)
-:s_in_rules: ``text[]`` source node **in** rules
-:s_out_rules: ``text[]`` source node **out** rules
-:t_in_rules: ``text[]`` target node **in** rules
-:t_out_rules: ``text[]`` target node **out** rules
-:oneway: ``text`` oneway column name name of the network table. Default value is ``oneway``.
-:source: ``text`` Source column name of the network table. Default value is ``source``.
-:target: ``text``  Target column name of the network table.  Default value is ``target``. 
-:two_way_if_null: ``boolean`` flag to treat oneway NULL values as bi-directional.  Default value is ``true``.
-
-.. note:: It is strongly recommended to use the named notation. See :ref:`pgr_createVerticesTable <pgr_create_vert_table>` or :ref:`pgr_createTopology <pgr_create_topology>` for examples.
-
-
-The function returns:
-
-  - ``OK`` after the analysis has finished.
-
-    * Uses the vertices table: <edge_table>_vertices_pgr.
-    * Fills completely the ``ein`` and ``eout`` columns of the vertices table.
-
-  - ``FAIL`` when the analysis was not completed due to an error. 
-
-    * The vertices table is not found.
-    * A required column of the Network table is not found or is not of the appropriate type.
-    * The names of source , target or oneway are the same.
-
-The rules are defined as an array of text strings that if match the ``oneway`` value would be counted as ``true`` for the source or target **in** or **out** condition.
-
-.. rubric:: The Vertices Table
-
-The vertices table can be created with :ref:`pgr_createVerticesTable <pgr_create_vert_table>` or :ref:`pgr_createTopology <pgr_create_topology>`
-
-The structure of the vertices table is:
-
-:id: ``bigint`` Identifier of the vertex.
-:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. See :ref:`pgr_analyzeGgraph <pgr_analyze_graph>`.
-:chk: ``integer``  Indicator that the vertex might have a problem. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
-:ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. 
-:eout: ``integer`` Number of vertices in the edge_table that reference this vertex as outgoing.
-:the_geom: ``geometry`` Point geometry of the vertex.
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-	SELECT pgr_analyzeOneway('edge_table', 
-        ARRAY['', 'B', 'TF'],
-        ARRAY['', 'B', 'FT'],
-        ARRAY['', 'B', 'FT'],
-        ARRAY['', 'B', 'TF'],
-        oneway:='dir');
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table','{"",B,TF}','{"",B,FT}','{"",B,FT}','{"",B,TF}','dir','source','target',t)
-	NOTICE:  Analyzing graph for one way street errors.
-	NOTICE:  Analysis 25% complete ...
-	NOTICE:  Analysis 50% complete ...
-	NOTICE:  Analysis 75% complete ...
-	NOTICE:  Analysis 100% complete ...
-	NOTICE:  Found 0 potential problems in directionality
-
-	pgr_analyzeoneway 
-	-------------------
-	OK
-	(1 row)
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`topology`  for an overview of a topology for routing algorithms.
-* :ref:`analytics` for an overview of the analysis of a graph.
-* :ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
-* :ref:`pgr_create_vert_table` to reconstruct the vertices table based on the source and target information.
-
diff --git a/src/common/doc/functions/create_topology.rst b/src/common/doc/functions/create_topology.rst
deleted file mode 100644
index 87a3231..0000000
--- a/src/common/doc/functions/create_topology.rst
+++ /dev/null
@@ -1,291 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_create_topology:
-
-pgr_createTopology
-===============================================================================
-
-.. index:: 
-	single: pgr_createTopology(text,double precision,text,text,text,text,text)
-	module: common
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_createTopology`` — Builds a network topology based on the geometry information.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The function returns:
-
-  - ``OK`` after the network topology has been built and the vertices table created.
-  - ``FAIL`` when the network topology was not built due to an error. 
-
-.. code-block:: sql
-
-	varchar pgr_createTopology(text edge_table, double precision tolerance, 
-                           text the_geom:='the_geom', text id:='id',
-                           text source:='source',text target:='target',
-                           text rows_where:='true', boolean clean:=false)
-
-
-
-Description
--------------------------------------------------------------------------------
-
-.. rubric:: Parameters
-
-The topology creation function accepts the following parameters:
-
-:edge_table: ``text`` Network table name. (may contain the schema name AS well)
-:tolerance: ``float8`` Snapping tolerance of disconnected edges. (in projection unit)
-:the_geom: ``text``  Geometry column name of the network table. Default value is ``the_geom``.  
-:id: ``text``  Primary key column name of the network table. Default value is ``id``. 
-:source: ``text`` Source column name of the network table. Default value is ``source``.
-:target: ``text``  Target column name of the network table.  Default value is ``target``. 
-:rows_where: ``text``   Condition to SELECT a subset or rows.  Default value is ``true`` to indicate
- all rows that where ``source`` or ``target`` have a null value, otherwise the condition is used.
-:clean: ``boolean`` Clean any previous topology.  Default value is ``false``.
-
-.. warning::
-
-    The ``edge_table`` will be affected
-
-	- The ``source`` column values will change.
-	- The ``target`` column values will change.
-        - An index will be created, if it doesn't exists, to speed up the process to the following columns:
-
-	   * ``id``
-	   * ``the_geom``
-	   * ``source``
-	   * ``target``
-
-The function returns:
-
-  - ``OK`` after the network topology has been built.
-
-    * Creates a vertices table: <edge_table>_vertices_pgr.
-    * Fills ``id`` and ``the_geom`` columns of the vertices table.
-    * Fills the source and target columns of the edge table referencing the ``id`` of the vertices table.
-
-
-  - ``FAIL`` when the network topology was not built due to an error:
-
-    * A required column of the Network table is not found or is not of the appropriate type.
-    * The condition is not well formed.
-    * The names of source , target or id are the same.
-    * The SRID of the geometry could not be determined.
-
-
-.. rubric:: The Vertices Table
-
-The vertices table is a requirment of the :ref:`pgr_analyzeGraph <pgr_analyze_graph>` and the :ref:`pgr_analyzeOneway <pgr_analyze_oneway>` functions.
-
-The structure of the vertices table is:
-
-:id: ``bigint`` Identifier of the vertex.
-:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
-:chk: ``integer``  Indicator that the vertex might have a problem. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
-:ein: ``integer`` Number of vertices in the edge_table that reference this vertex AS incoming. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`.
-:eout: ``integer`` Number of vertices in the edge_table that reference this vertex AS outgoing. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`. 
-:the_geom: ``geometry`` Point geometry of the vertex.
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-
-Usage when the edge table's columns MATCH the default values:
--------------------------------------------------------------------------------
- 
-.. rubric:: The simplest way to use pgr_createtopology is: 
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001);
-
-
-
-.. rubric:: When the arguments are given in the order described in the parameters:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target');
-
-We get the same result AS the simplest way to use the function.
-
-.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``id`` of the table ``ege_table`` is passed to the function AS the geometry column, and the geometry column ``the_geom`` is passed to the function AS the id column. 
- | ``SELECT  pgr_createTopology('edge_table',0.001,'id','the_geom','source','target');``
- | ERROR: Can not determine the srid of the geometry "id" in table public.edge_table
-
-.. rubric:: When using the named notation
-
-The order of the parameters do not matter:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
-
-Parameters defined with a default value can be omited, AS long AS the value matches the default:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001,source:='source');
-
-.. rubric:: Selecting rows using rows_where parameter
-
-Selecting rows based on the id.
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001,rows_where:='id < 10');
-
-Selecting the rows where the geometry is near the geometry of row with ``id`` =5 .
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
-
-Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom);
-	SELECT  pgr_createTopology('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-
-
-
-Usage when the edge table's columns DO NOT MATCH the default values:
--------------------------------------------------------------------------------
- 
-For the following table
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS mytable;
-	CREATE TABLE mytable AS (SELECT id AS gid, the_geom AS mygeom,source AS src ,target AS tgt FROM edge_table) ;
-
-.. rubric:: Using positional notation: 
-
-The arguments need to be given in the order described in the parameters:
-
-.. code-block:: sql
-
-	SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt');
-
-.. warning::  | An error would occur when the arguments are not given in the appropiriate order: In this example, the column ``gid`` of the table ``mytable`` is passed to the function AS the geometry column, and the geometry column ``mygeom`` is passed to the function AS the id column.
- | ``SELECT  pgr_createTopology('mytable',0.001,'gid','mygeom','src','tgt');``
- | ERROR: Can not determine the srid of the geometry "gid" in table public.mytable
-
-
-.. rubric:: When using the named notation
-
-The order of the parameters do not matter:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
-
-In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.
-
-
-.. rubric:: Selecting rows using rows_where parameter
-
-Selecting rows based on the id.
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
-
-Selecting the rows where the geometry is near the geometry of row with ``id`` =5 .
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
-
-Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
-	SELECT  pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt',
-                           rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createTopology('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
-                           rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
-
-
-
-Examples
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-	SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id<10');
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','id<10')
-	NOTICE:  Performing checks, pelase wait .....
-	NOTICE:  Creating Topology, Please wait...
-	NOTICE:  -------------> TOPOLOGY CREATED FOR  9 edges
-	NOTICE:  Rows with NULL geometry or NULL id: 0
-	NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
-	
-	 pgr_createtopology 
-	--------------------
-	 OK
-	(1 row)
-
-	SELECT pgr_createTopology('edge_table', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait .....
-	NOTICE:  Creating Topology, Please wait...
-	NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
-	NOTICE:  Rows with NULL geometry or NULL id: 0
-	NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
-
-	 pgr_createtopology 
-	--------------------
-	 OK
-	(1 row)
-
-The example uses the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`topology` for an overview of a topology for routing algorithms.
-* :ref:`pgr_create_vert_table` to reconstruct the vertices table based on the source and target information.
-* :ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
-
diff --git a/src/common/doc/functions/create_vert_table.rst b/src/common/doc/functions/create_vert_table.rst
deleted file mode 100644
index 383c991..0000000
--- a/src/common/doc/functions/create_vert_table.rst
+++ /dev/null
@@ -1,267 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_create_vert_table:
-
-pgr_createVerticesTable 
-===============================================================================
-
-.. index:: 
-	single: pgr_createVerticesTable(text,text,text,text,text)
-	module: common
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_createVerticesTable`` — Reconstructs the vertices table based on the source and target information.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The function returns:
-
-  - ``OK`` after the vertices table has been reconstructed.
-  - ``FAIL`` when the vertices table was not reconstructed due to an error. 
-
-.. code-block:: sql
-
-	varchar pgr_createVerticesTable(text edge_table,  text the_geom:='the_geom'
-                           text source:='source',text target:='target',text rows_where:='true')
-
-
-
-Description
--------------------------------------------------------------------------------
-
-.. Rubric:: Parameters
-
-The reconstruction of the vertices table  function accepts the following parameters:
-
-:edge_table: ``text`` Network table name. (may contain the schema name as well)
-:the_geom: ``text``  Geometry column name of the network table. Default value is ``the_geom``.  
-:source: ``text`` Source column name of the network table. Default value is ``source``.
-:target: ``text``  Target column name of the network table.  Default value is ``target``. 
-:rows_where: ``text``   Condition to SELECT a subset or rows.  Default value is ``true`` to indicate all rows.
-
-.. warning::
-
-    The ``edge_table`` will be affected
-
-        - An index will be created, if it doesn't exists, to speed up the process to the following columns:
-
-           * ``the_geom``
-           * ``source``
-           * ``target``
-
-The function returns:
-
-  - ``OK`` after the vertices table has been reconstructed.
-
-    * Creates a vertices table: <edge_table>_vertices_pgr.
-    * Fills ``id`` and ``the_geom`` columns of the vertices table based on the source and target columns of the edge table.
-
-  - ``FAIL`` when the vertices table was not reconstructed due to an error. 
-
-    * A required column of the Network table is not found or is not of the appropriate type.
-    * The condition is not well formed.
-    * The names of source, target are the same.
-    * The SRID of the geometry could not be determined.
-
-.. rubric:: The Vertices Table
-
-The vertices table is a requierment of the :ref:`pgr_analyzeGraph <pgr_analyze_graph>` and the :ref:`pgr_analyzeOneway <pgr_analyze_oneway>` functions.
-
-The structure of the vertices table is:
-
-:id: ``bigint`` Identifier of the vertex.
-:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
-:chk: ``integer``  Indicator that the vertex might have a problem. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
-:ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`.
-:eout: ``integer`` Number of vertices in the edge_table that reference this vertex as outgoing. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`. 
-:the_geom: ``geometry`` Point geometry of the vertex.
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-
-Usage when the edge table's columns MATCH the default values:
--------------------------------------------------------------------------------
- 
-.. rubric:: The simplest way to use pgr_createVerticesTable is: 
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table');
-
-
-.. rubric:: When the arguments are given in the order described in the parameters:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table','the_geom','source','target');
-
-We get the same result as the simplest way to use the function.
-
-.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column source column ``source`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``the_geom`` is passed to the function as the source column. 
- | ``SELECT  pgr_createVerticesTable('edge_table','source','the_geom','target');``
-
-
-.. rubric:: When using the named notation
-
-The order of the parameters do not matter:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table',the_geom:='the_geom',source:='source',target:='target');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table',source:='source',target:='target',the_geom:='the_geom');
-
-Parameters defined with a default value can be omited, as long as the value matches the default:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table',source:='source');
-
-.. rubric:: Selecting rows using rows_where parameter
-
-Selecting rows based on the id.
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='id < 10');
-
-Selecting the rows where the geometry is near the geometry of row with ``id`` =5 .
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(the_geom,0.5) FROM edge_table WHERE id=5)');
-
-Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
-	SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)');
-
-
-
-Usage when the edge table's columns DO NOT MATCH the default values:
--------------------------------------------------------------------------------
- 
-For the following table
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS mytable;
-	CREATE TABLE mytable AS (SELECT id AS gid, the_geom AS mygeom,source AS src ,target AS tgt FROM edge_table) ;
-
-.. rubric:: Using positional notation: 
-
-The arguments need to be given in the order described in the parameters:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt');
-
-.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``src`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``mygeom`` is passed to the function as the source column.
- | ``SELECT  pgr_createVerticesTable('mytable','src','mygeom','tgt');``
-
-
-.. rubric:: When using the named notation
-
-The order of the parameters do not matter:
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable',the_geom:='mygeom',source:='src',target:='tgt');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom');
-
-In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.
-
-
-.. rubric:: Selecting rows using rows_where parameter
-
-Selecting rows based on the gid.
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',rows_where:='gid < 10');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
-
-Selecting the rows where the geometry is near the geometry of row with ``gid`` =5 .
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
-	                            rows_where:='the_geom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)');
-
-.. code-block:: sql
-
-	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE id=5)');
-
-Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
-
-.. code-block:: sql
-
-	DROP TABLE IF EXISTS otherTable;
-	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
-	SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
-	                            rows_where:='the_geom && (SELECT st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)');
-
-.. code-block:: sql
-
-	SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
-	                            rows_where:='the_geom && (SELECT st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)');
-
-
-
-Examples
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-	SELECT pgr_createVerticesTable('edge_table');
-	NOTICE:  PROCESSING:
-    NOTICE:  pgr_createVerticesTable('edge_table','the_geom','source','target','true')
-    NOTICE:  Performing checks, pelase wait .....
-    NOTICE:  Populating public.edge_table_vertices_pgr, please wait...
-    NOTICE:    ----->   VERTICES TABLE CREATED WITH  17 VERTICES
-    NOTICE:                                         FOR   18  EDGES
-    NOTICE:    Edges with NULL geometry,source or target: 0
-    NOTICE:                              Edges processed: 18
-    NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
-    NOTICE:  ----------------------------------------------
-               
-	 pgr_createVerticesTable 
-	--------------------
-	 OK
-	(1 row)
-
-
-The example uses the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`topology`  for an overview of a topology for routing algorithms.
-* :ref:`pgr_createTopology <pgr_create_topology>` to create a topology based on the geometry.
-* :ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
-* :ref:`pgr_analyze_oneway` to analyze directionality of the edges.
diff --git a/src/common/doc/functions/images/Fig1-originalData.png b/src/common/doc/functions/images/Fig1-originalData.png
deleted file mode 100644
index 2784787..0000000
Binary files a/src/common/doc/functions/images/Fig1-originalData.png and /dev/null differ
diff --git a/src/common/doc/functions/index.rst b/src/common/doc/functions/index.rst
deleted file mode 100644
index 46e71d1..0000000
--- a/src/common/doc/functions/index.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _topology_functions:
-
-Topology Functions
-===============================================================================
-
-The pgRouting's topology of a network, represented with an edge table with source and target attributes and a vertices table associated with it. 
-Depending on the algorithm, you can create a topology or just reconstruct the vertices table, You can analyze the topology, 
-We also provide a function to node an unoded network.
-
-  -  :ref:`pgr_create_topology` -  to create a topology based on the geometry. 
-  -  :ref:`pgr_create_vert_table` - to reconstruct the vertices table based on the source and target information.
-  -  :ref:`pgr_analyze_graph`  - to analyze the edges and vertices of the edge table.
-  -  :ref:`pgr_analyze_oneway` - to analyze directionality of the edges.
-  -  :ref:`pgr_node_network`  -to create nodes to a not noded edge table.
-
-.. toctree::
-  :hidden: 
-
-  pgr_createTopology to create a topology based on the geometry. <create_topology>
-  pgr_createVerticesTable -to reconstruct the vertices table based on the source and target information. <create_vert_table>
-  pgr_analyzeGraph - to analyze the edges and vertices of the edge table. <analyze_graph>
-  pgr_analyzeOneway to analyze directionality of the edges. <analyze_oneway>
-  pgr_nodeNetwork -to create nodes to a not noded edge table. <node_network>
-
diff --git a/src/common/doc/functions/node_network.rst b/src/common/doc/functions/node_network.rst
deleted file mode 100644
index c5ca876..0000000
--- a/src/common/doc/functions/node_network.rst
+++ /dev/null
@@ -1,395 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_node_network:
-
-pgr_nodeNetwork
-===============================================================================
-
-.. index:: 
-	single: pgr_NodeNetwork(text,float8,text,text,text)
-	module: common
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_nodeNetwork`` - Nodes an network edge table.
-
-:Author: Nicolas Ribot
-:Copyright: Nicolas Ribot, The source code is released under the MIT-X license.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The function reads edges from a not "noded" network table and writes the "noded" edges into a new table.
-
-.. code-block:: sql
-
-    text pgr_nodenetwork(text edge_table, float8, tolerance,
-			 text  id='id', text the_geom='the_geom',text table_ending='noded')
-  
-
-Description
--------------------------------------------------------------------------------
-
-A common problem associated with bringing GIS data into pgRouting is the fact that the data is often not "noded" correctly. This will create invalid topologies, which will result in routes that are incorrect.
-
-What we mean by "noded" is that at every intersection in the road network all the edges will be broken into separate road segments. There are cases like an over-pass and under-pass intersection where you can not traverse from the over-pass to the under-pass, but this function does not have the ability to detect and accommodate those situations.
-
-This function reads the ``edge_table`` table, that has a primary key column ``id`` and geometry column named ``the_geom`` and intersect all the segments in it against all the other segments and then creates a table ``edge_table_noded``. It uses the ``tolerance`` for deciding that multiple nodes within the tolerance are considered the same node. 
-
-Parameters
-
-:edge_table: ``text`` Network table name. (may contain the schema name as well)
-:tolerance: ``float8`` tolerance for coincident points (in projection unit)dd
-:id: ``text`` Primary key column name of the network table. Default value is ``id``.
-:the_geom: ``text`` Geometry column name of the network table. Default value is ``the_geom``.
-:table_ending: ``text`` Suffix for the new table's. Default value is ``noded``.
-
-The output table will have for  ``edge_table_noded``  
-
-:id: ``bigint`` Unique identifier for the table
-:old_id: ``bigint``  Identifier of the edge in original table
-:sub_id: ``integer`` Segment number of the original edge
-:source: ``integer`` Empty source column to be used with  :ref:`pgr_create_topology` function
-:target: ``integer`` Empty target column to be used with  :ref:`pgr_create_topology` function
-:the geom: ``geometry`` Geometry column of the noded network
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Example
--------------------------------------------------------------------------------
-
-Let's create the topology for the data in :ref:`sampledata`
-
-.. code-block:: sql
-
-	SELECT pgr_createTopology('edge_table', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait .....
-	NOTICE:  Creating Topology, Please wait...
-	NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
-	NOTICE:  Rows with NULL geometry or NULL id: 0
-	NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
-	NOTICE:  ----------------------------------------------
- 	pgr_createtopology 
-	--------------------
- 	 OK
-	(1 row)
-	
-Now we can analyze the network.
-
-.. code-block:: sql
-
-	SELECT pgr_analyzegraph('edge_table', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 2
-	NOTICE:                            Dead ends: 7
-	NOTICE:  Potential gaps found near dead ends: 1
-	NOTICE:               Intersections detected: 1
-	NOTICE:                      Ring geometries: 0
- 	pgr_analyzegraph 
-	------------------
- 	 OK
-	(1 row)
-
-The analysis tell us that the network has a gap and and an intersection. We try to fix the problem using:
-
-.. code-block:: sql
-
-	SELECT pgr_nodeNetwork('edge_table', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_nodeNetwork('edge_table',0.001,'the_geom','id','noded')
-	NOTICE:  Performing checks, pelase wait .....
-	NOTICE:  Processing, pelase wait .....
-	NOTICE:    Splitted Edges: 3
-	NOTICE:   Untouched Edges: 15
-	NOTICE:       Total original Edges: 18
-	NOTICE:   Edges generated: 6
-	NOTICE:   Untouched Edges: 15
-	NOTICE:         Total New segments: 21
-	NOTICE:   New Table: public.edge_table_noded
-	NOTICE:  ----------------------------------
- 	pgr_nodenetwork 
-	-----------------
- 	 OK
-	(1 row)
-	
-Inspecting the generated table, we can see that edges 13,14 and 18 has been segmented
-
-.. code-block:: sql
-
-	SELECT old_id,sub_id FROM edge_table_noded ORDER BY old_id,sub_id;
- 	 old_id | sub_id 
-	--------+--------
-  	 1      |      1
-  	 2      |      1
-  	 3      |      1
-  	 4      |      1
-  	 5      |      1
-  	 6      |      1
-  	 7      |      1
-  	 8      |      1
-  	 9      |      1
- 	 10     |      1
- 	 11     |      1
- 	 12     |      1
- 	 13     |      1
- 	 13     |      2
- 	 14     |      1
- 	 14     |      2
- 	 15     |      1
- 	 16     |      1
- 	 17     |      1
- 	 18     |      1
- 	 18     |      2
-	(21 rows)
-		
-We can create the topology of the new network
-
-.. code-block:: sql
-
-	SELECT pgr_createTopology('edge_table_noded', 0.001);
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_createTopology('edge_table_noded',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait .....
-	NOTICE:  Creating Topology, Please wait...
-	NOTICE:  -------------> TOPOLOGY CREATED FOR  21 edges
-	NOTICE:  Rows with NULL geometry or NULL id: 0
-	NOTICE:  Vertices table for table public.edge_table_noded is: public.edge_table_noded_vertices_pgr
-	NOTICE:  ----------------------------------------------
- 	pgr_createtopology 
-	--------------------
- 	 OK
-	(1 row)
-	
-Now let's analyze the new topology
-
-.. code-block:: sql
-
-	SELECT pgr_analyzegraph('edge_table_noded', 0.001); 
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table_noded',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 0
-	NOTICE:                            Dead ends: 6
-	NOTICE:  Potential gaps found near dead ends: 0
-	NOTICE:               Intersections detected: 0
-	NOTICE:                      Ring geometries: 0
- 	pgr_createtopology 
-	--------------------
- 	 OK
-	(1 row)
-
-
-Images
--------------------------------------------------------------------------------
-
-.. only:: html
-
-	+--------------------------------------+-------------------------------------+
-	|.. Rubric:: Before Image              |.. Rubric:: After Image              |
-	|                                      |                                     |
-	|.. image:: images/before_node_net.png |.. image:: images/after_node_net.png |
-	|   :scale: 60%                        |   :scale: 60%                       |
-	|   :alt: before image                 |   :alt: after image                 |
-	|   :align: left                       |   :align: right                     |
-	+--------------------------------------+-------------------------------------+
-
-
-.. only:: latex
-
-	.. Rubric:: Before Image
-
-	.. image:: images/before_node_net.png 
-		:scale: 60%
-		:alt: before image 
-		:align: left
-
-
-	.. Rubric:: After Image
-
-	.. image:: images/after_node_net.png 
-		:scale: 60%
-		:alt: after image 
-		:align: left
-
-
-Comparing the results
--------------------------------------------------------------------------------
-
-Comparing with the Analysis in the original edge_table, we see that.  
-
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-|                  |                Before                   |                        After                                 |
-+==================+=========================================+==============================================================+
-|Table name        | edge_table                              | edge_table_noded                                             |
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-|Fields            | All original fields                     | Has only basic fields to do a topology analysis              |
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-|Dead ends         | - Edges with 1 dead end: 1,6,24         | Edges with 1 dead end: 1-1 ,6-1,14-2, 18-1 17-1 18-2         |
-|                  | - Edges with 2 dead ends  17,18         |                                                              |
-|                  |                                         |                                                              |
-|                  | Edge 17's right node is a dead end      |                                                              |
-|                  | because there is no other edge sharing  |                                                              |
-|                  | that same node. (cnt=1)                 |                                                              |
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-|Isolated segments | two isolated segments:  17 and 18 both  | No Isolated segments                                         |
-|                  | they have 2 dead ends                   |  - Edge 17 now shares a node with edges 14-1 and 14-2        |
-|                  |                                         |  - Edges 18-1 and 18-2 share a node with edges 13-1 and 13-2 |
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-|Gaps              | There is a gap between edge 17 and 14   | Edge 14 was segmented                                        |
-|                  | because edge 14 is near to the right    | Now edges: 14-1 14-2 17 share the same node                  |
-|                  | node of edge 17                         | The tolerance value was taken in account                     |
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-|Intersections     | Edges 13 and 18 were intersecting       | Edges were segmented, So, now in the interection's           |
-|                  |                                         | point there is a node and the following edges share it:      |
-|                  |                                         | 13-1 13-2 18-1 18-2                                          |
-+------------------+-----------------------------------------+--------------------------------------------------------------+
-
-Now, we are going to include the segments 13-1, 13-2 14-1, 14-2 ,18-1 and 18-2 into our edge-table, copying the data for dir,cost,and reverse cost with tho following steps:
-
-   - Add a column old_id into edge_table, this column is going to keep track the id of the original edge
-   - Insert only the segmented edges, that is, the ones whose max(sub_id) >1
- 
-.. code-block:: sql
-
-	alter table edge_table drop column if exists old_id;
-	alter table edge_table add column old_id integer;
-	insert into edge_table (old_id,dir,cost,reverse_cost,the_geom)
-   		(with
-       		segmented as (select old_id,count(*) as i from edge_table_noded group by old_id)
-   		select  segments.old_id,dir,cost,reverse_cost,segments.the_geom
-       			from edge_table as edges join edge_table_noded as segments on (edges.id = segments.old_id) 
-       			where edges.id in (select old_id from segmented where i>1) );
-
-We recreate the topology:
-
-.. code-block:: sql
-
-	SELECT pgr_createTopology('edge_table', 0.001);
-
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait .....
-	NOTICE:  Creating Topology, Please wait...
-	NOTICE:  -------------> TOPOLOGY CREATED FOR  24 edges
-	NOTICE:  Rows with NULL geometry or NULL id: 0
-	NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
-	NOTICE:  ----------------------------------------------
- 	pgr_createtopology 
-	--------------------
- 	OK
-	(1 row)
-
-
-To get the same analysis results as the topology of edge_table_noded, we do the following query:
-
-.. code-block:: sql
-
-	SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='id not in (select old_id from edge_table where old_id is not null)');
-
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target',
-                                   'id not in (select old_id from edge_table where old_id is not null)')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 0
-	NOTICE:                            Dead ends: 6
-	NOTICE:  Potential gaps found near dead ends: 0
-	NOTICE:               Intersections detected: 0
-	NOTICE:                      Ring geometries: 0
- 	pgr_createtopology 
-	--------------------
- 	OK
-	(1 row)
-
-
-To get the same analysis results as the original edge_table, we do the following query:
-
-.. code-block:: sql
-
-	SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='old_id is null')
-
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','old_id is null')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 2
-	NOTICE:                            Dead ends: 7
-	NOTICE:  Potential gaps found near dead ends: 1
-	NOTICE:               Intersections detected: 1
-	NOTICE:                      Ring geometries: 0
- 	pgr_createtopology 
-	--------------------
- 	OK
-	(1 row)
-
-Or we can analyze everything because, maybe edge 18 is an overpass, edge 14 is an under pass and there is also a street level juction, and the same happens with edges 17 and 13.
-
-.. code-block:: sql
-
-	SELECT pgr_analyzegraph('edge_table', 0.001);
-
-	NOTICE:  PROCESSING:
-	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
-	NOTICE:  Performing checks, pelase wait...
-	NOTICE:  Analyzing for dead ends. Please wait...
-	NOTICE:  Analyzing for gaps. Please wait...
-	NOTICE:  Analyzing for isolated edges. Please wait...
-	NOTICE:  Analyzing for ring geometries. Please wait...
-	NOTICE:  Analyzing for intersections. Please wait...
-	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
-	NOTICE:                    Isolated segments: 0
-	NOTICE:                            Dead ends: 3
-	NOTICE:  Potential gaps found near dead ends: 0
-	NOTICE:               Intersections detected: 5
-	NOTICE:                      Ring geometries: 0
- 	pgr_createtopology 
-	--------------------
- 	OK
-	(1 row)
-
-
-See Also
--------------------------------------------------------------------------------
-
-:ref:`topology` for an overview of a topology for routing algorithms.
-:ref:`pgr_analyze_oneway` to analyze directionality of the edges.
-:ref:`pgr_create_topology` to create a topology based on the geometry.
-:ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
diff --git a/src/common/doc/index.rst b/src/common/doc/index.rst
deleted file mode 100644
index 839c54e..0000000
--- a/src/common/doc/index.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _common:
-
-Common Functions
-===============================================================================
-
-.. toctree::
-   :maxdepth: 1
-
-   convenience/index
-   utilities/index
-   functions/index
-   types/index
diff --git a/src/common/doc/legacy.rst b/src/common/doc/legacy.rst
deleted file mode 100644
index 25592cb..0000000
--- a/src/common/doc/legacy.rst
+++ /dev/null
@@ -1,65 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _common_legacy:
-
-Legacy Functions
-===============================================================================
-
-pgRouting 2.0 release has total restructured the function naming and obsoleted many of the functions that were available in the 1.x releases. While we realize that this may inconvenience our existing users, we felt this was needed for the long term viability of the project to be more response to our users and to be able to add new functionality and test existing functionality.
-
-We have made a minimal effort to save most of these function and distribute with the release in a file ``pgrouting_legacy.sql`` that is not part of the pgrouting extension and is not supported. If you can use these functions that is great. We have not tested any of these functions so if you find issues and want to post a pull request or a patch to help other users that is fine, but it is likely this file will be removed in a future release and we strongly recommend that you convert your  [...]
-
-The follow is a list of TYPEs, CASTs and FUNCTION included in the ``pgrouting_legacy.sql`` file. The list is provide as a convenience but these functions are deprecated, not supported, and probably will need some changes to get them to work.
-
-
-TYPEs & CASTs
-********************************************************************************
-
-.. code-block:: sql
-
-	TYPE vertex_result AS ( x float8, y float8 ):
-	CAST (pgr_pathResult AS path_result) WITHOUT FUNCTION AS IMPLICIT;
-	CAST (pgr_geoms AS geoms) WITHOUT FUNCTION AS IMPLICIT;
-	CAST (pgr_linkPoint AS link_point) WITHOUT FUNCTION AS IMPLICIT;
-
-
-FUNCTIONs
-********************************************************************************
-
-.. code-block:: sql
-
-	FUNCTION text(boolean)
-	FUNCTION add_vertices_geometry(geom_table varchar)
-	FUNCTION update_cost_from_distance(geom_table varchar)
-	FUNCTION insert_vertex(vertices_table varchar, geom_id anyelement)
-	FUNCTION pgr_shootingStar(sql text, source_id integer, target_id integer,
-                              directed boolean, has_reverse_cost boolean)
-	FUNCTION shootingstar_sp( varchar,int4, int4, float8, varchar, boolean, boolean)
-	FUNCTION astar_sp_delta( varchar,int4, int4, float8)
-	FUNCTION astar_sp_delta_directed( varchar,int4, int4, float8, boolean, boolean)
-	FUNCTION astar_sp_delta_cc( varchar,int4, int4, float8, varchar)
-	FUNCTION astar_sp_delta_cc_directed( varchar,int4, int4, float8, varchar, boolean, boolean)
-	FUNCTION astar_sp_bbox( varchar,int4, int4, float8, float8, float8, float8)
-	FUNCTION astar_sp_bbox_directed( varchar,int4, int4, float8, float8, float8,
-                                     float8, boolean, boolean)
-	FUNCTION astar_sp( geom_table varchar, source int4, target int4)
-	FUNCTION astar_sp_directed( geom_table varchar, source int4, target int4,
-                                dir boolean, rc boolean)
-	FUNCTION dijkstra_sp( geom_table varchar, source int4, target int4)
-	FUNCTION dijkstra_sp_directed( geom_table varchar, source int4, target int4,
-                                   dir boolean, rc boolean)
-	FUNCTION dijkstra_sp_delta( varchar,int4, int4, float8)
-	FUNCTION dijkstra_sp_delta_directed( varchar,int4, int4, float8, boolean, boolean)
-	FUNCTION tsp_astar( geom_table varchar,ids varchar, source integer, delta double precision)
-	FUNCTION tsp_astar_directed( geom_table varchar,ids varchar, source integer, delta float8, dir boolean, rc boolean)
-	FUNCTION tsp_dijkstra( geom_table varchar,ids varchar, source integer)
-	FUNCTION tsp_dijkstra_directed( geom_table varchar,ids varchar, source integer,
-                                    delta float8, dir boolean, rc boolean)
-
diff --git a/src/common/doc/pgr_version.rst b/src/common/doc/pgr_version.rst
new file mode 100644
index 0000000..4267479
--- /dev/null
+++ b/src/common/doc/pgr_version.rst
@@ -0,0 +1,82 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_version:
+
+pgr_version 
+===============================================================================
+
+.. index:: 
+	single: version()
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_version`` — Query for pgRouting version information.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Returns a table with pgRouting version information.
+
+.. code-block:: sql
+
+	table() pgr_version();
+
+
+Description
+-------------------------------------------------------------------------------
+
+Returns a table with:
+
+:version: ``varchar`` pgRouting version
+:tag: ``varchar`` Git tag of pgRouting build
+:hash: ``varchar`` Git hash of pgRouting build
+:branch: ``varchar`` Git branch of pgRouting build
+:boost: ``varchar`` Boost version
+
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Query for full version string
+
+.. code-block:: sql
+
+    SELECT pgr_version();
+
+                      pgr_version
+    -----------------------------------------------
+     (2.2.0,pgrouting-2.2.0,9fd33c5,master,1.54.0)
+    (1 row)
+
+
+
+* Query for ``version`` and ``boost`` attribute
+
+.. code-block:: sql
+
+    SELECT version, boost FROM pgr_version();
+
+      version  | boost  
+    -----------+--------
+     2.2.0-dev | 1.49.0
+    (1 row)
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_versionless` to compare two version numbers
diff --git a/src/common/doc/types/cost_result.rst b/src/common/doc/types/cost_result.rst
index 26fba1d..e44fc6c 100644
--- a/src/common/doc/types/cost_result.rst
+++ b/src/common/doc/types/cost_result.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/types/geom_result.rst b/src/common/doc/types/geom_result.rst
index dddef78..846a632 100644
--- a/src/common/doc/types/geom_result.rst
+++ b/src/common/doc/types/geom_result.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/types/index.rst b/src/common/doc/types/index.rst
index 454f53f..62f9c8f 100644
--- a/src/common/doc/types/index.rst
+++ b/src/common/doc/types/index.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/end_point.rst b/src/common/doc/utilities/end_point.rst
index 472a1be..b0c8b03 100644
--- a/src/common/doc/utilities/end_point.rst
+++ b/src/common/doc/utilities/end_point.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/get_column_name.rst b/src/common/doc/utilities/get_column_name.rst
index e21c3cd..d66da13 100644
--- a/src/common/doc/utilities/get_column_name.rst
+++ b/src/common/doc/utilities/get_column_name.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/get_table_name.rst b/src/common/doc/utilities/get_table_name.rst
index 9bd420c..98dc64b 100644
--- a/src/common/doc/utilities/get_table_name.rst
+++ b/src/common/doc/utilities/get_table_name.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/index.rst b/src/common/doc/utilities/index.rst
index 1807182..1162060 100644
--- a/src/common/doc/utilities/index.rst
+++ b/src/common/doc/utilities/index.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
@@ -12,30 +12,33 @@
 Developers's Functions
 ===============================================================================
 
-Functions to help you develop a wrapper or a recipe 
+.. warning:: This functions have being deprecated in version 2.1
 
-   -  :ref:`pgr_get_column_name` - to get the name of the column as is stored in the postgres administration tables.
-   -  :ref:`pgr_get_table_name` - to retrieve the name of the table as is stored in the postgres administration tables.
-   -  :ref:`pgr_is_column_indexed` - to check if the column is indexed. 
-   -  :ref:`pgr_is_column_in_table` - to check only for the existance of the column.
-   -  :ref:`pgr_point_to_id` -to insert/get the id of the inserted point in a vertices table.
-   -  :ref:`pgr_quote_ident` - to quotes the input text to be used as an identifier in an SQL statement string.
-   -  :ref:`pgr_versionless` - to compare two version numbers.
-   -  :ref:`pgr_start_point` - to get the start point of a (multi)linestring.
-   -  :ref:`pgr_end_point` - to get the end point of a (multi)linestring.
 
-.. toctree::
-   :hidden:
+The functions have being renamed but documentation will not be generated for
+any of the developer's functions.
+
+   -  :ref:`pgr_get_column_name`
+   -  :ref:`pgr_get_table_name`
+   -  :ref:`pgr_is_column_indexed`
+   -  :ref:`pgr_is_column_in_table`
+   -  :ref:`pgr_point_to_id`
+   -  :ref:`pgr_quote_ident`
+   -  :ref:`pgr_versionless`
+   -  :ref:`pgr_start_point`
+   -  :ref:`pgr_end_point`
 
-	pgr_getColumnName - to get the name of the column as is stored in the postgres administration tables. <get_column_name> 
-	pgr_getTableName - to retrieve the name of the table as is stored in the postgres administration tables.<get_table_name>
-	pgr_isColumnIndexed - to check if the column is indexed. <is_column_indexed>
-	pgr_isColumnInTable - to check only for the existance of the column.<is_column_in_table> 
-	pgr_pointToId -to insert/get the id of the inserted point in a vertices table.<point_to_id>
-	pgr_quote_ident - to quotes the input text to be used as an identifier in an SQL statement string.<quote_ident>
-	pgr_versionless - to compare two version numbers<versionless>
-	pgr_startPoint - to get the start point of a (multi)linestring<start_point>
-	pgr_endPoint - to get the end point of a (multi)linestring<end_point>
 
+.. toctree::
+   :hidden:
 
+   get_column_name
+   get_table_name
+   is_column_indexed
+   is_column_in_table
+   point_to_id
+   quote_ident
+   versionless
+   start_point
+   end_point
 
diff --git a/src/common/doc/utilities/is_column_in_table.rst b/src/common/doc/utilities/is_column_in_table.rst
index 982d546..5369fbc 100644
--- a/src/common/doc/utilities/is_column_in_table.rst
+++ b/src/common/doc/utilities/is_column_in_table.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/is_column_indexed.rst b/src/common/doc/utilities/is_column_indexed.rst
index 377c862..bd883c0 100644
--- a/src/common/doc/utilities/is_column_indexed.rst
+++ b/src/common/doc/utilities/is_column_indexed.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
@@ -23,7 +23,7 @@ Name
 
 .. note:: This function is intended for the developer’s aid.
 
-.. warning:: This function is  deprecated in 2.1
+.. warning:: This function is deprecated in 2.1
              Use `_pgr_isColumnIndexed` instead
 
 
diff --git a/src/common/doc/utilities/point_to_id.rst b/src/common/doc/utilities/point_to_id.rst
index e64e908..00f2c3e 100644
--- a/src/common/doc/utilities/point_to_id.rst
+++ b/src/common/doc/utilities/point_to_id.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/quote_ident.rst b/src/common/doc/utilities/quote_ident.rst
index b496b5e..9b5f56e 100644
--- a/src/common/doc/utilities/quote_ident.rst
+++ b/src/common/doc/utilities/quote_ident.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/start_point.rst b/src/common/doc/utilities/start_point.rst
index f23f53b..5f7ff64 100644
--- a/src/common/doc/utilities/start_point.rst
+++ b/src/common/doc/utilities/start_point.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/doc/utilities/version.rst b/src/common/doc/utilities/version.rst
deleted file mode 100644
index 4fe143b..0000000
--- a/src/common/doc/utilities/version.rst
+++ /dev/null
@@ -1,81 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_version:
-
-pgr_version 
-===============================================================================
-
-.. index:: 
-	single: version()
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_version`` — Query for pgRouting version information.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-Returns a table with pgRouting version information.
-
-.. code-block:: sql
-
-	table() pgr_version();
-
-
-Description
--------------------------------------------------------------------------------
-
-Returns a table with:
-
-:version: ``varchar`` pgRouting version
-:tag: ``varchar`` Git tag of pgRouting build
-:hash: ``varchar`` Git hash of pgRouting build
-:branch: ``varchar`` Git branch of pgRouting build
-:boost: ``varchar`` Boost version
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Query for full version string
-
-.. code-block:: sql
-
-    SELECT pgr_version();
-
-                         pgr_version                      
-    ------------------------------------------------------
-     (2.0.0-dev,v2.0dev,290,c64bcb9,sew-devel-2_0,1.49.0)
-    (1 row)
-
-
-* Query for ``version`` and ``boost`` attribute
-
-.. code-block:: sql
-
-    SELECT version, boost FROM pgr_version();
-
-      version  | boost  
-    -----------+--------
-     2.0.0-dev | 1.49.0
-    (1 row)
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`pgr_versionless` to compare two version numbers
diff --git a/src/common/doc/utilities/versionless.rst b/src/common/doc/utilities/versionless.rst
index 1efb23e..6332b48 100644
--- a/src/common/doc/utilities/versionless.rst
+++ b/src/common/doc/utilities/versionless.rst
@@ -3,7 +3,7 @@
     pgRouting Manual
     Copyright(c) pgRouting Contributors
 
-    This documentation is licensed under a Creative Commons Attribution-Share  
+    This documentation is licensed under a Creative Commons Attribution-Share
     Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
    ****************************************************************************
 
diff --git a/src/common/sql/CMakeLists.txt b/src/common/sql/CMakeLists.txt
index d9afacb..86a9a5a 100644
--- a/src/common/sql/CMakeLists.txt
+++ b/src/common/sql/CMakeLists.txt
@@ -1,20 +1,15 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting-types.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_version.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_utilities.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_topology.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_analytics.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_node_network.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_conversion_tools.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_dmatrix_tools.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/pgr_parameter_check.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/utilities_pgr.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/noUnderUtilities.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/create_vertices_table.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/createIndex.sql
+    #${CMAKE_CURRENT_SOURCE_DIR}/findClosestEdge.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/_point_toId.sql
     
-# this one is in the main CMakelist becuse types have to go first
-#    ${CMAKE_CURRENT_SOURCE_DIR}/types.sql
 )
 
 # set in parent scope
diff --git a/src/common/sql/OBSOLETE/pgrouting_network_check.sql b/src/common/sql/OBSOLETE/pgrouting_network_check.sql
deleted file mode 100644
index 9e462df..0000000
--- a/src/common/sql/OBSOLETE/pgrouting_network_check.sql
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-	Alternative to pgrouting_analytics.sql
-
-	Example:
-	SELECT * FROM data.PGR_analyze_graph('SELECT source, target, geom_way 
-		AS geom FROM data.dhaka_2po_4pgr', 0.000001) WHERE checkit;
-CREATE OR REPLACE FUNCTION PGR_analyzeGraph(sql text, tolerance float)
-  RETURNS TABLE(
-	vertex bigint, 
-	source integer,
-	target integer,
-	checkit boolean,
-	geom geometry
-) AS
-$BODY$
-DECLARE 
-	rec	record;
-	pnt	record;
-	seg	record;
-BEGIN
-	-- Create temporary vertex table
-	CREATE TEMPORARY TABLE vertices_temp (
-		vertex bigint  PRIMARY KEY,
-		source integer DEFAULT 0,
-		target integer DEFAULT 0,
-		checkit boolean DEFAULT false,
-		geom geometry
-	) ON COMMIT DROP;
-
-	-- Count occurance of vertex as source/target
-	RAISE NOTICE 'Count occurance of vertex as source/target';
-	FOR rec IN EXECUTE sql
-	LOOP
-		-- Source
-		BEGIN
-			EXECUTE 'INSERT INTO vertices_temp (vertex,geom,source) VALUES ($1,$2,1)' 
-				USING rec.source, PGR_Startpoint(rec.geom);
-				-- This assumes that source equals start point of geometry
-		EXCEPTION WHEN unique_violation THEN
-			EXECUTE 'UPDATE vertices_temp SET source = source + 1 WHERE vertex = $1' 
-				USING rec.source;
-		END;
-
-		-- Target
-		BEGIN
-			EXECUTE 'INSERT INTO vertices_temp (vertex,geom,target) VALUES ($1,$2,1)' 
-				USING rec.target, PGR_Endpoint(rec.geom);
-				-- This assumes that target equals end point of geometry
-		EXCEPTION WHEN unique_violation THEN
-			EXECUTE 'UPDATE vertices_temp SET target = target + 1 WHERE vertex = $1' 
-				USING rec.target;
-		END;
-	END LOOP;
-
-	-- Create indices
-	RAISE NOTICE 'Create indices';
-	CREATE INDEX vertices_temp_source_idx ON vertices_temp USING btree (source);
-	CREATE INDEX vertices_temp_target_idx ON vertices_temp USING btree (target);
-	CREATE INDEX vertices_temp_geom_idx ON vertices_temp USING gist (geom);
-	CREATE INDEX vertices_temp_checkit_idx ON vertices_temp USING btree (checkit);
-
-	-- Analyze graph for gaps and zlev errors
-	RAISE NOTICE 'Analyze graph for gaps and zlev errors';
-	FOR pnt IN EXECUTE 'SELECT * FROM vertices_temp 
-				WHERE (source + target) = 1 ORDER BY vertex'
-	LOOP
-		-- TODO: Better to filter with tolerance BBOX?
-		FOR seg IN EXECUTE 'SELECT * FROM (' || sql || ') a WHERE ST_DWithin(a.geom,$1,$2)'
-				USING pnt.geom, tolerance
-		LOOP
-			IF pnt.vertex NOT IN (seg.source, seg.target) THEN
-				EXECUTE 'UPDATE vertices_temp SET checkit = TRUE WHERE vertex = $1'
-					USING pnt.vertex;
-			END IF;
-		END LOOP;
-	END LOOP;
-
-	RETURN QUERY SELECT * FROM vertices_temp;
-EXCEPTION
-	-- Not sure this is a good idea or not. It prevents to show "ugly" console output 
-	WHEN others THEN
-	RAISE EXCEPTION '%', SQLERRM;
-END;
-$BODY$
-  LANGUAGE plpgsql VOLATILE STRICT
-  COST 100;
- */
diff --git a/src/common/sql/OBSOLETE/routing_tsp_wrappers.sql b/src/common/sql/OBSOLETE/routing_tsp_wrappers.sql
deleted file mode 100644
index 060c867..0000000
--- a/src/common/sql/OBSOLETE/routing_tsp_wrappers.sql
+++ /dev/null
@@ -1,52 +0,0 @@
---
--- Copyright (c) 2005 Sylvain Pasche,
---               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
--- BEGIN;
-
------------------------------------------------------
--- Returns TSP solution as a set of vertex ids
---
--- Last changes: 14.02.2008
------------------------------------------------------
-CREATE OR REPLACE FUNCTION pgr_tspIds(geom_table varchar, 
-       ids varchar, source integer) 
-       RETURNS SETOF integer AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-	prev integer;
-
-BEGIN
-	prev := -1;
-	FOR path_result IN EXECUTE 'SELECT vertex_id FROM tsp(''select distinct source::integer as source_id, ST_X(PGR_StartPoint(the_geom)), ST_Y(PGR_StartPoint(the_geom)) from ' ||
-		pgr_quote_ident(geom_table) || ' where source in (' || 
-                ids || ')  UNION select distinct target as source_id, ST_X(PGR_EndPoint(the_geom)), ST_Y(PGR_EndPoint(the_geom)) from '|| pgr_quote_ident(geom_table) ||' where target in ('||ids||')'', '''|| ids  ||''', '|| source  ||')' LOOP
-
-                v_id = path_result.vertex_id;
-        RETURN NEXT v_id;
-	END LOOP;
-
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-
diff --git a/src/common/sql/_point_toId.sql b/src/common/sql/_point_toId.sql
new file mode 100644
index 0000000..a5e9f90
--- /dev/null
+++ b/src/common/sql/_point_toId.sql
@@ -0,0 +1,81 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Author: Stephen Woodbridge <woodbri at imaptools.com>
+Author: Vicky Vergara <vicky_vergara at hotmail,com>
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*
+.. function:: _pgr_pointToId(point geometry, tolerance double precision,vname text,srid integer)
+Using tolerance to determine if its an existing point:
+    - Inserts a point into the vertices table "vertname" with the srid "srid", 
+and returns
+    - the id of the new point
+    - the id of the existing point.
+   
+Tolerance is the minimal distance between existing points and the new point to create a new point.
+
+Last changes: 2013-03-22
+
+HISTORY
+Last changes: 2013-03-22
+2013-08-19: handling schemas
+*/
+
+CREATE OR REPLACE FUNCTION _pgr_pointToId(
+    point geometry, 
+    tolerance double precision,
+    vertname text,
+    srid integer)
+
+  RETURNS bigint AS
+$BODY$
+DECLARE
+    rec record;
+    pid bigint;
+
+BEGIN
+    EXECUTE 'SELECT ST_Distance(
+        the_geom,
+        ST_GeomFromText(ST_AsText('
+                || quote_literal(point::text)
+                || '),'
+            || srid ||')) AS d, id, the_geom
+    FROM '||_pgr_quote_ident(vertname)||'
+    WHERE ST_DWithin(
+        the_geom, 
+        ST_GeomFromText(
+            ST_AsText(' || quote_literal(point::text) ||'),
+            ' || srid || '),' || tolerance||')
+    ORDER BY d
+    LIMIT 1' INTO rec ;
+    IF rec.id IS NOT NULL THEN
+        pid := rec.id;
+    ELSE
+        execute 'INSERT INTO '||_pgr_quote_ident(vertname)||' (the_geom) VALUES ('||quote_literal(point::text)||')';
+        pid := lastval();
+END IF;
+
+RETURN pid;
+
+END;
+$BODY$
+LANGUAGE plpgsql VOLATILE STRICT;
+
diff --git a/src/common/sql/createIndex.sql b/src/common/sql/createIndex.sql
index c903ebf..0010fec 100644
--- a/src/common/sql/createIndex.sql
+++ b/src/common/sql/createIndex.sql
@@ -1,24 +1,28 @@
-/*PGR
- createIndex.sql
+/*PGR-GNU*****************************************************************
 
- Copyright (c) 2015 Celia Virginia Vergara Castillo
+ FILE: createIndex.sql
+
+ Copyright (c) 2014 Celia Virginia Vergara Castillo
  vicky_vergara at hotmail.com
 
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
 
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+********************************************************************PGR-GNU*/
 
-*/
 
 
 /************************************************************************
diff --git a/src/common/sql/create_vertices_table.sql b/src/common/sql/create_vertices_table.sql
deleted file mode 100644
index 937e8d1..0000000
--- a/src/common/sql/create_vertices_table.sql
+++ /dev/null
@@ -1,232 +0,0 @@
-/* PGR
-
-create_vertices_table.sql
-This function should not be used directly. Use assign_vertex_id instead
-Inserts a point into the vertices tablei "vname" with the srid "srid", and return an id
-of a new point or an existing point. Tolerance is the minimal distance
-between existing points and the new point to create a new point.
-
-Modified by: Vicky Vergara <vicky_vergara at hotmail,com>
-
-HISTORY
-Last changes: 2013-03-22
-2013-08-19: handling schemas
-*/
-
-
-
-/*
-.. function:: pgr_createVerticesTable(edge_table text, the_geom text, source text default 'source', target text default 'target')
-
-  Based on "source" and "target" columns creates the vetrices_pgr table for edge_table
-  Ignores rows where "source" or "target" have NULL values 
-
-  Author: Vicky Vergara <vicky_vergara at hotmail,com>
-
- HISTORY
-    Created 2013-08-19
-*/
-
-CREATE OR REPLACE FUNCTION pgr_createverticestable(
-   edge_table text,
-   the_geom text DEFAULT 'the_geom'::text,
-   source text DEFAULT 'source'::text,
-   target text DEFAULT 'target'::text,
-    rows_where text DEFAULT 'true'::text
-)
-  RETURNS text AS
-$BODY$
-DECLARE
-    naming record;
-    sridinfo record;
-    sname text;
-    tname text;
-    tabname text;
-    vname text;
-    vertname text;
-    gname text;
-    sourcename text;
-    targetname text;
-    query text;
-    ecnt integer; 
-    srid integer;
-    sourcetype text;
-    targettype text;
-    sql text;
-    totcount integer;
-    i integer;
-    notincluded integer;
-    included integer;
-    debuglevel text;
-    dummyRec text;
-    fnName text;
-    err bool;
-
-
-BEGIN 
-  fnName = 'pgr_createVerticesTable';
-  raise notice 'PROCESSING:'; 
-  raise notice 'pgr_createVerticesTable(''%'',''%'',''%'',''%'',''%'')',edge_table,the_geom,source,target,rows_where;
-  execute 'show client_min_messages' into debuglevel;
-
-  raise notice 'Performing checks, please wait .....';
-
-  RAISE DEBUG 'Checking % exists',edge_table;
-        execute 'select * from _pgr_getTableName('|| quote_literal(edge_table)
-                                                  || ',2,' || quote_literal(fnName) ||' )' into naming;
-
-    sname=naming.sname;
-    tname=naming.tname;
-    tabname=sname||'.'||tname;
-    vname=tname||'_vertices_pgr';
-    vertname= sname||'.'||vname;
-    rows_where = ' AND ('||rows_where||')';
-  raise debug '--> Edge table exists: OK';
-   
-  raise debug 'Checking column names';
-    select * into sourcename from _pgr_getColumnName(sname, tname,source,2, fnName);
-    select * into targetname from _pgr_getColumnName(sname, tname,target,2, fnName);
-    select * into gname      from _pgr_getColumnName(sname, tname,the_geom,2, fnName);
-
-
-    err = sourcename in (targetname,gname) or  targetname=gname;
-    perform _pgr_onError(err, 2, fnName,
-        'Two columns share the same name', 'Parameter names for the_geom,source and target  must be different');
-  raise debug '--> Column names: OK';
-
-  raise debug 'Checking column types in edge table';
-    select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1, fnName);
-    select * into targettype from _pgr_getColumnType(sname,tname,targetname,1, fnName);
-
-
-    err = sourcetype not in('integer','smallint','bigint');
-    perform _pgr_onError(err, 2, fnName,
-        'Wrong type of Column source: '|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found');
-
-    err = targettype not in('integer','smallint','bigint');
-    perform _pgr_onError(err, 2, fnName,
-        'Wrong type of Column target: '|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or biginti but '||targettype||' was found');
-
-  raise debug '-->Column types:OK';
-
-  raise debug 'Checking SRID of geometry column';
-     query= 'SELECT ST_SRID(' || quote_ident(gname) || ') as srid '
-        || ' FROM ' || _pgr_quote_ident(tabname)
-        || ' WHERE ' || quote_ident(gname)
-        || ' IS NOT NULL LIMIT 1';
-     raise debug '%',query;
-     EXECUTE query INTO sridinfo;
-
-     err =  sridinfo IS NULL OR sridinfo.srid IS NULL;
-     perform _pgr_onError(err, 2, fnName,
-         'Can not determine the srid of the geometry '|| gname ||' in table '||tabname, 'Check the geometry of column '||gname);
-     srid := sridinfo.srid;
-  raise DEBUG '     --> OK';
-
-  raise debug 'Checking and creating Indices';
-     perform _pgr_createIndex(sname, tname , sourcename , 'btree'::text);
-     perform _pgr_createIndex(sname, tname , targetname , 'btree'::text);
-     perform _pgr_createIndex(sname, tname , gname , 'gist'::text);
-  raise DEBUG '-->Check and create indices: OK';
-
-     gname=quote_ident(gname);
-     sourcename=quote_ident(sourcename);
-     targetname=quote_ident(targetname);
-
-
-  BEGIN
-  raise debug 'Checking Condition';
-    -- issue #193 & issue #210 & #213
-    -- this sql is for trying out the where clause
-    -- the select * is to avoid any colum name conflicts
-    -- limit 1, just try on first record
-    -- if the where clasuse is ill formed it will be catched in the exception
-    sql = 'select * from '||_pgr_quote_ident(tabname)||' WHERE true'||rows_where ||' limit 1';
-    EXECUTE sql into dummyRec;
-    -- end 
-
-    -- if above where clasue works this one should work
-    -- any error will be catched by the exception also
-    sql = 'select count(*) from '||_pgr_quote_ident(tabname)||' WHERE (' || gname || ' IS NULL or '||
-		sourcename||' is null or '||targetname||' is null)=true '||rows_where;
-    raise debug '%',sql;
-    EXECUTE SQL  into notincluded;
-    EXCEPTION WHEN OTHERS THEN  
-         RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
-         RAISE NOTICE 'ERROR: Condition is not correct, please execute the following query to test your condition';
-         RAISE NOTICE '%',sql;
-         RETURN 'FAIL';
-  END;
-
-
-
-    
-  BEGIN
-     raise DEBUG 'initializing %',vertname;
-       execute 'select * from _pgr_getTableName('||quote_literal(vertname)||',0)' into naming;
-       IF sname=naming.sname  AND vname=naming.tname  THEN
-           execute 'TRUNCATE TABLE '||_pgr_quote_ident(vertname)||' RESTART IDENTITY';
-           execute 'SELECT DROPGEOMETRYCOLUMN('||quote_literal(sname)||','||quote_literal(vname)||','||quote_literal('the_geom')||')';
-       ELSE
-           set client_min_messages  to warning;
-       	   execute 'CREATE TABLE '||_pgr_quote_ident(vertname)||' (id bigserial PRIMARY KEY,cnt integer,chk integer,ein integer,eout integer)';
-       END IF;
-       execute 'select addGeometryColumn('||quote_literal(sname)||','||quote_literal(vname)||','||
-                quote_literal('the_geom')||','|| srid||', '||quote_literal('POINT')||', 2)';
-       execute 'CREATE INDEX '||quote_ident(vname||'_the_geom_idx')||' ON '||_pgr_quote_ident(vertname)||'  USING GIST (the_geom)';
-       execute 'set client_min_messages  to '|| debuglevel;
-       raise DEBUG  '  ------>OK'; 
-       EXCEPTION WHEN OTHERS THEN  
-         RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
-         RAISE NOTICE 'ERROR: Initializing vertex table';
-         RAISE NOTICE '%',sql;
-         RETURN 'FAIL';
-  END;       
-
-  BEGIN
-       raise notice 'Populating %, please wait...',vertname;
-       sql= 'with
-		lines as ((select distinct '||sourcename||' as id, _pgr_startpoint(st_linemerge('||gname||')) as the_geom from '||_pgr_quote_ident(tabname)||
-		                  ' where ('|| gname || ' IS NULL 
-                                    or '||sourcename||' is null 
-                                    or '||targetname||' is null)=false 
-                                     '||rows_where||')
-			union (select distinct '||targetname||' as id,_pgr_endpoint(st_linemerge('||gname||')) as the_geom from '||_pgr_quote_ident(tabname)||
-			          ' where ('|| gname || ' IS NULL 
-                                    or '||sourcename||' is null 
-                                    or '||targetname||' is null)=false
-                                     '||rows_where||'))
-		,numberedLines as (select row_number() OVER (ORDER BY id) AS i,* from lines )
-		,maxid as (select id,max(i) as maxi from numberedLines group by id)
-		insert into '||_pgr_quote_ident(vertname)||'(id,the_geom)  (select id,the_geom  from numberedLines join maxid using(id) where i=maxi order by id)';
-       RAISE debug '%',sql;
-       execute sql;
-       GET DIAGNOSTICS totcount = ROW_COUNT;
-
-       sql = 'select count(*) from '||_pgr_quote_ident(tabname)||' a, '||_pgr_quote_ident(vertname)||' b 
-            where '||sourcename||'=b.id and '|| targetname||' in (select id from '||_pgr_quote_ident(vertname)||')';
-       RAISE debug '%',sql;
-       execute sql into included;
-
-
-
-       execute 'select max(id) from '||_pgr_quote_ident(vertname) into ecnt;
-       execute 'SELECT setval('||quote_literal(vertname||'_id_seq')||','||coalesce(ecnt,1)||' , false)';
-       raise notice '  ----->   VERTICES TABLE CREATED WITH  % VERTICES', totcount;
-       raise notice '                                       FOR   %  EDGES', included+notincluded;
-       RAISE NOTICE '  Edges with NULL geometry,source or target: %',notincluded;
-       RAISE NOTICE '                            Edges processed: %',included;
-       Raise notice 'Vertices table for table % is: %',_pgr_quote_ident(tabname),_pgr_quote_ident(vertname);
-       raise notice '----------------------------------------------';
-    END;
-    
-    RETURN 'OK';
- EXCEPTION WHEN OTHERS THEN
-   RAISE NOTICE 'Unexpected error %', SQLERRM; -- issue 210,211
-   RETURN 'FAIL';
-END;
-$BODY$
-  LANGUAGE plpgsql VOLATILE STRICT;
-
-COMMENT ON FUNCTION pgr_createVerticesTable(text,text,text,text,text) 
-IS 'args: edge_table, the_geom:=''the_geom'',source:=''source'', target:=''target'' rows_where:=''true'' - creates a vertices table based on the source and target identifiers for selected rows';
diff --git a/src/common/sql/findClosestEdge.sql b/src/common/sql/findClosestEdge.sql
new file mode 100644
index 0000000..29829eb
--- /dev/null
+++ b/src/common/sql/findClosestEdge.sql
@@ -0,0 +1,100 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+/*
+ *  pgr_findClosestEdge(edges_sql text, pnt geometry, tol float8)
+ *
+ *  Given and table of edges with a spatial index on the_geom
+ *  and a point geometry search for the closest edge within tol distance to the edges
+ *  then compute the projection of the point onto the line segment and select source or target
+ *  based on whether the projected point is closer to the respective end and return source or target.
+ *  If no edge is within tol distance then return -1
+  IF az > pi()/2 AND az < pi() OR az > 3 * pi()/2 THEN - then to the right
+*/
+
+CREATE OR REPLACE FUNCTION pgr_findClosestEdge(
+    edges_sql text,
+    point_geom geometry,
+    tolerance float8,
+
+    OUT edge_id BIGINT,
+    OUT fraction FLOAT,
+    OUT side CHAR)
+    returns SETOF RECORD AS
+$body$
+DECLARE
+    safe_sql text;
+    sql text;
+    rec RECORD;
+BEGIN
+
+    IF (tolerance < 0 ) THEN
+        RAISE EXCEPTION 'Invalid value for tolerance';
+    END IF;
+
+    safe_sql =  'SELECT * from ('|| edges_sql ||' ) AS __a__';
+
+    BEGIN
+        EXECUTE safe_sql || ' LIMIT 1' into rec;
+        EXCEPTION WHEN OTHERS THEN
+            RAISE EXCEPTION 'Could not execute query please verify syntax of: '
+            USING HINT = edges_sql;
+    END;
+
+    BEGIN
+        EXECUTE 'SELECT id, the_geom  from ('||safe_sql||') as __b__' into rec;
+        EXCEPTION
+            WHEN OTHERS THEN
+                RAISE EXCEPTION 'An expected column was not found in the query'
+                  USING HINT = 'Please veryfy the column names: id, the_geom';
+    END;
+
+    sql =' 
+    WITH
+    safesql AS (' || safe_sql || '),
+    close_ones AS
+    (SELECT id, the_geom AS line,
+        ST_Distance(the_geom,' || quote_literal(point_geom::TEXT) ||'::geometry ) AS distance,
+        ST_ClosestPoint(the_geom,' || quote_literal(point_geom::TEXT) || '::geometry) AS blade
+        FROM  safesql
+        WHERE ST_DWithin(the_geom,' || quote_literal(point_geom::TEXT) ||'::geometry, ' || tolerance || ')),
+    closest_ones AS
+    (SELECT min(distance) min_dist FROM close_ones),
+    third_q AS
+    (SELECT DISTINCT(id) id, distance, line, blade FROM close_ones WHERE distance = (select min_dist from closest_ones) ORDER BY id LIMIT 1),
+    dump_values AS
+    (SELECT id, 
+        (ST_length(ST_GeometryN(st_split(line, blade),1))/ST_length(line))::FLOAT AS fraction,
+        (line << ' || quote_literal(point_geom::TEXT) || '::geometry) as rightSide
+        FROM third_q)
+    SELECT id::BIGINT,
+           fraction::FLOAT,
+           (CASE WHEN rightSide THEN ''r'' ELSE ''l'' END)::char FROM dump_values';
+
+    RETURN query EXECUTE sql;
+
+END;
+$body$
+  language plpgsql volatile
+  cost 5;
+
diff --git a/src/common/sql/noUnderUtilities.sql b/src/common/sql/noUnderUtilities.sql
index f249284..e3df719 100644
--- a/src/common/sql/noUnderUtilities.sql
+++ b/src/common/sql/noUnderUtilities.sql
@@ -1,9 +1,27 @@
--- -------------------------------------------------------------------
--- pgrouting_utilities.sql
--- AuthorL Stephen Woodbridge <woodbri at imaptools.com>
--- Copyright 2013 Stephen Woodbridge
--- This file is release unde an MIT-X license.
--- -------------------------------------------------------------------
+/*PGR-GNU*****************************************************************
+
+FILE: noUnderUtilities.sql
+
+Copyright (c) 2015 Celia Vriginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 
 CREATE OR REPLACE FUNCTION pgr_getTableName(IN tab text,OUT sname text,OUT tname text)
diff --git a/src/common/sql/pgr_parameter_check.sql b/src/common/sql/pgr_parameter_check.sql
index 283f665..d017515 100644
--- a/src/common/sql/pgr_parameter_check.sql
+++ b/src/common/sql/pgr_parameter_check.sql
@@ -1,7 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
 
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+File: pgr_parameter_check.sql
+
+Copyright (c) 2014 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,7 +21,8 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
+
 
 -----------------------------------------------------------------------
 -- Function _pgr_parameter_check
@@ -25,6 +30,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 -----------------------------------------------------------------------
 
 -- change the default to true when all the functions will use the bigint
+-- put TRUE when it uses BGINT
+-- Query styles:
+-- dijkstra (id, source, target, cost, [reverse_cost])
+-- johnson (source, target, cost, [reverse_cost])
+
 CREATE OR REPLACE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean default false)
   RETURNS bool AS
   $BODY$  
@@ -35,6 +45,10 @@ CREATE OR REPLACE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean d
   has_rcost boolean;
   safesql text;
   BEGIN 
+    IF (big) THEN
+       RAISE EXCEPTION 'This function is for old style functions';
+    END IF;
+
     -- checking query is executable
     BEGIN
       safesql =  'select * from ('||sql||' ) AS __a__ limit 1';
@@ -46,40 +60,55 @@ CREATE OR REPLACE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean d
     END;
 
     -- checking the fixed columns and data types of the integers
-    IF fn IN ('driving', 'dijkstra', 'ksp') THEN
-      BEGIN
-        execute 'select id,source,target,cost  from ('||safesql||') as __b__' into rec;
-        EXCEPTION
-          WHEN OTHERS THEN
-              RAISE EXCEPTION 'An expected column was not found in the query'
-                USING HINT = 'Please veryfy the column names: id, source, target, cost';
-      END;
+    IF fn IN ('dijkstra') THEN
+        BEGIN
+          execute 'select id,source,target,cost  from ('||safesql||') as __b__' into rec;
+          EXCEPTION
+            WHEN OTHERS THEN
+                RAISE EXCEPTION 'An expected column was not found in the query'
+                  USING ERRCODE = 'XX000',
+                   HINT = 'Please veryfy the column names: id, source, target, cost';
+        END;
+        execute 'select pg_typeof(id)::text as id_type, pg_typeof(source)::text as source_type, pg_typeof(target)::text as target_type, pg_typeof(cost)::text as cost_type'
+            || ' from ('||safesql||') AS __b__ ' into rec;
+        -- Version 2.0.0 is more restrictive
+        IF NOT(   (rec.id_type in ('integer'::text))
+              AND (rec.source_type in ('integer'::text))
+              AND (rec.target_type in ('integer'::text))
+              AND (rec.cost_type = 'double precision'::text)) THEN
+            RAISE EXCEPTION 'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8'
+            USING ERRCODE = 'XX000';
+        END IF;
     END IF;
  
-    IF fn IN ('driving', 'dijkstra', 'ksp') THEN
-      execute 'select pg_typeof(id)::text as id_type, pg_typeof(source)::text as source_type, pg_typeof(target)::text as target_type, pg_typeof(cost)::text as cost_type'
+
+
+        -- checking the fixed columns and data types of the integers
+    IF fn IN ('johnson') THEN
+        BEGIN
+          execute 'select source,target,cost  from ('||safesql||') as __b__' into rec;
+          EXCEPTION
+            WHEN OTHERS THEN
+                RAISE EXCEPTION 'An expected column was not found in the query'
+                  USING HINT = 'Please veryfy the column names: id, source, target, cost',
+                         ERRCODE = 'XX000';
+        END;
+
+        execute 'select pg_typeof(source)::text as source_type, pg_typeof(target)::text as target_type, pg_typeof(cost)::text as cost_type'
             || ' from ('||safesql||') AS __b__ ' into rec;
-      if (big) then
-        if not (rec.id_type in ('bigint'::text, 'integer'::text, 'smallint'::text))
-           OR   not (rec.source_type in ('bigint'::text, 'integer'::text, 'smallint'::text))
-           OR   not (rec.target_type in ('bigint'::text, 'integer'::text, 'smallint'::text))
-           OR   not (rec.cost_type in ('bigint'::text, 'integer'::text, 'smallint'::text, 'double precision'::text, 'real'::text)) then
-           RAISE EXCEPTION 'Illegar type found in query.';
-        end if;
-      else -- Version 2.0.0 is more restrictive
-        if not(   (rec.id_type in ('integer'::text))
-              and (rec.source_type in ('integer'::text))
-              and (rec.target_type in ('integer'::text))
-              and (rec.cost_type = 'double precision'::text)) then
-            RAISE EXCEPTION 'Support for id,source,target columns only of type: integer. Support for Cost: double precision';
-        end if;
-      end if;
+        -- Version 2.0.0 is more restrictive
+        IF NOT(   (rec.source_type in ('integer'::text))
+              AND (rec.target_type in ('integer'::text))
+              AND (rec.cost_type = 'double precision'::text)) THEN
+            RAISE EXCEPTION 'Support for source,target columns only of type: integer. Support for Cost: double precision'
+            USING ERRCODE = 'XX000';
+        END IF;
     END IF;
 
 
     -- Checking the data types of the optional reverse_cost";
     has_rcost := false;
-    IF fn IN ('driving', 'dijkstra', 'ksp') THEN
+    IF fn IN ('johnson','dijkstra') THEN
       BEGIN
         execute 'select reverse_cost, pg_typeof(reverse_cost)::text as rev_type  from ('||safesql||' ) AS __b__ limit 1 ' into rec1;
         has_rcost := true;
@@ -91,11 +120,13 @@ CREATE OR REPLACE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean d
       if (has_rcost) then
         IF (big) then
            IF  not (rec1.rev_type in ('bigint'::text, 'integer'::text, 'smallint'::text, 'double precision'::text, 'real'::text)) then
-             RAISE EXCEPTION 'Illegar type in optional parameter reverse_cost.';
+             RAISE EXCEPTION 'Illegar type in optional parameter reverse_cost.'
+             USING ERRCODE = 'XX000';
            END IF;
         ELSE -- Version 2.0.0 is more restrictive
            IF (rec1.rev_type != 'double precision') then
-             RAISE EXCEPTION 'Illegal type in optimal parameter reverse_cost, expected: double precision';
+             RAISE EXCEPTION 'Illegal type in optional parameter reverse_cost, expected: double precision'
+             USING ERRCODE = 'XX000';
            END IF;
         END IF;
       end if;
diff --git a/src/common/sql/pgrouting-types.sql b/src/common/sql/pgrouting-types.sql
index d6a4f65..ac63ecf 100644
--- a/src/common/sql/pgrouting-types.sql
+++ b/src/common/sql/pgrouting-types.sql
@@ -1,6 +1,27 @@
+/*PGR-GNU*****************************************************************
 
---  pgRouting 2.0 types
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
 
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+--  pgRouting 2.0 types
 
 
 
diff --git a/src/common/sql/pgrouting_analytics.sql b/src/common/sql/pgrouting_analytics.sql
deleted file mode 100644
index 5d9310e..0000000
--- a/src/common/sql/pgrouting_analytics.sql
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
-=========================
-pgRouting Graph Analytics
-=========================
-:Author: Stephen Woodbridge <woodbri at swoodbridge.com>
-:Date: $Date: 2013-03-22 20:14:00 -5000 (Fri, 22 Mar 2013) $
-:Revision: $Revision: 0000 $
-:Description: This is a collection of tools for analyzing graphs.
-It has been contributed to pgRouting by iMaptools.com.
-:Copyright: Stephen Woodbridge. This is released under the MIT-X license.
-
-*/
-
-
-/*
-.. function:: pgr_analyzeGraph(edge_tab, tolerance,the_geom, source,target)
-
-   Analyzes the "edge_tab" and "edge_tab_vertices_pgr" tables and flags if
-   nodes are deadends, ie vertices_tmp.cnt=1 and identifies nodes
-   that might be disconnected because of gaps < tolerance or because of
-   zlevel errors in the data. For example:
-
-.. code-block:: sql
-
-       select pgr_analyzeGraph('mytab', 0.000002);
-
-   After the analyzing the graph, deadends are indentified by *cnt=1*
-   in the "vertices_tmp" table and potential problems are identified
-   with *chk=1*.  (Using 'source' and 'target' columns for analysis)
-
-.. code-block:: sql
-
-       select * from vertices_tmp where chk = 1;
-
-HISOTRY
-:Author: Stephen Woodbridge <woodbri at swoodbridge.com>
-:Modified: 2013/08/20 by Vicky Vergara <vicky_vergara at hotmail.com>
-
-Makes more checks:
-   checks table edge_tab exists in the schema
-   checks source and target columns exist in edge_tab
-   checks that source and target are completely populated i.e. do not have NULL values
-   checks table edge_tabVertices exist in the appropiate schema
-       if not, it creates it and populates it
-   checks 'cnt','chk' columns exist in  edge_tabVertices
-       if not, it creates them
-   checks if 'id' column of edge_tabVertices is indexed
-       if not, it creates the index
-   checks if 'source','target',the_geom columns of edge_tab are indexed
-       if not, it creates their index
-   populates cnt in edge_tabVertices  <--- changed the way it was processed, because on large tables took to long.
-					   For sure I am wrong doing this, but it gave me the same result as the original.
-   populates chk                      <--- added a notice for big tables, because it takes time
-           (edge_tab text, the_geom text, tolerance double precision)
-*/
-
-CREATE OR REPLACE FUNCTION pgr_analyzegraph(edge_table text,tolerance double precision,the_geom text default 'the_geom',id text default 'id',source text default 'source',target text default 'target',rows_where text default 'true')
-RETURNS character varying AS
-$BODY$
-
-DECLARE
-    points record;
-    seg record;
-    naming record;
-    sridinfo record;
-    srid integer;
-    ecnt integer;
-    vertname text;
-    sname text;
-    tname text;
-    vname text;
-    idname text;
-    sourcename text;
-    targetname text;
-    sourcetype text;
-    targettype text;
-    geotype text;
-    gname text;
-    tabName text;
-    flag boolean ;
-    query text;
-    selectionquery text;
-    i integer;
-    tot integer;
-    NumIsolated integer;
-    numdeadends integer;
-    numgaps integer;
-    NumCrossing integer;
-    numRings integer;
-    debuglevel text;
-
-
-
-
-BEGIN
-  raise notice 'PROCESSING:';
-  raise notice 'pgr_analyzeGraph(''%'',%,''%'',''%'',''%'',''%'',''%'')',edge_table,tolerance,the_geom,id,source,target,rows_where;
-  raise notice 'Performing checks, please wait ...';
-  execute 'show client_min_messages' into debuglevel;
-
-
-  BEGIN
-    RAISE DEBUG 'Checking % exists',edge_table;
-    execute 'select * from _pgr_getTableName('||quote_literal(edge_table)||',2)' into naming;
-    sname=naming.sname;
-    tname=naming.tname;
-    tabname=sname||'.'||tname;
-    vname=tname||'_vertices_pgr';
-    vertname= sname||'.'||vname;
-    rows_where = ' AND ('||rows_where||')';
-    raise DEBUG '     --> OK';
-/*    EXCEPTION WHEN raise_exception THEN
-      RAISE NOTICE 'ERROR: something went wrong checking the table name';
-      RETURN 'FAIL';
-*/
-  END;
-
-  BEGIN
-       raise debug 'Checking Vertices table';
-       execute 'select * from  _pgr_checkVertTab('||quote_literal(vertname) ||', ''{"id","cnt","chk"}''::text[])' into naming;
-       execute 'UPDATE '||_pgr_quote_ident(vertname)||' SET cnt=0 ,chk=0';
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking the vertices table';
-          RETURN 'FAIL';
-  END;
-
-
-
-  BEGIN
-       raise debug 'Checking column names in edge table';
-       select * into idname     from _pgr_getColumnName(sname, tname,id,2);
-       select * into sourcename from _pgr_getColumnName(sname, tname,source,2);
-       select * into targetname from _pgr_getColumnName(sname, tname,target,2);
-       select * into gname      from _pgr_getColumnName(sname, tname,the_geom,2);
-
-
-       perform _pgr_onError( sourcename in (targetname,idname,gname) or  targetname in (idname,gname) or idname=gname, 2,
-                       'pgr_analyzeGraph',  'Two columns share the same name', 'Parameter names for id,the_geom,source and target  must be different',
-                       'Column names are OK');
-
-        raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking the column names';
-          RETURN 'FAIL';
-  END;
-
-
-  BEGIN
-       raise debug 'Checking column types in edge table';
-       select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1);
-       select * into targettype from _pgr_getColumnType(sname,tname,targetname,1);
-
-       perform _pgr_onError(sourcetype not in('integer','smallint','bigint') , 2,
-                       'pgr_analyzeGraph',  'Wrong type of Column '|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found',
-                       'Type of Column '|| sourcename || ' is ' || sourcetype);
-
-       perform _pgr_onError(targettype not in('integer','smallint','bigint') , 2,
-                       'pgr_analyzeGraph',  'Wrong type of Column '|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or biginti but '||targettype||' was found',
-                       'Type of Column '|| targetname || ' is ' || targettype);
-
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking the column types';
-          RETURN 'FAIL';
-   END;
-
-   BEGIN
-       raise debug 'Checking SRID of geometry column';
-         query= 'SELECT ST_SRID(' || quote_ident(gname) || ') as srid '
-            || ' FROM ' || _pgr_quote_ident(tabname)
-            || ' WHERE ' || quote_ident(gname)
-            || ' IS NOT NULL LIMIT 1';
-         EXECUTE QUERY INTO sridinfo;
-
-         perform _pgr_onError( sridinfo IS NULL OR sridinfo.srid IS NULL,2,
-                 'Can not determine the srid of the geometry '|| gname ||' in table '||tabname, 'Check the geometry of column '||gname,
-                 'SRID of '||gname||' is '||sridinfo.srid);
-
-         IF sridinfo IS NULL OR sridinfo.srid IS NULL THEN
-             RAISE NOTICE ' Can not determine the srid of the geometry "%" in table %', the_geom,tabname;
-             RETURN 'FAIL';
-         END IF;
-         srid := sridinfo.srid;
-         raise DEBUG '     --> OK';
-         EXCEPTION WHEN OTHERS THEN
-             RAISE NOTICE 'Got %', SQLERRM;--issue 210,211,213
-             RAISE NOTICE 'ERROR: something went wrong when checking for SRID of % in table %', the_geom,tabname;
-             RETURN 'FAIL';
-    END;
-
-
-    BEGIN
-       raise debug 'Checking  indices in edge table';
-       perform _pgr_createIndex(tabname , idname , 'btree');
-       perform _pgr_createIndex(tabname , sourcename , 'btree');
-       perform _pgr_createIndex(tabname , targetname , 'btree');
-       perform _pgr_createIndex(tabname , gname , 'gist');
-
-       gname=quote_ident(gname);
-       sourcename=quote_ident(sourcename);
-       targetname=quote_ident(targetname);
-       idname=quote_ident(idname);
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking indices';
-          RETURN 'FAIL';
-    END;
-
-
-    BEGIN
-        query='select count(*) from '||_pgr_quote_ident(tabname)||' where true  '||rows_where;
-        EXECUTE query into ecnt;
-        raise DEBUG '-->Rows Where condition: OK';
-        raise DEBUG '     --> OK';
-         EXCEPTION WHEN OTHERS THEN
-            RAISE NOTICE 'Got %', SQLERRM;  --issue 210,211,213
-            RAISE NOTICE 'ERROR: Condition is not correct. Please execute the following query to test your condition';
-            RAISE NOTICE '%',query;
-            RETURN 'FAIL';
-    END;
-
-    selectionquery ='with
-           selectedRows as( (select '||sourcename||' as id from '||_pgr_quote_ident(tabname)||' where true '||rows_where||')
-                           union
-                           (select '||targetname||' as id from '||_pgr_quote_ident(tabname)||' where true '||rows_where||'))';
-
-
-
-
-
-   BEGIN
-       RAISE NOTICE 'Analyzing for dead ends. Please wait...';
-       query= 'with countingsource as (select a.'||sourcename||' as id,count(*) as cnts
-               from (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' ) a  group by a.'||sourcename||')
-                     ,countingtarget as (select a.'||targetname||' as id,count(*) as cntt
-                    from (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' ) a  group by a.'||targetname||')
-                   ,totalcount as (select id,case when cnts is null and cntt is null then 0
-                                                   when cnts is null then cntt
-                                                   when cntt is null then cnts
-                                                   else cnts+cntt end as totcnt
-                                   from ('||_pgr_quote_ident(vertname)||' as a left
-                                   join countingsource as t using(id) ) left join countingtarget using(id))
-               update '||_pgr_quote_ident(vertname)||' as a set cnt=totcnt from totalcount as b where a.id=b.id';
-       raise debug '%',query;
-       execute query;
-       query=selectionquery||'
-              SELECT count(*)  FROM '||_pgr_quote_ident(vertname)||' WHERE cnt=1 and id in (select id from selectedRows)';
-       raise debug '%',query;
-       execute query  INTO numdeadends;
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'Got %', SQLERRM;  --issue 210,211,213
-          RAISE NOTICE 'ERROR: something went wrong when analizing for dead ends';
-          RETURN 'FAIL';
-   END;
-
-
-
-    BEGIN
-          RAISE NOTICE 'Analyzing for gaps. Please wait...';
-          query = 'with
-                   buffer as (select id,st_buffer(the_geom,'||tolerance||') as buff from '||_pgr_quote_ident(vertname)||' where cnt=1)
-                   ,veryclose as (select b.id,st_crosses(a.'||gname||',b.buff) as flag
-                   from  (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' ) as a
-                   join buffer as b on (a.'||gname||'&&b.buff)
-                   where '||sourcename||'!=b.id and '||targetname||'!=b.id )
-                   update '||_pgr_quote_ident(vertname)||' set chk=1 where id in (select distinct id from veryclose where flag=true)';
-          raise debug '%' ,query;
-          execute query;
-          GET DIAGNOSTICS  numgaps= ROW_COUNT;
-          raise DEBUG '     --> OK';
-          EXCEPTION WHEN raise_exception THEN
-            RAISE NOTICE 'ERROR: something went wrong when Analyzing for gaps';
-            RETURN 'FAIL';
-    END;
-
-    BEGIN
-        RAISE NOTICE 'Analyzing for isolated edges. Please wait...';
-        query=selectionquery|| ' SELECT count(*) FROM (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' )  as a,
-                                                 '||_pgr_quote_ident(vertname)||' as b,
-                                                 '||_pgr_quote_ident(vertname)||' as c
-                            WHERE b.id in (select id from selectedRows) and a.'||sourcename||' =b.id
-                            AND b.cnt=1 AND a.'||targetname||' =c.id
-                            AND c.cnt=1';
-        raise debug '%' ,query;
-        execute query  INTO NumIsolated;
-        raise DEBUG '     --> OK';
-        EXCEPTION WHEN raise_exception THEN
-            RAISE NOTICE 'ERROR: something went wrong when Analyzing for isolated edges';
-            RETURN 'FAIL';
-    END;
-
-    BEGIN
-        RAISE NOTICE 'Analyzing for ring geometries. Please wait...';
-        execute 'SELECT geometrytype('||gname||')  FROM '||_pgr_quote_ident(tabname) limit 1 into geotype;
-        IF (geotype='MULTILINESTRING') THEN
-            query ='SELECT count(*)  FROM '||_pgr_quote_ident(tabname)||'
-                                 WHERE true  '||rows_where||' and st_isRing(st_linemerge('||gname||'))';
-            raise debug '%' ,query;
-            execute query  INTO numRings;
-        ELSE query ='SELECT count(*)  FROM '||_pgr_quote_ident(tabname)||'
-                                  WHERE true  '||rows_where||' and st_isRing('||gname||')';
-            raise debug '%' ,query;
-            execute query  INTO numRings;
-        END IF;
-        raise DEBUG '     --> OK';
-        EXCEPTION WHEN raise_exception THEN
-            RAISE NOTICE 'ERROR: something went wrong when Analyzing for ring geometries';
-            RETURN 'FAIL';
-    END;
-
-    BEGIN
-        RAISE NOTICE 'Analyzing for intersections. Please wait...';
-        query = 'select count(*) from (select distinct case when a.'||idname||' < b.'||idname||' then a.'||idname||'
-                                                        else b.'||idname||' end,
-                                                   case when a.'||idname||' < b.'||idname||' then b.'||idname||'
-                                                        else a.'||idname||' end
-                                    FROM (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||') as a
-                                    JOIN (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||') as b
-                                    ON (a.'|| gname||' && b.'||gname||')
-                                    WHERE a.'||idname||' != b.'||idname|| '
-                                        and (a.'||sourcename||' in (b.'||sourcename||',b.'||targetname||')
-                                              or a.'||targetname||' in (b.'||sourcename||',b.'||targetname||')) = false
-                                        and st_intersects(a.'||gname||', b.'||gname||')=true) as d ';
-        raise debug '%' ,query;
-        execute query  INTO numCrossing;
-        raise DEBUG '     --> OK';
-        EXCEPTION WHEN raise_exception THEN
-            RAISE NOTICE 'ERROR: something went wrong when Analyzing for intersections';
-            RETURN 'FAIL';
-    END;
-
-
-
-
-    RAISE NOTICE '            ANALYSIS RESULTS FOR SELECTED EDGES:';
-    RAISE NOTICE '                  Isolated segments: %', NumIsolated;
-    RAISE NOTICE '                          Dead ends: %', numdeadends;
-    RAISE NOTICE 'Potential gaps found near dead ends: %', numgaps;
-    RAISE NOTICE '             Intersections detected: %',numCrossing;
-    RAISE NOTICE '                    Ring geometries: %',numRings;
-
-
-    RETURN 'OK';
-END;
-$BODY$
-  LANGUAGE plpgsql VOLATILE STRICT;
-COMMENT ON FUNCTION pgr_analyzeGraph(text,double precision,text,text,text,text,text) IS 'args: edge_table, tolerance,the_geom:=''the_geom'',id:=''id'',source column:=''source'', target column:=''target'' rows_where:=''true'' - creates a vertices table based on the geometry for selected rows';
-
-
-
-
-
-/*
-.. function:: _pgr_analyzeOneway(tab, col, s_in_rules, s_out_rules, t_in_rules, t_out_rules)
-
-   This function analyzes oneway streets in a graph and identifies any
-   flipped segments. Basically if you count the edges coming into a node
-   and the edges exiting a node the number has to be greater than one.
-
-   * tab              - edge table name (TEXT)
-   * col              - oneway column name (TEXT)
-   * s_in_rules       - source node in rules
-   * s_out_rules      - source node out rules
-   * t_in_tules       - target node in rules
-   * t_out_rules      - target node out rules
-   * two_way_if_null  - flag to treat oneway nNULL values as by directional
-
-   After running this on a graph you can identify nodes with potential
-   problems with the following query.
-
-.. code-block:: sql
-
-       select * from vertices_tmp where in=0 or out=0;
-
-   The rules are defined as an array of text strings that if match the "col"
-   value would be counted as true for the source or target in or out condition.
-
-   Example
-   =======
-
-   Lets assume we have a table "st" of edges and a column "one_way" that
-   might have values like:
-
-   * 'FT'    - oneway from the source to the target node.
-   * 'TF'    - oneway from the target to the source node.
-   * 'B'     - two way street.
-   * ''      - empty field, assume teoway.
-   * <NULL>  - NULL field, use two_way_if_null flag.
-
-   Then we could form the following query to analyze the oneway streets for
-   errors.
-
-.. code-block:: sql
-
-   select _pgr_analyzeOneway('st', 'one_way',
-        ARRAY['', 'B', 'TF'],
-        ARRAY['', 'B', 'FT'],
-        ARRAY['', 'B', 'FT'],
-        ARRAY['', 'B', 'TF'],
-        true);
-
-   -- now we can see the problem nodes
-   select * from vertices_tmp where ein=0 or eout=0;
-
-   -- and the problem edges connected to those nodes
-   select gid
-
-     from st a, vertices_tmp b
-    where a.source=b.id and ein=0 or eout=0
-   union
-   select gid
-     from st a, vertices_tmp b
-    where a.target=b.id and ein=0 or eout=0;
-
-Typically these problems are generated by a break in the network, the
-oneway direction set wrong, maybe an error releted to zlevels or
-a network that is not properly noded.
-
-*/
-
-CREATE OR REPLACE FUNCTION pgr_analyzeOneway(
-   edge_table text,
-   s_in_rules TEXT[],
-   s_out_rules TEXT[],
-   t_in_rules TEXT[],
-   t_out_rules TEXT[],
-   two_way_if_null boolean default true,
-   oneway text default 'oneway',
-   source text default 'source',
-   target text default 'target')
-  RETURNS text AS
-$BODY$
-
-
-DECLARE
-    rule text;
-    ecnt integer;
-    instr text;
-    naming record;
-    sname text;
-    tname text;
-    tabname text;
-    vname text;
-    owname text;
-    sourcename text;
-    targetname text;
-    sourcetype text;
-    targettype text;
-    vertname text;
-    debuglevel text;
-
-
-BEGIN
-  raise notice 'PROCESSING:';
-  raise notice 'pgr_analyzeOneway(''%'',''%'',''%'',''%'',''%'',''%'',''%'',''%'',%)',
-		edge_table, s_in_rules , s_out_rules, t_in_rules, t_out_rules, oneway, source ,target,two_way_if_null ;
-  execute 'show client_min_messages' into debuglevel;
-
-  BEGIN
-    RAISE DEBUG 'Checking % exists',edge_table;
-    execute 'select * from _pgr_getTableName('||quote_literal(edge_table)||',2)' into naming;
-    sname=naming.sname;
-    tname=naming.tname;
-    tabname=sname||'.'||tname;
-    vname=tname||'_vertices_pgr';
-    vertname= sname||'.'||vname;
-    raise DEBUG '     --> OK';
-    EXCEPTION WHEN raise_exception THEN
-      RAISE NOTICE 'ERROR: something went wrong checking the table name';
-      RETURN 'FAIL';
-  END;
-
-  BEGIN
-       raise debug 'Checking Vertices table';
-       execute 'select * from  _pgr_checkVertTab('||quote_literal(vertname) ||', ''{"id","ein","eout"}''::text[])' into naming;
-       execute 'UPDATE '||_pgr_quote_ident(vertname)||' SET eout=0 ,ein=0';
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking the vertices table';
-          RETURN 'FAIL';
-  END;
-
-
-  BEGIN
-       raise debug 'Checking column names in edge table';
-       select * into sourcename from _pgr_getColumnName(sname, tname,source,2);
-       select * into targetname from _pgr_getColumnName(sname, tname,target,2);
-       select * into owname from _pgr_getColumnName(sname, tname,oneway,2);
-
-
-       perform _pgr_onError( sourcename in (targetname,owname) or  targetname=owname, 2,
-                       '_pgr_createToplogy',  'Two columns share the same name', 'Parameter names for oneway,source and target  must be different',
-                       'Column names are OK');
-
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking the column names';
-          RETURN 'FAIL';
-  END;
-
-  BEGIN
-       raise debug 'Checking column types in edge table';
-       select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1);
-       select * into targettype from _pgr_getColumnType(sname,tname,targetname,1);
-
-
-       perform _pgr_onError(sourcetype not in('integer','smallint','bigint') , 2,
-                       '_pgr_createTopology',  'Wrong type of Column '|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found',
-                       'Type of Column '|| sourcename || ' is ' || sourcetype);
-
-       perform _pgr_onError(targettype not in('integer','smallint','bigint') , 2,
-                       '_pgr_createTopology',  'Wrong type of Column '|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or biginti but '||targettype||' was found',
-                       'Type of Column '|| targetname || ' is ' || targettype);
-
-       raise DEBUG '     --> OK';
-       EXCEPTION WHEN raise_exception THEN
-          RAISE NOTICE 'ERROR: something went wrong checking the column types';
-          RETURN 'FAIL';
-   END;
-
-
-
-    RAISE NOTICE 'Analyzing graph for one way street errors.';
-
-    rule := CASE WHEN two_way_if_null
-            THEN owname || ' IS NULL OR '
-            ELSE '' END;
-
-    instr := '''' || array_to_string(s_in_rules, ''',''') || '''';
-       EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set ein=coalesce(ein,0)+b.cnt
-      from (
-         select '|| sourcename ||', count(*) as cnt
-           from '|| tabname ||'
-          where '|| rule || owname ||' in ('|| instr ||')
-          group by '|| sourcename ||' ) b
-     where a.id=b.'|| sourcename;
-
-    RAISE NOTICE 'Analysis 25%% complete ...';
-
-    instr := '''' || array_to_string(t_in_rules, ''',''') || '''';
-    EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set ein=coalesce(ein,0)+b.cnt
-        from (
-         select '|| targetname ||', count(*) as cnt
-           from '|| tabname ||'
-          where '|| rule || owname ||' in ('|| instr ||')
-          group by '|| targetname ||' ) b
-        where a.id=b.'|| targetname;
-
-    RAISE NOTICE 'Analysis 50%% complete ...';
-
-    instr := '''' || array_to_string(s_out_rules, ''',''') || '''';
-    EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set eout=coalesce(eout,0)+b.cnt
-        from (
-         select '|| sourcename ||', count(*) as cnt
-           from '|| tabname ||'
-          where '|| rule || owname ||' in ('|| instr ||')
-          group by '|| sourcename ||' ) b
-        where a.id=b.'|| sourcename;
-    RAISE NOTICE 'Analysis 75%% complete ...';
-
-    instr := '''' || array_to_string(t_out_rules, ''',''') || '''';
-    EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set eout=coalesce(eout,0)+b.cnt
-        from (
-         select '|| targetname ||', count(*) as cnt
-           from '|| tabname ||'
-          where '|| rule || owname ||' in ('|| instr ||')
-          group by '|| targetname ||' ) b
-        where a.id=b.'|| targetname;
-
-    RAISE NOTICE 'Analysis 100%% complete ...';
-
-    EXECUTE 'SELECT count(*)  FROM '||_pgr_quote_ident(vertname)||' WHERE ein=0 or eout=0' INTO ecnt;
-
-    RAISE NOTICE 'Found % potential problems in directionality' ,ecnt;
-
-    RETURN 'OK';
-
-END;
-$BODY$
-  LANGUAGE plpgsql VOLATILE STRICT;
-
-COMMENT ON FUNCTION pgr_analyzeOneway(text,TEXT[],TEXT[], TEXT[],TEXT[],boolean,text,text,text)
-IS 'args:edge_table , s_in_rules , s_out_rules, t_in_rules , t_out_rules, two_way_if_null:= true, oneway:=''oneway'',source:= ''source'',target:=''target'' - Analizes the directionality of the edges based on the rules';
-
diff --git a/src/common/sql/pgrouting_conversion_tools.sql b/src/common/sql/pgrouting_conversion_tools.sql
deleted file mode 100644
index 196a135..0000000
--- a/src/common/sql/pgrouting_conversion_tools.sql
+++ /dev/null
@@ -1,161 +0,0 @@
-create or replace function pgr_pointtoedgenode(edges text, pnt geometry, tol float8)
-    returns integer as
-$body$
-/*
- *  pgr_pointtoedgenode(edges text, pnt geometry, tol float8)
- *
- *  Given and table of edges with a spatial index on the_geom
- *  and a point geometry search for the closest edge within tol distance to the edges
- *  then compute the projection of the point onto the line segment and select source or target
- *  based on whether the projected point is closer to the respective end and return source or target.
- *  If no edge is within tol distance then return -1
-*/
-declare
-    rr record;
-    pct float;
-    debuglevel text;
-    
-begin
-    -- find the closest edge within tol distance
-    execute 'select * from ' || _pgr_quote_ident(edges) || 
-            ' where st_dwithin(''' || pnt::text ||
-            '''::geometry, the_geom, ' || tol || ') order by st_distance(''' || pnt::text ||
-            '''::geometry, the_geom) asc limit 1' into rr;
-
-    if rr.the_geom is not null then
-        -- deal with MULTILINESTRINGS
-        if geometrytype(rr.the_geom)='MULTILINESTRING' THEN
-            rr.the_geom := ST_GeometryN(rr.the_geom, 1);
-        end if;
-
-        -- project the point onto the linestring
-        execute 'show client_min_messages' into debuglevel;
-        SET client_min_messages='ERROR';
-        pct := st_line_locate_point(rr.the_geom, pnt);
-        execute 'set client_min_messages  to '|| debuglevel;
-
-        -- return the node we are closer to
-        if pct < 0.5 then
-            return rr.source;
-        else
-            return rr.target;
-        end if;
-    else
-        -- return a failure to find an edge within tol distance
-        return -1;
-    end if;
-end;
-$body$
-  language plpgsql volatile
-  cost 5;
-
-
-----------------------------------------------------------------------------
-
-create or replace function pgr_flipedges(ga geometry[])
-    returns geometry[] as
-$body$
-/*
- *  pgr_flipedges(ga geometry[])
- *
- *  Given an array of linestrings that are supposedly connected end to end like the results
- *  of a route, check the edges and flip any end for end if they do not connect with the
- *  previous seegment and return the array with the segments flipped as appropriate.
- *
- *  NOTE: no error checking is done for conditions like adjacent edges are not connected.
-*/
-declare
-    nn integer;
-    i integer;
-    g geometry;
-    
-begin
-    -- get the count of edges, and return if only one edge
-    nn := array_length(ga, 1);
-    if nn=1 then
-        return ga;
-    end if;
-
-    -- determine if first needs to be flipped
-    g := _pgr_startpoint(ga[1]);
-
-    -- if the start of the first is connected to the second then it needs to be flipped
-    if _pgr_startpoint(ga[2])=g or _pgr_endpoint(ga[2])=g then
-        ga[1] := st_reverse(ga[1]);
-    end if;
-    g := _pgr_endpoint(ga[1]);
-
-    -- now if  the end of the last edge matchs the end of the current edge we need to flip it
-    for i in 2 .. nn loop
-        if _pgr_endpoint(ga[i])=g then
-            ga[i] := st_reverse(ga[i]);
-        end if;
-        -- save the end of this edge into the last end for the next cycle
-        g := _pgr_endpoint(ga[i]);
-    end loop;
-
-    return ga;
-end;
-$body$
-    language plpgsql immutable;
-
-
-------------------------------------------------------------------------------
-
-create or replace function pgr_texttopoints(pnts text, srid integer DEFAULT(4326))
-    returns geometry[] as
-$body$
-/*
- *  pgr_texttopoints(pnts text, srid integer DEFAULT(4326))
- *
- *  Given a text string of the format "x,y;x,y;x,y;..." and the srid to use,
- *  split the string and create and array point geometries
-*/
-declare
-    a text[];
-    t text;
-    p geometry;
-    g geometry[];
-    
-begin
-    -- convert commas to space and split on ';'
-    a := string_to_array(replace(pnts, ',', ' '), ';');
-    -- convert each 'x y' into a point geometry and concattenate into a new array
-    for t in select unnest(a) loop
-        p := st_pointfromtext('POINT(' || t || ')', srid);
-        g := g || p;
-    end loop;
-
-    return g;
-end;
-$body$
-    language plpgsql immutable;
-
------------------------------------------------------------------------
-
-create or replace function pgr_pointstovids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
-    returns integer[] as
-$body$
-/*
- *  pgr_pointstovids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
- *
- *  Given an array of point geometries and an edge table and a max search tol distance
- *  convert points into vertex ids using pgr_pointtoedgenode()
- *
- *  NOTE: You need to check the results for any vids=-1 which indicates if failed to locate an edge
-*/
-declare
-    v integer[];
-    g geometry;
-    
-begin
-    -- cycle through each point and locate the nearest edge and vertex on that edge
-    for g in select unnest(pnts) loop
-        v := v || pgr_pointtoedgenode(edges, g, tol);
-    end loop;
-
-    return v;
-end;
-$body$
-    language plpgsql stable;
-
diff --git a/src/common/sql/pgrouting_dmatrix_tools.sql b/src/common/sql/pgrouting_dmatrix_tools.sql
deleted file mode 100644
index 46b87a4..0000000
--- a/src/common/sql/pgrouting_dmatrix_tools.sql
+++ /dev/null
@@ -1,120 +0,0 @@
-create or replace function pgr_pointstodmatrix(pnts geometry[], mode integer default (0), OUT dmatrix double precision[], OUT ids integer[])
-    returns record as
-$body$
-/*
- *  pgr_pointstodmatrix(pnts geometry[], OUT dmatrix double precision[], OUT ids integer[])
- *
- *  Create a distance symetric distance matrix suitable for TSP using Euclidean distances
- *  based on the st_distance(). You might want to create a variant of this the uses st_distance_sphere()
- *  or st_distance_spheriod() or some other function.
- *
-*/
-declare
-    r record;
-    
-begin
-    dmatrix := array[]::double precision[];
-    ids := array[]::integer[];
-
-    -- create an id for each point in the array and unnest it into a table nodes in the with clause
-    for r in with nodes as (select row_number() over()::integer as id, p from (select unnest(pnts) as p) as foo)
-        -- compute a row of distances
-        select i, array_agg(dist) as arow from (
-            select a.id as i, b.id as j, 
-                case when mode=0
-                    then st_distance(a.p, b.p)
-                    else st_distance_sphere(a.p, b.p)
-                end as dist
-              from nodes a, nodes b
-             order by a.id, b.id
-           ) as foo group by i order by i loop
-
-        -- you must concat an array[array[]] to make dmatrix[][]
-        -- concat the row of distances to the dmatrix
-        dmatrix := array_cat(dmatrix, array[r.arow]);
-        ids := ids || array[r.i];
-    end loop;
-end;
-$body$
-    language plpgsql stable;
-
-
-------------------------------------------------------------------------------
-
-create or replace function pgr_vidstodmatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1), OUT dmatrix double precision[], OUT ids integer[])
-    returns record as
-$body$
-/*
- *  pgr_vidstodmatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1),
- *                    OUT dmatrix double precision[], OUT ids integer[])
- *
- *  This function thats an array vertex ids, the original array of points, the edge table name and a tol.
- *  It then computes kdijkstra() distances for each vertex to all the other vertices and creates a symmetric
- *  distances matrix suitable for TSP. The pnt array and the tol are used to establish a BBOX for limiteding
- *  selection of edges.the extents of the points is expanded by tol.
- *
- *  NOTES:
- *  1. we compute a symmetric matrix because TSP requires that so the distances are better the Euclidean but
- *     but are not perfect
- *  2. kdijkstra() can fail to find a path between some of the vertex ids. We to not detect this other than
- *     the cost might get set to -1.0, so the dmatrix shoule be checked for this as it makes it invalid for TSP
- *
-*/
-declare
-    i integer;
-    j integer;
-    nn integer;
-    rr record;
-    bbox geometry;
-    t float8[];
-
-begin
-    -- check if the input arrays has any -1 values, maybe this whould be a raise exception
-    if vids @> ARRAY[-1] then
-    raise notice 'Some vids are undefined (-1)!';
-    dmatrix := null;
-    ids := null;
-    return;
-    end if;
-
-    ids := vids;
-
-    -- get the count of nodes
-    nn := array_length(vids,1);
-
-    -- zero out a dummy row
-    for i in 1 .. nn loop
-        t := t || 0.0::float8;
-    end loop;
-
-    -- using the dummy row, zero out the whole matrix
-    for i in 1 .. nn loop
-    dmatrix := dmatrix || ARRAY[t];
-    end loop;
-
-    for i in 1 .. nn-1 loop
-        j := i;
-        -- compute the bbox for the point needed for this row
-        select st_expand(st_collect(pnts[id]), tol) into bbox
-          from (select generate_series as id from generate_series(i, nn)) as foo;
-
-        -- compute kdijkstra() for this row
-        for rr in execute 'select * from pgr_kdijkstracost($1, $2, $3, false, false)'
-                  using 'select id, source, target, cost from ' || edges || 
-                        ' where the_geom && ''' || bbox::text || '''::geometry'::text, vids[i], vids[i+1:nn] loop
-
-            -- TODO need to check that all node were reachable from source
-            -- I think unreachable paths between nodes returns cost=-1.0
-
-            -- populate the matrix with the cost values, remember this is symmetric
-            j := j + 1;
-            -- raise notice 'cost(%,%)=%', i, j, rr.cost;
-            dmatrix[i][j] := rr.cost;
-            dmatrix[j][i] := rr.cost;
-        end loop;
-    end loop;
-
-end;
-$body$
-    language plpgsql stable cost 200;
-
diff --git a/src/common/sql/pgrouting_legacy.sql b/src/common/sql/pgrouting_legacy.sql
deleted file mode 100644
index 429c980..0000000
--- a/src/common/sql/pgrouting_legacy.sql
+++ /dev/null
@@ -1,1429 +0,0 @@
---
--- Copyright (c) 2005 Sylvain Pasche,
---               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
--- BEGIN;
-CREATE CAST (pgr_pathResult AS path_result) WITHOUT FUNCTION AS IMPLICIT;
-CREATE CAST (pgr_geoms AS geoms) WITHOUT FUNCTION AS IMPLICIT;
-CREATE CAST (pgr_linkPoint AS link_point) WITHOUT FUNCTION AS IMPLICIT;
-
--- Need to create this type as we do not have an equivalent one anymore in 2.0
-CREATE TYPE vertex_result AS ( x float8, y float8 ):
-
-CREATE OR REPLACE FUNCTION text(boolean)
-       RETURNS text AS
-$$
-SELECT CASE WHEN $1 THEN 'true' ELSE 'false' END
-$$
-LANGUAGE 'sql';
-
------------------------------------------------------------------------
--- For each vertex in the vertices table, set a point geometry which is
---  the corresponding line start or line end point
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION add_vertices_geometry(geom_table varchar) 
-       RETURNS VOID AS
-$$
-DECLARE
-	vertices_table varchar := quote_ident(geom_table) || '_vertices';
-BEGIN
-	
-	BEGIN
-		EXECUTE 'SELECT addGeometryColumn(''' || 
-                        quote_ident(vertices_table)  || 
-                        ''', ''the_geom'', -1, ''POINT'', 2)';
-	EXCEPTION 
-		WHEN DUPLICATE_COLUMN THEN
-	END;
-
-	EXECUTE 'UPDATE ' || quote_ident(vertices_table) || 
-                ' SET the_geom = NULL';
-
-	EXECUTE 'UPDATE ' || quote_ident(vertices_table) || 
-                ' SET the_geom = PGR_StartPoint(m.the_geom) FROM ' ||
-                 quote_ident(geom_table) || 
-                ' m where geom_id = m.source';
-
-	EXECUTE 'UPDATE ' || quote_ident(vertices_table) || 
-                ' set the_geom = PGR_EndPoint(m.the_geom) FROM ' || 
-                quote_ident(geom_table) || 
-                ' m where geom_id = m.target_id AND ' || 
-                quote_ident(vertices_table) || 
-                '.the_geom IS NULL';
-
-	RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- Update the cost column from the edges table, from the length of
---  all lines which belong to an edge.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION update_cost_from_distance(geom_table varchar) 
-       RETURNS VOID AS
-$$
-DECLARE 
-BEGIN
-	BEGIN
-	  EXECUTE 'CREATE INDEX ' || quote_ident(geom_table) || 
-                  '_edge_id_idx ON ' || quote_ident(geom_table) || 
-                  ' (edge_id)';
-	EXCEPTION 
-		WHEN DUPLICATE_TABLE THEN
-		RAISE NOTICE 'Not creating index, already there';
-	END;
-
-	EXECUTE 'UPDATE ' || quote_ident(geom_table) || 
-              '_edges SET cost = (SELECT sum( ST_Length( g.the_geom ) ) FROM ' || 
-              quote_ident(geom_table) || 
-              ' g WHERE g.edge_id = id GROUP BY id)';
-
-	RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-
-
-
------------------------------------------------------------------------
--- This function should not be used directly. Use create_graph_tables instead
---
--- Insert a vertex into the vertices table if not already there, and
---  return the id of the newly inserted or already existing element
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION insert_vertex(vertices_table varchar, geom_id anyelement) 
-       RETURNS int AS
-$$
-DECLARE
-        vertex_id int;
-        myrec record;
-BEGIN
-        LOOP
-          FOR myrec IN EXECUTE 'SELECT id FROM ' || 
-                     quote_ident(vertices_table) || 
-                     ' WHERE geom_id = ' || quote_literal(geom_id)  LOOP
-
-                        IF myrec.id IS NOT NULL THEN
-                                RETURN myrec.id;
-                        END IF;
-          END LOOP; 
-          EXECUTE 'INSERT INTO ' || quote_ident(vertices_table) || 
-                  ' (geom_id) VALUES (' || quote_literal(geom_id) || ')';
-        END LOOP;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
---
--- Copyright (c) 2005 Sylvain Pasche,
---               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
---
-
-CREATE OR REPLACE FUNCTION pgr_shootingStar(sql text, source_id integer, target_id integer,directed boolean, has_reverse_cost boolean)
-         RETURNS SETOF pgr_costResult AS 
-$body$
-begin
-raise exception 'The shootingstar functions are not available in pgRouting 2+, You should convert your code to use pgr_trsp() function.';
-end;
-$body$
-LANGUAGE plpgsql IMMUTABLE STRICT;
-
------------------------------------------------------------------------
--- Shooting* function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION shootingstar_sp( varchar,int4, int4, float8, varchar, boolean, boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-        cost_column ALIAS FOR $5;
-	dir ALIAS FOR $6;
-	rc ALIAS FOR $7;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	srid integer;
-
-	source_x float8;
-	source_y float8;
-	target_x float8;
-	target_y float8;
-	
-	ll_x float8;
-	ll_y float8;
-	ur_x float8;
-	ur_y float8;
-	
-	query text;
-
-	id integer;
-BEGIN
-
-    RAISE EXCEPTION 'The shootingstar functions are not available in pgRouting 2+, You should convert your code to use pgr_trsp() function.';
-	
-	id :=0;
-	FOR rec IN EXECUTE
-	    'select ST_SRID(the_geom) as srid from ' ||
-	    quote_ident(geom_table) || ' limit 1'
-	LOOP
-	END LOOP;
-	srid := rec.srid;
-	
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as source_x from ' || 
-            quote_ident(geom_table) || ' where gid = '||sourceid
-        LOOP
-	END LOOP;
-	source_x := rec.source_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as source_y from ' || 
-            quote_ident(geom_table) || ' where gid = ' ||sourceid
-        LOOP
-	END LOOP;
-
-	source_y := rec.source_y;
-
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as target_x from ' ||
-            quote_ident(geom_table) || ' where gid = ' ||targetid
-        LOOP
-	END LOOP;
-
-	target_x := rec.target_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as target_y from ' || 
-            quote_ident(geom_table) || ' where gid = ' ||targetid
-        LOOP
-	END LOOP;
-	target_y := rec.target_y;
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_x||'<'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||
-           ' END as ll_x, CASE WHEN '||source_x||'>'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||' END as ur_x'
-        LOOP
-	END LOOP;
-
-	ll_x := rec.ll_x;
-	ur_x := rec.ur_x;
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_y||'<'||
-            target_y||' THEN '||source_y||' ELSE '||
-            target_y||' END as ll_y, CASE WHEN '||
-            source_y||'>'||target_y||' THEN '||
-            source_y||' ELSE '||target_y||' END as ur_y'
-        LOOP
-	END LOOP;
-
-	ll_y := rec.ll_y;
-	ur_y := rec.ur_y;
-
-	query := 'SELECT gid,the_geom FROM ' || 
-          'shortest_path_shooting_star(''SELECT gid as id, source::integer, ' || 
-          'target::integer, '||cost_column||'::double precision as cost, ' || 
-          'x1::double precision, y1::double precision, x2::double ' ||
-          'precision, y2::double precision, rule::varchar, ' ||
-	  'to_cost::double precision ';
-	  
-	IF rc THEN query := query || ' , reverse_cost ';  
-	END IF;
-	  
-	query := query || 'FROM ' || quote_ident(geom_table) || ' where ST_SetSRID(''''BOX3D('||
-          ll_x-delta||' '||ll_y-delta||','||ur_x+delta||' '||
-          ur_y+delta||')''''::BOX3D, ' || srid || ') && the_geom'', ' || 
-          quote_literal(sourceid) || ' , ' || 
-          quote_literal(targetid) || ' , '''||dir::text||''', '''||rc::text||''' ),' || 
-          quote_ident(geom_table) || ' where edge_id = gid ';
-	  
-	FOR path_result IN EXECUTE query
-        LOOP
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
--- COMMIT;
---
--- Copyright (c) 2005 Sylvain Pasche,
---               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
---
-
-
------------------------------------------------------------------------
--- A* function for undirected graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_delta( varchar,int4, int4, float8) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	id integer;
-BEGIN
-	
-	id :=0;
-
-	FOR path_result IN EXECUTE 'SELECT gid,the_geom FROM ' || 
-           'astar_sp_delta_directed(''' || 
-           quote_ident(geom_table) || ''', ' || quote_literal(sourceid) || ', ' || 
-	   quote_literal(targetid) || ', ' || delta || ', false, false)'
-        LOOP
-
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- A* function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_delta_directed( varchar,int4, int4, float8, boolean, boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-	dir ALIAS FOR $5;
-	rc ALIAS FOR $6;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	srid integer;
-
-	source_x float8;
-	source_y float8;
-	target_x float8;
-	target_y float8;
-	
-	ll_x float8;
-	ll_y float8;
-	ur_x float8;
-	ur_y float8;
-	
-	query text;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR rec IN EXECUTE
-	    'select ST_SRID(the_geom) as srid from ' ||
-	    quote_ident(geom_table) || ' limit 1'
-	LOOP
-	END LOOP;
-	srid := rec.srid;
-	
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as source_x from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            sourceid ||  ' or target='||sourceid||' limit 1'
-        LOOP
-	END LOOP;
-	source_x := rec.source_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as source_y from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            sourceid ||  ' or target='||sourceid||' limit 1'
-        LOOP
-	END LOOP;
-
-	source_y := rec.source_y;
-
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as target_x from ' ||
-            quote_ident(geom_table) || ' where source = ' || 
-            targetid ||  ' or target='||targetid||' limit 1'
-        LOOP
-	END LOOP;
-
-	target_x := rec.target_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as target_y from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            targetid ||  ' or target='||targetid||' limit 1'
-        LOOP
-	END LOOP;
-	target_y := rec.target_y;
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_x||'<'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||
-           ' END as ll_x, CASE WHEN '||source_x||'>'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||' END as ur_x'
-        LOOP
-	END LOOP;
-
-	ll_x := rec.ll_x;
-	ur_x := rec.ur_x;
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_y||'<'||
-            target_y||' THEN '||source_y||' ELSE '||
-            target_y||' END as ll_y, CASE WHEN '||
-            source_y||'>'||target_y||' THEN '||
-            source_y||' ELSE '||target_y||' END as ur_y'
-        LOOP
-	END LOOP;
-
-	ll_y := rec.ll_y;
-	ur_y := rec.ur_y;
-
-	query := 'SELECT gid,the_geom FROM ' || 
-          'pgr_astar(''SELECT gid as id, source::integer, ' || 
-          'target::integer, length::double precision as cost, ' || 
-          'x1::double precision, y1::double precision, x2::double ' ||
-          'precision, y2::double precision ';
-	  
-	IF rc THEN query := query || ' , reverse_cost ';  
-	END IF;
-	  
-	query := query || 'FROM ' || quote_ident(geom_table) || ' where ST_SetSRID(''''BOX3D('||
-          ll_x-delta||' '||ll_y-delta||','||ur_x+delta||' '||
-          ur_y+delta||')''''::BOX3D, ' || srid || ') && the_geom'', ' || 
-          quote_literal(sourceid) || ' , ' || 
-          quote_literal(targetid) || ' , '''||dir::text||''', '''||rc::text||''' ),' || 
-          quote_ident(geom_table) || ' where edge_id = gid ';
-	  
-	FOR path_result IN EXECUTE query
-        LOOP
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
---
---                v_id = path_result.vertex_id;
---                e_id = path_result.edge_id;
-
---                FOR r IN EXECUTE 'SELECT gid, the_geom FROM ' || 
---                      quote_ident(geom_table) || '  WHERE gid = ' || 
---                      quote_literal(e_id) LOOP
---                        geom.gid := r.gid;
---                        geom.the_geom := r.the_geom;
---                        RETURN NEXT geom;
---                END LOOP;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-
------------------------------------------------------------------------
--- A* function for undirected graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
--- Cost column name can be specified (last parameter)
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_delta_cc( varchar,int4, int4, float8, varchar) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-	cost_column ALIAS FOR $5;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR path_result IN EXECUTE 'SELECT gid,the_geom FROM ' || 
-           'astar_sp_delta_cc_directed(''' || 
-           quote_ident(geom_table) || ''', ' || quote_literal(sourceid) || ', ' || 
-	   quote_literal(targetid) || ', ' || delta || ',' || 
-	   quote_literal(cost_column) || ', false, false)'
-        LOOP
-
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- A* function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
--- Cost column name can be specified (last parameter)
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_delta_cc_directed( varchar,int4, int4, float8, varchar, boolean, boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-	cost_column ALIAS FOR $5;
-	dir ALIAS FOR $6;
-	rc ALIAS FOR $7;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	srid integer;
-
-	source_x float8;
-	source_y float8;
-	target_x float8;
-	target_y float8;
-	
-	ll_x float8;
-	ll_y float8;
-	ur_x float8;
-	ur_y float8;
-	
-	query text;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR rec IN EXECUTE
-	    'select ST_SRID(the_geom) as srid from ' ||
-	    quote_ident(geom_table) || ' limit 1'
-	LOOP
-	END LOOP;
-	srid := rec.srid;
-	
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as source_x from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            sourceid || ' or target='||sourceid||' limit 1'
-        LOOP
-	END LOOP;
-	source_x := rec.source_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as source_y from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            sourceid ||  ' or target='||sourceid||' limit 1'
-        LOOP
-	END LOOP;
-
-	source_y := rec.source_y;
-
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as target_x from ' ||
-            quote_ident(geom_table) || ' where source = ' || 
-            targetid ||  ' or target='||targetid||' limit 1'
-        LOOP
-	END LOOP;
-
-	target_x := rec.target_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as target_y from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            targetid ||  ' or target='||targetid||' limit 1'
-        LOOP
-	END LOOP;
-	target_y := rec.target_y;
-
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_x||'<'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||
-           ' END as ll_x, CASE WHEN '||source_x||'>'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||' END as ur_x'
-        LOOP
-	END LOOP;
-
-	ll_x := rec.ll_x;
-	ur_x := rec.ur_x;
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_y||'<'||
-            target_y||' THEN '||source_y||' ELSE '||
-            target_y||' END as ll_y, CASE WHEN '||
-            source_y||'>'||target_y||' THEN '||
-            source_y||' ELSE '||target_y||' END as ur_y'
-        LOOP
-	END LOOP;
-
-	ll_y := rec.ll_y;
-	ur_y := rec.ur_y;
-
-	query := 'SELECT gid,the_geom FROM ' || 
-          'pgr_astar(''SELECT gid as id, source::integer, ' || 
-          'target::integer, '||cost_column||'::double precision as cost, ' || 
-          'x1::double precision, y1::double precision, x2::double ' ||
-          'precision, y2::double precision ';
-	
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-	  
-	query := query || 'FROM ' || quote_ident(geom_table) || ' where ST_SetSRID(''''BOX3D('||
-          ll_x-delta||' '||ll_y-delta||','||ur_x+delta||' '||
-          ur_y+delta||')''''::BOX3D, ' || srid || ') && the_geom'', ' || 
-          quote_literal(sourceid) || ' , ' || 
-          quote_literal(targetid) || ' , '''||dir::text||''', '''||rc::text||''' ),' || 
-          quote_ident(geom_table) || ' where edge_id = gid ';
-	
-	FOR path_result IN EXECUTE query
-        LOOP
-
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-
------------------------------------------------------------------------
--- A* function for undirected graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance
---  (specified by lower left and upper right box corners).
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_bbox( varchar,int4, int4, float8, float8, float8, float8) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	ll_x ALIAS FOR $4;
-	ll_y ALIAS FOR $5;
-	ur_x ALIAS FOR $6;
-	ur_y ALIAS FOR $7;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	srid integer;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR path_result IN EXECUTE 'SELECT gid,the_geom FROM ' || 
-           'astar_sp_bbox_directed(''' || 
-           quote_ident(geom_table) || ''', ' || quote_literal(sourceid) || ', ' || 
-	   quote_literal(targetid) || ', ' || ll_x || ', ' || ll_y || ', ' ||
-	   ur_x || ', ' || ur_y || ', false, false)'
-        LOOP
-
-               geom.gid      := path_result.gid;
-               geom.the_geom := path_result.the_geom;
-               id := id+1;
-	       geom.id       := id;
-                 
-               RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- A* function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance
---  (specified by lower left and upper right box corners).
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_bbox_directed( varchar,int4, int4, float8, float8, float8, float8, boolean, boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	ll_x ALIAS FOR $4;
-	ll_y ALIAS FOR $5;
-	ur_x ALIAS FOR $6;
-	ur_y ALIAS FOR $7;
-	dir ALIAS FOR $8;
-	rc ALIAS FOR $9;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	srid integer;
-	
-	query text;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR rec IN EXECUTE
-	    'select ST_SRID(the_geom) as srid from ' ||
-	    quote_ident(geom_table) || ' limit 1'
-	LOOP
-	END LOOP;
-	srid := rec.srid;
-	
-	query := 'SELECT gid,the_geom FROM ' || 
-           'pgr_astar(''SELECT gid as id, source::integer, ' || 
-           'target::integer, length::double precision as cost, ' || 
-           'x1::double precision, y1::double precision, ' || 
-           'x2::double precision, y2::double precision ';
-	   
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-	   
-	query := query || 'FROM ' || 
-           quote_ident(geom_table) || ' where ST_SetSRID(''''BOX3D('||ll_x||' '||
-           ll_y||','||ur_x||' '||ur_y||')''''::BOX3D, ' || srid || 
-	   ') && the_geom'', ' || quote_literal(sourceid) || ' , ' || 
-           quote_literal(targetid) || ' , '''||dir::text||''', '''||rc::text||''' ),'  ||
-           quote_ident(geom_table) || ' where edge_id = gid ';
-	
-	FOR path_result IN EXECUTE query
-        LOOP
-               geom.gid      := path_result.gid;
-               geom.the_geom := path_result.the_geom;
-               id := id+1;
-	       geom.id       := id;
-                 
-               RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-
-CREATE OR REPLACE FUNCTION astar_sp( geom_table varchar, source int4, target int4) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR path_result IN EXECUTE 'SELECT gid,the_geom FROM ' || 
-           'astar_sp_directed(''' || 
-           quote_ident(geom_table) || ''', ' || quote_literal(source) || ', ' || 
-	   quote_literal(target) || ', false, false)'
-        LOOP
-
-              geom.gid      := path_result.gid;
-              geom.the_geom := path_result.the_geom;
-              id := id+1;
-	      geom.id       := id;
-                 
-              RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- A* function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION astar_sp_directed( geom_table varchar, source int4, target int4, dir boolean, rc boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	query text;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	query := 'SELECT gid,the_geom FROM ' || 
-           'pgr_astar(''SELECT gid as id, source::integer, ' || 
-           'target::integer, length::double precision as cost, ' || 
-           'x1::double precision, y1::double precision, ' || 
-           'x2::double precision, y2::double precision ';
-	   
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-
-	query := query || 'FROM ' || quote_ident(geom_table) || ' '', ' || 
-           quote_literal(source) || ' , ' || 
-           quote_literal(target) || ' , '''||dir::text||''', '''||rc::text||'''), ' ||
-           quote_ident(geom_table) || ' where edge_id = gid ';
-	   
-	FOR path_result IN EXECUTE query
-        LOOP
-
-              geom.gid      := path_result.gid;
-              geom.the_geom := path_result.the_geom;
-              id := id+1;
-	      geom.id       := id;
-                 
-              RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
---
--- Copyright (c) 2005 Sylvain Pasche,
---               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
---
-
-
------------------------------------------------------------------------
--- Dijkstra function for undirected graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION dijkstra_sp( geom_table varchar, source int4, target int4) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-	r record;
-	path_result record;
-	v_id integer;
-	e_id integer;
-	geom geoms;
-	id integer;
-BEGIN
-	
-	id :=0;
-	
-	FOR path_result IN EXECUTE 'SELECT gid,the_geom FROM ' ||
-          'pgr_dijkstra(''SELECT gid as id, source::integer, target::integer, ' || 
-          'length::double precision as cost FROM ' ||
-	  quote_ident(geom_table) || ''', ' || quote_literal(source) || 
-          ' , ' || quote_literal(target) || ' , false, false), ' || 
-          quote_ident(geom_table) || ' where edge_id = gid ' 
-        LOOP
-
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-	END LOOP;
-	RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- Dijkstra wrapper function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION dijkstra_sp_directed( geom_table varchar, source int4, target int4, dir boolean, rc boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-	r record;
-	path_result record;
-	v_id integer;
-	e_id integer;
-	geom geoms;
-	query text;
-	id integer;
-BEGIN
-	
-	id :=0;
-	
-	query := 'SELECT gid,the_geom FROM ' ||
-          'pgr_dijkstra(''SELECT gid as id, source::integer, target::integer, ' || 
-          'length::double precision as cost ';
-	  
-	IF rc THEN query := query || ', reverse_cost ';  
-	END IF;
-	
-	query := query || 'FROM ' ||  quote_ident(geom_table) || ''', ' || quote_literal(source) || 
-          ' , ' || quote_literal(target) || ' , '''||dir::text||''', '''||rc::text||'''), ' || 
-          quote_ident(geom_table) || ' where edge_id = gid ';
-
-	FOR path_result IN EXECUTE query
-        LOOP
-
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-	END LOOP;
-	RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- Dijkstra function for undirected graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION dijkstra_sp_delta( varchar,int4, int4, float8) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR path_result IN EXECUTE 'SELECT gid,the_geom FROM ' || 
-           'dijkstra_sp_delta_directed(''' || 
-           quote_ident(geom_table) || ''', ' || quote_literal(sourceid) || ', ' || 
-	   quote_literal(targetid) || ', ' || delta || ', false, false)'
-        LOOP
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
------------------------------------------------------------------------
--- Dijkstra function for directed graphs.
--- Compute the shortest path using edges table, and return
---  the result as a set of (gid integer, the_geom geometry) records.
--- Also data clipping added to improve function performance.
---
--- Last changes: 14.02.2008
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION dijkstra_sp_delta_directed( varchar,int4, int4, float8, boolean, boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        geom_table ALIAS FOR $1;
-	sourceid ALIAS FOR $2;
-	targetid ALIAS FOR $3;
-	delta ALIAS FOR $4;
-	dir ALIAS FOR $5;
-	rc ALIAS FOR $6;
-
-	rec record;
-	r record;
-        path_result record;
-        v_id integer;
-        e_id integer;
-        geom geoms;
-	
-	srid integer;
-
-	source_x float8;
-	source_y float8;
-	target_x float8;
-	target_y float8;
-	
-	ll_x float8;
-	ll_y float8;
-	ur_x float8;
-	ur_y float8;
-	
-	query text;
-	id integer;
-BEGIN
-	
-	id :=0;
-	FOR rec IN EXECUTE
-	    'select ST_SRID(the_geom) as srid from ' ||
-	    quote_ident(geom_table) || ' limit 1'
-	LOOP
-	END LOOP;
-	srid := rec.srid;
-
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as source_x from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            sourceid ||  ' or target='||sourceid||' limit 1'
-        LOOP
-	END LOOP;
-	source_x := rec.source_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as source_y from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            sourceid ||  ' or target='||sourceid||' limit 1'
-        LOOP
-	END LOOP;
-
-	source_y := rec.source_y;
-
-	FOR rec IN EXECUTE 
-            'select ST_X(PGR_StartPoint(the_geom)) as target_x from ' ||
-            quote_ident(geom_table) || ' where source = ' || 
-            targetid ||  ' or target='||targetid||' limit 1'
-        LOOP
-	END LOOP;
-
-	target_x := rec.target_x;
-	
-	FOR rec IN EXECUTE 
-            'select ST_Y(PGR_StartPoint(the_geom)) as target_y from ' || 
-            quote_ident(geom_table) || ' where source = ' || 
-            targetid ||  ' or target='||targetid||' limit 1'
-        LOOP
-	END LOOP;
-	target_y := rec.target_y;
-
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_x||'<'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||
-           ' END as ll_x, CASE WHEN '||source_x||'>'||target_x||
-           ' THEN '||source_x||' ELSE '||target_x||' END as ur_x'
-        LOOP
-	END LOOP;
-
-	ll_x := rec.ll_x;
-	ur_x := rec.ur_x;
-
-	FOR rec IN EXECUTE 'SELECT CASE WHEN '||source_y||'<'||
-            target_y||' THEN '||source_y||' ELSE '||
-            target_y||' END as ll_y, CASE WHEN '||
-            source_y||'>'||target_y||' THEN '||
-            source_y||' ELSE '||target_y||' END as ur_y'
-        LOOP
-	END LOOP;
-
-	ll_y := rec.ll_y;
-	ur_y := rec.ur_y;
-
-	query := 'SELECT gid,the_geom FROM ' || 
-          'pgr_dijkstra(''SELECT gid as id, source::integer, target::integer, ' || 
-          'length::double precision as cost ';
-	  
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-
-	query := query || ' FROM ' || quote_ident(geom_table) || ' where ST_SetSRID(''''BOX3D('||
-          ll_x-delta||' '||ll_y-delta||','||ur_x+delta||' '||
-          ur_y+delta||')''''::BOX3D, ' || srid || ') && the_geom'', ' || 
-          quote_literal(sourceid) || ' , ' || 
-          quote_literal(targetid) || ' , '''||dir::text||''', '''||rc::text||''' ), ' ||
-          quote_ident(geom_table) || ' where edge_id = gid ';
-	  
-	FOR path_result IN EXECUTE query
-        LOOP
-                 geom.gid      := path_result.gid;
-                 geom.the_geom := path_result.the_geom;
-		 id := id+1;
-		 geom.id       := id;
-                 
-                 RETURN NEXT geom;
-
-        END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-------------------------------------------------------
--- Returns TSP solution as a set of vertices connected
--- with A* paths
---
--- Last changes: 14.02.2008
-------------------------------------------------------
-CREATE OR REPLACE FUNCTION tsp_astar( geom_table varchar,ids varchar, source integer, delta double precision) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-	prev integer;
-	geom geoms;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	prev := source;
-	FOR path_result IN EXECUTE 'SELECT vertex_id FROM tsp(''select distinct source::integer as source_id, x1::double precision as x, y1::double precision as y from ' ||
-	  quote_ident(geom_table) || ' where source in (' || 
-          ids || ') UNION select distinct target as source_id, ST_X(PGR_EndPoint(the_geom)), ST_Y(PGR_EndPoint(the_geom)) from '|| quote_ident(geom_table) ||' where target in ('||ids||')'', '''|| ids  ||''', '|| source  ||')' LOOP
-
-                v_id = path_result.vertex_id;
-		
-                FOR r IN EXECUTE 'SELECT gid, the_geom FROM astar_sp_delta( ''' || 
-                  quote_ident(geom_table)  ||''', '|| v_id ||', '|| 
-                  prev ||','||delta||')' LOOP
-                    geom.gid := r.gid;
-	            geom.the_geom := r.the_geom;
-                    id := id+1;
-		    geom.id       := id;
-    	            RETURN NEXT geom;
-                END LOOP;
-		
-	prev = v_id;
-	END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-------------------------------------------------------
--- Returns TSP solution as a set of vertices connected
--- with A* paths.
--- For directed graphs.
---
--- Last changes: 14.02.2008
-------------------------------------------------------
-CREATE OR REPLACE FUNCTION tsp_astar_directed( geom_table varchar,ids varchar, source integer, delta float8, dir boolean, rc boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-	prev integer;
-	geom geoms;
-	
-	query text;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	prev := source;
-	query := 'SELECT vertex_id FROM tsp(''select distinct source::integer '||
-		'as source_id, x1::double precision as x, y1::double precision as y ';
-		
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-
-	query := query || 'from ' || quote_ident(geom_table) || ' where source in (' || 
-          ids || ') UNION select distinct target as source_id, x1::double precision as x, y1::double precision as y ';
-
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-        
-        query := query || 'from '|| quote_ident(geom_table) ||' where target in ('||ids||')'', '''|| ids  ||''', '|| source  ||')';
-	
-	FOR path_result IN EXECUTE query
-	LOOP
-
-                v_id = path_result.vertex_id;
-		
-                FOR r IN EXECUTE 'SELECT gid, the_geom FROM astar_sp_delta_directed( ''' || 
-                  quote_ident(geom_table)  ||''', '|| v_id ||', '|| 
-                  prev ||','||delta||', '''||dir::text||''', '''||rc::text||''')' LOOP
-                    geom.gid := r.gid;
-	            geom.the_geom := r.the_geom;
-                    id := id+1;
-		    geom.id       := id;
-    	            RETURN NEXT geom;
-                END LOOP;
-		
-	prev = v_id;
-	END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-
-------------------------------------------------------
--- Returns TSP solution as a set of vertices connected
--- with Dijkstra paths.
-------------------------------------------------------
-CREATE OR REPLACE FUNCTION tsp_dijkstra( geom_table varchar,ids varchar, source integer) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-	prev integer;
-	geom geoms;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	prev := source;
-	FOR path_result IN EXECUTE 'SELECT vertex_id FROM tsp(''select distinct source::integer as source_id, ST_X(PGR_StartPoint(the_geom)), ST_Y(PGR_StartPoint(the_geom)) from ' ||
-	   quote_ident(geom_table) || ' where source in (' || 
-           ids || ') UNION select distinct target as source_id, ST_X(PGR_EndPoint(the_geom)), ST_Y(PGR_EndPoint(the_geom)) from '|| quote_ident(geom_table) ||' where target in ('||ids||')'', '''|| ids  ||''', '|| source  ||')' LOOP
-
-                v_id = path_result.vertex_id;
-		
-
-                FOR r IN EXECUTE 'SELECT gid, the_geom FROM dijkstra_sp_delta( ''' || 
-                  quote_ident(geom_table)  ||''', '|| v_id ||', '|| 
-                  prev ||',0.03)' LOOP
-                    geom.gid := r.gid;
-	            geom.the_geom := r.the_geom;
-                    id := id+1;
-		    geom.id       := id;
-    	            RETURN NEXT geom;
-                END LOOP;
-		
-	prev = v_id;
-	END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
-------------------------------------------------------
--- Returns TSP solution as a set of vertices connected
--- with Dijkstra paths.
--- For directed graphs.
---
--- Last changes: 14.02.2008
-------------------------------------------------------
-CREATE OR REPLACE FUNCTION tsp_dijkstra_directed( geom_table varchar,ids varchar, source integer, delta float8, dir boolean, rc boolean) 
-       RETURNS SETOF GEOMS AS
-$$
-DECLARE 
-        r record;
-        path_result record;
-        v_id integer;
-	prev integer;
-	geom geoms;
-	
-	query text;
-
-	id integer;
-BEGIN
-	
-	id :=0;
-	prev := source;
-	
-	query := 'SELECT vertex_id FROM tsp(''select distinct source::integer as source_id, '||
-		    'ST_X(PGR_StartPoint(the_geom)), ST_Y(PGR_StartPoint(the_geom))';
-		    
-	IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-
-	query := query || ' from ' || quote_ident(geom_table) || ' where source in (' || 
-           ids || ') UNION select distinct target as source_id, ST_X(PGR_EndPoint(the_geom)), ST_Y(PGR_EndPoint(the_geom))';
-        
-        IF rc THEN query := query || ' , reverse_cost ';
-	END IF;
-
-	query := query || 'from '|| quote_ident(geom_table) ||' where target in ('||ids||')'', '''|| ids  ||''', '|| source  ||')';
-	   
-	FOR path_result IN EXECUTE query
-	LOOP
-
-                v_id = path_result.vertex_id;
-		
-
-                FOR r IN EXECUTE 'SELECT gid, the_geom FROM dijkstra_sp_delta_directed( ''' || 
-                  quote_ident(geom_table)  ||''', '|| v_id ||', '|| 
-                  prev ||','||delta||', '''||dir::text||''', '''||rc::text||''')' LOOP
-                    geom.gid := r.gid;
-	            geom.the_geom := r.the_geom;
-                    id := id+1;
-		    geom.id       := id;
-    	            RETURN NEXT geom;
-                END LOOP;
-		
-	prev = v_id;
-	END LOOP;
-        RETURN;
-END;
-$$
-LANGUAGE 'plpgsql' VOLATILE STRICT; 
-
--- COMMIT;
diff --git a/src/common/sql/pgrouting_node_network.sql b/src/common/sql/pgrouting_node_network.sql
deleted file mode 100644
index 9b32462..0000000
--- a/src/common/sql/pgrouting_node_network.sql
+++ /dev/null
@@ -1,267 +0,0 @@
-
-/*****************************************************************************
-* Author: Nicolas Ribot, 2013
-******************************************************************************/
-
-
-CREATE OR REPLACE FUNCTION pgr_nodeNetwork(edge_table text, tolerance double precision, 
-			id text default 'id', the_geom text default 'the_geom', table_ending text default 'noded') RETURNS text AS
-$BODY$
-DECLARE
-	/*
-	 * Author: Nicolas Ribot, 2013
-	*/
-	p_num int := 0;
-	p_ret text := '';
-    pgis_ver_old boolean := _pgr_versionless(postgis_lib_version(), '2.1.0.0');
-    vst_line_substring text;
-    vst_line_locate_point text;
-    intab text;
-    outtab text;
-    n_pkey text;
-    n_geom text;
-    naming record;
-    sname text;
-    tname text;
-    outname text;
-    srid integer;
-    sridinfo record;
-    splits bigint;
-    touched bigint;
-    untouched bigint;
-    geomtype text;
-    debuglevel text;
-   
-
-BEGIN
-  raise notice 'PROCESSING:'; 
-  raise notice 'pgr_nodeNetwork(''%'',%,''%'',''%'',''%'')',edge_table,tolerance,the_geom,id,table_ending;
-  raise notice 'Performing checks, please wait .....';
-  execute 'show client_min_messages' into debuglevel;
-
-  BEGIN
-    RAISE DEBUG 'Checking % exists',edge_table;
-    execute 'select * from _pgr_getTableName('||quote_literal(edge_table)||',0)' into naming;
-    sname=naming.sname;
-    tname=naming.tname;
-    IF sname IS NULL OR tname IS NULL THEN
-	RAISE NOTICE '-------> % not found',edge_table;
-        RETURN 'FAIL';
-    ELSE
-	RAISE DEBUG '  -----> OK';
-    END IF;
-  
-    intab=sname||'.'||tname;
-    outname=tname||'_'||table_ending;
-    outtab= sname||'.'||outname;
-    --rows_where = ' AND ('||rows_where||')'; 
-  END;
-
-  BEGIN 
-       raise DEBUG 'Checking id column "%" columns in  % ',id,intab;
-       EXECUTE 'select _pgr_getColumnName('||quote_literal(intab)||','||quote_literal(id)||')' INTO n_pkey;
-       IF n_pkey is NULL then
-          raise notice  'ERROR: id column "%"  not found in %',id,intab;
-          RETURN 'FAIL';
-       END IF;
-  END; 
-
-
-  BEGIN 
-       raise DEBUG 'Checking id column "%" columns in  % ',the_geom,intab;
-       EXECUTE 'select _pgr_getColumnName('||quote_literal(intab)||','||quote_literal(the_geom)||')' INTO n_geom;
-       IF n_geom is NULL then
-          raise notice  'ERROR: the_geom  column "%"  not found in %',the_geom,intab;
-          RETURN 'FAIL';
-       END IF;
-  END;
-
-  IF n_pkey=n_geom THEN
-	raise notice  'ERROR: id and the_geom columns have the same name "%" in %',n_pkey,intab;
-        RETURN 'FAIL';
-  END IF;
- 
-  BEGIN 
-       	raise DEBUG 'Checking the SRID of the geometry "%"', n_geom;
-       	EXECUTE 'SELECT ST_SRID(' || quote_ident(n_geom) || ') as srid '
-          		|| ' FROM ' || _pgr_quote_ident(intab)
-          		|| ' WHERE ' || quote_ident(n_geom)
-          		|| ' IS NOT NULL LIMIT 1' INTO sridinfo;
-       	IF sridinfo IS NULL OR sridinfo.srid IS NULL THEN
-        	RAISE NOTICE 'ERROR: Can not determine the srid of the geometry "%" in table %', n_geom,intab;
-           	RETURN 'FAIL';
-       	END IF;
-       	srid := sridinfo.srid;
-       	raise DEBUG '  -----> SRID found %',srid;
-       	EXCEPTION WHEN OTHERS THEN
-           		RAISE NOTICE 'ERROR: Can not determine the srid of the geometry "%" in table %', n_geom,intab;
-           		RETURN 'FAIL';
-  END;
-
-    BEGIN
-      RAISE DEBUG 'Checking "%" column in % is indexed',n_pkey,intab;
-      if (_pgr_isColumnIndexed(intab,n_pkey)) then 
-	RAISE DEBUG '  ------>OK';
-      else 
-        RAISE DEBUG ' ------> Adding  index "%_%_idx".',n_pkey,intab;
-
-	set client_min_messages  to warning;
-        execute 'create  index '||tname||'_'||n_pkey||'_idx on '||_pgr_quote_ident(intab)||' using btree('||quote_ident(n_pkey)||')';
-	execute 'set client_min_messages  to '|| debuglevel;
-      END IF;
-    END;
-
-    BEGIN
-      RAISE DEBUG 'Checking "%" column in % is indexed',n_geom,intab;
-      if (_pgr_iscolumnindexed(intab,n_geom)) then 
-	RAISE DEBUG '  ------>OK';
-      else 
-        RAISE DEBUG ' ------> Adding unique index "%_%_gidx".',intab,n_geom;
-	set client_min_messages  to warning;
-        execute 'CREATE INDEX '
-            || quote_ident(tname || '_' || n_geom || '_gidx' )
-            || ' ON ' || _pgr_quote_ident(intab)
-            || ' USING gist (' || quote_ident(n_geom) || ')';
-	execute 'set client_min_messages  to '|| debuglevel;
-      END IF;
-    END;
----------------
-    BEGIN
-       raise DEBUG 'initializing %',outtab;
-       execute 'select * from _pgr_getTableName('||quote_literal(outtab)||',0)' into naming;
-       IF sname=naming.sname  AND outname=naming.tname  THEN
-           execute 'TRUNCATE TABLE '||_pgr_quote_ident(outtab)||' RESTART IDENTITY';
-           execute 'SELECT DROPGEOMETRYCOLUMN('||quote_literal(sname)||','||quote_literal(outname)||','||quote_literal(n_geom)||')';
-       ELSE
-	   set client_min_messages  to warning;
-       	   execute 'CREATE TABLE '||_pgr_quote_ident(outtab)||' (id bigserial PRIMARY KEY,old_id integer,sub_id integer,
-								source bigint,target bigint)';
-       END IF;
-       execute 'select geometrytype('||quote_ident(n_geom)||') from  '||_pgr_quote_ident(intab)||' limit 1' into geomtype;
-       execute 'select addGeometryColumn('||quote_literal(sname)||','||quote_literal(outname)||','||
-                quote_literal(n_geom)||','|| srid||', '||quote_literal(geomtype)||', 2)';
-       execute 'CREATE INDEX '||quote_ident(outname||'_'||n_geom||'_idx')||' ON '||_pgr_quote_ident(outtab)||'  USING GIST ('||quote_ident(n_geom)||')';
-	execute 'set client_min_messages  to '|| debuglevel;
-       raise DEBUG  '  ------>OK'; 
-    END;  
-----------------
-
-
-  raise notice 'Processing, please wait .....';
-
-
-    if pgis_ver_old then
-        vst_line_substring    := 'st_line_substring';
-        vst_line_locate_point := 'st_line_locate_point';
-    else
-        vst_line_substring    := 'st_linesubstring';
-        vst_line_locate_point := 'st_linelocatepoint';
-    end if;
-
---    -- First creates temp table with intersection points
-    p_ret = 'create temp table intergeom on commit drop as (
-        select l1.' || quote_ident(n_pkey) || ' as l1id, 
-               l2.' || quote_ident(n_pkey) || ' as l2id, 
-	       l1.' || quote_ident(n_geom) || ' as line,
-	       _pgr_startpoint(l2.' || quote_ident(n_geom) || ') as source,
-	       _pgr_endpoint(l2.' || quote_ident(n_geom) || ') as target,
-               st_intersection(l1.' || quote_ident(n_geom) || ', l2.' || quote_ident(n_geom) || ') as geom 
-        from ' || _pgr_quote_ident(intab) || ' l1 
-             join ' || _pgr_quote_ident(intab) || ' l2 
-             on (st_dwithin(l1.' || quote_ident(n_geom) || ', l2.' || quote_ident(n_geom) || ', ' || tolerance || '))'||
-        'where l1.' || quote_ident(n_pkey) || ' <> l2.' || quote_ident(n_pkey)||' and 
-	st_equals(_pgr_startpoint(l1.' || quote_ident(n_geom) || '),_pgr_startpoint(l2.' || quote_ident(n_geom) || '))=false and 
-	st_equals(_pgr_startpoint(l1.' || quote_ident(n_geom) || '),_pgr_endpoint(l2.' || quote_ident(n_geom) || '))=false and 
-	st_equals(_pgr_endpoint(l1.' || quote_ident(n_geom) || '),_pgr_startpoint(l2.' || quote_ident(n_geom) || '))=false and 
-	st_equals(_pgr_endpoint(l1.' || quote_ident(n_geom) || '),_pgr_endpoint(l2.' || quote_ident(n_geom) || '))=false  )';
-    raise debug '%',p_ret;	
-    EXECUTE p_ret;	
-
-    -- second temp table with locus (index of intersection point on the line)
-    -- to avoid updating the previous table
-    -- we keep only intersection points occuring onto the line, not at one of its ends
---    drop table if exists inter_loc;
-
---HAD TO CHANGE THIS QUERY
- p_ret= 'create temp table inter_loc on commit drop as ( 
-        select l1id, l2id, ' || vst_line_locate_point || '(line,point) as locus from (
-        select DISTINCT l1id, l2id, line, (ST_DumpPoints(geom)).geom as point from intergeom) as foo
-        where ' || vst_line_locate_point || '(line,point)<>0 and ' || vst_line_locate_point || '(line,point)<>1)';
---    p_ret= 'create temp table inter_loc on commit drop as ( select * from (
---        (select l1id, l2id, ' || vst_line_locate_point || '(line,source) as locus from intergeom)
---         union
---        (select l1id, l2id, ' || vst_line_locate_point || '(line,target) as locus from intergeom)) as foo
---        where locus<>0 and locus<>1)';
-    raise debug  '%',p_ret;	
-    EXECUTE p_ret;	
-
-    -- index on l1id
-    create index inter_loc_id_idx on inter_loc(l1id);
-
-    -- Then computes the intersection on the lines subset, which is much smaller than full set 
-    -- as there are very few intersection points
-
---- outab needs to be formally created with id, old_id, subid,the_geom, source,target
----  so it can be inmediatly be used with createTopology
-
---   EXECUTE 'drop table if exists ' || _pgr_quote_ident(outtab);
---   EXECUTE 'create table ' || _pgr_quote_ident(outtab) || ' as 
-     P_RET = 'insert into '||_pgr_quote_ident(outtab)||' (old_id,sub_id,'||quote_ident(n_geom)||') (  with cut_locations as (
-           select l1id as lid, locus 
-           from inter_loc
-           -- then generates start and end locus for each line that have to be cut buy a location point
-           UNION ALL
-           select i.l1id  as lid, 0 as locus
-           from inter_loc i left join ' || _pgr_quote_ident(intab) || ' b on (i.l1id = b.' || quote_ident(n_pkey) || ')
-           UNION ALL
-           select i.l1id  as lid, 1 as locus
-           from inter_loc i left join ' || _pgr_quote_ident(intab) || ' b on (i.l1id = b.' || quote_ident(n_pkey) || ')
-           order by lid, locus
-       ), 
-       -- we generate a row_number index column for each input line 
-       -- to be able to self-join the table to cut a line between two consecutive locations 
-       loc_with_idx as (
-           select lid, locus, row_number() over (partition by lid order by locus) as idx
-           from cut_locations
-       ) 
-       -- finally, each original line is cut with consecutive locations using linear referencing functions
-       select l.' || quote_ident(n_pkey) || ', loc1.idx as sub_id, ' || vst_line_substring || '(l.' || quote_ident(n_geom) || ', loc1.locus, loc2.locus) as ' || quote_ident(n_geom) || ' 
-       from loc_with_idx loc1 join loc_with_idx loc2 using (lid) join ' || _pgr_quote_ident(intab) || ' l on (l.' || quote_ident(n_pkey) || ' = loc1.lid)
-       where loc2.idx = loc1.idx+1
-           -- keeps only linestring geometries
-           and geometryType(' || vst_line_substring || '(l.' || quote_ident(n_geom) || ', loc1.locus, loc2.locus)) = ''LINESTRING'') ';
-    raise debug  '%',p_ret;	
-    EXECUTE p_ret;	
-	GET DIAGNOSTICS splits = ROW_COUNT;
-        execute 'with diff as (select distinct old_id from '||_pgr_quote_ident(outtab)||' )
-                 select count(*) from diff' into touched; 
-	-- here, it misses all original line that did not need to be cut by intersection points: these lines
-	-- are already clean
-	-- inserts them in the final result: all lines which gid is not in the res table.
-	EXECUTE 'insert into ' || _pgr_quote_ident(outtab) || ' (old_id , sub_id, ' || quote_ident(n_geom) || ')
-                ( with used as (select distinct old_id from '|| _pgr_quote_ident(outtab)||')
-		select ' ||  quote_ident(n_pkey) || ', 1 as sub_id, ' ||  quote_ident(n_geom) ||
-		' from '|| _pgr_quote_ident(intab) ||' where  '||quote_ident(n_pkey)||' not in (select * from used))';
-	GET DIAGNOSTICS untouched = ROW_COUNT;
-
-	raise NOTICE '  Splitted Edges: %', touched;
-	raise NOTICE ' Untouched Edges: %', untouched;
-	raise NOTICE '     Total original Edges: %', touched+untouched;
-        RAISE NOTICE ' Edges generated: %', splits;
-	raise NOTICE ' Untouched Edges: %',untouched;
-	raise NOTICE '       Total New segments: %', splits+untouched;
-        RAISE NOTICE ' New Table: %', outtab;
-        RAISE NOTICE '----------------------------------';
-
-    drop table  if exists intergeom;
-    drop table if exists inter_loc;
-    RETURN 'OK';
-END;
-$BODY$
-    LANGUAGE 'plpgsql' VOLATILE STRICT COST 100;
-
-
-COMMENT ON FUNCTION pgr_nodeNetwork(text,tolerance double precision, 
-                        text,  text ,  text )
- IS  'edge_table, tolerance, id:=''id'', the_geom:=''the_geom'', table_ending:=''noded'' ';
-
diff --git a/src/common/sql/pgrouting_topology.sql b/src/common/sql/pgrouting_topology.sql
deleted file mode 100644
index 3838653..0000000
--- a/src/common/sql/pgrouting_topology.sql
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-.. function:: _pgr_pointToId(point geometry, tolerance double precision,vname text,srid integer)
-
-This function should not be used directly. Use assign_vertex_id instead
-Inserts a point into the vertices tablei "vname" with the srid "srid", and return an id
-of a new point or an existing point. Tolerance is the minimal distance
-between existing points and the new point to create a new point.
-
-Last changes: 2013-03-22
-Author: Christian Gonzalez
-Author: Stephen Woodbridge <woodbri at imaptools.com>
-Modified by: Vicky Vergara <vicky_vergara at hotmail,com>
-
-HISTORY
-Last changes: 2013-03-22
-2013-08-19: handling schemas
-*/
-
-CREATE OR REPLACE FUNCTION _pgr_pointToId(point geometry, tolerance double precision,vertname text,srid integer)
-  RETURNS bigint AS
-$BODY$
-DECLARE
-    rec record;
-    pid bigint;
-
-BEGIN
-    execute 'SELECT ST_Distance(the_geom,ST_GeomFromText(st_astext('||quote_literal(point::text)||'),'||srid||')) AS d, id, the_geom
-FROM '||_pgr_quote_ident(vertname)||'
-WHERE ST_DWithin(the_geom, ST_GeomFromText(st_astext('||quote_literal(point::text)||'),'||srid||'),'|| tolerance||')
-ORDER BY d
-LIMIT 1' INTO rec ;
-    IF rec.id is not null THEN
-        pid := rec.id;
-    ELSE
-        execute 'INSERT INTO '||_pgr_quote_ident(vertname)||' (the_geom) VALUES ('||quote_literal(point::text)||')';
-        pid := lastval();
-    END IF;
-
-    RETURN pid;
-
-END;
-$BODY$
-  LANGUAGE plpgsql VOLATILE STRICT;
-COMMENT ON FUNCTION _pgr_pointToId(geometry,double precision, text,integer) IS 'args: point geometry,tolerance,verticesTable,srid - inserts the point into the vertices table using tolerance to determine if its an existing point and returns the id assigned to it' ;
-
-
-/*
-.. function:: _pgr_createtopology(edge_table, tolerance,the_geom,id,source,target,rows_where)
-
-Fill the source and target column for all lines. All line ends
-with a distance less than tolerance, are assigned the same id
-
-Author: Christian Gonzalez <christian.gonzalez at sigis.com.ve>
-Author: Stephen Woodbridge <woodbri at imaptools.com>
-Modified by: Vicky Vergara <vicky_vergara at hotmail,com>
-
-HISTORY
-Last changes: 2013-03-22
-2013-08-19:  handling schemas
-2014-july: fixes issue 211
-*/
-
-CREATE OR REPLACE FUNCTION pgr_createtopology(edge_table text, tolerance double precision, 
-		   the_geom text default 'the_geom', id text default 'id',
-		   source text default 'source', target text default 'target',rows_where text default 'true',
-		   clean boolean default true)
-RETURNS VARCHAR AS
-$BODY$
-
-DECLARE
-    points record;
-    sridinfo record;
-    source_id bigint;
-    target_id bigint;
-    totcount bigint;
-    rowcount bigint;
-    srid integer;
-    sql text;
-    sname text;
-    tname text;
-    tabname text;
-    vname text;
-    vertname text;
-    gname text;
-    idname text;
-    sourcename text;
-    targetname text;
-    notincluded integer;
-    i integer;
-    naming record;
-    info record;
-    flag boolean;
-    query text;
-    idtype text;
-    gtype text;
-    sourcetype text;
-    targettype text;
-    debuglevel text;
-    dummyRec text;
-    fnName text;
-    err bool;
-    msgKind int;
-
-BEGIN
-    msgKind = 1; -- notice
-    fnName = 'pgr_createTopology';
-    raise notice 'PROCESSING:'; 
-    raise notice 'pgr_createTopology(''%'',%,''%'',''%'',''%'',''%'',''%'')',edge_table,tolerance,the_geom,id,source,target,rows_where;
-    -- raise notice 'pgr_createTopology(''%'',%,''%'',''%'',''%'',''%'',''%'',''%'')',edge_table,tolerance,the_geom,id,source,target,rows_where,clean;
-    execute 'show client_min_messages' into debuglevel;
-
-
-    raise notice 'Performing checks, please wait .....';
-
-        execute 'select * from _pgr_getTableName('|| quote_literal(edge_table)
-                                                  || ',2,' || quote_literal(fnName) ||' )' into naming;
-        sname=naming.sname;
-        tname=naming.tname;
-        tabname=sname||'.'||tname;
-        vname=tname||'_vertices_pgr';
-        vertname= sname||'.'||vname;
-        rows_where = ' AND ('||rows_where||')'; 
-      raise DEBUG '     --> OK';
-
-
-      raise debug 'Checking column names in edge table';
-        select * into idname     from _pgr_getColumnName(sname, tname,id,2,fnName);
-        select * into sourcename from _pgr_getColumnName(sname, tname,source,2,fnName);
-        select * into targetname from _pgr_getColumnName(sname, tname,target,2,fnName);
-        select * into gname      from _pgr_getColumnName(sname, tname,the_geom,2,fnName);
-
-
-        err = sourcename in (targetname,idname,gname) or  targetname in (idname,gname) or idname=gname;
-        perform _pgr_onError( err, 2, fnName,
-               'Two columns share the same name', 'Parameter names for id,the_geom,source and target  must be different',
-	       'Column names are OK');
-
-      raise DEBUG '     --> OK';
-
-      raise debug 'Checking column types in edge table';
-        select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1, fnName);
-        select * into targettype from _pgr_getColumnType(sname,tname,targetname,1, fnName);
-        select * into idtype from _pgr_getColumnType(sname,tname,idname,1, fnName);
-
-        err = idtype not in('integer','smallint','bigint');
-        perform _pgr_onError(err, 2, fnName,
-	       'Wrong type of Column id:'|| idname, ' Expected type of '|| idname || ' is integer,smallint or bigint but '||idtype||' was found');
-
-        err = sourcetype not in('integer','smallint','bigint');
-        perform _pgr_onError(err, 2, fnName,
-	       'Wrong type of Column source:'|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found');
-
-        err = targettype not in('integer','smallint','bigint');
-        perform _pgr_onError(err, 2, fnName,
-	       'Wrong type of Column target:'|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or bigint but '||targettype||' was found');
-
-      raise DEBUG '     --> OK';
-
-      raise debug 'Checking SRID of geometry column';
-         query= 'SELECT ST_SRID(' || quote_ident(gname) || ') as srid '
-            || ' FROM ' || _pgr_quote_ident(tabname)
-            || ' WHERE ' || quote_ident(gname)
-            || ' IS NOT NULL LIMIT 1';
-         raise debug '%',query;
-         EXECUTE query INTO sridinfo;
-
-         err =  sridinfo IS NULL OR sridinfo.srid IS NULL;
-         perform _pgr_onError(err, 2, fnName,
-	     'Can not determine the srid of the geometry '|| gname ||' in table '||tabname, 'Check the geometry of column '||gname);
-
-         srid := sridinfo.srid;
-      raise DEBUG '     --> OK';
-
-      raise debug 'Checking and creating indices in edge table';
-        perform _pgr_createIndex(sname, tname , idname , 'btree'::text);
-        perform _pgr_createIndex(sname, tname , sourcename , 'btree'::text);
-        perform _pgr_createIndex(sname, tname , targetname , 'btree'::text);
-        perform _pgr_createIndex(sname, tname , gname , 'gist'::text);
-
-        gname=quote_ident(gname);
-        idname=quote_ident(idname);
-        sourcename=quote_ident(sourcename);
-        targetname=quote_ident(targetname);
-      raise DEBUG '     --> OK';
-
-
-
-
-
-    BEGIN 
-        -- issue #193 & issue #210 & #213
-        -- this sql is for trying out the where clause
-        -- the select * is to avoid any colum name conflicts
-        -- limit 1, just try on first record
-        -- if the where clasuse is ill formed it will be catched in the exception
-        sql = 'select * from '||_pgr_quote_ident(tabname)||' WHERE true'||rows_where ||' limit 1';
-        EXECUTE sql into dummyRec;
-        -- end 
-
-        -- if above where clasue works this one should work
-        -- any error will be catched by the exception also
-        sql = 'select count(*) from '||_pgr_quote_ident(tabname)||' WHERE (' || gname || ' IS NOT NULL AND '||
-	    idname||' IS NOT NULL)=false '||rows_where;
-        EXECUTE SQL  into notincluded;
-
-        if clean then 
-            raise debug 'Cleaning previous Topology ';
-               execute 'UPDATE ' || _pgr_quote_ident(tabname) ||
-               ' SET '||sourcename||' = NULL,'||targetname||' = NULL'; 
-        else 
-            raise debug 'Creating topology for edges with non assigned topology';
-            if rows_where=' AND (true)' then
-                rows_where=  ' and ('||quote_ident(sourcename)||' is null or '||quote_ident(targetname)||' is  null)'; 
-            end if;
-        end if;
-        -- my thoery is that the select Count(*) will never go thru here
-        EXCEPTION WHEN OTHERS THEN  
-             RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
-             RAISE NOTICE 'ERROR: Condition is not correct, please execute the following query to test your condition'; 
-             RAISE NOTICE '%',sql;
-             RETURN 'FAIL'; 
-    END;    
-
-    BEGIN
-        if clean then 
-             raise DEBUG 'initializing %',vertname;
-             execute 'select * from _pgr_getTableName('||quote_literal(vertname)
-                                                  || ',0,' || quote_literal(fnName) ||' )' into naming;
-             set client_min_messages  to warning;
-             IF sname=naming.sname  AND vname=naming.tname  THEN
-                   execute 'TRUNCATE TABLE '||_pgr_quote_ident(vertname)||' RESTART IDENTITY';
-                   execute 'SELECT DROPGEOMETRYCOLUMN('||quote_literal(sname)||','||quote_literal(vname)||','||quote_literal('the_geom')||')';
-             ELSE
-                   execute 'CREATE TABLE '||_pgr_quote_ident(vertname)||' (id bigserial PRIMARY KEY,cnt integer,chk integer,ein integer,eout integer)';
-             END IF;
-             execute 'select addGeometryColumn('||quote_literal(sname)||','||quote_literal(vname)||','||
-	     quote_literal('the_geom')||','|| srid||', '||quote_literal('POINT')||', 2)';
-
-             perform _pgr_createIndex(vertname , 'the_geom'::text , 'gist'::text);
-
-             execute 'set client_min_messages  to '|| debuglevel;
-        else  
-             execute 'select * from  _pgr_checkVertTab('||quote_literal(vertname) ||', ''{"id"}''::text[])' into naming;
-        end if;
-        raise DEBUG  '  ------>OK'; 
-        EXCEPTION WHEN OTHERS THEN  
-             RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
-             RAISE NOTICE 'ERROR: something went wrong when initializing the verties table';
-             RETURN 'FAIL'; 
-    END;       
-
-
-
-    raise notice 'Creating Topology, Please wait...';
-        rowcount := 0;
-        FOR points IN EXECUTE 'SELECT ' || idname || '::bigint AS id,'
-            || ' _pgr_StartPoint(' || gname || ') AS source,'
-            || ' _pgr_EndPoint('   || gname || ') AS target'
-            || ' FROM '  || _pgr_quote_ident(tabname)
-            || ' WHERE ' || gname || ' IS NOT NULL AND ' || idname||' IS NOT NULL '||rows_where
-        LOOP
-
-            rowcount := rowcount + 1;
-            IF rowcount % 1000 = 0 THEN
-                RAISE NOTICE '% edges processed', rowcount;
-            END IF;
-
-
-            source_id := _pgr_pointToId(points.source, tolerance,vertname,srid);
-            target_id := _pgr_pointToId(points.target, tolerance,vertname,srid);
-            BEGIN                         
-                sql := 'UPDATE ' || _pgr_quote_ident(tabname) || 
-                    ' SET '||sourcename||' = '|| source_id::text || ','||targetname||' = ' || target_id::text || 
-                    ' WHERE ' || idname || ' =  ' || points.id::text;
-
-                IF sql IS NULL THEN
-                    RAISE NOTICE 'WARNING: UPDATE % SET source = %, target = % WHERE % = % ', tabname, source_id::text, target_id::text, idname,  points.id::text;
-                ELSE
-                    EXECUTE sql;
-                END IF;
-                EXCEPTION WHEN OTHERS THEN 
-                    RAISE NOTICE '%', SQLERRM;
-                    RAISE NOTICE '%',sql;
-                    RETURN 'FAIL'; 
-            end;
-        END LOOP;
-        raise notice '-------------> TOPOLOGY CREATED FOR  % edges', rowcount;
-        RAISE NOTICE 'Rows with NULL geometry or NULL id: %',notincluded;
-        Raise notice 'Vertices table for table % is: %',_pgr_quote_ident(tabname), _pgr_quote_ident(vertname);
-        raise notice '----------------------------------------------';
-
-    RETURN 'OK';
- EXCEPTION WHEN OTHERS THEN
-   RAISE NOTICE 'Unexpected error %', SQLERRM; -- issue 210,211
-   RETURN 'FAIL';
-END;
-
-
-$BODY$
-LANGUAGE plpgsql VOLATILE STRICT;
-COMMENT ON FUNCTION pgr_createTopology(text, double precision,text,text,text,text,text,boolean) 
-IS 'args: edge_table,tolerance, the_geom:=''the_geom'',source:=''source'', target:=''target'',rows_where:=''true'' - fills columns source and target in the geometry table and creates a vertices table for selected rows';
-
-
-
-
diff --git a/src/common/sql/pgrouting_utilities.sql b/src/common/sql/pgrouting_utilities.sql
index 84b9c81..0528d48 100644
--- a/src/common/sql/pgrouting_utilities.sql
+++ b/src/common/sql/pgrouting_utilities.sql
@@ -1,9 +1,28 @@
--- -------------------------------------------------------------------
--- pgrouting_utilities.sql
--- Author Vicky Vergara <vicky_vergara at hotmail.com>
--- Copyright 2015 Vicky Vergara
--- This file is release unde an MIT-X license.
--- -------------------------------------------------------------------
+/*PGR-GNU*****************************************************************
+
+FILE: pgrouting_utilities.sql
+
+Copyright (c) 2015 Celia Vriginia Vergara Castillo
+Copyright (c) 2015 REgina Obe
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 
 
@@ -22,8 +41,9 @@
            (NULL,NULL) when schema was not found.
 
    Author: Vicky Vergara <vicky_vergara at hotmail.com>>
-
+  
   HISTORY
+     2015/11/01 Changed to handle views and refactored
      Created: 2013/08/19  for handling schemas
 
 */
@@ -31,15 +51,17 @@
 
 CREATE OR REPLACE FUNCTION _pgr_getTableName(IN tab text, IN reportErrs int default 0, IN fnName text default '_pgr_getTableName', OUT sname text,OUT tname text)
   RETURNS RECORD AS
-$BODY$
+$$
 DECLARE
         naming record;
         i integer;
         query text;
-        sn text;
-        tn text;
+        sn text; -- schema name
+        tn text; -- table name
+        ttype text; --table type for future use
         err boolean;
         debuglevel text;
+        var_types text[] = ARRAY['BASE TABLE', 'VIEW'];
 BEGIN
 
     execute 'show client_min_messages' into debuglevel;
@@ -48,56 +70,63 @@ BEGIN
     perform _pgr_msg( 0, fnName, 'Checking table ' || tab || ' exists');
     --RAISE DEBUG 'Checking % exists',tab;
 
-    execute 'select strpos('||quote_literal(tab)||','||quote_literal('.')||')' into i;
-    if (i!=0) then
-        execute 'select substr('||quote_literal(tab)||',1,strpos('||quote_literal(tab)||','||quote_literal('.')||')-1)' into sn;
-        execute 'select substr('||quote_literal(tab)||',strpos('||quote_literal(tab)||','||quote_literal('.')||')+1),length('||quote_literal(tab)||')' into tn;
-    else
-        execute 'select current_schema' into sn;
-        tn =tab;
-    end if;
+    i := strpos(tab,'.');
+    IF (i <> 0) THEN
+        sn := split_part(tab, '.',1); 
+        tn := split_part(tab, '.',2);
+    ELSE
+        sn := current_schema;
+        tn := tab;
+    END IF;
 
 
-    EXECUTE 'SELECT schema_name FROM information_schema.schemata WHERE schema_name = '||quote_literal(sn) into naming;
-    sname=naming.schema_name;
+   SELECT schema_name INTO sname 
+   FROM information_schema.schemata WHERE schema_name = sn;
 
-    if sname is NOT NULL THEN -- found schema (as is)
-            EXECUTE 'select table_name from information_schema.tables where
-                table_type='||quote_literal('BASE TABLE')||' and
-                table_schema='||quote_literal(sname)||' and
-                table_name='||quote_literal(tn) INTO  naming;
-        tname=naming.table_name;
+    IF sname IS NOT NULL THEN -- found schema (as is)
+       SELECT table_name, table_type INTO tname, ttype 
+       FROM information_schema.tables 
+       WHERE
+                table_type = ANY(var_types) and
+                table_schema = sname and
+                table_name = tn ;
         IF tname is NULL THEN
-           EXECUTE 'select table_name from information_schema.tables where
-                table_type='||quote_literal('BASE TABLE')||' and
-                table_schema='||quote_literal(sname)||' and
-                table_name='||quote_literal(lower(tn))||'order by table_name' INTO naming;
-           tname=naming.table_name;
+            SELECT table_name, table_type INTO tname, ttype 
+            FROM information_schema.tables 
+            WHERE
+                table_type  = ANY(var_types) and
+                table_schema = sname and
+                table_name = lower(tn) ORDER BY table_name;
         END IF;
     END IF;
-    IF sname is NULL or tname is NULL THEN         --schema not found or table in schema was not found
-        EXECUTE 'SELECT schema_name FROM information_schema.schemata WHERE schema_name = '||quote_literal(lower(sn)) into naming;
-        sname=naming.schema_name;
-        if sname is NOT NULL THEN -- found schema (with lower caps)
-           EXECUTE 'select table_name from information_schema.tables where
-                table_type='||quote_literal('BASE TABLE')||' and
-                table_schema='||quote_literal(sname)||' and
-                table_name='||quote_literal(tn) INTO  naming;
-           tname=naming.table_name;
-           IF tname is NULL THEN
-                EXECUTE 'select table_name from information_schema.tables where
-                table_type='||quote_literal('BASE TABLE')||' and
-                table_schema='||quote_literal(sname)||' and
-                table_name='||quote_literal(lower(tn))||'order by table_name' INTO naming;
-                tname=naming.table_name;
+    IF sname is NULL or tname is NULL THEN --schema not found or table not found
+        SELECT schema_name INTO sname 
+        FROM information_schema.schemata 
+        WHERE schema_name = lower(sn) ;
+
+        IF sname IS NOT NULL THEN -- found schema (with lower caps)
+            SELECT table_name, table_type INTO tname, ttype 
+            FROM information_schema.tables 
+            WHERE
+                table_type  =  ANY(var_types) and
+                table_schema = sname and
+                table_name= tn ;
+                
+           IF tname IS NULL THEN
+                SELECT table_name, table_type INTO tname, ttype 
+                FROM information_schema.tables 
+                WHERE
+                    table_type  =  ANY(var_types) and
+                    table_schema = sname and
+                    table_name= lower(tn) ;
            END IF;
         END IF;
     END IF;
-   err = case when sname IS NULL OR tname IS NULL then true else false end;
+   err = (sname IS NULL OR tname IS NULL);
    perform _pgr_onError(err, reportErrs, fnName, 'Table ' || tab ||' not found',' Check your table name', 'Table '|| tab || ' found');
 
 END;
-$BODY$
+$$
 LANGUAGE plpgsql VOLATILE STRICT;
 
 
diff --git a/src/common/sql/pgrouting_version.sql b/src/common/sql/pgrouting_version.sql
index 667abe5..b16d881 100644
--- a/src/common/sql/pgrouting_version.sql
+++ b/src/common/sql/pgrouting_version.sql
@@ -1,5 +1,5 @@
 -- -------------------------------------------------------------------
--- pgrouting_utilities.sql
+-- pgrouting_version.sql
 -- AuthorL Stephen Woodbridge <woodbri at imaptools.com>
 -- Copyright 2013 Stephen Woodbridge
 -- This file is release unde an MIT-X license.
@@ -9,7 +9,7 @@ CREATE OR REPLACE FUNCTION pgr_version()
 RETURNS TABLE(
 		"version" varchar, 
 		tag varchar,
-		build varchar,
+		--build varchar,
 		hash varchar,
 		branch varchar,
 		boost varchar
@@ -28,7 +28,7 @@ DECLARE
 BEGIN
     RETURN QUERY SELECT '${PGROUTING_VERSION_STRING}'::varchar AS version, 
     					'${PGROUTING_GIT_TAG}'::varchar AS tag, 
-                        '${PGROUTING_GIT_BUILD}'::varchar AS build, 
+                        --'${PGROUTING_GIT_BUILD}'::varchar AS build, 
                         '${PGROUTING_GIT_HASH}'::varchar AS hash, 
                         '${PGROUTING_GIT_BRANCH}'::varchar AS branch, 
                         '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'::varchar AS boost;
diff --git a/src/common/sql/utilities_pgr.sql b/src/common/sql/utilities_pgr.sql
index bf98491..2f93cc8 100644
--- a/src/common/sql/utilities_pgr.sql
+++ b/src/common/sql/utilities_pgr.sql
@@ -1,24 +1,27 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+
  utilities_pgr.sql
 
- Copyright (c) 2015 Celia Virginia Vergara Castillo
+ Copyright (c) 2014 Celia Virginia Vergara Castillo
  vicky_vergara at hotmail.com
 
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+------
 
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
 
-*/
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 
 /************************************************************************
@@ -35,7 +38,7 @@
                      'Two columns share the same name');
 	*	preforn _pgr_onError( idname=gname, 2, 'pgr_createToplogy',
                      'Two columns share the same name', 'Idname and gname must be different');
-        *	preforn _pgr_onError( idname=gname, 2, 'pgr_createToplogy',
+    *	preforn _pgr_onError( idname=gname, 2, 'pgr_createToplogy',
                      'Two columns share the same name', 'Idname and gname must be different',
                      'Column names are OK');
 
@@ -208,7 +211,7 @@ LANGUAGE plpgsql VOLATILE STRICT;
   HISTORY
      Created: 2014/JUL/28 
 ************************************************************************/
-
+/*
 CREATE OR REPLACE FUNCTION _pgr_createIndex(
     sname text, tname text, colname text, indext text,
     IN reportErrs int default 1, IN fnName text default '_pgr_createIndex')
@@ -272,6 +275,37 @@ END;
 
 $BODY$
   LANGUAGE plpgsql VOLATILE STRICT;
+*/
+/************************************************************************
+.. function:: _pgr_get_statement( sql ) returns the original statement if its a prepared statement
+
+    Returns:
+          sname,vname  registered schemaname, vertices table name 
+    
+          
+ Examples:  
+    select * from _pgr_dijkstra(_pgr_get_statament($1),$2,$3,$4);
+
+   Author: Vicky Vergara <vicky_vergara at hotmail.com>>
+
+  HISTORY
+     Created: 2014/JUL/27 
+************************************************************************/
+CREATE OR REPLACE FUNCTION _pgr_get_statement(o_sql text)
+RETURNS text AS
+$BODY$
+DECLARE
+sql TEXT;
+BEGIN
+    EXECUTE 'SELECT statement FROM pg_prepared_statements WHERE name ='  || quote_literal(o_sql) || ' limit 1 ' INTO sql;
+    IF (sql IS NULL) THEN
+      RETURN   o_sql;
+    ELSE
+      RETURN  regexp_replace(sql, '(.)* as ', '', 'i');
+    END IF;
+END
+$BODY$
+LANGUAGE plpgsql STABLE STRICT;
 
 
 /************************************************************************
diff --git a/src/common/src/CMakeLists.txt b/src/common/src/CMakeLists.txt
index 1f277ed..19c84d0 100644
--- a/src/common/src/CMakeLists.txt
+++ b/src/common/src/CMakeLists.txt
@@ -1,5 +1,10 @@
 ADD_LIBRARY(common OBJECT 
-               postgres_connection.c
-               basePath_SSEC.cpp
-           )
-
+    postgres_connection.c
+    restrictions_input.c
+    basePath_SSEC.cpp
+    points_input.c
+    get_check_data.c
+    edges_input.c
+    arrays_input.c
+    time_msg.c
+    )
diff --git a/src/common/src/arrays_input.c b/src/common/src/arrays_input.c
new file mode 100644
index 0000000..67c3ad5
--- /dev/null
+++ b/src/common/src/arrays_input.c
@@ -0,0 +1,115 @@
+/*PGR-GNU*****************************************************************
+File: arrays_input.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "./pgr_types.h"
+#include "postgres.h"
+#include "utils/lsyscache.h"
+#include "catalog/pg_type.h"
+#include "utils/array.h"
+
+
+// #define DEBUG
+#include "./time_msg.h"
+#include "./debug_macro.h"
+#include "./arrays_input.h"
+
+
+int64_t* pgr_get_bigIntArray(size_t *arrlen, ArrayType *input) {
+    int         ndims;
+    bool       *nulls;
+    Oid         i_eltype;
+    int16       i_typlen;
+    bool        i_typbyval;
+    char        i_typalign;
+    Datum      *i_data;
+    int         i;
+    int         n;
+    int64_t      *data;
+    clock_t start_t = clock();
+
+    PGR_DBG("Geting integer array");
+    /* get input array element type */
+    i_eltype = ARR_ELEMTYPE(input);
+    get_typlenbyvalalign(i_eltype, &i_typlen, &i_typbyval, &i_typalign);
+
+
+    /* validate input data type */
+    switch (i_eltype) {
+        case INT2OID:
+        case INT4OID:
+        case INT8OID:
+            break;
+        default:
+            elog(ERROR, "Expected array of ANY-INTEGER");
+            return (int64_t*) NULL;
+            break;
+    }
+
+    /* get various pieces of data from the input array */
+    ndims = ARR_NDIM(input);
+    n = (*ARR_DIMS(input));
+    (*arrlen) = (size_t)(n);
+
+    if (ndims != 1) {
+        elog(ERROR, "One dimension expected");
+    }
+
+    /* get src data */
+    deconstruct_array(input, i_eltype, i_typlen, i_typbyval, i_typalign,
+            &i_data, &nulls, &n);
+
+    /* construct a C array */
+    data = (int64_t *) malloc((*arrlen) * sizeof(int64_t));
+
+    if (!data) {
+        elog(ERROR, "Out of memory!");
+    }
+
+    PGR_DBG("array size %ld", (*arrlen));
+
+    for (i = 0; i < (*arrlen); i++) {
+        if (nulls[i]) {
+            data[i] = -1;
+        } else {
+            switch (i_eltype) {
+                case INT2OID:
+                    data[i] = (int64_t) DatumGetInt16(i_data[i]);
+                    break;
+                case INT4OID:
+                    data[i] = (int64_t) DatumGetInt32(i_data[i]);
+                    break;
+                case INT8OID:
+                    data[i] = DatumGetInt64(i_data[i]);
+                    break;
+            }
+        }
+    }
+
+    pfree(nulls);
+    pfree(i_data);
+
+    PGR_DBG("Finished processing array");
+    time_msg(" reading Array", start_t, clock());
+    return (int64_t*)data;
+}
diff --git a/src/common/src/arrays_input.h b/src/common/src/arrays_input.h
new file mode 100644
index 0000000..9a1f9a8
--- /dev/null
+++ b/src/common/src/arrays_input.h
@@ -0,0 +1,29 @@
+/*PGR-GNU*****************************************************************
+File: arrays_input.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./pgr_types.h"
+
+int64_t* pgr_get_bigIntArray(size_t *arrlen, ArrayType *input);
diff --git a/src/common/src/baseGraph.hpp b/src/common/src/baseGraph.hpp
index 6fc8e61..ab8d6b9 100644
--- a/src/common/src/baseGraph.hpp
+++ b/src/common/src/baseGraph.hpp
@@ -1,8 +1,10 @@
-/*PGR
+/*PGR-GNU*****************************************************************
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +19,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 #ifndef SRC_COMMON_SRC_BASE_GRAPH_HPP_
 #define SRC_COMMON_SRC_BASE_GRAPH_HPP_
@@ -32,422 +34,531 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #include <map>
 #include <limits>
 
-#include "postgres.h"
 #include "./pgr_types.h"
 
 /*! \brief boost::graph simplified to pgRouting needs
 
-This class gives the handling basics of a boost::graph of kind G
-where G:
- can be an undirected graph or a directed graph.
+  This class gives the handling basics of a boost::graph of kind G
+  where G:
+  can be an undirected graph or a directed graph.
 
 Usage:
 ======
 
- Given the following types:
+Given the following types:
 ~~~~{.c}
- typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::undirectedS,
-            boost_vertex_t, boost_edge_t > UndirectedGraph;
+typedef boost::adjacency_list < boost::vecS, boost::vecS,
+boost::undirectedS,
+boost_vertex_t, boost_edge_t > UndirectedGraph;
 
- typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::bidirectionalS,
-            boost_vertex_t, boost_edge_t > DirectedGraph;
+typedef boost::adjacency_list < boost::vecS, boost::vecS,
+boost::bidirectionalS,
+boost_vertex_t, boost_edge_t > DirectedGraph;
 ~~~~
 
 direct usage:
 ---------------
 
 ~~~~{.c}
-    Pgr_base_graph < DirectedGraph > digraph(gType, initial_size);
-    Pgr_base_graph < UndirectedGraph > undigraph(gType, initial_size);
+Pgr_base_graph < DirectedGraph > digraph(gType, initial_size);
+Pgr_base_graph < UndirectedGraph > undigraph(gType, initial_size);
 ~~~~
 
 usage by inheritance:
 ---------------------
 
 ~~~~{.c}
- class my_graph: public Pgr_base_graph {
-   explicit my_graph(graphType gtype, const int initial_size)
-     :Pgr_base_graph< G >(gtype, initial_size) {}
-   // the class: my_graph will have the functionality of this class
- }
- 
- my_graph < DirectedGraph > digraph(gType, initial_size);
- my_graph < UndirectedGraph > undigraph(gType, initial_size);
+class my_graph: public Pgr_base_graph {
+explicit my_graph(graphType gtype, const int initial_size)
+:Pgr_base_graph< G >(gtype, initial_size) {}
+// the class: my_graph will have the functionality of this class
+}
+
+my_graph < DirectedGraph > digraph(gType, initial_size);
+my_graph < UndirectedGraph > undigraph(gType, initial_size);
 ~~~~
 
 */
 
+typedef typename boost::adjacency_list < boost::vecS, boost::vecS,
+        boost::undirectedS,
+        boost_vertex_t, boost_edge_t > UndirectedGraph;
+
+typedef typename boost::adjacency_list < boost::vecS, boost::vecS,
+        boost::bidirectionalS,
+        boost_vertex_t, boost_edge_t > DirectedGraph;
+
+
 template <class G>
 class Pgr_base_graph {
  public:
-  /** @name Graph related types
-  Type      |     boost meaning     |   pgRouting Meaning
-:---------: | :-------------------- | :----------------------
-   G        | boost::adjacency_list |   Graph
-   V        | vertex_descriptor     |   Think of it as local ID of a vertex
-   E        | edge_descriptor       |   Think of it as local ID of an edge
-   V_i      | vertex_iterator       |   To cycle the vertices of the Graph
-   E_i      | edge_iterator         |   To cycle the edges of the Graph
-   EO_i     | out_edge_iterator     |   To cycle the out going edges of a vertex
-   EI_i     | in_edge_iterator      |   To cycle the in coming edges of a vertex (only in bidirectional graphs)
-  */
-  //@{
-  typedef typename boost::graph_traits < G >::vertex_descriptor V;
-  typedef typename boost::graph_traits < G >::edge_descriptor E;
-  typedef typename boost::graph_traits < G >::vertex_iterator V_i;
-  typedef typename boost::graph_traits < G >::edge_iterator E_i;
-  typedef typename boost::graph_traits < G >::out_edge_iterator EO_i;
-  typedef typename boost::graph_traits < G >::in_edge_iterator EI_i;
-  //@}
-
-  /** @name Id handling related types
-  Type      |  Meaning       |   pgRouting Meaning
-:---------: | :------------- | :----------------------
-   id_to_V  | maps id -> V   | given an id store the V
-   V_to_id  | maps V -> id   | given a V store the id
-   LI       | Left Iterator  | iterates over id_to_V
-   RI       | right Iterator | iterates over V_to_id
-  */
-  //@{
-  typedef typename std::map< int64_t, V > id_to_V;
-  typedef typename std::map< V, int64_t > V_to_id;
-  typedef typename id_to_V::const_iterator LI;
-  typedef typename V_to_id::const_iterator RI;
-  //@}
-
-  //! @name The Graph
-  //@{
-  G graph;                //!< The graph
-  int64_t numb_vertices;  //!< number of vertices
-  graphType m_gType;      //!< type (DIRECTED or UNDIRECTED)
-  //@}
-
-  //! @name Id handling
-  //@{
-  id_to_V  vertices_map;   //!< id -> graph id
-  V_to_id  gVertices_map;  //!< graph id -> id
-  //@}
-
-  //! @name Graph Modification
-  //@{
-  //! Used for storing the removed_edges
-  std::deque<pgr_edge_t> removed_edges;
-  //@}
-
-  //! @name Used by dijkstra
-  //@{
-  std::vector<V> predecessors;
-  std::vector<float8> distances;
-  std::deque<V> nodesInDistance;
-  //@}
-
-  //! @name The Graph
-  //@{
-  //! \brief Constructor
-  /*!
-    Prepares the _graph_ to be of type _gtype_ with the
-    aproximate number of vertices its coing to have as *initial_size*
-  */
-  explicit Pgr_base_graph< G >(graphType gtype, const int initial_size)
-     : graph(initial_size),
-       numb_vertices(0),
-       m_gType(gtype)
-     {}
-
-  //! \brief Inserts *count* edges of type *pgr_edge_t* into the graph
-  void graph_insert_data(const pgr_edge_t *data_edges, int64_t count) {
-      for (unsigned int i = 0; i < count; ++i) {
-         graph_add_edge(data_edges[i]);
-      }
-      for ( int64_t i = 0; (unsigned int) i < gVertices_map.size(); ++i )
-         graph[i].id = gVertices_map.find(i)->second;
-  }
-
-  //! \brief Disconnects all edges from p_from to p_to
-  /*!
-    - No edge is disconnected if the vertices id's do not exist in the graph
-    - All removed edges are stored for future reinsertion
-    - All parallel edges are disconnected (automatically by boost)
-
-    ![disconnect_edge(2,3) on an UNDIRECTED graph](disconnectEdgeUndirected.png)
-    ![disconnect_edge(2,3) on a DIRECTED graph](disconnectEdgeDirected.png)
-
-    @param [IN] *p_from* original vertex id of the starting point of the edge
-    @param [IN] *p_to*   original vertex id of the ending point of the edge
-  */
-  void disconnect_edge(int64_t p_from, int64_t p_to) {
-      V g_from;
-      V g_to;
-      pgr_edge_t d_edge;
-      // nothing to do, the vertex doesnt exist
-      if (!get_gVertex(p_from, g_from)) return;
-      if (!get_gVertex(p_to, g_to)) return;
-      EO_i out, out_end;
-      // store the edges that are going to be removed
-      for (boost::tie(out, out_end) = out_edges(g_from, graph);
-           out != out_end; ++out) {
-            if (target(*out, graph) == g_to) {
-                d_edge.id = graph[*out].id;
-                d_edge.source = graph[source(*out, graph)].id;
-                d_edge.target = graph[target(*out, graph)].id;
-                d_edge.cost = graph[*out].cost;
-                d_edge.reverse_cost = -1;
-                removed_edges.push_back(d_edge);
-            }
-      }
-      // the actual removal
-      boost::remove_edge(g_from, g_to, graph);
-  }
-
-
-  //! \brief Disconnects all incomming and outgoing edges from the vertex
-  /*!
-    boost::graph doesn't recommend th to insert/remove vertices, so a vertex removal is
-    simulated by disconnecting the vertex from the graph
-    
-    - No edge is disconnected if the vertices id's do not exist in the graph
-    - All removed edges are stored for future reinsertion
-    - All parallel edges are disconnected (automatically by boost)
-
-    ![disconnect_vertex(2) on an UNDIRECTED graph](disconnectVertexUndirected.png)
-    ![disconnect_vertex(2) on a DIRECTED graph](disconnectVertexDirected.png)
-
-    @param [IN] *p_vertex* original vertex id of the starting point of the edge
-  */
-  void disconnect_vertex(int64_t p_vertex) {
-      V g_vertex;
-      pgr_edge_t d_edge;
-      // nothing to do, the vertex doesnt exist
-      if (!get_gVertex(p_vertex, g_vertex)) return;
-      EO_i out, out_end;
-      // store the edges that are going to be removed
-      for (boost::tie(out, out_end) = out_edges(g_vertex, graph);
-        out != out_end; ++out) {
-            d_edge.id = graph[*out].id;
-            d_edge.source = graph[source(*out, graph)].id;
-            d_edge.target = graph[target(*out, graph)].id;
-            d_edge.cost = graph[*out].cost;
-            d_edge.reverse_cost = -1;
-            removed_edges.push_back(d_edge);
-      }
-
-      // special case
-      if (m_gType == DIRECTED) {
-          EI_i in, in_end;
-          for (boost::tie(in, in_end) = in_edges(g_vertex, graph);
-            in != in_end; ++in) {
-                d_edge.id = graph[*in].id;
-                d_edge.source = graph[source(*in, graph)].id;
-                d_edge.target = graph[target(*in, graph)].id;
-                d_edge.cost = graph[*in].cost;
-                d_edge.reverse_cost = -1;
-                removed_edges.push_back(d_edge);
-          }
-      }
-
-      V d_vertex = boost::vertex(vertices_map.find(p_vertex)->second, graph);
-      // delete incomming and outgoing edges from the vertex
-      boost::clear_vertex(d_vertex, graph);
-  }
-
-  //! \brief Reconnects all edges that were removed
-    void restore_graph() {
-        while (removed_edges.size() != 0) {
-            graph_add_edge(removed_edges[0]);
-            removed_edges.pop_front();
-        }
-    }
-  //@}
-
-  //! @name only for stand by program
-  //@{
-  void print_graph() {
-        EO_i out, out_end;
-        V_i vi;
-
-        for (vi = vertices(graph).first; vi != vertices(graph).second; ++vi) {
-            std::cout << (*vi) << " out_edges(" << graph[(*vi)].id << "):";
-            for (boost::tie(out, out_end) = out_edges(*vi, graph);
-              out != out_end; ++out) {
-              std::cout << ' ' << *out << "=(" << graph[source(*out, graph)].id
-                        << ", " << graph[target(*out, graph)].id << ") = "
-                        <<  graph[*out].cost <<"\t";
-            }
-            std::cout << std::endl;
-        }
-        std::cout << "\n i, distance, predecesor\n"; 
-        for (unsigned int i = 0; i < distances.size(); i++) {
-            std::cout << i+1 << ", " << distances[i] << ", " << predecessors[i] << "\n";
-        }
-    }
-  //@}
-
-
-  bool get_gVertex(int64_t vertex_id, V &gVertex) {
-      LI vertex_ptr = vertices_map.find(vertex_id);
-
-      if (vertex_ptr == vertices_map.end())
-          return false;
-
-      gVertex = vertex(vertex_ptr->second, graph);
-      return true;
-  }
+     /** @name Graph related types
+       Type      |     boost meaning     |   pgRouting Meaning
+       :---------: | :-------------------- | :----------------------
+       G        | boost::adjacency_list |   Graph
+       V        | vertex_descriptor     |   Think of it as local ID of a vertex
+       E        | edge_descriptor       |   Think of it as local ID of an edge
+       V_i      | vertex_iterator       |   To cycle the vertices of the Graph
+       E_i      | edge_iterator         |   To cycle the edges of the Graph
+       EO_i     | out_edge_iterator     |   To cycle the out going edges of a vertex
+       EI_i     | in_edge_iterator      |   To cycle the in coming edges of a vertex (only in bidirectional graphs)
+       */
+     //@{
+     typedef typename boost::graph_traits < G >::vertex_descriptor V;
+     typedef typename boost::graph_traits < G >::edge_descriptor E;
+     typedef typename boost::graph_traits < G >::vertex_iterator V_i;
+     typedef typename boost::graph_traits < G >::edge_iterator E_i;
+     typedef typename boost::graph_traits < G >::out_edge_iterator EO_i;
+     typedef typename boost::graph_traits < G >::in_edge_iterator EI_i;
+
+     typedef typename boost::graph_traits < G >::vertices_size_type     vertices_size_type;
+     typedef typename boost::graph_traits < G >::edges_size_type        edges_size_type;
+     typedef typename boost::graph_traits < G >::degree_size_type       degree_size_type;
+
+     //@}
+
+     /** @name Id handling related types
+       Type      |  Meaning       |   pgRouting Meaning
+       :---------: | :------------- | :----------------------
+       id_to_V  | maps id -> V   | given an id store the V
+       V_to_id  | maps V -> id   | given a V store the id
+       LI       | Left Iterator  | iterates over id_to_V
+       RI       | right Iterator | iterates over V_to_id
+       */
+     //@{
+     typedef typename std::map< int64_t, V > id_to_V;
+     typedef typename std::map< V, int64_t > V_to_id;
+     typedef typename id_to_V::const_iterator LI;
+     typedef typename V_to_id::const_iterator RI;
+     //@}
+
+     //! @name The Graph
+     //@{
+     G graph;                //!< The graph
+     size_t m_num_vertices;  //!< number of vertices
+     graphType m_gType;      //!< type (DIRECTED or UNDIRECTED)
+     //@}
+
+     //! @name Id handling
+     //@{
+     id_to_V  vertices_map;   //!< id -> graph id
+     V_to_id  gVertices_map;  //!< graph id -> id
+     //@}
+
+     //! @name Graph Modification
+     //@{
+     //! Used for storing the removed_edges
+     std::deque<boost_edge_t> removed_edges;
+
+     //! Used for storing modified edges because of adding points
+     // TODO
+#if 0
+     std::deque<boost_edge_t> modified_edges;
+     std::deque< Point_on_edge > points;
+     // map to get wich boost edge was modified
+     std::map < int64_t, int64_t >;
+#endif
+     //@}
+
+#if 0
+     void add_point(Point_on_edge &point, int driving) {
+         // we have:
+         // point.point_id
+         // point.edge_id
+         // point.fraction
+         // Look for the edge in modified edges
+         //
+         // Driving: 0: doesnt matter (both), 1) right, 2) left
+         bool found = false;
+         int64_t edge_to_modify = 0;
+         for (const auto &edge : modified_edges) {
+             if (point.edge_id == edge.id) {
+                 found = true;
+                 break;
+             }
+             ++edge_to_modify;
+         }
+
+         //was not there so look for it in the graph
+         if (!found) {
+             E_i edge_ptr, edges_end;
+             for (boost::tie(edge_ptr, edges_end) = edges(graph);
+                     edge_ptr != edges_end; ++edge_ptr) {
+                 if (point.edge_id == edge_ptr->id) {
+                     modified_edges.push_back(*edge_ptr);
+                     boost::remove_edge(edge_ptr, graph);
+                     //delete the edge from the graph
+                     found = true;
+                     break;
+                 }
+             }
+         }
+
+         // add the point
+         int64_t vertex_id = -(points.size() + 1);
+         point.vertex_id = vertex_id;
+         points.push_back(point);
+
+         // add the vertex
+         LI vm_s;
+         vm_s = vertices_map.find(vertex_id);
+         if (vm_s == vertices_map.end()) {
+             vertices_map[vertex_id]=  m_num_vertices;
+             gVertices_map[m_num_vertices++] = vertex_id;
+             vm_s = vertices_map.find(vertex_id);
+         }
+
+         if (!found) {
+             // the vertex remains disconnected
+             // because the edge was not found
+             return;
+         }
+         
+     }
+#endif
+
+
+
+
+
+     //! @name The Graph
+     //@{
+     //! \brief Constructor
+     /*!
+       Prepares the _graph_ to be of type _gtype_ with the
+       aproximate number of vertices its coing to have as *initial_size*
+       */
+     explicit Pgr_base_graph< G >(graphType gtype, const size_t initial_size)
+         : graph(1),
+         m_num_vertices(0),
+         m_gType(gtype)
+    {}
+
+     //! \brief Inserts *count* edges of type *pgr_edge_t* into the graph
+     void graph_insert_data(const pgr_edge_t *data_edges, int64_t count) {
+         for (unsigned int i = 0; i < count; ++i) {
+             graph_add_edge(data_edges[i]);
+         }
+         adjust_vertices();
+         for ( int64_t i = 0; (unsigned int) i < gVertices_map.size(); ++i )
+             graph[i].id = gVertices_map.find(i)->second;
+     }
+
+     void graph_insert_data( const std::vector <pgr_edge_t > &data_edges) {
+         for (const auto edge : data_edges) {
+             graph_add_edge(edge);
+         }
+         adjust_vertices();
+         for ( int64_t i = 0; (unsigned int) i < gVertices_map.size(); ++i )
+             graph[i].id = gVertices_map.find(i)->second;
+     }
+
+     //! \brief Disconnects all edges from p_from to p_to
+     /*!
+       - No edge is disconnected if the vertices id's do not exist in the graph
+       - All removed edges are stored for future reinsertion
+       - All parallel edges are disconnected (automatically by boost)
+
+       ![disconnect_edge(2,3) on an UNDIRECTED graph](disconnectEdgeUndirected.png)
+       ![disconnect_edge(2,3) on a DIRECTED graph](disconnectEdgeDirected.png)
+
+       @param [IN] *p_from* original vertex id of the starting point of the edge
+       @param [IN] *p_to*   original vertex id of the ending point of the edge
+       */
+     void disconnect_edge(int64_t p_from, int64_t p_to) {
+         V g_from;
+         V g_to;
+         boost_edge_t d_edge;
+         // nothing to do, the vertex doesnt exist
+         if (!get_gVertex(p_from, g_from)) return;
+         if (!get_gVertex(p_to, g_to)) return;
+         EO_i out, out_end;
+         // store the edges that are going to be removed
+         for (boost::tie(out, out_end) = out_edges(g_from, graph);
+                 out != out_end; ++out) {
+             if (target(*out, graph) == g_to) {
+                 d_edge.id = graph[*out].id;
+                 d_edge.source = graph[source(*out, graph)].id;
+                 d_edge.target = graph[target(*out, graph)].id;
+                 d_edge.cost = graph[*out].cost;
+                 //        d_edge.reverse_cost = -1;
+                 removed_edges.push_back(d_edge);
+             }
+         }
+         // the actual removal
+         boost::remove_edge(g_from, g_to, graph);
+     }
+
+
+     //! @name boost wrappers
+     //@{
+     //! \brief get the out-degree  of a vertex
+     /*!
+       \returns 0: The out degree of a vertex that its not in the graph
+
+       @param [IN] *vertex_id* original vertex id
+       */
+
+
+     degree_size_type out_degree(int64_t vertex_id) const{
+         V v_from;
+         if (!get_gVertex(vertex_id, v_from)) {
+             return 0;
+         }
+         return out_degree(v_from);
+     }
+
+     degree_size_type out_degree(V &v) const {
+         return boost::out_degree(v, graph);
+     }
+     //@}
+
+
+     //! \brief Disconnects the outgoing edges with a particular original id from a vertex
+     /*!
+       - No edge is disconnected if it doesn't exist in the graph
+       - Removed edges are stored for future reinsertion
+       - all outgoing edges with the edge_id are removed if they exist
+
+       @param [IN] *vertex_id* original vertex
+       @param [IN] *edge_id* original edge_id
+       */
+     void disconnect_out_going_edge(int64_t vertex_id, int64_t edge_id) {
+         V v_from;
+         boost_edge_t d_edge;
+
+         // nothing to do, the vertex doesnt exist
+         if (!get_gVertex(vertex_id, v_from)) {
+             return;
+         }
+
+         EO_i out, out_end;
+         bool change = true;
+         // store the edge that are going to be removed
+         while (change) {
+             change = false;
+             for (boost::tie(out, out_end) = out_edges(v_from, graph);
+                     out != out_end; ++out) {
+                 if (graph[*out].id  == edge_id) {
+                     d_edge.id = graph[*out].id;
+                     d_edge.source = graph[source(*out, graph)].id;
+                     d_edge.target = graph[target(*out, graph)].id;
+                     d_edge.cost = graph[*out].cost;
+                     //        d_edge.reverse_cost = -1;
+                     removed_edges.push_back(d_edge);
+                     boost::remove_edge((*out), graph);
+                     change = true;
+                     break;
+                 }
+             }
+         }
+
+     }
+
+
+     //! \brief Disconnects all incomming and outgoing edges from the vertex
+     /*!
+       boost::graph doesn't recommend th to insert/remove vertices, so a vertex removal is
+       simulated by disconnecting the vertex from the graph
+
+       - No edge is disconnected if the vertices id's do not exist in the graph
+       - All removed edges are stored for future reinsertion
+       - All parallel edges are disconnected (automatically by boost)
+
+       ![disconnect_vertex(2) on an UNDIRECTED graph](disconnectVertexUndirected.png)
+       ![disconnect_vertex(2) on a DIRECTED graph](disconnectVertexDirected.png)
+
+       @param [IN] *p_vertex* original vertex id of the starting point of the edge
+       */
+     void disconnect_vertex(int64_t p_vertex) {
+         V g_vertex;
+         boost_edge_t d_edge;
+         // nothing to do, the vertex doesnt exist
+         if (!get_gVertex(p_vertex, g_vertex)) return;
+         EO_i out, out_end;
+         // store the edges that are going to be removed
+         for (boost::tie(out, out_end) = out_edges(g_vertex, graph);
+                 out != out_end; ++out) {
+             d_edge.id = graph[*out].id;
+             d_edge.source = graph[source(*out, graph)].id;
+             d_edge.target = graph[target(*out, graph)].id;
+             d_edge.cost = graph[*out].cost;
+             //        d_edge.reverse_cost = -1;
+             removed_edges.push_back(d_edge);
+         }
+
+         // special case
+         if (m_gType == DIRECTED) {
+             EI_i in, in_end;
+             for (boost::tie(in, in_end) = in_edges(g_vertex, graph);
+                     in != in_end; ++in) {
+                 d_edge.id = graph[*in].id;
+                 d_edge.source = graph[source(*in, graph)].id;
+                 d_edge.target = graph[target(*in, graph)].id;
+                 d_edge.cost = graph[*in].cost;
+                 //           d_edge.reverse_cost = -1;
+                 removed_edges.push_back(d_edge);
+             }
+         }
+
+         V d_vertex = boost::vertex(vertices_map.find(p_vertex)->second, graph);
+         // delete incomming and outgoing edges from the vertex
+         boost::clear_vertex(d_vertex, graph);
+     }
+
+     //! \brief Reconnects all edges that were removed
+     void restore_graph() {
+         while (removed_edges.size() != 0) {
+             graph_add_edge(removed_edges[0]);
+             removed_edges.pop_front();
+         }
+     }
+     //@}
+
+     //! @name only for stand by program
+     //@{
+     void print_graph(std::ostream &log = std::cout) const {
+         EO_i out, out_end;
+         V_i vi;
+
+         for (vi = vertices(graph).first; vi != vertices(graph).second; ++vi) {
+             if ((*vi) >= m_num_vertices) continue;
+             log << (*vi) << " out_edges(" << graph[(*vi)].id << "):";
+             for (boost::tie(out, out_end) = out_edges(*vi, graph);
+                     out != out_end; ++out) {
+                 log << ' ' << graph[*out].id << "=(" << graph[source(*out, graph)].id
+                     << ", " << graph[target(*out, graph)].id << ") = "
+                     <<  graph[*out].cost <<"\t";
+             }
+             log << std::endl;
+         }
+     }
+     //@}
+
+
+     bool get_gVertex(int64_t vertex_id, V &gVertex) const {
+         LI vertex_ptr = vertices_map.find(vertex_id);
+
+         if (vertex_ptr == vertices_map.end())
+             return false;
+
+         gVertex = vertex(vertex_ptr->second, graph);
+         return true;
+     }
 
+ public:
+     int64_t
+         get_edge_id(V from, V to, float8 &distance) const {
+             E e;
+             EO_i out_i, out_end;
+             V v_source, v_target;
+             float8 minCost =  std::numeric_limits<float8>::max();
+             int64_t minEdge = -1;
+             for (boost::tie(out_i, out_end) = boost::out_edges(from, graph);
+                     out_i != out_end; ++out_i) {
+                 e = *out_i;
+                 v_target = target(e, graph);
+                 v_source = source(e, graph);
+                 if ((from == v_source) && (to == v_target)
+                         && (distance == graph[e].cost))
+                     return graph[e].id;
+                 if ((from == v_source) && (to == v_target)
+                         && (minCost > graph[e].cost)) {
+                     minCost = graph[e].cost;
+                     minEdge = graph[e].id;
+                 }
+             }
+             distance = minEdge == -1? 0: minCost;
+             return minEdge;
+         }
 
  public:
-    void get_nodesInDistance(Path &path, V source, float8 distance) {
-      path.clear();
-      int seq = 0;
-      float8 cost;
-      int64_t edge_id;
-      for (V i = 0; i < distances.size(); ++i) {
-        if (distances[i] <= distance ) {
-          cost = distances[i] - distances[predecessors[i]];
-          edge_id = get_edge_id(graph, predecessors[i], i, cost);
-          path.push_back(seq, graph[source].id, graph[source].id, graph[i].id, edge_id, cost, distances[i]);
-          seq++;
-        }
-      }
-    }
-
-    void get_path(std::deque< Path > &paths, std::set< V > sources, V &target) const{
-      // used with multiple sources
-      Path path;
-      for (const auto source: sources) {
-        path.clear();
-        get_path(path, source, target);
-        paths.push_back(path);
-      }
-    }
-
-
-    void get_path(std::deque< Path > &paths, V source, std::set< V > &targets) {
-      // used when multiple goals
-      Path path;
-      typename std::set< V >::iterator s_it;
-      for (s_it = targets.begin(); s_it != targets.end(); ++s_it) {
-        path.clear();
-        get_path(path, source, *s_it);
-        paths.push_back(path);
-      }
-    }
-
-    void get_path(Path &path, V source, V target) {
-      // backup of the target
-      V target_back = target;
-      uint64_t from(graph[source].id);
-      uint64_t to(graph[target].id);
-
-      // no path was found
-      if (target == predecessors[target]) {
-          path.clear();
-          return;
-      }
-
-      // findout how large is the path
-      int64_t result_size = 1;
-      while (target != source) {
-          if (target == predecessors[target]) break;
-          result_size++;
-          target = predecessors[target];
-      }
-
-      // recover the target
-      target = target_back;
-
-      // variables that are going to be stored
-      int64_t vertex_id;
-      int64_t edge_id;
-      float8 cost;
-
-      // working from the last to the beginning
-
-      // initialize the sequence
-      int seq = result_size;
-      // the last stop is the target
-      path.push_front(seq, from, to, graph[target].id, -1, 0,  distances[target]);
-
-      while (target != source) {
-        // we are done when the predecesor of the target is the target
-        if (target == predecessors[target]) break;
-          // values to be inserted in the path
-          --seq;
-          cost = distances[target] - distances[predecessors[target]];
-          vertex_id = graph[predecessors[target]].id;
-          edge_id = get_edge_id(graph, predecessors[target], target, cost);
-
-          path.push_front(seq, from, to, vertex_id, edge_id, cost, distances[target] - cost);
-          target = predecessors[target];
-      }
-      return;
-    }
+     size_t num_vertices() const { return m_num_vertices; }
+     void
+         adjust_vertices() {
+             while (boost::num_vertices(graph) != num_vertices()) {
+                 if (boost::num_vertices(graph) > num_vertices()) {
+                     boost::remove_vertex(boost::num_vertices(graph), graph);
+                 }
+             }
+         }
 
 
+     boost_vertex_t operator[](V v) const {
+         return graph[v];
+     }
 
  private:
-  int64_t
-  get_edge_id(const G &graph, V from, V to, float8 &distance) {
-        E e;
-        EO_i out_i, out_end;
-        V v_source, v_target;
-        float8 minCost =  std::numeric_limits<float8>::max();
-        int64_t minEdge = -1;
-        for (boost::tie(out_i, out_end) = boost::out_edges(from, graph);
-          out_i != out_end; ++out_i) {
-              e = *out_i;
-              v_target = target(e, graph);
-              v_source = source(e, graph);
-              if ((from == v_source) && (to == v_target)
-                   && (distance == graph[e].cost))
-                     return graph[e].id;
-              if ((from == v_source) && (to == v_target)
-                   && (minCost > graph[e].cost)) {
-                     minCost = graph[e].cost;
-                     minEdge = graph[e].id;
-              }
-        }
-        distance = minEdge == -1? 0: minCost;
-        return minEdge;
-  }
 
 
- private:
-  void
-  graph_add_edge(const pgr_edge_t &edge ) {
-      bool inserted;
-      LI vm_s, vm_t;
-      E e;
-
-      vm_s = vertices_map.find(edge.source);
-      if (vm_s == vertices_map.end()) {
-        vertices_map[edge.source]=  numb_vertices;
-        gVertices_map[numb_vertices++] = edge.source;
-        vm_s = vertices_map.find(edge.source);
-      }
-
-      vm_t = vertices_map.find(edge.target);
-      if (vm_t == vertices_map.end()) {
-        vertices_map[edge.target]=  numb_vertices;
-        gVertices_map[numb_vertices++] = edge.target;
-        vm_t = vertices_map.find(edge.target);
-      }
-
-      if (edge.cost >= 0) {
-        boost::tie(e, inserted) =
-          boost::add_edge(vm_s->second, vm_t->second, graph);
-        graph[e].cost = edge.cost;
-        graph[e].id = edge.id;
-      }
-
-      if (edge.reverse_cost >= 0) {
-        boost::tie(e, inserted) =
-          boost::add_edge(vm_t->second, vm_s->second, graph);
-        graph[e].cost = edge.reverse_cost;
-        graph[e].id = edge.id;
-      }
-    }
+     void
+         graph_add_edge(const boost_edge_t &edge ) {
+             bool inserted;
+             LI vm_s, vm_t;
+             E e;
+
+             vm_s = vertices_map.find(edge.source);
+             if (vm_s == vertices_map.end()) {
+                 vertices_map[edge.source]=  m_num_vertices;
+                 gVertices_map[m_num_vertices++] = edge.source;
+                 vm_s = vertices_map.find(edge.source);
+             }
+
+             vm_t = vertices_map.find(edge.target);
+             if (vm_t == vertices_map.end()) {
+                 vertices_map[edge.target]=  m_num_vertices;
+                 gVertices_map[m_num_vertices++] = edge.target;
+                 vm_t = vertices_map.find(edge.target);
+             }
+
+             if (edge.cost >= 0) {
+                 boost::tie(e, inserted) =
+                     boost::add_edge(vm_s->second, vm_t->second, graph);
+                 graph[e].cost = edge.cost;
+                 graph[e].id = edge.id;
+                 graph[e].first = edge.first;
+             }
+         }
+
+     void
+         graph_add_edge(const pgr_edge_t &edge ) {
+             bool inserted;
+             LI vm_s, vm_t;
+             E e;
+             if ((edge.cost < 0) && (edge.reverse_cost < 0))
+                 return;
+
+             vm_s = vertices_map.find(edge.source);
+             if (vm_s == vertices_map.end()) {
+                 vertices_map[edge.source]=  m_num_vertices;
+                 gVertices_map[m_num_vertices++] = edge.source;
+                 vm_s = vertices_map.find(edge.source);
+             }
+
+             vm_t = vertices_map.find(edge.target);
+             if (vm_t == vertices_map.end()) {
+                 vertices_map[edge.target]=  m_num_vertices;
+                 gVertices_map[m_num_vertices++] = edge.target;
+                 vm_t = vertices_map.find(edge.target);
+             }
+
+             if (edge.cost >= 0) {
+                 boost::tie(e, inserted) =
+                     boost::add_edge(vm_s->second, vm_t->second, graph);
+                 graph[e].cost = edge.cost;
+                 graph[e].id = edge.id;
+                 graph[e].first = true;
+             }
+
+             if (edge.reverse_cost >= 0) {
+                 boost::tie(e, inserted) =
+                     boost::add_edge(vm_t->second, vm_s->second, graph);
+                 graph[e].cost = edge.reverse_cost;
+                 graph[e].id = edge.id;
+                 graph[e].first = false;
+             }
+         }
 };
 
+
 #endif  // SRC_COMMON_SRC_BASE_GRAPH_HPP_
diff --git a/src/common/src/basePath_SSEC.cpp b/src/common/src/basePath_SSEC.cpp
index f76b133..3cca77f 100644
--- a/src/common/src/basePath_SSEC.cpp
+++ b/src/common/src/basePath_SSEC.cpp
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: basePath_SSEC.cpp
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -15,9 +18,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 #ifdef __MINGW32__
 #include <winsock2.h>
@@ -33,199 +35,111 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #include "./pgr_types.h"
 
 
-    void Path::push_front(pgr_path_element3_t data) {
-        cost += data.cost;
-        path.push_back(data);
-    }
-
-    void Path::push_back(pgr_path_element3_t data) {
-        cost += data.cost;
-        path.push_back(data);
-    }
-
-    pgr_path_element3_t Path::set_data(
-         int d_seq, 
-         int64_t d_from, 
-         int64_t d_to,
-         int64_t d_vertex,
-         int64_t d_edge, 
-         float8 d_cost,
-         float8 d_tot_cost) {
-      pgr_path_element3_t data;
-      data.seq = d_seq;
-      data.from = d_from;
-      data.to = d_to;
-      data.vertex = d_vertex;
-      data.edge = d_edge;
-      data.cost = d_cost;
-      data.tot_cost = d_tot_cost;
-      return data;
-    }
-
-    void Path::push_front(
-         int d_seq, 
-         int64_t d_from, 
-         int64_t d_to,
-         int64_t d_vertex,
-         int64_t d_edge, 
-         float8 d_cost,
-         float8 d_tot_cost) {
-      path.push_front(set_data(d_seq, d_from, d_to, d_vertex, d_edge, d_cost, d_tot_cost));
-      cost += path[0].cost;
-    }
-
-    void Path::push_back(
-         int d_seq, 
-         int64_t d_from, 
-         int64_t d_to,
-         int64_t d_vertex,
-         int64_t d_edge, 
-         float8 d_cost,
-         float8 d_tot_cost) {
-      path.push_back(set_data(d_seq, d_from, d_to, d_vertex, d_edge, d_cost, d_tot_cost));
-      cost += path[path.size() - 1].cost;
-    }
-
-    void Path::clear() {
-        path.clear();
-        cost = 0;
-    }
-
-    void Path::print_path(std::ostream& log) const {
-       log << "seq\tfrom\tto\tvertex\tedge\tcost\ttot_Cost\n";
-       for (unsigned int i = 0; i < path.size(); ++i)
-          log << path[i].seq << "\t"
-              << path[i].from << "\t"
-              << path[i].to << "\t"
-              << path[i].vertex << "\t"
-              << path[i].edge << "\t"
-              << path[i].cost << "\t"
-              << path[i].tot_cost << "\n";
-    }
-
-    void Path::print_path() const {
-       print_path(std::cout);
-    }
+void Path::push_front(Path_t data) {
+    path.push_front(data);
+    m_tot_cost += data.cost;
+}
 
+void Path::push_back(Path_t data) {
+    path.push_back(data);
+    m_tot_cost += data.cost;
+}
 
-    Path  Path::getSubpath(unsigned int j) const {
-        Path  result;
-        if (j == 0)  return result;
-        for (auto i = path.begin(); i != path.begin() + j; ++i) result.push_back((*i));
-        return result;
-    }
 
 
-    bool Path::isEqual(const Path &subpath) const {
-        if (subpath.path.empty()) return true;
-        if (subpath.path.size() >= path.size()) return false;
-        std::deque<pgr_path_element3_t>::const_iterator i, j;
-        for (i = path.begin(),  j = subpath.path.begin();
-             j != subpath.path.end();
-             ++i, ++j)
-             if ((*i).vertex !=  (*j).vertex) return false;
-        return true;
-    }
+void Path::clear() {
+    path.clear();
+    m_tot_cost = 0;
+    m_start_id = 0;
+    m_end_id = 0;
+}
 
-    void Path::appendPath(const Path &o_path) {
-        path.insert(path.end(), o_path.path.begin(), o_path.path.end());
-        cost +=  o_path.cost;
+std::ostream& operator<<(std::ostream &log, const Path &path) {
+    log << "Path: " << path.start_id() << " -> " << path.end_id() << "\n"
+        << "seq\tnode\tedge\tcost\tagg_cost\n";
+    int64_t i = 0;
+    for (const auto &e : path) {
+        log << i << "\t"
+            << e.node << "\t"
+            << e.edge << "\t"
+            << e.cost << "\t"
+            << e.agg_cost << "\n";
+        ++i;
     }
+    return log;
+}
 
-    void Path::empty_path(unsigned int d_vertex) {
-        path.push_back(set_data(1, d_vertex, d_vertex, d_vertex, -1, 0, 0));
-    }
 
- void Path::dpPrint(
-        pgr_path_element3_t **ret_path,
-        int &sequence) const {
 
-    for (unsigned int i = 0; i < path.size(); i++) {
-      (*ret_path)[sequence] = path[i];
-      sequence++;
+Path Path::getSubpath(unsigned int j) const {
+    Path result(start_id(), end_id());
+    if (j == 0)  return result;
+    for (auto i = path.begin(); i != path.begin() + j; ++i) {
+        result.push_back((*i));
     }
-  }
+    return result;
+}
+
+
+bool Path::isEqual(const Path &subpath) const {
+    if (subpath.empty()) return true;
+    if (subpath.size() >= path.size()) return false;
+    std::deque< Path_t >::const_iterator i, j;
+    for (i = path.begin(),  j = subpath.begin();
+            j != subpath.end();
+            ++i, ++j)
+        if ((*i).node != (*j).node) return false;
+    return true;
+}
+
+void Path::appendPath(const Path &o_path) {
+    path.insert(path.end(), o_path.path.begin(), o_path.path.end());
+    m_tot_cost +=  o_path.m_tot_cost;
+}
+
+
+void Path::generate_postgres_data(
+        General_path_element_t **postgres_data,
+        size_t &sequence) const{
+    int i = 1;
+    for (const auto e : path) {
+        (*postgres_data)[sequence] = 
+        {i, start_id(), end_id(), e.node, e.edge, e.cost, e.agg_cost};
+        ++i;
+        ++sequence;
+    }
+}
 
 /* used by driving distance */
-   void Path::ddPrint(
-        pgr_path_element3_t **ret_path,
-        int &sequence, int routeId) const {
+void Path::get_pg_dd_path(
+        General_path_element_t **ret_path,
+        size_t &sequence) const {
 
     for (unsigned int i = 0; i < path.size(); i++) {
-      (*ret_path)[sequence] = path[i];
-      (*ret_path)[sequence].from = (uint64_t)routeId;
-      sequence++;
+        (*ret_path)[sequence].seq = i;
+        (*ret_path)[sequence].start_id = start_id();
+        (*ret_path)[sequence].end_id = start_id();
+        (*ret_path)[sequence].node = path[i].node;
+        (*ret_path)[sequence].edge = path[i].edge;
+        (*ret_path)[sequence].cost = path[i].cost;
+        (*ret_path)[sequence].agg_cost = path[i].agg_cost;
+        sequence++;
     }
-  }
+}
 
 /* used by ksp */
-   void Path::dpPrint(
-        pgr_path_element3_t **ret_path,
-        int &sequence, int routeId) const {
+void Path::get_pg_ksp_path(
+        General_path_element_t **ret_path,
+        size_t &sequence, int routeId) const {
 
     for (unsigned int i = 0; i < path.size(); i++) {
-      (*ret_path)[sequence] = path[i];
-      (*ret_path)[sequence].seq = i + 1;
-      (*ret_path)[sequence].from = (uint64_t)routeId;
-      (*ret_path)[sequence].tot_cost = (i == 0)? 0: (*ret_path)[sequence-1].tot_cost +  path[i-1].cost;
-      sequence++;
-    }
-  }
-
-#if 0
-  friend int collapse_paths(
-      pgr_path_element3_t **ret_path,
-      const std::deque< Path > &paths) {
-   int sequence = 0;
-   for (const Path &path : paths) {
-   if (path.path.size() > 0)
-        path.dpPrint(ret_path, sequence);
-   }
-   return sequence;
-  }
-
-
-
-  
-  friend Path equi_cost(const Path &p1, const Path &p2) {
-    Path result(p1);
-    sort(result.path.begin(), result.path.end(), 
-      [](const pgr_path_element3_t &e1, const pgr_path_element3_t &e2)->bool { 
-         return e1.vertex < e2.vertex; 
-      });
-
-    for (auto const &e : p2.path) {
-      auto pos = find_if(result.path.begin(), result.path.end(),
-                 [&e](const pgr_path_element3_t &e1)->bool { 
-                   return e.vertex == e1.vertex; 
-                 });
-      if (pos != result.path.end()) {
-        if (pos->cost > e.cost) {
-           (*pos) = e;
-        }  
-      } else {
-        result.push_back(e);
-      }
-    }
-    return result;
-  }
-
-  friend Path equi_cost(const std::deque< Path > &paths) {
-    Path result;
-    for (const auto &p1 : paths) {
-      result = equi_cost(result, p1);
-    }
-    return result;
-  }
- 
-  friend int count_tuples(const std::deque< Path > &paths) {
-    int count(0);
-    for (const Path &e : paths) {
-       count += e.path.size();
-    }
-    return count;
-  }
-
-};
-
-#endif // 0
+        (*ret_path)[sequence].seq = i + 1;
+        (*ret_path)[sequence].start_id = routeId;
+        (*ret_path)[sequence].end_id = end_id();
+        (*ret_path)[sequence].node = path[i].node;
+        (*ret_path)[sequence].edge = path[i].edge;
+        (*ret_path)[sequence].cost = path[i].cost;
+        (*ret_path)[sequence].agg_cost = (i == 0)? 0: (*ret_path)[sequence-1].agg_cost +  path[i-1].cost;
+        sequence++;
+    }
+}
diff --git a/src/common/src/basePath_SSEC.hpp b/src/common/src/basePath_SSEC.hpp
index c8a3cd2..48c5c37 100644
--- a/src/common/src/basePath_SSEC.hpp
+++ b/src/common/src/basePath_SSEC.hpp
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
 
+File: basePath_SSEC.hpp
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,61 +20,74 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
-#ifndef SRC_COMMON_SRC_BASE_PATH_SSCE_H_
-#define SRC_COMMON_SRC_BASE_PATH_SSCE_H_
+#pragma once
 
 #include <deque>
 #include <iostream>
 #include <algorithm>
-// #include <fstream>
 #include "postgres.h"
 #include "./pgr_types.h"
 
 class Path {
- public:
-    std::deque< pgr_path_element3_t > path;
-    float8 cost;
-
-    Path(): cost(0) {}
-    size_t size() const { return path.size();}
+    typedef std::deque< Path_t >::iterator pthIt;
+    typedef std::deque< Path_t >::const_iterator ConstpthIt;
+ private:
+    std::deque< Path_t > path;
+    int64_t m_start_id;
+    int64_t m_end_id;
+    double m_tot_cost;
 
-    void push_front(pgr_path_element3_t data) ;
+ public:
+    Path(): m_tot_cost(0) {}
+    Path(int64_t s_id, int64_t e_id)
+        : m_start_id(s_id), m_end_id(e_id), m_tot_cost(0)
+    {}
+    int64_t start_id() const {return m_start_id;}
+    void start_id(int64_t value) {m_start_id = value;}
+    int64_t end_id()  const {return m_end_id;}
+    void end_id(int64_t value) {m_end_id = value;}
+    double tot_cost()  const {return m_tot_cost;}
+
+    size_t size() const {return path.size();}
+    bool empty() const {return path.empty();}
+
+    void push_front(Path_t data);
+    void push_back(Path_t data);
+    const Path_t& operator[](size_t i) const {return path[i];}
+    Path_t& operator[](size_t i) {return path[i];}
+    pthIt begin() {return path.begin();}
+    pthIt end() {return path.end();}
+    void erase(pthIt pos) {path.erase(pos);}
+    ConstpthIt begin() const {return path.begin();}
+    ConstpthIt end() const {return path.end();}
+    const Path_t& back() const {return path.back();};
+    Path_t& back() {return path.back();};
+    const Path_t& front() const {return path.front();};
+    Path_t& front() {return path.front();};
+
+
+    Path_t set_data(
+            int64_t d_from, 
+            int64_t d_to,
+            int64_t d_vertex,
+            int64_t d_edge, 
+            float8 d_cost,
+            float8 d_tot_cost);
 
-    void push_back(pgr_path_element3_t data) ;
+    void push_front(
+            int64_t d_vertex,
+            int64_t d_edge, 
+            float8 d_cost,
+            float8 d_tot_cost);
+    void clear();
 
-    pgr_path_element3_t set_data(
-         int d_seq, 
-         int64_t d_from, 
-         int64_t d_to,
-         int64_t d_vertex,
-         int64_t d_edge, 
-         float8 d_cost,
-         float8 d_tot_cost);
+    friend std::ostream& operator<<(std::ostream &log, const Path &p);
 
-    void push_front(
-         int d_seq, 
-         int64_t d_from, 
-         int64_t d_to,
-         int64_t d_vertex,
-         int64_t d_edge, 
-         float8 d_cost,
-         float8 d_tot_cost);
-
-    void push_back(
-         int d_seq, 
-         int64_t d_from, 
-         int64_t d_to,
-         int64_t d_vertex,
-         int64_t d_edge, 
-         float8 d_cost,
-         float8 d_tot_cost);
 
-    void clear();
+    void fix_path(int64_t from, int64_t to);
 
-    void print_path(std::ostream& log) const;
-    void print_path() const;
 
     Path  getSubpath(unsigned int j) const;
 
@@ -80,75 +96,108 @@ class Path {
     void appendPath(const Path &o_path);
     void empty_path(unsigned int d_vertex);
 
-    void dpPrint(
-        pgr_path_element3_t **ret_path,
-        int &sequence) const;
-
-
-   void ddPrint(
-        pgr_path_element3_t **ret_path,
-        int &sequence, int routeId) const;
-
-   void dpPrint(
-        pgr_path_element3_t **ret_path,
-        int &sequence, int routeId) const;
-
-
-
-  friend int collapse_paths(
-      pgr_path_element3_t **ret_path,
-      const std::deque< Path > &paths) {
-   int sequence = 0;
-   for (const Path &path : paths) {
-   if (path.path.size() > 0)
-        path.dpPrint(ret_path, sequence);
-   }
-   return sequence;
-  }
-
-
-
-  
-  friend Path equi_cost(const Path &p1, const Path &p2) {
-    Path result(p1);
-    sort(result.path.begin(), result.path.end(), 
-      [](const pgr_path_element3_t &e1, const pgr_path_element3_t &e2)->bool { 
-         return e1.vertex < e2.vertex; 
-      });
-
-    for (auto const &e : p2.path) {
-      auto pos = find_if(result.path.begin(), result.path.end(),
-                 [&e](const pgr_path_element3_t &e1)->bool { 
-                   return e.vertex == e1.vertex; 
-                 });
-      if (pos != result.path.end()) {
-        if (pos->cost > e.cost) {
-           (*pos) = e;
-        }  
-      } else {
-        result.push_back(e);
-      }
+    void get_pg_dd_path(
+            General_path_element_t **ret_path,
+            size_t &sequence) const;
+
+    void get_pg_ksp_path(
+            General_path_element_t **ret_path,
+            size_t &sequence, int routeId) const;
+
+    void generate_postgres_data(
+            General_path_element_t **postgres_data,
+            size_t &sequence) const;
+
+    friend size_t collapse_paths(
+            General_path_element_t **ret_path,
+            const std::deque< Path > &paths) {
+        size_t sequence = 0;
+        for (const Path &path : paths) {
+            if (path.path.size() > 0)
+                path.generate_postgres_data(ret_path, sequence);
+        }
+        return sequence;
     }
-    return result;
-  }
 
-  friend Path equi_cost(const std::deque< Path > &paths) {
-    Path result;
-    for (const auto &p1 : paths) {
-      result = equi_cost(result, p1);
-    }
-    return result;
-  }
- 
-  friend int count_tuples(const std::deque< Path > &paths) {
-    int count(0);
-    for (const Path &e : paths) {
-       count += e.path.size();
+
+
+    /*
+     * sort the paths by size from greater to smaller
+     *        and sort each path by node 
+     * all the nodes on p2 are going to be compared
+     * with the nodes of p1
+     *
+     * When both paths reach the node and p1.agg_cost > p2.agg_cost
+     *    erase the node of p1 
+     *    (cant erase from p2 because we loose the iterators
+     *     so in a future cycle it will be deleted)
+     *
+     * sort the paths by start_id, 
+     */
+
+    friend void equi_cost(std::deque< Path > &paths) {
+
+        /* sort paths by size: largest first */
+        std::sort(paths.begin(), paths.end(), 
+                [](const Path &e1, const Path &e2)->bool { 
+                return e2.size() < e1.size(); 
+                });
+
+        /* sort each path by node: smaller id first */
+        for (auto &p : paths) {
+            if (p.size() < 2) continue; 
+            std::sort(p.begin(), p.end(), 
+                    [](const Path_t &e1, const Path_t &e2)->bool { 
+                    return e1.node < e2.node; 
+                    });
+        }
+
+        for (auto &p1 : paths) {
+            for (const auto &p2 : paths) {
+                if (p1.start_id() == p2.start_id()) continue;
+                for (const auto &stop : p2.path) {
+                    /* find the node of p2 in p1 */
+                    auto pos = lower_bound(p1.begin(), p1.end(), stop,
+                            [](const Path_t &l, const Path_t &r )->bool { 
+                            return l.node < r.node; 
+                            });
+                            
+                    if (pos != p1.end() && stop.agg_cost < pos->agg_cost) {
+                        /* both share the same node &
+                         * the second path has the smallest
+                         *  So erasing from the first path */
+                        p1.erase(pos);
+                    }
+                }
+            }
+        }
+
+        /* sort paths by start_id */
+        std::sort(paths.begin(), paths.end(), 
+                [](const Path &e1, const Path &e2)->bool { 
+                return e1.start_id() < e2.start_id(); 
+                });
+
+        /* sort each path by agg_cost, node */
+        for (auto &path : paths) {
+            /* least influential data first */
+            std::sort(path.begin(), path.end(),
+                    [](const Path_t &l, const  Path_t &r)   
+                    { return l.node < r.node;});
+            /* preserve the order of what we did before */
+            std::stable_sort(path.begin(), path.end(),
+                    [](const Path_t &l, const  Path_t &r)   
+                    { return l.agg_cost < r.agg_cost;});
+        }                               
     }
-    return count;
-  }
 
+    friend size_t count_tuples(const std::deque< Path > &paths) {
+        size_t count(0);
+        for (const Path &e : paths) {
+            count += e.path.size();
+        }
+        return count;
+    }
 };
 
 
-#endif  // SRC_COMMON_SRC_BASE_PATH_SSCE_H_
diff --git a/src/common/src/debug_macro.h b/src/common/src/debug_macro.h
new file mode 100644
index 0000000..62af333
--- /dev/null
+++ b/src/common/src/debug_macro.h
@@ -0,0 +1,35 @@
+/*PGR-GNU*****************************************************************
+
+File: debug_macro.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#ifdef DEBUG
+#include "postgres.h"
+#define PGR_DBG(...) \
+    elog(NOTICE, __VA_ARGS__)
+#else
+#define PGR_DBG(...) do { ; } while (0)
+#endif
+
diff --git a/src/common/src/edges_input.c b/src/common/src/edges_input.c
new file mode 100644
index 0000000..acb0db3
--- /dev/null
+++ b/src/common/src/edges_input.c
@@ -0,0 +1,179 @@
+/*PGR-GNU*****************************************************************
+File: edges_input.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+// #define DEBUG
+#include "./debug_macro.h"
+#include "./pgr_types.h"
+#include "./postgres_connection.h"
+#include "./get_check_data.h"
+#include "./edges_input.h"
+#include "./time_msg.h"
+
+
+
+static
+void pgr_fetch_edge(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info[5],
+        int64_t *default_id,
+        float8 default_rcost,
+        pgr_edge_t *edge,
+        size_t *valid_edges) {
+    if (column_found(info[0].colNumber)) {
+        edge->id = pgr_SPI_getBigInt(tuple, tupdesc, info[0]);
+    } else {
+        edge->id = *default_id;
+        ++(*default_id);
+    }
+
+    edge->source = pgr_SPI_getBigInt(tuple, tupdesc,  info[1]);
+    edge->target = pgr_SPI_getBigInt(tuple, tupdesc, info[2]);
+    edge->cost = pgr_SPI_getFloat8(tuple, tupdesc, info[3]);
+
+    if (column_found(info[4].colNumber)) {
+        edge->reverse_cost = pgr_SPI_getFloat8(tuple, tupdesc, info[4]);
+    } else {
+        edge->reverse_cost = default_rcost;
+    }
+
+    *valid_edges = edge->cost < 0? *valid_edges: *valid_edges + 1;
+    *valid_edges = edge->reverse_cost < 0? *valid_edges: *valid_edges + 1;
+}
+
+static
+void
+get_data_5_columns(
+        char *sql,
+        pgr_edge_t **edges,
+        size_t *totalTuples,
+        bool ignore_id) {
+    clock_t start_t = clock();
+
+    const int tuple_limit = 1000000;
+
+    size_t ntuples;
+    size_t total_tuples;
+    size_t valid_edges;
+
+    Column_info_t info[5];
+
+    int i;
+    for (i = 0; i < 5; ++i) {
+        info[i].colNumber = -1;
+        info[i].type = 0;
+        info[i].strict = true;
+        info[i].eType = ANY_INTEGER;
+    }
+    info[0].name = strdup("id");
+    info[1].name = strdup("source");
+    info[2].name = strdup("target");
+    info[3].name = strdup("cost");
+    info[4].name = strdup("reverse_cost");
+
+    info[0].strict = !ignore_id;
+    info[4].strict = false;
+
+    info[3].eType = ANY_NUMERICAL;
+    info[4].eType = ANY_NUMERICAL;
+
+
+    void *SPIplan;
+    SPIplan = pgr_SPI_prepare(sql);
+
+    Portal SPIportal;
+    SPIportal = pgr_SPI_cursor_open(SPIplan);
+
+
+    bool moredata = TRUE;
+    (*totalTuples) = total_tuples = valid_edges = 0;
+
+
+    int64_t default_id = 0;
+    while (moredata == TRUE) {
+        SPI_cursor_fetch(SPIportal, TRUE, tuple_limit);
+        if (total_tuples == 0)
+            pgr_fetch_column_info(info, 5);
+
+        ntuples = SPI_processed;
+        total_tuples += ntuples;
+
+        if (ntuples > 0) {
+            if ((*edges) == NULL)
+                (*edges) = (pgr_edge_t *)palloc0(total_tuples * sizeof(pgr_edge_t));
+            else
+                (*edges) = (pgr_edge_t *)repalloc((*edges), total_tuples * sizeof(pgr_edge_t));
+
+            if ((*edges) == NULL) {
+                elog(ERROR, "Out of memory");
+            }
+
+            size_t t;
+            SPITupleTable *tuptable = SPI_tuptable;
+            TupleDesc tupdesc = SPI_tuptable->tupdesc;
+            PGR_DBG("processing %d edge tupĺes", ntuples);
+
+            for (t = 0; t < ntuples; t++) {
+                HeapTuple tuple = tuptable->vals[t];
+                pgr_fetch_edge(&tuple, &tupdesc, info,
+                        &default_id, -1,
+                        &(*edges)[total_tuples - ntuples + t],
+                        &valid_edges);
+            }
+            SPI_freetuptable(tuptable);
+        } else {
+            moredata = FALSE;
+        }
+    }
+
+
+    if (total_tuples == 0 || valid_edges == 0) {
+        (*totalTuples) = 0;
+        PGR_DBG("NO edges");
+        return;
+    }
+
+
+    (*totalTuples) = total_tuples;
+    PGR_DBG("Finish reading %ld edges, %ld", total_tuples, (*totalTuples));
+    time_msg(" reading Edges", start_t, clock());
+}
+
+void
+pgr_get_data_5_columns(
+        char *sql,
+        pgr_edge_t **edges,
+        size_t *totalTuples) {
+    bool ignore_id = false;
+    get_data_5_columns(sql, edges, totalTuples, ignore_id);
+}
+
+void
+pgr_get_data_4_columns(
+        char *sql,
+        pgr_edge_t **edges,
+        size_t *totalTuples) {
+    bool ignore_id = true;
+    get_data_5_columns(sql, edges, totalTuples, ignore_id);
+}
diff --git a/src/common/src/edges_input.h b/src/common/src/edges_input.h
new file mode 100644
index 0000000..a17c5b9
--- /dev/null
+++ b/src/common/src/edges_input.h
@@ -0,0 +1,52 @@
+/*PGR-GNU*****************************************************************
+File: edges_input.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./pgr_types.h"
+
+/*!
+  Signature 1:
+  bigint source,
+  bigint target,
+  float cost
+  float reverse_cost
+  */
+void pgr_get_data_4_columns(
+        char *sql,
+        pgr_edge_t **edges,
+        size_t *total_tuples);
+
+/*!
+  Signature 1:
+  bigint id,
+  bigint source,
+  bigint target,
+  float cost
+  float reverse_cost
+  */
+void pgr_get_data_5_columns(
+        char *sql,
+        pgr_edge_t **edges,
+        size_t *total_tuples);
diff --git a/src/common/src/get_check_data.c b/src/common/src/get_check_data.c
new file mode 100644
index 0000000..7aa4f1c
--- /dev/null
+++ b/src/common/src/get_check_data.c
@@ -0,0 +1,231 @@
+/*PGR-GNU*****************************************************************
+File: get_check_data.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "./pgr_types.h"
+#include "postgres.h"
+
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+
+
+// #define DEBUG
+#include "./debug_macro.h"
+#include "./get_check_data.h"
+
+char*
+pgr_stradd(const char* a, const char* b) {
+    size_t len = strlen(a) + strlen(b);
+    char *ret = (char*)malloc(len * sizeof(char) + 1);
+    *ret = '\0';
+    return strcat(strcat(ret, a), b);
+}
+
+bool
+column_found(int colNumber) {
+    return !(colNumber == SPI_ERROR_NOATTRIBUTE);
+}
+
+static
+bool
+fetch_column_info(
+        Column_info_t *info) {
+    PGR_DBG("Fetching column info of %s", info->name);
+    info->colNumber =  SPI_fnumber(SPI_tuptable->tupdesc, info->name);
+    if (info->strict && !column_found(info->colNumber)) {
+        elog(ERROR, "Column '%s' not Found", info->name);
+    }
+    if (column_found(info->colNumber)) {
+        (info->type) = SPI_gettypeid(SPI_tuptable->tupdesc, (info->colNumber));
+        if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
+            elog(ERROR, "Type of column '%s' not Found", info->name);
+        }
+        PGR_DBG("Column %s found: %llu", info->name, info->type);
+        return true;
+    }
+    PGR_DBG("Column %s not found", info->name);
+    return false;
+}
+
+
+void pgr_fetch_column_info(
+        Column_info_t info[],
+        int info_size) {
+    int i;
+    for (i = 0; i < info_size; ++i) {
+        if (fetch_column_info(&info[i])) {
+            switch (info[i].eType) {
+                case ANY_INTEGER:
+                    pgr_check_any_integer_type(info[i]);
+                    break;
+                case ANY_NUMERICAL:
+                    pgr_check_any_numerical_type(info[i]);
+                    break;
+                case TEXT:
+                    pgr_check_text_type(info[i]);
+                    break;
+                case CHAR1:
+                    pgr_check_char_type(info[i]);
+                    break;
+                default:
+                    elog(ERROR, "Unknown type of column %s", info[i].name);
+            }
+        }
+    }
+}
+
+
+void
+pgr_check_char_type(Column_info_t info) {
+    if (!(info.type == BPCHAROID)) {
+        elog(ERROR, "Unexpected Column '%s' type. Expected CHAR", info.name);
+    }
+}
+
+void
+pgr_check_text_type(Column_info_t info) {
+    if (!(info.type == TEXTOID)) {
+        elog(ERROR, "Unexpected Column '%s' type. Expected TEXT", info.name);
+    }
+}
+
+void
+pgr_check_any_integer_type(Column_info_t info) {
+    if (!(info.type == INT2OID
+                || info.type == INT4OID
+                || info.type == INT8OID)) {
+        elog(ERROR,
+                "Unexpected Column '%s' type. Expected ANY-INTEGER",
+                info.name);
+    }
+}
+
+void pgr_check_any_numerical_type(Column_info_t info) {
+    if (!(info.type == INT2OID
+                || info.type == INT4OID
+                || info.type == INT8OID
+                || info.type == FLOAT4OID
+                || info.type == FLOAT8OID)) {
+        elog(ERROR,
+                "Unexpected Column '%s' type. Expected ANY-NUMERICAL",
+                info.name);
+    }
+}
+
+
+/*
+ * http://doxygen.postgresql.org/include_2catalog_2pg__type_8h.html;
+ */
+char
+pgr_SPI_getChar(
+        HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info,
+        bool strict, char default_value) {
+    Datum binval;
+    bool isNull;
+    char value = default_value;
+
+    binval = SPI_getbinval(*tuple, *tupdesc, info.colNumber, &isNull);
+    if (!(info.type == BPCHAROID)) {
+        elog(ERROR, "Unexpected Column type of %s. Expected CHAR", info.name);
+    }
+    if (!isNull) {
+        value =  ((char*)binval)[1];
+    } else {
+        if (strict) {
+            elog(ERROR, "Unexpected Null value in column %s", info.name);
+        }
+        value = default_value;
+    }
+    return value;
+}
+
+int64_t
+pgr_SPI_getBigInt(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info) {
+    Datum binval;
+    bool isnull;
+    int64_t value = 0;
+    binval = SPI_getbinval(*tuple, *tupdesc, info.colNumber, &isnull);
+    if (isnull)
+        elog(ERROR, "Unexpected Null value in column %s", info.name);
+    switch (info.type) {
+        case INT2OID:
+            value = (int64_t) DatumGetInt16(binval);
+            break;
+        case INT4OID:
+            value = (int64_t) DatumGetInt32(binval);
+            break;
+        case INT8OID:
+            value = DatumGetInt64(binval);
+            break;
+        default:
+            elog(ERROR,
+                    "Unexpected Column type of %s. Expected ANY-INTEGER",
+                    info.name);
+    }
+    PGR_DBG("Variable: %s Value: %lld", info.name, value);
+    return value;
+}
+
+double
+pgr_SPI_getFloat8(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info) {
+    Datum binval;
+    bool isnull;
+    double value = 0.0;
+    binval = SPI_getbinval(*tuple, *tupdesc, info.colNumber, &isnull);
+    if (isnull)
+        elog(ERROR, "Unexpected Null value in column %s", info.name);
+
+    switch (info.type) {
+        case INT2OID:
+            value = (double) DatumGetInt16(binval);
+            break;
+        case INT4OID:
+            value = (double) DatumGetInt32(binval);
+            break;
+        case INT8OID:
+            value = (double) DatumGetInt64(binval);
+            break;
+        case FLOAT4OID:
+            value = (double) DatumGetFloat4(binval);
+            break;
+        case FLOAT8OID:
+            value = DatumGetFloat8(binval);
+            break;
+        default:
+            elog(ERROR,
+                    "Unexpected Column type of %s. Expected ANY-NUMERICAL",
+                    info.name);
+    }
+    PGR_DBG("Variable: %s Value: %lf", info.name, value);
+    return value;
+}
+
+char*
+pgr_SPI_getText(HeapTuple *tuple, TupleDesc *tupdesc,  Column_info_t info) {
+    char* value = NULL;
+    char* val = NULL;
+    val = SPI_getvalue(*tuple, *tupdesc, info.colNumber);
+    value = DatumGetCString(&val);
+    pfree(val);
+    return value;
+}
diff --git a/src/common/src/get_check_data.h b/src/common/src/get_check_data.h
new file mode 100644
index 0000000..69313c2
--- /dev/null
+++ b/src/common/src/get_check_data.h
@@ -0,0 +1,60 @@
+/*PGR-GNU*****************************************************************
+File: get_check_data.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+bool column_found(int colNumber);
+
+void pgr_fetch_column_info(
+        Column_info_t info[],
+        int info_size);
+
+void pgr_check_any_integer_type(Column_info_t info);
+void pgr_check_any_numerical_type(Column_info_t info);
+void pgr_check_text_type(Column_info_t info);
+void pgr_check_char_type(Column_info_t info);
+
+char pgr_SPI_getChar(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info,
+        bool strict,
+        char default_value);
+
+int64_t pgr_SPI_getBigInt(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info);
+
+double  pgr_SPI_getFloat8(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info);
+
+char* pgr_SPI_getText(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info);
+
+char* pgr_stradd(const char *a, const char *b);
diff --git a/src/common/src/memory_func.hpp b/src/common/src/memory_func.hpp
new file mode 100644
index 0000000..8b4066d
--- /dev/null
+++ b/src/common/src/memory_func.hpp
@@ -0,0 +1,47 @@
+/*PGR-GNU*****************************************************************
+File: memory_func.hpp
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+#include <stdlib.h>
+
+
+template <typename T>
+T*
+get_memory(std::size_t size, T *ptr){
+    if( !ptr ){
+        ptr = (T*) malloc(size * sizeof(T));
+    } else {
+        ptr = (T*) realloc(ptr, size * sizeof(T));
+    }
+    return (T*) ptr;
+}
+
+
+template <typename T>
+T*
+noResult(std::size_t *count, T *ptr) {
+    (*count) = 0;
+    if (ptr)
+        free(ptr);
+    return NULL;
+}
+
diff --git a/src/common/src/pgr_assert.cpp b/src/common/src/pgr_assert.cpp
index 0b3efe2..550cede 100644
--- a/src/common/src/pgr_assert.cpp
+++ b/src/common/src/pgr_assert.cpp
@@ -1,4 +1,4 @@
-/*PGR*********************************************************************
+/*PGR-MIT******************************************************************
  *
  * file pgr_assert.cpp
  *
@@ -6,9 +6,9 @@
  * Copyright 2014 Vicky Vergara <vicky_vergara at hotmail.com>
  *
  * This is free software; you can redistribute and/or modify it under
- * the terms of the MIT License. Please file LICENSE for details.
+ * the terms of the MIT License. Please file MIT-LICENSE for details.
  *
- ********************************************************************PGR*/
+ *****************************************************************PGR-MIT*/
 #include "./pgr_assert.h"
 #include <exception>
 
@@ -27,7 +27,7 @@ const char *AssertFailedException::what() const throw() {
   return str;
 }
 
-AssertFailedException::AssertFailedException(const char *_str) : str(
-    _str ) {}
+AssertFailedException::AssertFailedException(const char *_str) :
+    str(_str) {}
 
 
diff --git a/src/common/src/pgr_assert.h b/src/common/src/pgr_assert.h
index cf704b8..11ba97e 100644
--- a/src/common/src/pgr_assert.h
+++ b/src/common/src/pgr_assert.h
@@ -1,14 +1,16 @@
-/*PGR*********************************************************************
+/*PGR-MIT******************************************************************
  *
  * file pgr_assert.h
  *
  * Copyright 2014 Stephen Woodbridge <woodbri at imaptools.com>
  * Copyright 2014 Vicky Vergara <vicky_vergara at hotmail.com>
- *
+ *      
  * This is free software; you can redistribute and/or modify it under
- * the terms of the MIT License. Please file LICENSE for details.
- *
- ********************************************************************PGR*/
+ * the terms of the MIT License. Please file MIT-LICENSE for details.
+ *  
+ *****************************************************************PGR-MIT*/
+
+
 
 /*! \file vrp_assert.h
  * \brief An assert functionality that uses C++ throw().
@@ -64,10 +66,14 @@
     }
 \endcode
  */
+#ifdef NDEBUG
+#define assert(expr) ((void)0)
+#else
 #define assert(expr) \
     ((expr) \
      ? static_cast<void>(0) \
      : throw AssertFailedException("AssertFailedException: " __STRING(expr) " at " __FILE__ ":" __TOSTRING(__LINE__) ))
+#endif
 
 
 /*! \class AssertFailedException
diff --git a/src/common/src/pgr_logger.h b/src/common/src/pgr_logger.h
index e50fa0d..9afced3 100644
--- a/src/common/src/pgr_logger.h
+++ b/src/common/src/pgr_logger.h
@@ -1,9 +1,18 @@
-/*
-    pgr_logger.h
-
+/*PGR-MIT******************************************************************
+ *
+ * file pgr_logger.h
+ *
     Author: Stephen Woodbridge
     Date: 2014-05-04
     License: MIT-X
+ *      
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the MIT License. Please file MIT-LICENSE for details.
+ *  
+ *****************************************************************PGR-MIT*/
+
+/*
+    pgr_logger.h
 
     A simple logging mechanism the can be disabled for production
     and should work in C or C++ code.
diff --git a/src/common/src/pgr_types.h b/src/common/src/pgr_types.h
index 2ecf0e9..cd83d1b 100644
--- a/src/common/src/pgr_types.h
+++ b/src/common/src/pgr_types.h
@@ -1,7 +1,10 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: pgr_types.h
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+Mail: vicky_vergara at hotmail.com
+
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,95 +20,171 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
-#ifndef PGR_TYPES_H
-#define PGR_TYPES_H
+#pragma once
 
-#include "postgres.h"
+#include <stdint.h>
+#include <stdbool.h>
 
 typedef struct edge_astar
 {
   int id;
   int source;
   int target;
-  float8 cost;
-  float8 reverse_cost;
-  float8 s_x;
-  float8 s_y;
-  float8 t_x;
-  float8 t_y;
+  double cost;
+  double reverse_cost;
+  double s_x;
+  double s_y;
+  double t_x;
+  double t_y;
 } edge_astar_t;
 
 
-typedef struct path_element
-{
+
+typedef struct {
     int64_t vertex_id;
     int64_t edge_id;
-    float8 cost;
+    double cost;
 } path_element_t;
 
-typedef struct path_element3
-{
+/*
+ * This one is for processing
+ */
+typedef struct {
+    int64_t node;
+    int64_t edge;
+    double cost;
+    double agg_cost;
+} Path_t;
+
+/*
+ * This ones are for returning the info to postgres
+     */
+
+typedef struct {
     int seq;
-    int64_t from;
-    int64_t to;
-    int64_t vertex;
+    int64_t start_id;
+    int64_t end_id;
+    int64_t node;
+    int64_t edge;
+    double cost;
+    double agg_cost;
+} General_path_element_t;
+
+
+typedef struct{
+    int route_id;
+    int path_id;
+    int path_seq;
+    int64_t start_vid;
+    int64_t end_vid;
+    int64_t node;
     int64_t edge;
-    float8 cost;
-    float8 tot_cost;
-} pgr_path_element3_t;
+    double cost;
+    double agg_cost;
+    double route_agg_cost;
+} Routes_t;
+
 
 typedef struct {
-  int64_t id;
-  int64_t source;
-  int64_t target;
-  float8 cost;
-  float8 reverse_cost;
+    int64_t id;
+    int64_t source;
+    int64_t target;
+    double cost;
+    double reverse_cost;
 } pgr_edge_t;
 
 typedef struct {
-  int seq;
-  int64_t source;
-  int64_t edge;
-  float8 cost;
+    int seq;
+    int64_t source;
+    int64_t edge;
+    double cost;
 } pgr_path_t;
 
-struct boost_vertex_t {
-  int64_t id;
-};
+typedef struct matrix_cell {
+    int64_t from_vid;
+    int64_t to_vid;
+    double cost;
+} Matrix_cell_t;
 
-struct boost_edge_t{
-  int64_t id;
-  float8 cost;
-  int64_t source_id;
-  int64_t target_id;
-};
+// Restrictions used in pgr_turnRestrictions
 
-// used in kdijktra
-#if 0
+#define  MAX_RULE_LENGTH 5
 typedef struct 
 {
-   int64_t vertex_id_source;
-   int64_t edge_id_source;
-   int64_t vertex_id_target;
-   int64_t edge_id_target;
-   float8 cost;
-   float8 totcost;
-} dist_fromto_t;
+    int64_t target_id;
+    double to_cost;
+    int64_t via[MAX_RULE_LENGTH];
+}
+Restrict_t;
 
+typedef struct {
+    int64_t pid;
+    int64_t edge_id;
+    char side;  // 'r', 'l', 'b' (default is both)
+    double fraction;
+    int64_t vertex_id; // number is negative and is used for processing
+} Point_on_edge_t;
+
+// used for getting the data
+typedef
+enum {
+    ANY_INTEGER,
+    ANY_NUMERICAL,
+    TEXT,
+    CHAR1
+} expectType;
+
+typedef
+struct {
+    int colNumber;
+    uint64_t type;
+    bool strict;
+    char *name;
+    expectType eType;
+
+} Column_info_t;
+
+// used in boost
+struct boost_vertex_t {
+    int64_t id;
+};
+
+struct boost_edge_t{
+    int64_t id;
+    double cost;
+    int64_t source;
+    int64_t target;
+    bool first;  // originally was true (source, target) false (target, source)
+};
 
-typedef struct 
-{
-  int64_t vertex_id_source;
-  int64_t edge_id_source;
-  int64_t vertex_id_target;
-  int64_t edge_id_target;
-  float8 cost;
-  char* the_way;
-} path_fromto_t;
-#endif
 
 enum graphType { UNDIRECTED= 0, DIRECTED};
 
-#endif // PGR_TYPES_H
+#if 0
+/**************************************************************************
+ * VRPPDTW types
+ * ***********************************************************************/
+typedef struct {
+    int64_t id;
+    double x;
+    double y;
+    double demand;
+    double Etime;
+    double Ltime;
+    double Stime;
+    int64_t Pindex;
+    int64_t Dindex;
+    double Ddist;
+} Customer;
+
+typedef struct  {
+    int seq;
+    int64_t rid;
+    int64_t nid;
+    double cost;
+} path_element;
+
+/*************************************************************************/
+#endif
diff --git a/src/common/src/points_input.c b/src/common/src/points_input.c
new file mode 100644
index 0000000..31bbc45
--- /dev/null
+++ b/src/common/src/points_input.c
@@ -0,0 +1,150 @@
+/*PGR-GNU*****************************************************************
+File: points_input.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+// #define DEBUG
+#include "./debug_macro.h"
+#include "pgr_types.h"
+#include "postgres_connection.h"
+#include "get_check_data.h"
+#include "points_input.h"
+
+
+static
+void fetch_point(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info[4],
+        int64_t *default_pid,
+        char default_side,
+        Point_on_edge_t *point) {
+    if (column_found(info[0].colNumber)) {
+        point->pid = pgr_SPI_getBigInt(tuple, tupdesc, info[0]);
+    } else {
+        point->pid = *default_pid;
+        ++(*default_pid);
+    }
+
+    point->edge_id = pgr_SPI_getBigInt(tuple, tupdesc, info[1]);
+    point->fraction = pgr_SPI_getFloat8(tuple, tupdesc, info[2]);
+
+    if (column_found(info[3].colNumber)) {
+        point->side =
+            (char)pgr_SPI_getChar(tuple, tupdesc, info[3], false, default_side);
+    } else {
+        point->side = default_side;
+    }
+}
+
+
+// pid, edge_id, fraction, [side]
+void
+pgr_get_points(
+        char *points_sql,
+        Point_on_edge_t **points,
+        size_t *total_points) {
+    const int tuple_limit = 1000;
+
+    size_t ntuples;
+    size_t total_tuples;
+    Column_info_t info[4];
+
+    int i;
+    for (i = 0; i < 4; ++i) {
+        info[i].colNumber = -1;
+        info[i].type = 0;
+        info[i].strict = true;
+        info[i].eType = ANY_INTEGER;
+    }
+
+    info[0].name = strdup("pid");
+    info[1].name = strdup("edge_id");
+    info[2].name = strdup("fraction");
+    info[3].name = strdup("side");
+
+    info[0].strict = false;
+    info[3].strict = false;
+    info[2].eType = ANY_NUMERICAL;
+    info[3].eType = CHAR1;
+
+
+    void *SPIplan;
+    SPIplan = pgr_SPI_prepare(points_sql);
+
+    Portal SPIportal;
+    SPIportal = pgr_SPI_cursor_open(SPIplan);
+
+    bool moredata = TRUE;
+    (*total_points) = total_tuples = 0;
+
+    int64_t default_pid = 0;
+    char default_side = 'b';
+
+    while (moredata == TRUE) {
+        SPI_cursor_fetch(SPIportal, TRUE, tuple_limit);
+        if (total_tuples == 0) {
+            /* on the first tuple get the column information */
+            pgr_fetch_column_info(info, 4);
+        }
+
+        ntuples = SPI_processed;
+        total_tuples += ntuples;
+
+        if (ntuples > 0) {
+            if ((*points) == NULL)
+                (*points) = (Point_on_edge_t *)palloc0(total_tuples * sizeof(Point_on_edge_t));
+            else
+                (*points) = (Point_on_edge_t *)repalloc((*points), total_tuples * sizeof(Point_on_edge_t));
+
+            if ((*points) == NULL) {
+                elog(ERROR, "Out of memory");
+            }
+
+            SPITupleTable *tuptable = SPI_tuptable;
+            TupleDesc tupdesc = SPI_tuptable->tupdesc;
+            size_t t;
+
+            PGR_DBG("processing %ld points tuples", ntuples);
+            for (t = 0; t < ntuples; t++) {
+                HeapTuple tuple = tuptable->vals[t];
+                fetch_point(&tuple, &tupdesc, info,
+                        &default_pid, default_side,
+                        &(*points)[total_tuples - ntuples + t]);
+            }
+            SPI_freetuptable(tuptable);
+        } else {
+            moredata = FALSE;
+        }
+    }
+    SPI_cursor_close(SPIportal);
+
+
+    if (total_tuples == 0) {
+        (*total_points) = 0;
+        PGR_DBG("NO points");
+        return;
+    }
+
+    (*total_points) = total_tuples;
+    PGR_DBG("Finish reading %ld points, %ld", total_tuples, (*total_points));
+}
diff --git a/src/common/src/points_input.h b/src/common/src/points_input.h
new file mode 100644
index 0000000..8e03fbc
--- /dev/null
+++ b/src/common/src/points_input.h
@@ -0,0 +1,32 @@
+/*PGR-GNU*****************************************************************
+File: points_input.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./pgr_types.h"
+
+void pgr_get_points(
+        char *points_sql,
+        Point_on_edge_t **points,
+        size_t *total_points);
diff --git a/src/common/src/postgres_connection.c b/src/common/src/postgres_connection.c
index 55f8c95..ae457d1 100644
--- a/src/common/src/postgres_connection.c
+++ b/src/common/src/postgres_connection.c
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: postgres_connection.c
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,399 +20,81 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
-// #define DEBUG
 #include "postgres.h"
-#include "utils/lsyscache.h"
 #include "catalog/pg_type.h"
-#include "utils/array.h"
 #include "executor/spi.h"
 
 
-#include "pgr_types.h"
-#include "postgres_connection.h"
-
-#define TUPLIMIT 1000
-
-char *
-pgr_text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-int pgr_finish(int code, int ret)
-{
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH )
-  {
-    elog(ERROR,"couldn't disconnect from SPI");
-    return -1 ;
-  }			
-  return ret;
-}
-
-static int pgr_fetch_column_info(
-  int *colNumber,
-  int *coltype,
-  char *colName) {
-    (*colNumber) =  SPI_fnumber(SPI_tuptable->tupdesc, colName);
-    if ((*colNumber) == SPI_ERROR_NOATTRIBUTE) {
-      elog(ERROR, "Fetching column number");
-      return -1;
-    }
-    (*coltype) = SPI_gettypeid(SPI_tuptable->tupdesc, (*colNumber));
-    if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
-      elog(ERROR, "Fetching column type");
-      return -1;
-    }
-    return 0;
-  }
-
-    
-int64_t* pgr_get_bigIntArray(int *arrlen, ArrayType *input) {
-    int         ndims;
-    // int *lbs;
-    bool       *nulls;
-    Oid         i_eltype;
-    int16       i_typlen;
-    bool        i_typbyval;
-    char        i_typalign;
-    Datum      *i_data;
-    int         i, n;
-    int64_t      *data;
-
-    /* get input array element type */
-    i_eltype = ARR_ELEMTYPE(input);
-    get_typlenbyvalalign(i_eltype, &i_typlen, &i_typbyval, &i_typalign);
-
-
-    /* validate input data type */
-    switch(i_eltype){
-      case INT2OID:
-      case INT4OID:
-      case INT8OID:
+// #define DEBUG
+#include "./debug_macro.h"
+#include "./postgres_connection.h"
+
+void
+pgr_send_error(int errcode) {
+    switch (errcode) {
+        case 1:
+            elog(ERROR, "Unexpected point(s) with same pid but different edge/fraction/side combination found.");
             break;
-    default:
-      elog(ERROR, "Expected array of any-integer");
-      return (int64_t*) NULL;  
-      break;
-    }
-
-    /* get various pieces of data from the input array */
-    ndims = ARR_NDIM(input);
-    n = (*ARR_DIMS(input));
-    (*arrlen) = n;
-    // lbs = ARR_LBOUND(input);
-
-    if ( (ndims) != 1) {
-        elog(ERROR, "One dimenton expected");
-    }
-
-    /* get src data */
-    deconstruct_array(input, i_eltype, i_typlen, i_typbyval, i_typalign,
-       &i_data, &nulls, &n);
-
-    /* construct a C array */
-    data = (int64_t *) malloc((*arrlen) * sizeof(int64_t));
-    if (!data) {
-        elog(ERROR, "Error: Out of memory!");
-    }
-    PGR_DBG("array size %d", (*arrlen));
-
-    for (i=0; i<(*arrlen); i++) {
-        if (nulls[i]) {
-            data[i] = -1;
-        }
-        else {
-            switch(i_eltype){
-                case INT2OID:
-                    data[i] = (int64_t) DatumGetInt16(i_data[i]);
-                    break;
-                case INT4OID:
-                    data[i] = (int64_t) DatumGetInt32(i_data[i]);
-                    break;
-                case INT8OID:
-                    data[i] = DatumGetInt64(i_data[i]);
-                    break;
-            }
-        }
-        PGR_DBG("    data[%d]=%li", i, data[i]);
+        case 2:
+            elog(ERROR, "Internal: Unexpected missmatch count and sequence number on results");
+            break;
+        default:
+            elog(ERROR, "Unknown exception");
     }
-
-    pfree(nulls);
-    pfree(i_data);
-
-    return (int64_t*)data;
 }
 
 
-/********************
-Functions for pgr_foo with sql:
- id, source, target, cost, reverse_cost(optional) 
-************/
-static int pgr_fetch_edge_columns(
-     int (*edge_columns)[5], 
-     int (*edge_types)[5], 
-     bool has_rcost) {
-
-  int error;
-  error = pgr_fetch_column_info(&(*edge_columns)[0], &(*edge_types)[0], "id");
-  if (error == -1) return error;
-  error = pgr_fetch_column_info(&(*edge_columns)[1], &(*edge_types)[1], "source");
-  if (error == -1) return error;
-  error = pgr_fetch_column_info(&(*edge_columns)[2], &(*edge_types)[2], "target");
-  if (error == -1) return error;
-  error = pgr_fetch_column_info(&(*edge_columns)[3], &(*edge_types)[3], "cost");
-  if (error == -1) return error;
-  if (has_rcost) {
-    error = pgr_fetch_column_info(&(*edge_columns)[4], &(*edge_types)[4], "reverse_cost");
-    if (error == -1) return error;
-  }
-
- return 0;
-
-}
-
-static int64_t pgr_SPI_getBigInt(HeapTuple *tuple, TupleDesc *tupdesc, int colNumber, int colType) {
-  Datum binval;
-  bool isnull;
-  int64_t value = 0;
-  binval = SPI_getbinval(*tuple, *tupdesc, colNumber, &isnull);
-  if (isnull) elog(ERROR, "Null value found");
-  switch (colType) {
-    case INT2OID:
-      value = (int64_t) DatumGetInt16(binval);
-      break;
-    case INT4OID:
-      value = (int64_t) DatumGetInt32(binval);
-      break;
-    case INT8OID:
-      value = DatumGetInt64(binval);
-      break;
-    default:
-      elog(ERROR, "BigInt, int or SmallInt expected");
-  }
-  return value;
-}
+char*
+pgr_text2char(text *in) {
+    char *out = palloc(VARSIZE(in));
 
-static float8 pgr_SPI_getFloat8(HeapTuple *tuple, TupleDesc *tupdesc, int colNumber, int colType) {
-  Datum binval;
-  bool isnull;
-  float8 value = 0.0;
-  binval = SPI_getbinval(*tuple, *tupdesc, colNumber, &isnull);
-  if (isnull) elog(ERROR, "Null value found");
-  switch (colType) {
-    case INT2OID:
-      value = (float8) DatumGetInt16(binval);
-      break;
-    case INT4OID:
-      value = (float8) DatumGetInt32(binval);
-      break;
-    case INT8OID:
-      value = (float8) DatumGetInt64(binval);
-      break;
-    case FLOAT4OID:
-      value = (float8) DatumGetFloat4(binval);
-      break;
-    case FLOAT8OID:
-      value = DatumGetFloat8(binval);
-      break;
-    default:
-      elog(ERROR, "BigInt, int, SmallInt, real  expected");
-  }
-  return value;
+    memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
+    out[VARSIZE(in) - VARHDRSZ] = '\0';
+    return out;
 }
 
-void pgr_fetch_edge(
-   HeapTuple *tuple,
-   TupleDesc *tupdesc, 
-   int (*edge_columns)[5],
-   int (*edge_types)[5],
-   pgr_edge_t *target_edge,
-   bool has_rcost) {
-
-  target_edge->id = pgr_SPI_getBigInt(tuple, tupdesc, (*edge_columns)[0], (*edge_types)[0]);
-  target_edge->source = pgr_SPI_getBigInt(tuple, tupdesc, (*edge_columns)[1], (*edge_types)[1]);
-  target_edge->target = pgr_SPI_getBigInt(tuple, tupdesc, (*edge_columns)[2], (*edge_types)[2]);
-  target_edge->cost = pgr_SPI_getFloat8(tuple, tupdesc, (*edge_columns)[3], (*edge_types)[3]);
 
-  if (has_rcost) {
-    target_edge->reverse_cost = pgr_SPI_getFloat8(tuple, tupdesc, (*edge_columns)[4], (*edge_types)[4]);
-  } else {
-    target_edge->reverse_cost = -1.0;
-  }
-  PGR_DBG("id: %li\t source: %li\ttarget: %li\tcost: %f\t,reverse: %f\n",
-          target_edge->id,  target_edge->source,  target_edge->target,  target_edge->cost,  target_edge->reverse_cost);
+// http://www.postgresql.org/docs/9.4/static/spi-spi-finish.html
+void
+pgr_SPI_finish(void) {
+    PGR_DBG("Disconnecting SPI");
+    int code = SPI_OK_FINISH;
+    code = SPI_finish();
+    if (code != SPI_OK_FINISH) {  // SPI_ERROR_UNCONNECTED
+        elog(ERROR, "There was no connection to SPI");
+    }
 }
 
-
-
-int pgr_get_data(
-    char *sql,
-    pgr_edge_t **edges,
-    int64_t *totalTuples,
-    bool has_rcost,
-    int64_t start_vertex,
-    int64_t end_vertex) {
-  PGR_DBG("Entering pgr_get_data");
-
-  bool sourceFound = false;
-  bool targetFound = false;
-  if (start_vertex == -1 && end_vertex == -1) {
-    sourceFound = targetFound = true;
-  }
-  int ntuples;
-  int64_t total_tuples;
-
-  int edge_columns[5];
-  int edge_types[5];
-  int i;
-  for (i = 0; i < 5; ++i) edge_columns[i] = -1;
-  for (i = 0; i < 5; ++i) edge_types[i] = -1;
-  int ret = -1;
-
-        
-  PGR_DBG("Connecting to SPI");
-  int SPIcode;
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT) {
-      elog(ERROR, "Couldn't open a connection to SPI");
-      return -1;
-  }
-
-  PGR_DBG("Preparing Plan");
-  void *SPIplan;
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL) {
-      elog(ERROR, "Couldn't create query plan via SPI");
-      return -1;
-  }
-
-  PGR_DBG("Opening Portal");
-  Portal SPIportal;
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-      elog(ERROR, "SPI_cursor_open('%s') returns NULL", sql);
-      return -1;
-  }
-
-
-  PGR_DBG("Starting Cycle");
-  bool moredata = TRUE;
-  (*totalTuples) = total_tuples = 0;
-  while (moredata == TRUE) {
-      SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-      /*  on the first tuple get the column numbers */
-      if (edge_columns[0] == -1) {
-        PGR_DBG("Fetching column numbers");
-        if (pgr_fetch_edge_columns(&edge_columns, &edge_types,
-                                 has_rcost) == -1)
-           return pgr_finish(SPIcode, ret);
-        PGR_DBG("Finished fetching column numbers");
-      }
-
-      ntuples = SPI_processed;
-      total_tuples += ntuples;
-
-      PGR_DBG("Getting Memory");
-      if ((*edges) == NULL)
-        (*edges) = (pgr_edge_t *)palloc(total_tuples * sizeof(pgr_edge_t));
-      else
-        (*edges) = (pgr_edge_t *)repalloc((*edges), total_tuples * sizeof(pgr_edge_t));
-      PGR_DBG("Got Memory");
-
-      if ((*edges) == NULL) {
-          elog(ERROR, "Out of memory");
-          return pgr_finish(SPIcode, ret);	  
-      }
-
-      if (ntuples > 0) {
-          int t;
-          SPITupleTable *tuptable = SPI_tuptable;
-          TupleDesc tupdesc = SPI_tuptable->tupdesc;
-          PGR_DBG("processing %d", ntuples);
-          for (t = 0; t < ntuples; t++) {
-              HeapTuple tuple = tuptable->vals[t];
-              pgr_fetch_edge(&tuple, &tupdesc, &edge_columns, &edge_types,
-                         &(*edges)[total_tuples - ntuples + t], has_rcost);
-
-              if (!sourceFound
-                 && (((*edges)[total_tuples - ntuples + t].source == start_vertex)
-                 || ((*edges)[total_tuples - ntuples + t].target == start_vertex))) {
-                    sourceFound = true;
-              }
-              if (!targetFound
-                 && (((*edges)[total_tuples - ntuples + t].source == end_vertex)
-                 || ((*edges)[total_tuples - ntuples + t].target == end_vertex))) {
-                    targetFound = true;
-             }
-           }
-           SPI_freetuptable(tuptable);
-      } else {
-          moredata = FALSE;
-      }
-  }
-
-  
-#if 0
-  if (!sourceFound) {
-      // elog(NOTICE, "Starting Vertex does not exist in the data");
-      return 0;
-  }
-  if (!targetFound) {
-      // elog(NOTICE, "Ending Vertex does not exist in the data");
-      return 0;
-  }
-#endif
-  if (total_tuples == 1) {
-    // for some reason it needs at least a second edge for boost.graph to work
-    // makeing a simple test and asking boost people
-    ++total_tuples;
-    (*edges) = (pgr_edge_t *)repalloc((*edges), total_tuples * sizeof(pgr_edge_t));
-    (*edges)[1].source = -1;
-    (*edges)[1].target = -1;
-    (*edges)[1].cost = 10000;
-    (*edges)[1].id = (*edges)[0].id + 1;
-    (*edges)[1].reverse_cost = -1;
-  }
-
-  (*totalTuples) = total_tuples;
-  return 0;
+void
+pgr_SPI_connect(void) {
+    PGR_DBG("Connecting to SPI");
+    int SPIcode;
+    SPIcode = SPI_connect();
+    if (SPIcode  != SPI_OK_CONNECT) {
+        elog(ERROR, "Couldn't open a connection to SPI");
+    }
 }
 
-pgr_path_element3_t* pgr_get_memory3(int size, pgr_path_element3_t *path){
-	if(path ==0  ){
-		path=malloc(size * sizeof(pgr_path_element3_t));
-	} else {
-		path=realloc(path,size * sizeof(pgr_path_element3_t));
-	}
-	return path;
+SPIPlanPtr
+pgr_SPI_prepare(char* sql) {
+    PGR_DBG("Preparing Plan");
+    SPIPlanPtr SPIplan;
+    SPIplan = SPI_prepare(sql, 0, NULL);
+    if (SPIplan  == NULL) {
+        elog(ERROR, "Couldn't create query plan via SPI: %s", sql);
+    }
+    return SPIplan;
 }
 
-
-pgr_path_element3_t* noPathFound3(int64_t fill_value, int *count, pgr_path_element3_t *no_path) {
-#if 0        
-        (*count) = 1;
-        no_path = pgr_get_memory3(1, no_path);
-        no_path[0].seq  = 0;
-        no_path[0].from  = fill_value;
-        no_path[0].to  = fill_value;
-        no_path[0].vertex = fill_value;
-        no_path[0].edge = -1;
-        no_path[0].cost = 0;
-        no_path[0].tot_cost = 0;
-        return no_path;
-#else
-   count = 0;
-   return NULL;
-#endif
+Portal
+pgr_SPI_cursor_open(SPIPlanPtr SPIplan) {
+    PGR_DBG("Opening Portal");
+    Portal SPIportal;
+    SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true);
+    if (SPIportal == NULL) {
+        elog(ERROR, "SPI_cursor_open returns NULL");
+    }
+    return SPIportal;
 }
-
-
-
-
diff --git a/src/common/src/postgres_connection.h b/src/common/src/postgres_connection.h
index 5163d88..a7306bf 100644
--- a/src/common/src/postgres_connection.h
+++ b/src/common/src/postgres_connection.h
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: postgres_connection.h
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,67 +20,18 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
-#ifndef SRC_COMMON_SRC_POSTGRES_CONNECTION_H_
-#define SRC_COMMON_SRC_POSTGRES_CONNECTION_H_
+#pragma once
 
 #include "postgres.h"
 #include "executor/spi.h"
-#include "utils/array.h"
-
-
-#include "./pgr_types.h"
-#include "./postgres_connection.h"
-
-#ifdef DEBUG
-#define PGR_DBG(format, arg...) \
-elog(NOTICE, format , ## arg)
-#else
-#define PGR_DBG(format, arg...) do { ; } while (0)
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-  char * pgr_text2char(text *in);
-  int pgr_finish(int code, int ret);
-  int64_t* pgr_get_bigIntArray(int *arrlen, ArrayType *input);
-/*
-  int pgr_fetch_edge_columns(SPITupleTable *tuptable, int (*edge_columns)[5],
-                   bool has_reverse_cost);
-  void pgr_fetch_edge(HeapTuple *tuple, TupleDesc *tupdesc,
-           int (*edge_columns)[5], pgr_edge_t *target_edge,
-           bool has_rcost);
-*/
-
-  /*!
-   Signature 1:
-      bigint id,
-      bigint source,
-      bigint target,
-      float cost
-      float reverse_cost
-  */
-  int pgr_get_data(
-      char *sql,           //!< \param [IN]  sql from where we get the data
-      pgr_edge_t **edges,  //!< \param [OUT] edges retrieved edges
-      int64_t *total_tuples,  //!< \param [OUT] total_tuples Total edges retrived
-      bool has_rcost,      //!< \param [IN]  has_rcost flag for reverse_cost
-      int64_t start_vertex,  //!< \param [IN] start_vertex index to look for
-      int64_t end_vertex);   //!< \param [IN] end_vertex index to look for
-
-
-  // output corresponding to costResult3Big
-  pgr_path_element3_t* pgr_get_memory3(int size, pgr_path_element3_t *path);
-  // pgr_path_element3_t * noPathFound3(int64_t start_id);
-  pgr_path_element3_t* noPathFound3(int64_t fill_value, int *count, pgr_path_element3_t *no_path);
-
 
-#ifdef __cplusplus
-}
-#endif
+// #include "./pgr_types.h"
 
-#endif  // SRC_COMMON_SRC_POSTGRES_CONNECTION_H_
+void pgr_send_error(int errcode);
+void pgr_SPI_finish(void);
+void pgr_SPI_connect(void);
+SPIPlanPtr pgr_SPI_prepare(char* sql);
+Portal pgr_SPI_cursor_open(SPIPlanPtr SPIplan);
+char* pgr_text2char(text *in);
diff --git a/src/common/src/restrictions_input.c b/src/common/src/restrictions_input.c
new file mode 100644
index 0000000..4a36165
--- /dev/null
+++ b/src/common/src/restrictions_input.c
@@ -0,0 +1,151 @@
+/*PGR-GNU*****************************************************************
+File: restrictions_input.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+
+#include "./debug_macro.h"
+#include "./pgr_types.h"
+#include "./time_msg.h"
+#include "./postgres_connection.h"
+#include "./get_check_data.h"
+#include "./restrictions_input.h"
+
+
+static
+void fetch_restriction(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info[4],
+        Restrict_t *restriction) {
+    restriction->target_id = pgr_SPI_getBigInt(tuple, tupdesc, info[0]);
+    restriction->to_cost = pgr_SPI_getFloat8(tuple, tupdesc,  info[1]);
+    char *str = DatumGetCString(SPI_getvalue(*tuple, *tupdesc, info[2].colNumber));
+// TODO because its  text, there is no garanee that the text read is correct
+// move this code to c++ to tokenize the integers.
+
+    int i = 0;
+    for(i = 0; i < MAX_RULE_LENGTH; ++i) restriction->via[i] = -1;
+
+    if (str != NULL) {
+        char *token = NULL;
+        int i = 0;
+
+        token = (char *)strtok(str," ,");
+
+        while (token != NULL && i < MAX_RULE_LENGTH)
+        {
+            restriction->via[i] = atoi(token);
+            i++;
+            token = (char *)strtok(NULL, " ,");
+        }
+    }
+}
+
+
+void
+pgr_get_restriction_data(
+        char *restrictions_sql,
+        Restrict_t **restrictions,
+        size_t *total_restrictions) {
+    const int tuple_limit = 1000000;
+    clock_t start_t = clock();
+
+    PGR_DBG("pgr_get_restriction_data");
+    PGR_DBG("%s", restrictions_sql);
+
+    Column_info_t info[3];
+
+    int i;
+    for (i = 0; i < 3; ++i) {
+        info[i].colNumber = -1;
+        info[i].type = 0;
+        info[i].strict = true;
+        info[i].eType = ANY_INTEGER;
+    }
+    info[0].name = strdup("target_id");
+    info[1].name = strdup("to_cost");
+    info[2].name = strdup("via_path");
+
+    info[1].eType = ANY_NUMERICAL;
+    info[2].eType = TEXT;
+
+
+    size_t ntuples;
+    size_t total_tuples;
+
+    void *SPIplan;
+    SPIplan = pgr_SPI_prepare(restrictions_sql);
+    Portal SPIportal;
+    SPIportal = pgr_SPI_cursor_open(SPIplan);
+
+    bool moredata = TRUE;
+    (*total_restrictions) = total_tuples = 0;
+
+    /*  on the first tuple get the column numbers */
+
+    while (moredata == TRUE) {
+        SPI_cursor_fetch(SPIportal, TRUE, tuple_limit);
+        if (total_tuples == 0) {
+            pgr_fetch_column_info(info, 3);
+        }
+        ntuples = SPI_processed;
+        total_tuples += ntuples;
+        PGR_DBG("SPI_processed %ld", ntuples);
+        if (ntuples > 0) {
+            if ((*restrictions) == NULL)
+                (*restrictions) = (Restrict_t *)palloc0(total_tuples * sizeof(Restrict_t));
+            else
+                (*restrictions) = (Restrict_t *)repalloc((*restrictions), total_tuples * sizeof(Restrict_t));
+
+            if ((*restrictions) == NULL) {
+                elog(ERROR, "Out of memory");
+            }
+
+            size_t t;
+            SPITupleTable *tuptable = SPI_tuptable;
+            TupleDesc tupdesc = SPI_tuptable->tupdesc;
+            PGR_DBG("processing %ld", ntuples);
+            for (t = 0; t < ntuples; t++) {
+                HeapTuple tuple = tuptable->vals[t];
+                fetch_restriction(&tuple, &tupdesc, info,
+                        &(*restrictions)[total_tuples - ntuples + t]);
+            }
+            SPI_freetuptable(tuptable);
+        } else {
+            moredata = FALSE;
+        }
+    }
+
+    if (total_tuples == 0) {
+        (*total_restrictions) = 0;
+        PGR_DBG("NO restrictions");
+        return;
+    }
+
+    (*total_restrictions) = total_tuples;
+    PGR_DBG("Finish reading %ld data, %ld", total_tuples, (*total_restrictions));
+    clock_t end_t = clock();
+    time_msg(" reading Restrictions", start_t, end_t);
+}
diff --git a/src/common/src/restrictions_input.h b/src/common/src/restrictions_input.h
new file mode 100644
index 0000000..c9f7da3
--- /dev/null
+++ b/src/common/src/restrictions_input.h
@@ -0,0 +1,32 @@
+/*PGR-GNU*****************************************************************
+File: restrictions_input.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./pgr_types.h"
+
+void pgr_get_restriction_data(
+        char *restrictions_sql,
+        Restrict_t **restructions,
+        size_t *total_restrictions);
diff --git a/src/common/src/signalhandler.cpp b/src/common/src/signalhandler.cpp
index 373fe64..da95634 100644
--- a/src/common/src/signalhandler.cpp
+++ b/src/common/src/signalhandler.cpp
@@ -1,4 +1,26 @@
-/*PGR*********************************************************************
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*PGR-MIT******************************************************************
  *
  * file signalhandler.cpp
  *
@@ -6,16 +28,17 @@
  * Copyright 2014 Vicky Vergara <vicky_vergara at hotmail.com>
  *
  * This is free software; you can redistribute and/or modify it under
- * the terms of the MIT License. Please file LICENSE for details.
+ * the terms of the MIT License. Please file MIT-LICENSE for details.
  *
- ********************************************************************PGR*/
+ *****************************************************************PGR-MIT*/
+
 #include "./signalhandler.h"
 
 SignalHandler *
 SignalHandler::instance() {
   if (!instance_) instance_ = new SignalHandler;
 
-  assert(instance_ != NULL);
+  // assert(instance_ != NULL);
   return instance_;
 }
 
diff --git a/src/common/src/signalhandler.h b/src/common/src/signalhandler.h
index a788e3e..7508047 100644
--- a/src/common/src/signalhandler.h
+++ b/src/common/src/signalhandler.h
@@ -1,4 +1,26 @@
-/*PGR*********************************************************************
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*PGR-MIT******************************************************************
  *
  * file signalhandler.h
  *
@@ -6,9 +28,10 @@
  * Copyright 2014 Vicky Vergara <vicky_vergara at hotmail.com>
  *
  * This is free software; you can redistribute and/or modify it under
- * the terms of the MIT License. Please file LICENSE for details.
+ * the terms of the MIT License. Please file MIT-LICENSE for details.
  *
- ********************************************************************PGR*/
+ *****************************************************************PGR-MIT*/
+
 #ifndef SRC_COMMON_SRC_SIGNALHANDLER_H_
 #define SRC_COMMON_SRC_SIGNALHANDLER_H_
 
@@ -16,7 +39,7 @@
 #include <csignal>
 #include <exception>
 
-#include "./pgr_assert.h"
+// #include "./pgr_assert.h"
 
 class UserQuitException: public std::exception {
  private:
diff --git a/src/common/src/time_msg.c b/src/common/src/time_msg.c
new file mode 100644
index 0000000..6afcf4e
--- /dev/null
+++ b/src/common/src/time_msg.c
@@ -0,0 +1,12 @@
+
+
+
+#include "postgres.h"
+#include <time.h>
+
+#include "time_msg.h"
+
+void time_msg(char *msg, clock_t start_t, clock_t end_t) {
+    double elapsed_t = (double)(end_t - start_t) / CLOCKS_PER_SEC;
+    elog(DEBUG1, "Elapsed time for %s: %lfsec = (%lf - %f) / CLOCKS_PER_SEC ", msg, elapsed_t, (double) end_t, (double) start_t);
+};
diff --git a/src/common/src/time_msg.h b/src/common/src/time_msg.h
new file mode 100644
index 0000000..377b34f
--- /dev/null
+++ b/src/common/src/time_msg.h
@@ -0,0 +1,5 @@
+
+#include <time.h>
+#include <stdio.h>
+
+void time_msg(char *msg, clock_t start_t, clock_t end_t);
diff --git a/src/common/test/common-any-00.data b/src/common/test/common-any-00.data
deleted file mode 100644
index f2c7528..0000000
--- a/src/common/test/common-any-00.data
+++ /dev/null
@@ -1,92 +0,0 @@
-BEGIN;
---
--- PostgreSQL database dump
---
-
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET escape_string_warning = off;
-
-SET search_path = public, pg_catalog;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: edges2; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS edges2 CASCADE;
-
-CREATE TABLE edges2 (
-    eid integer NOT NULL,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    to_cost double precision,
-    rule text,
-    the_geom geometry,
-    CONSTRAINT enforce_dims_the_geom CHECK ((st_ndims(the_geom) = 2)),
-    CONSTRAINT enforce_geotype_the_geom CHECK (((geometrytype(the_geom) = 'LINESTRING'::text) OR (the_geom IS NULL)))
---    , CONSTRAINT enforce_srid_the_geom CHECK ((st_srid(the_geom) = (0)))
-);
-
-
---
--- Data for Name: edges2; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY edges2 (eid, dir, source, target, cost, reverse_cost, x1, y1, x2, y2, to_cost, rule, the_geom) FROM stdin WITH NULL '__NULL__';
-1	B	1	2	1	1	2	0	2	1	__NULL__	__NULL__	010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2	TF	2	3	-1	1	2	1	3	1	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3	TF	3	4	-1	1	3	1	4	1	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4	B	2	7	1	1	2	1	2	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5	FT	3	8	1	-1	3	1	3	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6	B	5	6	1	1	0	2	1	2	__NULL__	__NULL__	01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7	B	6	7	1	1	1	2	2	2	__NULL__	__NULL__	010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8	B	7	8	1	1	2	2	3	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9	B	8	9	1	1	3	2	4	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10	B	7	10	1	1	2	2	2	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11	FT	8	11	1	-1	3	2	3	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12	FT	10	11	1	-1	2	3	3	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13	FT	11	12	1	-1	3	3	4	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14	B	10	13	1	1	2	3	2	4	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15	B	9	12	1	1	4	2	4	3	__NULL__	__NULL__	0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16	B	4	9	1	1	4	1	4	2	__NULL__	__NULL__	0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-\.
-
---
--- add some additional edges the cause problems
---
-
-insert into edges2 values (17,'FT',0,0,1,1,1,0.5,2,0.5,NULL,NULL,'LINESTRING(1 0.5,2 0.5)'::geometry);
-insert into edges2 values (18,'TF',0,0,1,1,2,0.5,3,0.5,NULL,NULL,'LINESTRING(2 0.5,3 0.5)'::geometry);
-insert into edges2 values (19,'FT',0,0,1,1,1,0.5,1,1.5,NULL,NULL,'LINESTRING(1 0.5,1 1.5)'::geometry);
-insert into edges2 values (20,'TF',0,0,1,1,1,1.5,1,2.5,NULL,NULL,'LINESTRING(1 1.5,1 2.5)'::geometry);
-insert into edges2 values (21,'B',0,0,1,1,1,2.5,3,0.5,NULL,NULL,'LINESTRING(1 2.5,3 0.5)'::geometry);
-insert into edges2 values (22,'B',0,0,1,1,1,2.5,1,3.5,NULL,NULL,'LINESTRING(1 2.5,1 3.5)'::geometry);
-insert into edges2 values (23,'B',0,0,1,1,1,2.5,1,3.5,NULL,NULL,'LINESTRING(1 3.5,2 3.5)'::geometry);
-
-
---
--- Name: edges2_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY edges2
-    ADD CONSTRAINT edges2_pkey PRIMARY KEY (eid);
-
-
---
--- PostgreSQL database dump complete
---
-COMMIT;
-
diff --git a/src/common/test/common-any-01.data b/src/common/test/common-any-01.data
deleted file mode 100644
index c5a9fbf..0000000
--- a/src/common/test/common-any-01.data
+++ /dev/null
@@ -1,13 +0,0 @@
--- create 4x4 grid of overlapping lines horizontal and vertical
--- set the even numbered ones with dir='FT' and the odd ones 'TF'
-drop table if exists unnoded;
-create table unnoded (
-  id serial not null primary key,
-  dir text
-);
-select addgeometrycolumn('unnoded', 'the_geom', ST_SRID('POINT(0 0)'::geometry) , 'LINESTRING', 2);
-insert into unnoded (dir, the_geom)
-select case when s1%2=0 then 'FT' else 'TF' end, st_astext(st_makeline(st_makepoint(1,s1), st_makepoint(6,s1))) from (select generate_series(2,5) as s1) as foo
-union all
-select case when s1%2=0 then 'FT' else 'TF' end, st_astext(st_makeline(st_makepoint(s1,1), st_makepoint(s1,6))) from (select generate_series(2,5) as s1) as foo;
-
diff --git a/src/common/test/common-any-01.result b/src/common/test/common-any-01.result
deleted file mode 100644
index 7e0af17..0000000
--- a/src/common/test/common-any-01.result
+++ /dev/null
@@ -1,53 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edges2',1e-06,'the_geom','eid','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  23 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-1|||||010100000000000000000000400000000000000000
-2|||||01010000000000000000000040000000000000F03F
-3|||||01010000000000000000000840000000000000F03F
-4|||||01010000000000000000001040000000000000F03F
-5|||||010100000000000000000000400000000000000040
-6|||||010100000000000000000008400000000000000040
-7|||||010100000000000000000000000000000000000040
-8|||||0101000000000000000000F03F0000000000000040
-9|||||010100000000000000000010400000000000000040
-10|||||010100000000000000000000400000000000000840
-11|||||010100000000000000000008400000000000000840
-12|||||010100000000000000000010400000000000000840
-13|||||010100000000000000000000400000000000001040
-14|||||0101000000000000000000F03F000000000000E03F
-15|||||01010000000000000000000040000000000000E03F
-16|||||01010000000000000000000840000000000000E03F
-17|||||0101000000000000000000F03F000000000000F83F
-18|||||0101000000000000000000F03F0000000000000440
-19|||||0101000000000000000000F03F0000000000000C40
-20|||||010100000000000000000000400000000000000C40
----------------------------------------
-1|1|2
-2|2|3
-3|3|4
-4|2|5
-5|3|6
-6|7|8
-7|8|5
-8|5|6
-9|6|9
-10|5|10
-11|6|11
-12|10|11
-13|11|12
-14|10|13
-15|9|12
-16|4|9
-17|14|15
-18|15|16
-19|14|17
-20|17|18
-21|18|16
-22|18|19
-23|19|20
diff --git a/src/common/test/common-any-01.test.sql b/src/common/test/common-any-01.test.sql
deleted file mode 100644
index 8259c9e..0000000
--- a/src/common/test/common-any-01.test.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-select pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid');
-select * from edges2_vertices_pgr order by id;
-\echo '---------------------------------------'
-select eid, source, target from edges2 order by eid;
diff --git a/src/common/test/common-any-02.data b/src/common/test/common-any-02.data
deleted file mode 100644
index 3da158f..0000000
--- a/src/common/test/common-any-02.data
+++ /dev/null
@@ -1,132 +0,0 @@
---
--- PostgreSQL database dump
---
-
-SET statement_timeout = 0;
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: edge_table; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
---
-
-DROP TABLE IF EXISTS edge_table CASCADE;
-
-CREATE TABLE edge_table (
-    id integer NOT NULL,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry,
-    sgid integer,
-    tgid integer
-);
-
-
-ALTER TABLE edge_table OWNER TO postgres;
-
---
--- Name: edge_table_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
---
-
-CREATE SEQUENCE edge_table_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-ALTER TABLE edge_table_id_seq OWNER TO postgres;
-
---
--- Name: edge_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
---
-
-ALTER SEQUENCE edge_table_id_seq OWNED BY edge_table.id;
-
-
---
--- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
---
-
-ALTER TABLE ONLY edge_table ALTER COLUMN id SET DEFAULT nextval('edge_table_id_seq'::regclass);
-
-
---
--- Data for Name: edge_table; Type: TABLE DATA; Schema: public; Owner: postgres
---
-
-COPY edge_table (id, dir, source, target, cost, reverse_cost, x1, y1, x2, y2, the_geom, sgid, tgid) FROM stdin;
-1	B	1	2	1	1	2	0	2	1	010200000002000000000000000000004000000000000000000000000000000040000000000000F03F	2	4
-2	TF	2	3	-1	1	2	1	3	1	0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F	4	4
-3	TF	3	4	-1	1	3	1	4	1	0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F	4	4
-7	B	8	5	1	1	1	2	2	2	010200000002000000000000000000F03F000000000000004000000000000000400000000000000040	4	4
-4	B	2	5	1	1	2	1	2	2	0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040	4	4
-5	FT	3	6	1	-1	3	1	3	2	0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040	4	4
-6	B	7	8	1	1	0	2	1	2	01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040	1	4
-16	B	4	9	1	1	4	1	4	2	0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040	4	4
-12	FT	10	11	1	-1	2	3	3	3	0102000000020000000000000000000040000000000000084000000000000008400000000000000840	3	3
-11	FT	6	11	1	-1	3	2	3	3	0102000000020000000000000000000840000000000000004000000000000008400000000000000840	4	3
-13	FT	11	12	1	-1	3	3	4	3	0102000000020000000000000000000840000000000000084000000000000010400000000000000840	3	3
-15	B	9	12	1	1	4	2	4	3	0102000000020000000000000000001040000000000000004000000000000010400000000000000840	4	3
-14	B	10	13	1	1	2	3	2	4	0102000000020000000000000000000040000000000000084000000000000000400000000000001040	3	3
-17	B	14	15	1	1	0.5	3.5	1.99999999999899991	3.5	010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40	3	3
-18	B	16	17	1	1	3.5	2.29999999999999982	3.5	4	0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040	4	3
-8	B	5	6	1	1	2	2	3	2	0102000000020000000000000000000040000000000000004000000000000008400000000000000040	4	4
-9	B	6	9	1	1	3	2	4	2	0102000000020000000000000000000840000000000000004000000000000010400000000000000040	4	4
-10	B	5	10	1	1	2	2	2	3	0102000000020000000000000000000040000000000000004000000000000000400000000000000840	4	3
-\.
-
-
---
--- Name: edge_table_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
---
-
-SELECT pg_catalog.setval('edge_table_id_seq', 18, true);
-
-
---
--- Name: edge_table_id_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
---
-
-CREATE INDEX edge_table_id_idx ON edge_table USING btree (id);
-
-
---
--- Name: edge_table_source_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
---
-
-CREATE INDEX edge_table_source_idx ON edge_table USING btree (source);
-
-
---
--- Name: edge_table_target_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
---
-
-CREATE INDEX edge_table_target_idx ON edge_table USING btree (target);
-
-
---
--- Name: edge_table_the_geom_gidx; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
---
-
-CREATE INDEX edge_table_the_geom_gidx ON edge_table USING gist (the_geom);
-
-
---
--- PostgreSQL database dump complete
---
-
diff --git a/src/common/test/common-any-02.result b/src/common/test/common-any-02.result
deleted file mode 100644
index 7bbeb48..0000000
--- a/src/common/test/common-any-02.result
+++ /dev/null
@@ -1,51 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edges2',1e-06,'the_geom','eid','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  23 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('edges2',1e-06,'the_geom','eid','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 4
- NOTICE:  Potential gaps found near dead ends: 1
- NOTICE:               Intersections detected: 8
- NOTICE:                      Ring geometries: 0
-OK
-1
----------------------------------------
-1|4
-2|8
-3|6
-4|2
----------------------------------------
-1|1|0|||010100000000000000000000400000000000000000
-2|3|0|||01010000000000000000000040000000000000F03F
-3|3|0|||01010000000000000000000840000000000000F03F
-4|2|0|||01010000000000000000001040000000000000F03F
-5|4|0|||010100000000000000000000400000000000000040
-6|4|0|||010100000000000000000008400000000000000040
-7|1|0|||010100000000000000000000000000000000000040
-8|2|0|||0101000000000000000000F03F0000000000000040
-9|3|0|||010100000000000000000010400000000000000040
-10|3|0|||010100000000000000000000400000000000000840
-11|3|0|||010100000000000000000008400000000000000840
-12|2|0|||010100000000000000000010400000000000000840
-13|1|0|||010100000000000000000000400000000000001040
-14|2|0|||0101000000000000000000F03F000000000000E03F
-15|2|0|||01010000000000000000000040000000000000E03F
-16|2|0|||01010000000000000000000840000000000000E03F
-17|2|0|||0101000000000000000000F03F000000000000F83F
-18|3|0|||0101000000000000000000F03F0000000000000440
-19|2|0|||0101000000000000000000F03F0000000000000C40
-20|1|1|||010100000000000000000000400000000000000C40
diff --git a/src/common/test/common-any-02.test.sql b/src/common/test/common-any-02.test.sql
deleted file mode 100644
index 63ca326..0000000
--- a/src/common/test/common-any-02.test.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-select pgr_createTopology('edges2',0.000001,id:='eid');
-select pgr_analyzegraph('edges2', 0.000001,id:='eid');
-select count(*) from edges2_vertices_pgr where chk=1;
-\echo '---------------------------------------'
-select cnt, count(*) from edges2_vertices_pgr group by cnt order by cnt;
-\echo '---------------------------------------'
-select * from edges2_vertices_pgr order by id;
diff --git a/src/common/test/common-any-03.result b/src/common/test/common-any-03.result
deleted file mode 100644
index 9f27f38..0000000
--- a/src/common/test/common-any-03.result
+++ /dev/null
@@ -1,21 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edges2',1e-05,'the_geom','eid','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  23 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeOneway('edges2','{"",B,TF}','{"",B,FT}','{"",B,FT}','{"",B,TF}','dir','source','target',t)
- NOTICE:  Analyzing graph for one way street errors.
- NOTICE:  Analysis 25% complete ...
- NOTICE:  Analysis 50% complete ...
- NOTICE:  Analysis 75% complete ...
- NOTICE:  Analysis 100% complete ...
- NOTICE:  Found 3 potential problems in directionality
-OK
-17|||2|0|POINT(1 1.5)
-15|||2|0|POINT(2 0.5)
-14|||0|2|POINT(1 0.5)
diff --git a/src/common/test/common-any-03.test.sql b/src/common/test/common-any-03.test.sql
deleted file mode 100644
index d5cd045..0000000
--- a/src/common/test/common-any-03.test.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-select pgr_createTopology('edges2',0.00001,id:='eid');
-select pgr_analyzeOneway('edges2', 
-    ARRAY['', 'B', 'TF'],
-    ARRAY['', 'B', 'FT'],
-    ARRAY['', 'B', 'FT'],
-    ARRAY['', 'B', 'TF'],
-    oneway:='dir');
-select id, cnt, chk, ein, eout, st_astext(the_geom)  from edges2_vertices_pgr where ein=0 or eout=0;
-
diff --git a/src/common/test/common-any-04.result b/src/common/test/common-any-04.result
deleted file mode 100644
index 4d83406..0000000
--- a/src/common/test/common-any-04.result
+++ /dev/null
@@ -1,216 +0,0 @@
-8
- NOTICE:  PROCESSING:
- NOTICE:  pgr_nodeNetwork('unnoded',1e-06,'the_geom','id','noded')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Processing, please wait .....
- NOTICE:    Splitted Edges: 8
- NOTICE:   Untouched Edges: 0
- NOTICE:       Total original Edges: 8
- NOTICE:   Edges generated: 40
- NOTICE:   Untouched Edges: 0
- NOTICE:         Total New segments: 40
- NOTICE:   New Table: public.unnoded_noded
- NOTICE:  ----------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('unnoded_noded',1e-06,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  40 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.unnoded_noded is: public.unnoded_noded_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('unnoded_noded',1e-06,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 16
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
-1|1|4|1|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-2|1|5|2|3|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-3|1|6|3|4|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-4|1|7|4|5|0102000000020000000000000000001040000000000000004000000000000014400000000000000040
-5|1|8|5|6|0102000000020000000000000000001440000000000000004000000000000018400000000000000040
-6|2|4|7|8|010200000002000000000000000000F03F000000000000084000000000000000400000000000000840
-7|2|5|8|9|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-8|2|6|9|10|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-9|2|7|10|11|0102000000020000000000000000001040000000000000084000000000000014400000000000000840
-10|2|8|11|12|0102000000020000000000000000001440000000000000084000000000000018400000000000000840
-11|3|4|13|14|010200000002000000000000000000F03F000000000000104000000000000000400000000000001040
-12|3|5|14|15|0102000000020000000000000000000040000000000000104000000000000008400000000000001040
-13|3|6|15|16|0102000000020000000000000000000840000000000000104000000000000010400000000000001040
-14|3|7|16|17|0102000000020000000000000000001040000000000000104000000000000014400000000000001040
-15|3|8|17|18|0102000000020000000000000000001440000000000000104000000000000018400000000000001040
-16|4|4|19|20|010200000002000000000000000000F03F000000000000144000000000000000400000000000001440
-17|4|5|20|21|0102000000020000000000000000000040000000000000144000000000000008400000000000001440
-18|4|6|21|22|0102000000020000000000000000000840000000000000144000000000000010400000000000001440
-19|4|7|22|23|0102000000020000000000000000001040000000000000144000000000000014400000000000001440
-20|4|8|23|24|0102000000020000000000000000001440000000000000144000000000000018400000000000001440
-21|5|4|25|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-22|5|5|2|8|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-23|5|6|8|14|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-24|5|7|14|20|0102000000020000000000000000000040000000000000104000000000000000400000000000001440
-25|5|8|20|26|0102000000020000000000000000000040000000000000144000000000000000400000000000001840
-26|6|4|27|3|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-27|6|5|3|9|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-28|6|6|9|15|0102000000020000000000000000000840000000000000084000000000000008400000000000001040
-29|6|7|15|21|0102000000020000000000000000000840000000000000104000000000000008400000000000001440
-30|6|8|21|28|0102000000020000000000000000000840000000000000144000000000000008400000000000001840
-31|7|4|29|4|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-32|7|5|4|10|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-33|7|6|10|16|0102000000020000000000000000001040000000000000084000000000000010400000000000001040
-34|7|7|16|22|0102000000020000000000000000001040000000000000104000000000000010400000000000001440
-35|7|8|22|30|0102000000020000000000000000001040000000000000144000000000000010400000000000001840
-36|8|4|31|5|0102000000020000000000000000001440000000000000F03F00000000000014400000000000000040
-37|8|5|5|11|0102000000020000000000000000001440000000000000004000000000000014400000000000000840
-38|8|6|11|17|0102000000020000000000000000001440000000000000084000000000000014400000000000001040
-39|8|7|17|23|0102000000020000000000000000001440000000000000104000000000000014400000000000001440
-40|8|8|23|32|0102000000020000000000000000001440000000000000144000000000000014400000000000001840
-1|1|0|||0101000000000000000000F03F0000000000000040
-2|4|0|||010100000000000000000000400000000000000040
-3|4|0|||010100000000000000000008400000000000000040
-4|4|0|||010100000000000000000010400000000000000040
-5|4|0|||010100000000000000000014400000000000000040
-6|1|0|||010100000000000000000018400000000000000040
-7|1|0|||0101000000000000000000F03F0000000000000840
-8|4|0|||010100000000000000000000400000000000000840
-9|4|0|||010100000000000000000008400000000000000840
-10|4|0|||010100000000000000000010400000000000000840
-11|4|0|||010100000000000000000014400000000000000840
-12|1|0|||010100000000000000000018400000000000000840
-13|1|0|||0101000000000000000000F03F0000000000001040
-14|4|0|||010100000000000000000000400000000000001040
-15|4|0|||010100000000000000000008400000000000001040
-16|4|0|||010100000000000000000010400000000000001040
-17|4|0|||010100000000000000000014400000000000001040
-18|1|0|||010100000000000000000018400000000000001040
-19|1|0|||0101000000000000000000F03F0000000000001440
-20|4|0|||010100000000000000000000400000000000001440
-21|4|0|||010100000000000000000008400000000000001440
-22|4|0|||010100000000000000000010400000000000001440
-23|4|0|||010100000000000000000014400000000000001440
-24|1|0|||010100000000000000000018400000000000001440
-25|1|0|||01010000000000000000000040000000000000F03F
-26|1|0|||010100000000000000000000400000000000001840
-27|1|0|||01010000000000000000000840000000000000F03F
-28|1|0|||010100000000000000000008400000000000001840
-29|1|0|||01010000000000000000001040000000000000F03F
-30|1|0|||010100000000000000000010400000000000001840
-31|1|0|||01010000000000000000001440000000000000F03F
-32|1|0|||010100000000000000000014400000000000001840
-public.noded2.the_geom SRID:0 TYPE:LINESTRING DIMS:2 
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('noded2',1e-06,'the_geom','gid','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  40 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.noded2 is: public.noded2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeGraph('noded2',1e-06,'the_geom','gid','source','target','true')
- NOTICE:  Performing checks, please wait...
- NOTICE:  Analyzing for dead ends. Please wait...
- NOTICE:  Analyzing for gaps. Please wait...
- NOTICE:  Analyzing for isolated edges. Please wait...
- NOTICE:  Analyzing for ring geometries. Please wait...
- NOTICE:  Analyzing for intersections. Please wait...
- NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
- NOTICE:                    Isolated segments: 0
- NOTICE:                            Dead ends: 16
- NOTICE:  Potential gaps found near dead ends: 0
- NOTICE:               Intersections detected: 0
- NOTICE:                      Ring geometries: 0
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_analyzeOneway('noded2','{"",B,TF}','{"",B,FT}','{"",B,FT}','{"",B,TF}','dir','source','target',t)
- NOTICE:  Analyzing graph for one way street errors.
- NOTICE:  Analysis 25% complete ...
- NOTICE:  Analysis 50% complete ...
- NOTICE:  Analysis 75% complete ...
- NOTICE:  Analysis 100% complete ...
- NOTICE:  Found 16 potential problems in directionality
-OK
-1|1|FT|1|2|||010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-2|1|FT|2|3|||0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-3|1|FT|3|4|||0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-4|1|FT|4|5|||0102000000020000000000000000001040000000000000004000000000000014400000000000000040
-5|1|FT|5|6|||0102000000020000000000000000001440000000000000004000000000000018400000000000000040
-6|2|TF|7|8|||010200000002000000000000000000F03F000000000000084000000000000000400000000000000840
-7|2|TF|8|9|||0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-8|2|TF|9|10|||0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-9|2|TF|10|11|||0102000000020000000000000000001040000000000000084000000000000014400000000000000840
-10|2|TF|11|12|||0102000000020000000000000000001440000000000000084000000000000018400000000000000840
-11|3|FT|13|14|||010200000002000000000000000000F03F000000000000104000000000000000400000000000001040
-12|3|FT|14|15|||0102000000020000000000000000000040000000000000104000000000000008400000000000001040
-13|3|FT|15|16|||0102000000020000000000000000000840000000000000104000000000000010400000000000001040
-14|3|FT|16|17|||0102000000020000000000000000001040000000000000104000000000000014400000000000001040
-15|3|FT|17|18|||0102000000020000000000000000001440000000000000104000000000000018400000000000001040
-16|4|TF|19|20|||010200000002000000000000000000F03F000000000000144000000000000000400000000000001440
-17|4|TF|20|21|||0102000000020000000000000000000040000000000000144000000000000008400000000000001440
-18|4|TF|21|22|||0102000000020000000000000000000840000000000000144000000000000010400000000000001440
-19|4|TF|22|23|||0102000000020000000000000000001040000000000000144000000000000014400000000000001440
-20|4|TF|23|24|||0102000000020000000000000000001440000000000000144000000000000018400000000000001440
-21|5|FT|25|2|||0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-22|5|FT|2|8|||0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-23|5|FT|8|14|||0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-24|5|FT|14|20|||0102000000020000000000000000000040000000000000104000000000000000400000000000001440
-25|5|FT|20|26|||0102000000020000000000000000000040000000000000144000000000000000400000000000001840
-26|6|TF|27|3|||0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-27|6|TF|3|9|||0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-28|6|TF|9|15|||0102000000020000000000000000000840000000000000084000000000000008400000000000001040
-29|6|TF|15|21|||0102000000020000000000000000000840000000000000104000000000000008400000000000001440
-30|6|TF|21|28|||0102000000020000000000000000000840000000000000144000000000000008400000000000001840
-31|7|FT|29|4|||0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-32|7|FT|4|10|||0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-33|7|FT|10|16|||0102000000020000000000000000001040000000000000084000000000000010400000000000001040
-34|7|FT|16|22|||0102000000020000000000000000001040000000000000104000000000000010400000000000001440
-35|7|FT|22|30|||0102000000020000000000000000001040000000000000144000000000000010400000000000001840
-36|8|TF|31|5|||0102000000020000000000000000001440000000000000F03F00000000000014400000000000000040
-37|8|TF|5|11|||0102000000020000000000000000001440000000000000004000000000000014400000000000000840
-38|8|TF|11|17|||0102000000020000000000000000001440000000000000084000000000000014400000000000001040
-39|8|TF|17|23|||0102000000020000000000000000001440000000000000104000000000000014400000000000001440
-40|8|TF|23|32|||0102000000020000000000000000001440000000000000144000000000000014400000000000001840
-1|1|0|0|1|0101000000000000000000F03F0000000000000040
-2|4|0|2|2|010100000000000000000000400000000000000040
-3|4|0|2|2|010100000000000000000008400000000000000040
-4|4|0|2|2|010100000000000000000010400000000000000040
-5|4|0|2|2|010100000000000000000014400000000000000040
-6|1|0|1|0|010100000000000000000018400000000000000040
-7|1|0|1|0|0101000000000000000000F03F0000000000000840
-8|4|0|2|2|010100000000000000000000400000000000000840
-9|4|0|2|2|010100000000000000000008400000000000000840
-10|4|0|2|2|010100000000000000000010400000000000000840
-11|4|0|2|2|010100000000000000000014400000000000000840
-12|1|0|0|1|010100000000000000000018400000000000000840
-13|1|0|0|1|0101000000000000000000F03F0000000000001040
-14|4|0|2|2|010100000000000000000000400000000000001040
-15|4|0|2|2|010100000000000000000008400000000000001040
-16|4|0|2|2|010100000000000000000010400000000000001040
-17|4|0|2|2|010100000000000000000014400000000000001040
-18|1|0|1|0|010100000000000000000018400000000000001040
-19|1|0|1|0|0101000000000000000000F03F0000000000001440
-20|4|0|2|2|010100000000000000000000400000000000001440
-21|4|0|2|2|010100000000000000000008400000000000001440
-22|4|0|2|2|010100000000000000000010400000000000001440
-23|4|0|2|2|010100000000000000000014400000000000001440
-24|1|0|0|1|010100000000000000000018400000000000001440
-25|1|0|0|1|01010000000000000000000040000000000000F03F
-26|1|0|1|0|010100000000000000000000400000000000001840
-27|1|0|1|0|01010000000000000000000840000000000000F03F
-28|1|0|0|1|010100000000000000000008400000000000001840
-29|1|0|0|1|01010000000000000000001040000000000000F03F
-30|1|0|1|0|010100000000000000000010400000000000001840
-31|1|0|1|0|01010000000000000000001440000000000000F03F
-32|1|0|0|1|010100000000000000000014400000000000001840
diff --git a/src/common/test/common-any-04.test.sql b/src/common/test/common-any-04.test.sql
deleted file mode 100644
index c1fa4a2..0000000
--- a/src/common/test/common-any-04.test.sql
+++ /dev/null
@@ -1,49 +0,0 @@
--- node the network
-
-select count(*) from unnoded limit 1;
-select pgr_nodenetwork('unnoded', 0.000001);
-select pgr_createtopology('unnoded_noded', 0.000001 );
-select pgr_analyzegraph('unnoded_noded',  0.000001);
-
-select * from unnoded_noded order by old_id, sub_id;
-select * from unnoded_noded_vertices_pgr order by id;
-
-
-
--- create a new table and merge attribute from original and noded
--- into table noded2
-set client_min_messages to warning;
-drop table if exists noded2;
-create table noded2 (
-  gid serial not null primary key,
-  id int,
-  dir text,
-  source int,
-  target int,
-  cost float8,
-  rcost float8
- );
-
-
-
-select regexp_replace(addgeometrycolumn('noded2', 'the_geom', ST_SRID('POINT(0 0)'::geometry) , 'LINESTRING', 2), 'SRID:-1', 'SRID:0');
-insert into noded2 (id, dir, the_geom)
- select a.old_id, b.dir, a.the_geom
-   from unnoded_noded a, unnoded b
-  where a.old_id=b.id;
-
-set client_min_messages to notice;
-
-
-select pgr_createtopology('noded2', 0.000001,id:='gid');
-select pgr_analyzegraph('noded2', 0.000001,id:='gid');
-select pgr_analyzeoneway('noded2',
-    ARRAY['', 'B', 'TF'],
-    ARRAY['', 'B', 'FT'],
-    ARRAY['', 'B', 'FT'],
-    ARRAY['', 'B', 'TF'],
-    oneway:='dir');
-
-
-select * from noded2 order by id;
-select * from noded2_vertices_pgr order by id;
diff --git a/src/common/test/common-any-05.result b/src/common/test/common-any-05.result
deleted file mode 100644
index 0e9f7e6..0000000
--- a/src/common/test/common-any-05.result
+++ /dev/null
@@ -1,44 +0,0 @@
-public.noded3.the_geom SRID:0 TYPE:MULTILINESTRING DIMS:2 
----------------------------------
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('noded3',1e-06,'the_geom','gid','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  40 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.noded3 is: public.noded3_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
----------------------------------
-1|||||0101000000000000000000F03F0000000000000040
-2|||||010100000000000000000000400000000000000040
-3|||||010100000000000000000008400000000000000040
-4|||||010100000000000000000010400000000000000040
-5|||||010100000000000000000014400000000000000040
-6|||||010100000000000000000018400000000000000040
-7|||||0101000000000000000000F03F0000000000000840
-8|||||010100000000000000000000400000000000000840
-9|||||010100000000000000000008400000000000000840
-10|||||010100000000000000000010400000000000000840
-11|||||010100000000000000000014400000000000000840
-12|||||010100000000000000000018400000000000000840
-13|||||0101000000000000000000F03F0000000000001040
-14|||||010100000000000000000000400000000000001040
-15|||||010100000000000000000008400000000000001040
-16|||||010100000000000000000010400000000000001040
-17|||||010100000000000000000014400000000000001040
-18|||||010100000000000000000018400000000000001040
-19|||||0101000000000000000000F03F0000000000001440
-20|||||010100000000000000000000400000000000001440
-21|||||010100000000000000000008400000000000001440
-22|||||010100000000000000000010400000000000001440
-23|||||010100000000000000000014400000000000001440
-24|||||010100000000000000000018400000000000001440
-25|||||01010000000000000000000040000000000000F03F
-26|||||010100000000000000000000400000000000001840
-27|||||01010000000000000000000840000000000000F03F
-28|||||010100000000000000000008400000000000001840
-29|||||01010000000000000000001040000000000000F03F
-30|||||010100000000000000000010400000000000001840
-31|||||01010000000000000000001440000000000000F03F
-32|||||010100000000000000000014400000000000001840
diff --git a/src/common/test/common-any-05.test.sql b/src/common/test/common-any-05.test.sql
deleted file mode 100644
index ad713b6..0000000
--- a/src/common/test/common-any-05.test.sql
+++ /dev/null
@@ -1,29 +0,0 @@
--- create a new table and merge attribute from original and noded
--- into table noded3
-
-set client_min_messages to warning;
-drop table if exists noded3 cascade;
-create table noded3 (
-  gid serial not null primary key,
-  id int,
-  dir text,
-  source int,
-  target int,
-  cost float8,
-  rcost float8
- );
-select regexp_replace(addgeometrycolumn('noded3', 'the_geom', ST_SRID('POINT(0 0)'::geometry) , 'MULTILINESTRING', 2), 'SRID:-1', 'SRID:0');
-insert into noded3 (id, dir, the_geom)
- select a.id, b.dir, st_multi(a.the_geom) as the_geom
-   from unnoded_noded a, unnoded b
-  where a.old_id=b.id;
-
-set client_min_messages to notice;
-
-\echo '---------------------------------'
-
-select pgr_createtopology('noded3', 0.000001, id:= 'gid');
-
-\echo '---------------------------------'
-
-select * from noded3_vertices_pgr order by id;
diff --git a/src/common/test/createTopology-any-01.result b/src/common/test/createTopology-any-01.result
deleted file mode 100644
index db6cdbd..0000000
--- a/src/common/test/createTopology-any-01.result
+++ /dev/null
@@ -1,66 +0,0 @@
-1|t
-2|t
-3|t
-4|t
-5|t
-6|t
-7|t
-8|t
-9|t
-10|t
-11|t
-12|t
-13|t
-14|t
-15|t
-16|t
-17|t
-18|t
-19|t
-20|t
-21|t
-22|t
-23|t
-24|t
-25|t
-26|t
-27|t
-28|t
-29|t
-30|t
-30|t
-31|t
-32|t
-33|t
-34|t
-35|t
-36|t
-37|t
-38|t
-39|t
-40|t
-41|t
-42|t
-43|t
-44|t
-45|t
-46|t
-47|t
-48|t
-49|t
-50|t
-51|t
-52|t
-53|t
-54|t
-55|t
-56|t
-57|t
-58|t
-59|t
-60|t
-61|t
-62|t
-63|t
-64|t
-65|t
diff --git a/src/common/test/createTopology-any-01.test.sql b/src/common/test/createTopology-any-01.test.sql
deleted file mode 100644
index 17a6350..0000000
--- a/src/common/test/createTopology-any-01.test.sql
+++ /dev/null
@@ -1,133 +0,0 @@
-\set VERBOSITY 'terse'
-
-set client_min_messages to warning;
-SET search_path TO public;
-drop table if exists "Edges2";
-drop table if exists "Edges2_vertices_pgr";
-drop schema if exists "myschema" cascade;
-
-
--- The following should be OK
-
-select 1, pgr_createTopology('edges2', 0.000001, id:='eid') = 'OK';
-select 2, pgr_createTopology('Edges2', 0.000001, 'the_geom', 'eid') = 'OK';
-select 3, pgr_createTopology('edges2', 0.000001, 'The_Geom', 'eid') = 'OK';
-select 4, pgr_createTopology('edges2', 0.000001, 'the_geom', 'Eid') = 'OK';
-select 5, pgr_createTopology('edges2', 0.000001, 'The_geom', 'Eid') = 'OK';
-select 6, pgr_createTopology('Edges2', 0.000001, 'The_geom', 'Eid') = 'OK';
-select 7, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','source') = 'OK';
-select 8, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','Source') = 'OK';
-select 9, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','source','target') = 'OK';
-select 10, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',rows_where:='eid<15') = 'OK';
-select 11, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',source:='source') = 'OK';
-select 12, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',target:='target',rows_where:='eid<15 and eid>5') = 'OK';
-
--- the following tests should FAIL
-
-select 13, pgr_createTopology('edges22', 0.000001, 'the_geom', 'eid') = 'FAIL';
-select 14, pgr_createTopology('edges2', 0.000001, 'geom', 'eid') = 'FAIL';
-select 15, pgr_createTopology('edges2', 0.000001, 'the_geom', 'gid') = 'FAIL';
-select 16, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','sourc') = 'FAIL';
-select 17, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',target:='source') = 'FAIL';
-select 18, pgr_createTopology('edges2', 0.000001, id:='eid',source:='the_geom') = 'FAIL';
-select 19, pgr_createTopology('edges2', 0.000001, id:='eid',target:='the_geom') = 'FAIL';
-
--- Testing with table with a similar name
-
-select * into "Edges2" from edges2;
-
--- The following should be OK
-
-select 20, pgr_createTopology('Edges2', 0.000001,id:='eid') = 'OK';
-update "Edges2" set the_geom=NULL where eid=5;
-select 21, pgr_createTopology('Edges2', 0.000001,id:='eid') = 'OK';
-update "Edges2" set eid=NULL where eid=7;
-select 22, pgr_createTopology('Edges2', 0.000001,id:='eid') = 'OK';
-
-create schema myschema;
-SET search_path TO myschema,public;
-
--- reaching tables when located in another schema
--- the following should be OK
-
-select 23, pgr_createTopology('public.edges2', 0.000001, id:='eid') = 'OK';
-select 24, pgr_createTopology('public.Edges2', 0.000001, 'the_geom', 'eid') = 'OK';
-select 25, pgr_createTopology('Public.edges2', 0.000001, 'The_Geom', 'eid') = 'OK';
-select 26, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'Eid') = 'OK';
-select 27, pgr_createTopology('public.edges2', 0.000001, 'The_geom', 'Eid') = 'OK';
-select 28, pgr_createTopology('PUBLIC.Edges2', 0.000001, 'The_geom', 'Eid') = 'OK';
-select 29, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid','source') = 'OK';
-select 30, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid','Source') = 'OK';
-select 30, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid','source','target') = 'OK';
-select 31, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid',rows_where:='eid<15') = 'OK';
-select 32, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid',source:='source') = 'OK';
-select 33, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid',target:='target',rows_where:='eid<15') = 'OK';
-
--- the following tests should fail
-
-select 34, pgr_createTopology('public.edges22', 0.000001, 'the_geom', 'eid') = 'FAIL';
-select 35, pgr_createTopology('public.edges2', 0.000001, 'geom', 'eid') = 'FAIL';
-select 36, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'gid') = 'FAIL';
-select 37, pgr_createTopology('public.Edges2', 0.000001, 'the_geom', 'eid','sourc') = 'FAIL';
-select 38, pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'eid',target:='source') = 'FAIL';
-select 39, pgr_createTopology('public.edges2', 0.000001, id:='eid',source:='the_geom') = 'FAIL';
-select 40, pgr_createTopology('public.edges2', 0.000001, id:='eid',target:='the_geom') = 'FAIL';
-
--- creating tables with similar names in myschema
-
-select * into edges2 from public.edges2;
-select * into "Edges2" from public."Edges2";
-
--- The following should be OK
-
-select 41, pgr_createTopology('edges2', 0.000001, id:='eid') = 'OK';
-select 42, pgr_createTopology('Edges2', 0.000001, 'the_geom', 'eid') = 'OK';
-select 43, pgr_createTopology('edges2', 0.000001, 'The_Geom', 'eid') = 'OK';
-select 44, pgr_createTopology('edges2', 0.000001, 'the_geom', 'Eid') = 'OK';
-select 45, pgr_createTopology('edges2', 0.000001, 'The_geom', 'Eid') = 'OK';
-select 46, pgr_createTopology('Edges2', 0.000001, 'The_geom', 'Eid') = 'OK';
-select 47, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','source') = 'OK';
-select 48, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','Source') = 'OK';
-select 49, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','source','target') = 'OK';
-select 50, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',rows_where:='eid<15') = 'OK';
-select 51, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',source:='source') = 'OK';
-select 52, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',target:='target',rows_where:='eid<15') = 'OK';
-
--- the following tests should FAIL
-
-select 53, pgr_createTopology('edges22', 0.000001, 'the_geom', 'eid') = 'FAIL';
-select 54, pgr_createTopology('edges2', 0.000001, 'geom', 'eid') = 'FAIL';
-select 55, pgr_createTopology('edges2', 0.000001, 'the_geom', 'gid') = 'FAIL';
-select 56, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid','sourc') = 'FAIL';
-select 57, pgr_createTopology('edges2', 0.000001, 'the_geom', 'eid',target:='source') = 'FAIL';
-select 58, pgr_createTopology('edges2', 0.000001, id:='eid',source:='the_geom') = 'FAIL';
-select 59, pgr_createTopology('edges2', 0.000001, id:='eid',target:='the_geom') = 'FAIL';
-
---Test of the rows_where clause
-
-
--- The following should be OK
-select 60, pgr_createTopology('edges2', 0.000001, id:= 'eid',rows_where:='eid<15') = 'OK';
-select 61, pgr_createTopology('Edges2', 0.000001, id:= 'eid',rows_where:='eid<15 and eid>5') = 'OK';
-select 62, pgr_createTopology('Edges2', 0.000001, id:= 'eid',rows_where:=' the_geom && (select st_buffer(the_geom,0.0001) as buffer from "Edges2" where eid=6)') = 'OK';
-
--- The following should FAIL (working on myschema)
-
-select 63, pgr_createTopology('edges2', 0.000001, id:= 'eid',rows_where:='eid<') = 'FAIL';
-select 64, pgr_createTopology('Edges2', 0.000001, id:= 'eid',rows_where:='eid<15 and ed>5') = 'FAIL';
-select 65, pgr_createTopology('Edges2', 0.000001, id:= 'eid',rows_where:=' the_geom && (select st_buffer(the_geom,0.0001 as buffer from "Edges2" where eid=6)')  = 'FAIL';
-
--- BIG TABLE TEST TAKES TIME
---create table bigtable ( id bigserial PRIMARY KEY, source smallint,target smallint);
---SELECT AddGeometryColumn( 'bigtable', 'the_geom', 0, 'LINESTRING',2);
---insert into bigtable (the_geom) ( select ST_MakeLine(ST_MakePoint(random()*1000,random()*1000), ST_MakePoint(random()*1000,random()*1000))
---from (SELECT * FROM generate_series(1,20000) AS id) AS x) ;
---select 66, pgr_createTopology('bigtable', 0.000001);
-
-
-set client_min_messages to warning;
-
-SET search_path TO public;
-drop table if exists "Edges2";
-drop table if exists "Edges2_vertices_pgr";
-drop schema if exists "myschema" cascade;
diff --git a/src/common/test/createVerticesTable-any-01.result b/src/common/test/createVerticesTable-any-01.result
deleted file mode 100644
index 259d236..0000000
--- a/src/common/test/createVerticesTable-any-01.result
+++ /dev/null
@@ -1,475 +0,0 @@
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edges2',1e-05,'the_geom','eid','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  23 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  table "edges2_vertex_pgr" does not exist, skipping
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','The_Geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','The_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','The_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','Source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','eid<15')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  13 VERTICES
- NOTICE:                                         FOR   16  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 16
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','eid<15 and eid>5')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  9 VERTICES
- NOTICE:                                         FOR   10  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 10
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public."Edges2" is: public."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   24  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 1
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public."Edges2" is: public."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   24  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 2
- NOTICE:                              Edges processed: 22
- NOTICE:  Vertices table for table public."Edges2" is: public."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.Edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   24  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 2
- NOTICE:                              Edges processed: 22
- NOTICE:  Vertices table for table public."Edges2" is: public."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Public.edges2','The_Geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','The_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('PUBLIC.Edges2','The_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   24  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 2
- NOTICE:                              Edges processed: 22
- NOTICE:  Vertices table for table public."Edges2" is: public."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','Source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','source','target','eid<15')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  13 VERTICES
- NOTICE:                                         FOR   16  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 16
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('public.edges2','the_geom','source','target','eid<15')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating public.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  13 VERTICES
- NOTICE:                                         FOR   16  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 16
- NOTICE:  Vertices table for table public.edges2 is: public.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   24  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 2
- NOTICE:                              Edges processed: 22
- NOTICE:  Vertices table for table myschema."Edges2" is: myschema."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','The_Geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','The_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','The_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   24  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 2
- NOTICE:                              Edges processed: 22
- NOTICE:  Vertices table for table myschema."Edges2" is: myschema."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','Source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','eid<15')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  13 VERTICES
- NOTICE:                                         FOR   16  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 16
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  20 VERTICES
- NOTICE:                                         FOR   23  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 23
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','eid<15')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  13 VERTICES
- NOTICE:                                         FOR   16  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 16
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
-FAIL
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('edges2','the_geom','source','target','eid<15')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  13 VERTICES
- NOTICE:                                         FOR   16  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 0
- NOTICE:                              Edges processed: 16
- NOTICE:  Vertices table for table myschema.edges2 is: myschema.edges2_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target','eid<15 and eid>5')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  9 VERTICES
- NOTICE:                                         FOR   10  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 1
- NOTICE:                              Edges processed: 9
- NOTICE:  Vertices table for table myschema."Edges2" is: myschema."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createVerticesTable('Edges2','the_geom','source','target',' the_geom && (select st_buffer(the_geom,0.0001) as buffer from "Edges2" 
-where eid=6)')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Populating myschema.Edges2_vertices_pgr, please wait...
- NOTICE:    ----->   VERTICES TABLE CREATED WITH  5 VERTICES
- NOTICE:                                         FOR   4  EDGES
- NOTICE:    Edges with NULL geometry,source or target: 1
- NOTICE:                              Edges processed: 3
- NOTICE:  Vertices table for table myschema."Edges2" is: myschema."Edges2_vertices_pgr"
- NOTICE:  ----------------------------------------------
-OK
-FAIL
-FAIL
-FAIL
diff --git a/src/common/test/createVerticesTable-any-01.test.sql b/src/common/test/createVerticesTable-any-01.test.sql
deleted file mode 100644
index e5522a3..0000000
--- a/src/common/test/createVerticesTable-any-01.test.sql
+++ /dev/null
@@ -1,146 +0,0 @@
-set client_min_messages to warning;
-SET search_path TO public;
-
-drop table if exists "Edges2";
-drop table if exists "Edges2_vertices_pgr";
-drop schema if exists "myschema" cascade;
-
-set client_min_messages to notice;
-
--- The following should be OK
-
-select pgr_createTopology('edges2',0.00001, id:='eid');
-drop table if exists edges2_vertex_pgr;
-select pgr_createVerticesTable('edges2');
-select pgr_createVerticesTable('Edges2', 'the_geom');
-select pgr_createVerticesTable('edges2', 'The_Geom');
-select pgr_createVerticesTable('edges2', 'the_geom');
-select pgr_createVerticesTable('edges2', 'The_geom');
-select pgr_createVerticesTable('Edges2', 'The_geom');
-select pgr_createVerticesTable('edges2', 'the_geom','source');
-select pgr_createVerticesTable('edges2', 'the_geom','Source');
-select pgr_createVerticesTable('edges2', 'the_geom','source','target');
-select pgr_createVerticesTable('edges2', 'the_geom',rows_where:='eid<15');
-select pgr_createVerticesTable('edges2', 'the_geom',source:='source');
-select pgr_createVerticesTable('edges2', 'the_geom',target:='target',rows_where:='eid<15 and eid>5');
-
--- the following tests should FAIL
-set client_min_messages to warning;
-
-select pgr_createVerticesTable('edges22', 'the_geom');
-select pgr_createVerticesTable('edges2', 'geom');
-select pgr_createVerticesTable('edges2', 'the_geom', 'gid');
-select pgr_createVerticesTable('edges2', 'the_geom','sourc');
-select pgr_createVerticesTable('edges2', 'the_geom',target:='source');
-select pgr_createVerticesTable('edges2', source:='the_geom');
-select pgr_createVerticesTable('edges2', target:='the_geom');
-
--- Testing with table with a similar name
-
-select * into "Edges2" from edges2;
-
--- The following should be OK                                                                                                                 
-set client_min_messages to notice;
-                                                                                                                                              
-select pgr_createVerticesTable('Edges2');                                                                                     
-update "Edges2" set the_geom=NULL where eid=5;                                                                                                
-select pgr_createVerticesTable('Edges2');                                                                                     
-update "Edges2" set source=NULL where eid=7;                                                                                                     
-select pgr_createVerticesTable('Edges2');                                                                                     
-                                                                                                                                              
-create schema myschema;                                                                                                                       
-SET search_path TO myschema,public;                                                                                                           
-                                                                                                                                              
--- reaching tables when located in another schema                                                                                             
--- the following should be OK                                                                                                                 
-                                                                                                                                              
-select pgr_createVerticesTable('public.edges2' );                                                                              
-select pgr_createVerticesTable('public.Edges2', 'the_geom');                                                                      
-select pgr_createVerticesTable('Public.edges2', 'The_Geom');
-select pgr_createVerticesTable('public.edges2', 'The_geom'); 
-select pgr_createVerticesTable('PUBLIC.Edges2', 'The_geom');
-select pgr_createVerticesTable('public.edges2', 'the_geom','source');
-select pgr_createVerticesTable('public.edges2', 'the_geom','Source');
-select pgr_createVerticesTable('public.edges2', 'the_geom','source','target');
-select pgr_createVerticesTable('public.edges2', 'the_geom',rows_where:='eid<15');
-select pgr_createVerticesTable('public.edges2', 'the_geom',source:='source');
-select pgr_createVerticesTable('public.edges2', 'the_geom',target:='target',rows_where:='eid<15');
-
--- the following tests should fail
-set client_min_messages to warning;
-
-select pgr_createVerticesTable('public.edges22', 'the_geom');
-select pgr_createVerticesTable('public.edges2', 'geom');
-select pgr_createVerticesTable('public.edges2', 'the_geom', 'gid');
-select pgr_createVerticesTable('public.Edges2', 'the_geom','sourc');
-select pgr_createVerticesTable('public.edges2', 'the_geom',target:='source');
-select pgr_createVerticesTable('public.edges2',source:='the_geom');
-select pgr_createVerticesTable('public.edges2', target:='the_geom');
-
--- creating tables with similar names in myschema
-
-select * into edges2 from public.edges2;
-select * into "Edges2" from public."Edges2";
-
--- The following should be OK 
-set client_min_messages to notice;
-
-select pgr_createVerticesTable('edges2');
-select pgr_createVerticesTable('Edges2', 'the_geom');
-select pgr_createVerticesTable('edges2', 'The_Geom');
-select pgr_createVerticesTable('edges2', 'The_geom');
-select pgr_createVerticesTable('Edges2', 'The_geom');
-select pgr_createVerticesTable('edges2', 'the_geom','source');
-select pgr_createVerticesTable('edges2', 'the_geom','Source');
-select pgr_createVerticesTable('edges2', 'the_geom','source','target');
-select pgr_createVerticesTable('edges2', 'the_geom',rows_where:='eid<15');
-select pgr_createVerticesTable('edges2', 'the_geom',source:='source');
-select pgr_createVerticesTable('edges2', 'the_geom',target:='target',rows_where:='eid<15');
-
--- the following tests should FAIL
-set client_min_messages to warning;
-
-select pgr_createVerticesTable('edges22', 'the_geom');
-select pgr_createVerticesTable('edges2', 'geom');
-select pgr_createVerticesTable('edges2', 'the_geom', 'gid');
-select pgr_createVerticesTable('edges2', 'the_geom','sourc');
-select pgr_createVerticesTable('edges2', 'the_geom',target:='source');
-select pgr_createVerticesTable('edges2', source:='the_geom');
-select pgr_createVerticesTable('edges2', target:='the_geom');
-
---Test of the rows_where  clause
-
-
--- The following should be OK
-set client_min_messages to notice;
-select pgr_createVerticesTable('edges2', rows_where:='eid<15');
-select pgr_createVerticesTable('Edges2', rows_where:='eid<15 and eid>5');
-select pgr_createVerticesTable('Edges2', rows_where:=' the_geom && (select st_buffer(the_geom,0.0001) as buffer from "Edges2" 
-where eid=6)') ;
-
--- The following should FAIL (working on myschema)
-set client_min_messages to warning;
-
-select pgr_createVerticesTable('edges2',rows_where:='eid<');
-select pgr_createVerticesTable('Edges2', rows_where:='eid<15 and ed>5');
-select pgr_createVerticesTable('Edges2', rows_where:=' the_geom && (select st_buffer(the_geom,0.0001 as buffer from "Edges2" where eid=6)') ;
-
-/* BIG TABLE TEST TAKES TIME
-create table bigtable ( id bigserial PRIMARY KEY, source integer,target integer);
-SELECT AddGeometryColumn( 'bigtable', 'the_geom', 0, 'LINESTRING',2);
-insert into bigtable (the_geom) ( select ST_MakeLine(ST_MakePoint(random()*1000,random()*1000), ST_MakePoint(random()*1000,random()*1000)) 
-from  (SELECT * FROM generate_series(1,3000) AS id) AS x) ;
-select pgr_createVerticesTable('bigtable');
-select pgr_createTopology('bigtable',0.0001);
-select * into big_table_vertices from bigtable_vertices_pgr;
-drop table if exists bigtable_vertices_pgr;
-select pgr_createVerticesTable('myschema.bigtable');
-select (select count(*) from myschema.big_table_vertices) = (select count(*) from myschema.bigtable_vertices_pgr);
-select count(*) from ( (select * from myschema.big_table_vertices) union (select * from myschema.bigtable_vertices_pgr)) as a;
-*/
-
-set client_min_messages to warning;
-SET search_path TO public;
-drop table if exists "Edges2";
-drop table if exists "Edges2_vertices_pgr";
-drop schema if exists "myschema" cascade;
diff --git a/src/common/test/gettablename-any-01.result b/src/common/test/gettablename-any-01.result
deleted file mode 100644
index 9c48584..0000000
--- a/src/common/test/gettablename-any-01.result
+++ /dev/null
@@ -1,35 +0,0 @@
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
diff --git a/src/common/test/gettablename-any-01.test.sql b/src/common/test/gettablename-any-01.test.sql
deleted file mode 100644
index ea7b3da..0000000
--- a/src/common/test/gettablename-any-01.test.sql
+++ /dev/null
@@ -1,83 +0,0 @@
-set client_min_messages  to warning;
-
-SET search_path TO "$user", public;
-
-create schema s1;
-create schema s2;
-create schema "S2";
-create schema s3;
-create table streets (id serial PRIMARY KEY,source integer,target integer);
-create table "Streets" (ID serial PRIMARY KEY,SOURCE integer,TARGET integer);
-create table s1.streets ("ID" serial PRIMARY KEY,sour integer,targ integer);
-create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
-create table s2."Streets" (id serial ,source integer,target integer);
-create table "S2".streets (id serial ,source integer,target integer);
-create table s3."Streets" (id serial ,source integer,target integer);
-create table s3."sTreets" (id serial ,source integer,target integer);
-create table s3."StrEets" (id serial ,source integer,target integer);
-
-set client_min_messages to warning;
-
-select sname = 'public' and tname = 'streets' from  _pgr_getTableName('StreEts'); --public.streets
-select sname = 'public' and tname = 'Streets' from _pgr_getTableName('Streets');  --public.Streets
-select sname = 'public' and tname = 'streets' from _pgr_getTableName('streEts');  --public.streets
-select sname = 'public' and tname is null from _pgr_getTableName('streEts1');     --public.<null>
-
-select sname = 's1' and tname = 'streets' from _pgr_getTableName('s1.StreEts');         --s1.streets
-select sname = 's1' and tname = 'Streets' from _pgr_getTableName('s1.Streets');         --s1.Streets
-select sname = 's1' and tname = 'streets' from _pgr_getTableName('S1.streEts');         --s1.streets
-select sname = 's1' and tname is null from _pgr_getTableName('S1.streEts1');         --s1.<null>
-
-select sname = 's2' and tname is null from _pgr_getTableName('s2.StreEts');         --s2.<null>
-select sname = 's2' and tname = 'Streets' from _pgr_getTableName('s2.Streets');         --s2.Streets
-select sname = 'S2' and tname = 'streets' from _pgr_getTableName('S2.streEts');         --S2.streets
-
-
-select sname = 's3' and tname = 'Streets' from _pgr_getTableName('s3.Streets');         --s3.Streets
-select sname = 's3' and tname = 'sTreets' from _pgr_getTableName('s3.sTreets');         --s3.sTreets
-select sname = 's3' and tname = 'StrEets' from _pgr_getTableName('s3.StrEets');         --s3.StrEets
-
-select sname = 's3' and tname is null from _pgr_getTableName('s3.streets');         --s3.<null>
-select sname = 's3' and tname is null from _pgr_getTableName('s3.streetS');         --s3.<null>
-select sname = 's3' and tname is null from _pgr_getTableName('S3.streEts1');         --s3.<null>
-
-SET search_path TO s1,public;
-
-select sname = 's1' and tname = 'streets' from _pgr_getTableName('StreEts');         --s1.streets
-select sname = 's1' and tname = 'Streets' from _pgr_getTableName('Streets');         --s1.Streets
-select sname = 's1' and tname = 'streets' from _pgr_getTableName('streEts');         --s1.streets
-select sname = 's1' and tname is null from _pgr_getTableName('streEts1');         --s1.<null>
-
-select sname = 's1' and tname = 'streets' from _pgr_getTableName('s1.StreEts');         --s1.streets
-select sname = 's1' and tname = 'Streets' from _pgr_getTableName('s1.Streets');         --s1.Streets
-select sname = 's1' and tname = 'streets' from _pgr_getTableName('S1.streEts');         --s1.streets
-select sname = 's1' and tname is null from _pgr_getTableName('S1.streEts1');         --s1.<null>
-
-select sname = 's2' and tname is null from _pgr_getTableName('s2.StreEts');         --s2.<null>
-select sname = 's2' and tname = 'Streets' from _pgr_getTableName('s2.Streets');         --s2.Streets
-select sname = 'S2' and tname = 'streets' from _pgr_getTableName('S2.streEts');         --S2.streets
-
-
-select sname = 's3' and tname = 'Streets' from _pgr_getTableName('s3.Streets');         --s3.Streets
-select sname = 's3' and tname = 'sTreets' from _pgr_getTableName('s3.sTreets');         --s3.sTreets
-select sname = 's3' and tname = 'StrEets' from _pgr_getTableName('s3.StrEets');         --s3.StrEets
-select sname = 's3' and tname is null from _pgr_getTableName('s3.streets');         --s3.<null>
-select sname = 's3' and tname is null from _pgr_getTableName('s3.streetS');         --s3.<null>
-select sname = 's3' and tname is null from _pgr_getTableName('S3.streEts1');         --s3.<null>
-
-select sname is null and tname is null from _pgr_getTableName('S4.streEts1');         --<null>.<null>
-
-SET search_path TO "$user", public;
-
-set client_min_messages  to warning;
-
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop schema if exists s2 cascade;
-drop schema if exists "S2" cascade; 
-drop schema if exists s3 cascade; 
-
-
diff --git a/src/common/test/incrementalCreateTopology_any_01.result b/src/common/test/incrementalCreateTopology_any_01.result
deleted file mode 100644
index fd28b94..0000000
--- a/src/common/test/incrementalCreateTopology_any_01.result
+++ /dev/null
@@ -1,146 +0,0 @@
-8
-1|B|||1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|||-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|||-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|||1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|||1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|||1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|||1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|||1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  8 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-18
-1|B|1|2|1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|2|3|-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|3|4|-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|2|5|1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|3|6|1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|7|8|1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|8|5|1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|5|6|1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9|B|||1|1|3|2|4|2|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10|B|||1|1|2|2|2|3|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11|FT|||1|-1|3|2|3|3|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12|FT|||1|-1|2|3|3|3|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13|FT|||1|-1|3|3|4|3|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14|B|||1|1|2|3|2|4|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15|B|||1|1|4|2|4|3|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16|B|||1|1|4|1|4|2|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-17|B|||1|1|0.5|3.5|1.999999999999|3.5|010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
-18|B|||1|1|3.5|2.3|3.5|4|0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040
-0
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  10 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-1|B|1|2|1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|2|3|-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|3|4|-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|2|5|1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|3|6|1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|7|8|1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|8|5|1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|5|6|1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9|B|6|9|1|1|3|2|4|2|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10|B|5|10|1|1|2|2|2|3|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11|FT|6|11|1|-1|3|2|3|3|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12|FT|10|11|1|-1|2|3|3|3|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13|FT|11|12|1|-1|3|3|4|3|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14|B|10|13|1|1|2|3|2|4|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15|B|9|12|1|1|4|2|4|3|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16|B|4|9|1|1|4|1|4|2|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-17|B|14|15|1|1|0.5|3.5|1.999999999999|3.5|010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
-18|B|16|17|1|1|3.5|2.3|3.5|4|0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','dir='B'')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  12 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-1|B|10|11|1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|||-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|||-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|11|3|1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|||1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|12|13|1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|13|3|1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|3|1|1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9|B|1|2|1|1|3|2|4|2|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10|B|3|4|1|1|2|2|2|3|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11|FT|||1|-1|3|2|3|3|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12|FT|||1|-1|2|3|3|3|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13|FT|||1|-1|3|3|4|3|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14|B|4|5|1|1|2|3|2|4|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15|B|2|6|1|1|4|2|4|3|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16|B|7|2|1|1|4|1|4|2|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-17|B|8|9|1|1|0.5|3.5|1.999999999999|3.5|010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
-18|B|14|15|1|1|3.5|2.3|3.5|4|0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','true')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  6 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-1|B|10|11|1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|11|17|-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|17|7|-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|11|3|1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|17|1|1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|12|13|1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|13|3|1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|3|1|1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9|B|1|2|1|1|3|2|4|2|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10|B|3|4|1|1|2|2|2|3|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11|FT|1|16|1|-1|3|2|3|3|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12|FT|4|16|1|-1|2|3|3|3|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13|FT|16|6|1|-1|3|3|4|3|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14|B|4|5|1|1|2|3|2|4|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15|B|2|6|1|1|4|2|4|3|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16|B|7|2|1|1|4|1|4|2|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-17|B|8|9|1|1|0.5|3.5|1.999999999999|3.5|010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
-18|B|14|15|1|1|3.5|2.3|3.5|4|0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040
- NOTICE:  PROCESSING:
- NOTICE:  pgr_createTopology('edge_table',0.0001,'the_geom','id','source','target','dir='B'')
- NOTICE:  Performing checks, please wait .....
- NOTICE:  Creating Topology, Please wait...
- NOTICE:  -------------> TOPOLOGY CREATED FOR  12 edges
- NOTICE:  Rows with NULL geometry or NULL id: 0
- NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
- NOTICE:  ----------------------------------------------
-OK
-1|B|10|11|1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|11|17|-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|17|7|-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|11|3|1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|17|1|1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|12|13|1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|13|3|1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|3|1|1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9|B|1|2|1|1|3|2|4|2|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10|B|3|4|1|1|2|2|2|3|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11|FT|1|16|1|-1|3|2|3|3|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12|FT|4|16|1|-1|2|3|3|3|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13|FT|16|6|1|-1|3|3|4|3|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14|B|4|5|1|1|2|3|2|4|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15|B|2|6|1|1|4|2|4|3|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16|B|7|2|1|1|4|1|4|2|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-17|B|8|9|1|1|0.5|3.5|1.999999999999|3.5|010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
-18|B|14|15|1|1|3.5|2.3|3.5|4|0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040
diff --git a/src/common/test/incrementalCreateTopology_any_01.test.sql b/src/common/test/incrementalCreateTopology_any_01.test.sql
deleted file mode 100644
index 77fa245..0000000
--- a/src/common/test/incrementalCreateTopology_any_01.test.sql
+++ /dev/null
@@ -1,75 +0,0 @@
-set client_min_messages  to warning;
-drop table  if exists edge_table;
-drop table if exists edge_table_vertices_pgr ;
-CREATE TABLE edge_table (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-set client_min_messages  to warning;
-
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-set client_min_messages  to notice;
-select count(*) from edge_table;
-select * from edge_table order by id;
-select * from pgr_createTopology('edge_table',0.0001);
-
-set client_min_messages  to warning;
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-set client_min_messages  to notice;
-select count(*) from edge_table;
-select * from edge_table  order by id;
-select count(*) from public.edge_table WHERE (the_geom IS NOT NULL AND id IS NOT NULL)=false  AND (true) and (source is null and target is  null);
-
--- 10 edges must be updated the rest is untouched
-select * from pgr_createTopology('edge_table',0.0001,clean:=false); 
-select * from edge_table order by id;
--- 12 edges have 'B' the rest is wiped
-select * from pgr_createTopology('edge_table',0.0001,rows_where:='dir=''B''',clean:=true); 
-select * from edge_table order by id;
--- 6 edges must be processed, the rest is untouched
-select * from pgr_createTopology('edge_table',0.0001,clean:=false); 
-select * from edge_table order by id;
-
---12 edges have 'B' the rest is untouched
-select * from pgr_createTopology('edge_table',0.0001,rows_where:='dir=''B''',clean:=false); 
-select * from edge_table order by id;
diff --git a/src/common/test/isColumnInTable-any.result b/src/common/test/isColumnInTable-any.result
deleted file mode 100644
index 26a00c1..0000000
--- a/src/common/test/isColumnInTable-any.result
+++ /dev/null
@@ -1,56 +0,0 @@
-1|t
-2|t
-3|t
-4|t
-5|t
-6|t
-7|t
-8|t
-9|t
-10|t
-11|t
-12|t
-13|t
-14|t
-15|t
-16|t
-17|t
-18|t
-19|t
-20|t
-21|t
-22|t
-23|t
-24|t
-25|t
-26|t
-27|t
-28|t
-29|t
-30|t
-31|t
-32|t
-33|t
-34|t
-35|t
-36|t
-37|t
-38|t
-39|t
-40|t
-41|t
-42|t
-43|t
-44|t
-45|t
-46|t
-47|t
-48|t
-49|t
-50|t
-51|t
-52|t
-53|t
-54|t
-55|t
-56|t
diff --git a/src/common/test/isColumnInTable-any.test.sql b/src/common/test/isColumnInTable-any.test.sql
deleted file mode 100644
index 3e34e14..0000000
--- a/src/common/test/isColumnInTable-any.test.sql
+++ /dev/null
@@ -1,103 +0,0 @@
-set client_min_messages  to warning;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop schema if exists s2 cascade;
-drop schema if exists "S2" cascade; 
-drop schema if exists s3 cascade; 
-
-create schema s1;
-create schema s2;
-create schema "S2";
-create schema s3;
-create table streets (id serial PRIMARY KEY,source integer,target integer);
-create table "Streets" (ID serial PRIMARY KEY,SOURCE integer,TARGET integer);
-create table s1.streets ("ID" serial PRIMARY KEY,sour integer,targ integer);
-create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
-create table s2."Streets" (id serial ,source integer,target integer);
-create table "S2".streets (id serial ,source integer,target integer);
-create table s3."Streets" (id serial ,source integer,target integer);
-create table s3."sTreets" (id serial ,source integer,target integer);
-create table s3."StrEets" (id serial ,source integer,target integer);
-
-set client_min_messages to warning;
-
-
-select 1,   _pgr_isColumnInTable('streets','id') = true;
-select 2,   _pgr_isColumnInTable('streets','source') = true;
-select 3,   _pgr_isColumnInTable('streets','target') = true;
-select 4,   _pgr_isColumnInTable('streets','ID') = true;
-select 5,   _pgr_isColumnInTable('streets','Source') = true;
-select 6,   _pgr_isColumnInTable('streets','Target') = true;
-select 7,   _pgr_isColumnInTable('Streets','id') = true;
-select 8,   _pgr_isColumnInTable('Streets','source') = true;
-select 9,   _pgr_isColumnInTable('Streets','target') = true;
-select 10,   _pgr_isColumnInTable('Streets','ID') = true;
-select 11,   _pgr_isColumnInTable('Streets','SOURCE') = true;
-select 12,   _pgr_isColumnInTable('Streets','Target') = true;
-select 13,   _pgr_isColumnInTable('s1.streets','ID') = true;
-select 14,   _pgr_isColumnInTable('s1.streets','Targ') = true;
-select 15,   _pgr_isColumnInTable('s1.Streets','ID') = true;
-select 16,   _pgr_isColumnInTable('s1.Streets','SOURCE') = true;
-select 17,   _pgr_isColumnInTable('s1.Streets','Target') = true;
-
-
-select 18,   _pgr_isColumnInTable('streets','Targ') = false;
-select 19,   _pgr_isColumnInTable('Streets','Targ') = false;
-select 20,   _pgr_isColumnInTable('s1.STREETS','id') = false;
-select 21,   _pgr_isColumnInTable('s1.STREETS','source') = false;
-select 22,   _pgr_isColumnInTable('s1.stReets','target') = false;
-select 23,   _pgr_isColumnInTable('s1.streets','SOURCE') = false;
-select 24,   _pgr_isColumnInTable('s1.streets','Target') = false;
-select 25,   _pgr_isColumnInTable('s1.Streets','id') = false;
-select 26,   _pgr_isColumnInTable('s1.Streets','source') = false;
-select 27,   _pgr_isColumnInTable('s1.Streets','target') = false;
-select 28,   _pgr_isColumnInTable('s1.Streets','Targ') = false;
-
-
-SET search_path TO s1,public;
-
-select 29,   _pgr_isColumnInTable('streets','ID') = true;
-select 30,   _pgr_isColumnInTable('streets','Targ') = true;
-select 31,   _pgr_isColumnInTable('Streets','ID') = true;
-select 32,   _pgr_isColumnInTable('Streets','SOURCE') = true;
-select 33,   _pgr_isColumnInTable('Streets','Target') = true;
-select 34,   _pgr_isColumnInTable('s1.streets','ID') = true;
-select 35,   _pgr_isColumnInTable('s1.streets','Targ') = true;
-select 36,   _pgr_isColumnInTable('s1.Streets','ID') = true;
-select 37,   _pgr_isColumnInTable('s1.Streets','SOURCE') = true;
-select 38,   _pgr_isColumnInTable('s1.Streets','Target') = true;
-
-
-select 39,   _pgr_isColumnInTable('streets','id') = false;
-select 40,   _pgr_isColumnInTable('streets','source') = false;
-select 41,   _pgr_isColumnInTable('streets','target') = false;
-select 42,   _pgr_isColumnInTable('streets','Source') = false;
-select 43,   _pgr_isColumnInTable('streets','Target') = false;
-select 44,   _pgr_isColumnInTable('Streets','id') = false;
-select 45,   _pgr_isColumnInTable('Streets','source') = false;
-select 46,   _pgr_isColumnInTable('Streets','target') = false;
-select 47,   _pgr_isColumnInTable('Streets','Targ') = false;
-select 48,   _pgr_isColumnInTable('s1.STREETS','id') = false;
-select 49,   _pgr_isColumnInTable('s1.STREETS','source') = false;
-select 50,   _pgr_isColumnInTable('s1.stReets','target') = false;
-select 51,   _pgr_isColumnInTable('s1.streets','SOURCE') = false;
-select 52,   _pgr_isColumnInTable('s1.streets','Target') = false;
-select 53,   _pgr_isColumnInTable('s1.Streets','id') = false;
-select 54,   _pgr_isColumnInTable('s1.Streets','source') = false;
-select 55,   _pgr_isColumnInTable('s1.Streets','target') = false;
-select 56,   _pgr_isColumnInTable('s1.Streets','Targ') = false;
-
-set client_min_messages  to warning;
-
-SET search_path TO public, "$user";
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop schema if exists s2 cascade;
-drop schema if exists "S2" cascade; 
-drop schema if exists s3 cascade; 
-
-
diff --git a/src/common/test/isColumnIndexed-any.result b/src/common/test/isColumnIndexed-any.result
deleted file mode 100644
index 9edf057..0000000
--- a/src/common/test/isColumnIndexed-any.result
+++ /dev/null
@@ -1,56 +0,0 @@
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
-t
diff --git a/src/common/test/isColumnIndexed-any.test.sql b/src/common/test/isColumnIndexed-any.test.sql
deleted file mode 100644
index 8e9287a..0000000
--- a/src/common/test/isColumnIndexed-any.test.sql
+++ /dev/null
@@ -1,103 +0,0 @@
-set client_min_messages  to warning;
-
-SET search_path TO "$user", public;
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop schema if exists s2 cascade;
-drop schema if exists "S2" cascade;
-drop schema if exists s3 cascade;
-
-create schema s1;
-create schema s2;
-create schema "S2";
-create schema s3;
-create table streets (id serial PRIMARY KEY,source integer,target integer);
-create table "Streets" (ID serial PRIMARY KEY,SOURCE integer,TARGET integer);
-create table s1.streets ("ID" serial PRIMARY KEY,sour integer,targ integer);
-create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
-create table s2."Streets" (id serial ,source integer,target integer);
-create table "S2".streets (id serial ,source integer,target integer);
-create table s3."Streets" (id serial ,source integer,target integer);
-create table s3."sTreets" (id serial ,source integer,target integer);
-create table s3."StrEets" (id serial ,source integer,target integer);
-
-set client_min_messages to warning;
-
-
-
-select _pgr_isColumnIndexed('streets','id') = true;
-select _pgr_isColumnIndexed('streets','ID') = true;
-select _pgr_isColumnIndexed('Streets','id') = true;
-select _pgr_isColumnIndexed('Streets','ID') = true;
-select _pgr_isColumnIndexed('s1.streets','ID') = true;
-select _pgr_isColumnIndexed('s1.Streets','ID') = true;
-
-select _pgr_isColumnIndexed('streets','source') = false;
-select _pgr_isColumnIndexed('streets','target') = false;
-select _pgr_isColumnIndexed('streets','Source') = false;
-select _pgr_isColumnIndexed('streets','Target') = false;
-select _pgr_isColumnIndexed('streets','Targ') = false;
-select _pgr_isColumnIndexed('Streets','source') = false;
-select _pgr_isColumnIndexed('Streets','target') = false;
-select _pgr_isColumnIndexed('Streets','SOURCE') = false;
-select _pgr_isColumnIndexed('Streets','Target') = false;
-select _pgr_isColumnIndexed('Streets','Targ') = false;
-select _pgr_isColumnIndexed('s1.STREETS','id') = false;
-select _pgr_isColumnIndexed('s1.STREETS','source') = false;
-select _pgr_isColumnIndexed('s1.stReets','target') = false;
-select _pgr_isColumnIndexed('s1.streets','SOURCE') = false;
-select _pgr_isColumnIndexed('s1.streets','Target') = false;
-select _pgr_isColumnIndexed('s1.streets','Targ') = false;
-select _pgr_isColumnIndexed('s1.Streets','id') = false;
-select _pgr_isColumnIndexed('s1.Streets','source') = false;
-select _pgr_isColumnIndexed('s1.Streets','target') = false;
-select _pgr_isColumnIndexed('s1.Streets','SOURCE') = false;
-select _pgr_isColumnIndexed('s1.Streets','Target') = false;
-select _pgr_isColumnIndexed('s1.Streets','Targ') = false;
-
-
-SET search_path TO s1,public;
-
-select _pgr_isColumnIndexed('streets','ID') = true;
-select _pgr_isColumnIndexed('Streets','ID') = true;
-select _pgr_isColumnIndexed('s1.streets','ID') = true;
-select _pgr_isColumnIndexed('s1.Streets','ID') = true;
-
-select _pgr_isColumnIndexed('streets','id') = false;
-select _pgr_isColumnIndexed('streets','source') = false;
-select _pgr_isColumnIndexed('streets','target') = false;
-select _pgr_isColumnIndexed('streets','Source') = false;
-select _pgr_isColumnIndexed('streets','Target') = false;
-select _pgr_isColumnIndexed('streets','Targ') = false;
-select _pgr_isColumnIndexed('Streets','id') = false;
-select _pgr_isColumnIndexed('Streets','source') = false;
-select _pgr_isColumnIndexed('Streets','target') = false;
-select _pgr_isColumnIndexed('Streets','SOURCE') = false;
-select _pgr_isColumnIndexed('Streets','Target') = false;
-select _pgr_isColumnIndexed('Streets','Targ') = false;
-select _pgr_isColumnIndexed('s1.STREETS','id') = false;
-select _pgr_isColumnIndexed('s1.STREETS','source') = false;
-select _pgr_isColumnIndexed('s1.stReets','target') = false;
-select _pgr_isColumnIndexed('s1.streets','SOURCE') = false;
-select _pgr_isColumnIndexed('s1.streets','Target') = false;
-select _pgr_isColumnIndexed('s1.streets','Targ') = false;
-select _pgr_isColumnIndexed('s1.Streets','id') = false;
-select _pgr_isColumnIndexed('s1.Streets','source') = false;
-select _pgr_isColumnIndexed('s1.Streets','target') = false;
-select _pgr_isColumnIndexed('s1.Streets','SOURCE') = false;
-select _pgr_isColumnIndexed('s1.Streets','Target') = false;
-select _pgr_isColumnIndexed('s1.Streets','Targ') = false;
-
-set client_min_messages  to warning;
-
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop schema if exists s2 cascade;
-drop schema if exists "S2" cascade;
-drop schema if exists s3 cascade;
-
-
diff --git a/src/common/test/makeTests.sh b/src/common/test/makeTests.sh
deleted file mode 100644
index 3e0c9cd..0000000
--- a/src/common/test/makeTests.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-psql  -U postgres -h localhost -A -t -q -f common-any-00.data pgr_test 
-psql  -U postgres -h localhost -A -t -q -f common-any-01.data pgr_test 
-
-psql  -U postgres -h localhost -A -t -q -f versionless-any-01.test pgr_test &> versionless-any-01.aaa
-sed s/psql:versionless-any-01.test:[0-9]*:// <versionless-any-01.aaa >versionless-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f common-any-01.test pgr_test &> common-any-01.aaa
-sed s/psql:common-any-01.test:[0-9]*:// <common-any-01.aaa >common-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f common-any-02.test pgr_test &> common-any-02.aaa
-sed s/psql:common-any-02.test:[0-9]*:// <common-any-02.aaa >common-any-02.rest
-
-psql  -U postgres -h localhost -A -t -q -f common-any-03.test pgr_test &> common-any-03.aaa
-sed s/psql:common-any-03.test:[0-9]*:// <common-any-03.aaa >common-any-03.rest
-
-psql  -U postgres -h localhost -A -t -q -f common-any-04.test pgr_test &> common-any-04.aaa
-sed s/psql:common-any-04.test:[0-9]*:// <common-any-04.aaa >common-any-04.rest
-
-psql  -U postgres -h localhost -A -t -q -f common-any-05.test pgr_test &> common-any-05.aaa
-sed s/psql:common-any-05.test:[0-9]*:// <common-any-05.aaa >common-any-05.rest
-
-psql  -U postgres -h localhost -A -t -q -f gettablename-any-01.test pgr_test &> gettablename-any-01.aaa
-sed s/psql:gettablename-any-01.test:[0-9]*:// <gettablename-any-01.aaa >gettablename-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f createTopology-any-01.test pgr_test &> createTopology-any-01.aaa
-sed s/psql:createTopology-any-01.test:[0-9]*:// <createTopology-any-01.aaa >createTopology-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f createVerticesTable-any-01.test pgr_test &> createVerticesTable-any-01.aaa
-sed s/psql:createVerticesTable-any-01.test:[0-9]*:// <createVerticesTable-any-01.aaa >createVerticesTable-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f routweb-any-01.test pgr_test &> routweb-any-01.aaa
-sed s/psql:routweb-any-01.test:[0-9]*:// <routweb-any-01.aaa >routweb-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f topoweb-any-01.test pgr_test &> topoweb-any-01.aaa
-sed s/psql:topoweb-any-01.test:[0-9]*:// <topoweb-any-01.aaa >topoweb-any-01.rest
-
-psql  -U postgres -h localhost -A -t -q -f pgr_getColumnName_any_01.test pgr_test &> pgr_getColumnName_any_01.test.aaa
-sed s/psql:pgr_getColumnName_any_01.test:[0-9]*:// <pgr_getColumnName_any_01.test.aaa >pgr_getColumnName_any_01.rest
-
-psql  -U postgres -h localhost -A -t -q -f pgr_getColumnType_any_01.test pgr_test &> pgr_getColumnType_any_01.aaa
-sed s/psql:pgr_getColumnType_any_01.test:[0-9]*:// <pgr_getColumnType_any_01.aaa >pgr_getColumnType_any_01.rest
-
-psql  -U postgres -h localhost -A -t -q -f pgr_checkVertTab_any_01.test pgr_test &> pgr_checkVertTab_any_01.aaa
-sed s/psql:pgr_checkVertTab_any_01.test:[0-9]*:// <pgr_checkVertTab_any_01.aaa >pgr_checkVertTab_any_01.rest
-
-psql  -U postgres -h localhost -A -t -q -f incrementalCreateTopology_any_01.test  pgr_test &> incrementalCreateTopology_any_01.aaa
-sed s/psql:incrementalCreateTopology_any_01.test:[0-9]*:// <incrementalCreateTopology_any_01.aaa >incrementalCreateTopology_any_01.rest 
-
-rm *.aaa
diff --git a/src/common/test/no_underscored-2x.result b/src/common/test/no_underscored-2x.result
deleted file mode 100644
index 718f67e..0000000
--- a/src/common/test/no_underscored-2x.result
+++ /dev/null
@@ -1,36 +0,0 @@
- NOTICE:  pgr_getTableName: This function will no longer be soported
-1|t
- NOTICE:  pgr_getTableName: This function will no longer be soported
-2|t
- NOTICE:  pgr_getColumnName: This function will no longer be soported
-3|t
- NOTICE:  pgr_getColumnName: This function will no longer be soported
-4|t
- NOTICE:  pgr_getColumnName: This function will no longer be soported
-5|t
- NOTICE:  pgr_getColumnName: This function will no longer be soported
-6|t
- NOTICE:  pgr_isColumnInTable: This function will no longer be soported
-7|t
- NOTICE:  pgr_isColumnInTable: This function will no longer be soported
-8|f
- NOTICE:  pgr_isColumnInTable: This function will no longer be soported
-9|f
- NOTICE:  pgr_isColumnInTable: This function will no longer be soported
-10|f
- NOTICE:  pgr_isColumnIndexed: This function will no longer be soported
-11|t
- NOTICE:  pgr_isColumnIndexed: This function will no longer be soported
-12|f
- NOTICE:  pgr_versionless: This function will no longer be soported
-13|t
- NOTICE:  pgr_versionless: This function will no longer be soported
-14|t
- NOTICE:  pgr_versionless: This function will no longer be soported
-15|t
- NOTICE:  pgr_isColumnInTable: This function will no longer be soported
-16|t
- NOTICE:  pgr_startPoint: This function will no longer be soported
-17|t
- NOTICE:  pgr_endPoint: This function will no longer be soported
-18|t
diff --git a/src/common/test/no_underscored-2x.test.sql b/src/common/test/no_underscored-2x.test.sql
deleted file mode 100644
index 0dbbef0..0000000
--- a/src/common/test/no_underscored-2x.test.sql
+++ /dev/null
@@ -1,28 +0,0 @@
-
-set client_min_messages to notice;
-select 1, sname = 'public' and tname = 'edges2' from pgr_getTableName('EDGes2');
-select 2, sname = 'public' and tname is null from pgr_getTableName('EDes2');
-
-select 3,  pgr_getColumnName('EDGes2', 'SOuRce') = 'source';
-select 4,  pgr_getColumnName('EDes2', 'SOuRce') is null;
-select 5,  pgr_getColumnName('EDes2', 'SOuce') is null;
-select 6,  pgr_getColumnName('EDes2', 'SOuce') is null;
-
-select 7, pgr_isColumnInTable('EDGes2', 'SOuRce') = true;
-select 8, pgr_isColumnInTable('EDes2', 'SOuRce');
-select 9, pgr_isColumnInTable('EDes2', 'SOuce');
-select 10, pgr_isColumnInTable('EDes2', 'SOuce');
-
-select 11, pgr_isColumnIndexed('EDGes2', 'eid') = true;
-select 12, pgr_isColumnIndexed('EDGes2', 'X1');
-
-select 13, pgr_versionless('2.1.0foobar23', '2.1') = true;
-select 14, pgr_versionless('2.1.0foobar23', '2.1-rc1') = true;
-select 15, pgr_versionless('2.1.0foobar23', '2.1-beta') = true;
-
-select 16, pgr_quote_ident('idname.text') = 'idname.text';
-
-select 17, pgr_startPoint(the_geom) = '010100000000000000000000400000000000000000' from edges2 where eid = 1;
-select 18, pgr_endPoint(the_geom) = '01010000000000000000000040000000000000F03F'  from edges2 where eid = 1;
-
-
diff --git a/src/common/test/pgr_checkVertTab_any_01.result b/src/common/test/pgr_checkVertTab_any_01.result
deleted file mode 100644
index 9a3ce0a..0000000
--- a/src/common/test/pgr_checkVertTab_any_01.result
+++ /dev/null
@@ -1,13 +0,0 @@
-test #1:OK
-test #2:OK
-test #3:OK
-test #4:OK
-test #5:OK
-test #6:OK
-test #7:OK
-test #8:OK
-test #9:OK
-
-
-test #10:OK
-test #11:OK
diff --git a/src/common/test/pgr_checkVertTab_any_01.test.sql b/src/common/test/pgr_checkVertTab_any_01.test.sql
deleted file mode 100644
index 4e55a7b..0000000
--- a/src/common/test/pgr_checkVertTab_any_01.test.sql
+++ /dev/null
@@ -1,96 +0,0 @@
-
-set client_min_messages  to warning;
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop function if exists make_tests_return_text(text,text,int);
-
-
-create schema s1;
-create table streets (id serial PRIMARY KEY,source integer,target integer);
-create table "Streets" (GID serial PRIMARY KEY,SOURCE integer,TARGET integer);
-create table s1.streets ("ID" serial PRIMARY KEY,sour integer,targ integer);
-create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
-
-create or replace function make_tests_return_tab(query text,result text,testnumber int default 0)
-RETURNS text AS
-$BODY$
-DECLARE
-    returnvalue text;
-    naming record;
-    err boolean;
-BEGIN
-    if (result is null) then  result='NULL'; end if;
-   execute query into naming;
-   returnvalue=naming.sname||'.'||naming.vname;
-   if (returnvalue is null) then returnvalue='NULL'; end if;
-   if (returnvalue=result) then
-      return 'test #'|| testnumber || ':OK';
-   else
-      return 'test #'|| testnumber || ':got '||returnvalue;
-   end if;
-END;
-$BODY$
-LANGUAGE plpgsql VOLATILE ;
-
-create or replace function make_tests_return_text(query text,result text,testnumber int default 0)
-RETURNS text AS
-$BODY$
-DECLARE
-    returnvalue text;
-    naming record;
-    err boolean;
-BEGIN
-    if (result is null) then  result='NULL'; end if;
-   execute query into returnvalue;
-   if (returnvalue is null) then returnvalue='NULL'; end if;
-   if (returnvalue=result) then
-      return 'test #'|| testnumber || ':OK';
-   else
-      return 'test #'|| testnumber || ':got '||returnvalue;
-   end if;
-END;
-$BODY$
-LANGUAGE plpgsql VOLATILE ;
-
-create or replace function make_tests_return_text(query text,result boolean,testnumber int default 0)
-RETURNS text AS
-$BODY$
-DECLARE
-    returnvalue boolean;
-    naming record;
-    err boolean;
-BEGIN
-    if (result is null) then  result='NULL'; end if;
-   execute query into returnvalue;
-   if (returnvalue is null) then returnvalue='NULL'; end if;
-
-   if (returnvalue=result) then
-      return 'test #'|| testnumber || ':OK';
-   else
-      return 'test #'|| testnumber || ':got '||returnvalue;
-   end if;
-END;
-$BODY$
-LANGUAGE plpgsql VOLATILE ;
-
-
-set client_min_messages  to notice;
-
-select * from make_tests_return_text('select * from  _pgr_isColumnInTable (''streets'',''id'')',  true,1);
-select * from make_tests_return_text('select * from  _pgr_isColumnInTable (''streets'',''cnt'')',  false,2);
-select * from make_tests_return_text('select * from  _pgr_isColumnInTable (''streets'',''chk'')',  false,3);
-select * from make_tests_return_tab('select * from  _pgr_checkVertTab(''streets'', ''{"id","cnt","chk"}''::text[])','public.streets',4);
-select * from make_tests_return_text('select * from  _pgr_isColumnInTable (''streets'',''cnt'')',  true,5);
-select * from make_tests_return_text('select * from  _pgr_isColumnInTable (''streets'',''cnt'')',  true,6);
-select * from make_tests_return_text('select * from  _pgr_isColumnInTable (''streets'',''chk'')',  true,7);
-
-select * from make_tests_return_text('select * from  _pgr_isColumnIndexed (''streets'',''cnt'')',  false,8);
-select * from make_tests_return_text('select * from  _pgr_isColumnIndexed (''streets'',''chk'')',  false,9);
-select * from  _pgr_createIndex ('streets','chk','foo');
-select * from  _pgr_createIndex ('streets','cnt','btree');
-select * from make_tests_return_text('select * from  _pgr_isColumnIndexed (''streets'',''cnt'')',  true,10);
-select * from make_tests_return_text('select * from  _pgr_isColumnIndexed (''streets'',''chk'')',  true,11);
-
diff --git a/src/common/test/pgr_getColumnName_any_01.result b/src/common/test/pgr_getColumnName_any_01.result
deleted file mode 100644
index fa34a14..0000000
--- a/src/common/test/pgr_getColumnName_any_01.result
+++ /dev/null
@@ -1,32 +0,0 @@
-test #1:OK
-test #2:OK
-test #3:OK
-test #4:OK
-test #5:OK
-test #6:OK
-test #7:OK
-test #8:OK
-test #9:OK
-test #10:OK
-test #11:OK
-test #12:OK
-test #13:OK
-test #14:OK
-test #15:OK
-test #16:OK
-test #17:OK
-test #18:OK
-test #19:OK
-test #20:OK
-test #21:OK
-test #22:OK
-test #23:OK
-test #24:OK
-test #25:OK
-test #26:OK
-test #27:OK
-test #28:OK
-test #29:OK
-test #30:OK
-test #31:OK
-test #32:OK
diff --git a/src/common/test/pgr_getColumnName_any_01.test.sql b/src/common/test/pgr_getColumnName_any_01.test.sql
deleted file mode 100644
index 0e37ebe..0000000
--- a/src/common/test/pgr_getColumnName_any_01.test.sql
+++ /dev/null
@@ -1,87 +0,0 @@
-
-set client_min_messages  to warning;
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop function if exists make_tests_return_text(text,text,int);
-
-
-create schema s1;
-create table streets (id serial PRIMARY KEY,source integer,target integer);
-create table "Streets" (GID serial PRIMARY KEY,SOURCE integer,TARGET integer);
-create table s1.streets ("ID" serial PRIMARY KEY,sour integer,targ integer);
-create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
-
-create or replace function make_tests_return_text(query text,result text,testnumber int default 0)
-RETURNS text AS
-$BODY$
-DECLARE
-    returnvalue text;
-    naming record;
-    err boolean;
-BEGIN
-    if (result is null) then  result='NULL'; end if;
-   execute query into returnvalue;
-   if (returnvalue is null) then returnvalue='NULL'; end if;
-   if (returnvalue=result) then
-      return 'test #'|| testnumber || ':OK';
-   else
-      return 'test #'|| testnumber || ':got '||returnvalue;
-   end if;
-END;
-$BODY$
-LANGUAGE plpgsql VOLATILE ;
-set client_min_messages  to warning;
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''streets'',''id'')',  'id',1);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''streets'',''ID'')',  'id',2);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''Streets'',''gid'')',  'gid',3);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''Streets'',''GID'')',  'gid',4);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''Streets'',''ID'')',  NULL,5);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1.streets'',''ID'')',  'ID',6);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1.streets'',''id'')',  NULL,7);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1.Streets'',''id'')',  NULL,8); 
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1.Streets'',''ID'')',  'ID',9);  
-
-SET search_path TO  s1,public;
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public.streets'',''ID'')',  'id',10);
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public.Streets'',''GID'')',  'gid',11);
-
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''streets'',''ID'')',  'ID',12);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''streets'',''id'')',  NULL,13);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''Streets'',''id'')',  NULL,14); 
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''Streets'',''ID'')',  'ID',15);
-
-SET search_path TO "$user", public;
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''streets'',''id'')',  'id',16);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''streets'',''ID'')',  'id',17);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''Streets'',''gid'')',  'gid',18);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''Streets'',''GID'')',  'gid',19);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''Streets'',''ID'')',  NULL,20);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''streets'',''ID'')',  'ID',21);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''streets'',''id'')',  NULL,22);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''Streets'',''id'')',  NULL,23); 
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''Streets'',''ID'')',  'ID',24);  
-
-SET search_path TO  s1,public;
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''streets'',''ID'')',  'id',25);
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''Streets'',''GID'')',  'gid',26);
-
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''streets'',''ID'')',  'ID',27);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''streets'',''id'')',  NULL,28);  
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''Streets'',''id'')',  NULL,29); 
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''s1'',''Streets'',''ID'')',  'ID',30);
-
--- becuase this dont test for schema or table names the expected results are NULL
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''publIc'',''Streets'',''gid'')',  NULL,31);
-select * from make_tests_return_text('select * from  _pgr_getColumnName (''public'',''StrEets'',''gid'')', NULL,32);
-
-set client_min_messages  to warning;
-
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop function make_tests_return_text(text,text,int);
diff --git a/src/common/test/pgr_getColumnType_any_01.result b/src/common/test/pgr_getColumnType_any_01.result
deleted file mode 100644
index 56ba077..0000000
--- a/src/common/test/pgr_getColumnType_any_01.result
+++ /dev/null
@@ -1,21 +0,0 @@
-test #1:OK
-test #2:OK
-test #3:OK
-test #4:OK
-test #5:OK
-test #6:OK
-test #7:OK
-test #8:OK
-test #9:OK
-test #10:OK
-test #11:OK
-test #12:OK
-test #13:OK
-test #14:OK
-test #12:OK
-test #15:OK
-test #16:OK
-test #17:OK
-test #18:OK
-test #19:OK
-test #20:OK
diff --git a/src/common/test/pgr_getColumnType_any_01.test.sql b/src/common/test/pgr_getColumnType_any_01.test.sql
deleted file mode 100644
index 856f5a3..0000000
--- a/src/common/test/pgr_getColumnType_any_01.test.sql
+++ /dev/null
@@ -1,76 +0,0 @@
-
-set client_min_messages  to warning;
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop function if exists make_tests_return_text(text,text,int);
-
-
-create schema s1;
-create table streets (id serial PRIMARY KEY,source double precision,target real);
-create table "Streets" (GID bigserial PRIMARY KEY,SOURCE text,TARGET integer);
-create table s1.streets ("ID" serial PRIMARY KEY,sour double precision,targ real);
-create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
-
-create or replace function make_tests_return_text(query text,result text,testnumber int default 0)
-RETURNS text AS
-$BODY$
-DECLARE
-    returnvalue text;
-    naming record;
-    err boolean;
-BEGIN
-    if (result is null) then  result='NULL'; end if;
-   execute query into returnvalue;
-   if (returnvalue is null) then returnvalue='NULL'; end if;
-   if (returnvalue=result) then
-      return 'test #'|| testnumber || ':OK';
-   else
-      return 'test #'|| testnumber || ':got '||returnvalue;
-   end if;
-END;
-$BODY$
-LANGUAGE plpgsql VOLATILE ;
-set client_min_messages  to notice;
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''streets'',''id'')',  'integer',	1);
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''streets'',''source'')',  'double precision',	2);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''streets'',''target'')',  'real',	3);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''Streets'',''GID'')',  'bigint',	4);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''Streets'',''SOURCE'')',  'text',	5);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''Streets'',''TARGET'')',  'integer',	6);  
-
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''s1.streets'',''ID'')',  'integer',	7);
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''s1.streets'',''sour'')', 'double precision',	8);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''s1.streets'',''targ'')', 'real',	9);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''s1.Streets'',''ID'')',  'integer',	10);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''s1.Streets'',''SOURCE'')','integer',	11);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''s1.Streets'',''Target'')','integer',	12);  
-
-SET search_path TO  s1,public;
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''public.streets'',''ID'')',  'integer',13);
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''public.Streets'',''GID'')',  'bigint',14);
-
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''streets'',''ID'')',	'integer',	12);  
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''Streets'',''ID'')',	'integer',	15);
-
-SET search_path TO "$user", public;
---NULL when table or column doesnt exist
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''Streets'',''data'',0)',	NULL,	16);
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''strats'',''id'',0)', 		NULL,	17);
-
--- becuase this dont test for schema or table names the expected results are NULL
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''publIc'',''Streets'',''gid'')',  NULL, 18);
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''public'',''StrEets'',''gid'')',  NULL, 19);
-select * from make_tests_return_text('select * from  _pgr_getColumnType (''public'',''Streets'',''data'')',  NULL, 20);
-
-set client_min_messages  to warning;
-
-SET search_path TO "$user", public;
-
-drop table if exists streets;
-drop table if exists "Streets";
-drop schema if exists s1 cascade;
-drop function make_tests_return_text(text,text,int);
-
diff --git a/src/common/test/pgrouting_conversion_tools-any-01.result b/src/common/test/pgrouting_conversion_tools-any-01.result
deleted file mode 100644
index e3abd77..0000000
--- a/src/common/test/pgrouting_conversion_tools-any-01.result
+++ /dev/null
@@ -1,25 +0,0 @@
----- pgr_pointtoedgenode ----
-1
-6
----- pgr_flipedges ----
-LINESTRING(2 1,2 2)
-LINESTRING(2 2,2 3)
-LINESTRING(2 3,2 2)
-LINESTRING(2 2,3 2)
-LINESTRING(3 2,4 2)
-LINESTRING(4 2,4 1)
-LINESTRING(4 1,3 1)
-LINESTRING(3 1,2 1)
-LINESTRING(2 1,2 0)
-LINESTRING(2 0,2 1)
----- pgr_texttopoints ----
-POINT(0 0)
-POINT(1 1)
-POINT(1 0)
-POINT(0 1)
-POINT(1 4)
-POINT(1 5)
-POINT(0 4)
-POINT(0 5)
----- pgr_pointstovids ----
-{1,2,3,5,4,9,10,6}
diff --git a/src/common/test/pgrouting_conversion_tools-any-01.test.sql b/src/common/test/pgrouting_conversion_tools-any-01.test.sql
deleted file mode 100644
index 0efa189..0000000
--- a/src/common/test/pgrouting_conversion_tools-any-01.test.sql
+++ /dev/null
@@ -1,23 +0,0 @@
-\echo '---- pgr_pointtoedgenode ----'
-select pgr_pointtoedgenode('edge_table', 'POINT(2 0)'::geometry, 0.02);
-select pgr_pointtoedgenode('edge_table', 'POINT(3 2)'::geometry, 0.02);
-
-\echo '---- pgr_flipedges ----'
-select st_astext(e) from (select unnest(pgr_flipedges(ARRAY[
-'LINESTRING(2 1,2 2)'::geometry,
-'LINESTRING(2 2,2 3)'::geometry,
-'LINESTRING(2 2,2 3)'::geometry,
-'LINESTRING(2 2,3 2)'::geometry,
-'LINESTRING(3 2,4 2)'::geometry,
-'LINESTRING(4 1,4 2)'::geometry,
-'LINESTRING(3 1,4 1)'::geometry,
-'LINESTRING(2 1,3 1)'::geometry,
-'LINESTRING(2 0,2 1)'::geometry,
-'LINESTRING(2 0,2 1)'::geometry]::geometry[])) as e) as foo;
-
-\echo '---- pgr_texttopoints ----'
-select st_astext(g) from (select unnest(pgr_texttopoints('0,0;1,1;1,0;0,1;1,4;1,5;0,4;0,5', 0)) as g) as foo;
-
-\echo '---- pgr_pointstovids ----'
-select * from pgr_pointstovids(pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0), 'edge_table');
-
diff --git a/src/common/test/pgrouting_dmatrix_tools-any-01.result b/src/common/test/pgrouting_dmatrix_tools-any-01.result
deleted file mode 100644
index 0be4fc4..0000000
--- a/src/common/test/pgrouting_dmatrix_tools-any-01.result
+++ /dev/null
@@ -1,11 +0,0 @@
----- pgr_pointstodmatrix ----
-{{0,1,1.4142135623731,2,2.23606797749979,2.82842712474619,3,2.23606797749979},{1,0,1,1,2,2.23606797749979,2,1.4142135623731},{1.4142135623731,1,0,1.4142135623731,1,1.4142135623731,2.23606797749979,1},{2,1,1.4142135623731,0,2.23606797749979,2,1,1},{2.23606797749979,2,1,2.23606797749979,0,1,2.82842712474619,1.4142135623731},{2.82842712474619,2.23606797749979,1.4142135623731,2,1,0,2.23606797749979,1},{3,2,2.23606797749979,1,2.82842712474619,2.23606797749979,0,1.4142135623731},{2.23606797749 [...]
----- pgr_vidstodmatrix ----
-0|1
-1|3
-2|7
-3|5
-4|4
-5|2
-6|6
-7|0
diff --git a/src/common/test/pgrouting_dmatrix_tools-any-01.test.sql b/src/common/test/pgrouting_dmatrix_tools-any-01.test.sql
deleted file mode 100644
index e0009f7..0000000
--- a/src/common/test/pgrouting_dmatrix_tools-any-01.test.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-\echo '---- pgr_pointstodmatrix ----'
-select * from pgr_pointstodmatrix(pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0));
-
-\echo '---- pgr_vidstodmatrix ----'
-select * from pgr_tsp(
-    (select dmatrix::float8[]
-       from pgr_vidstodmatrix(
-                pgr_pointstovids(
-                    pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0),
-                    'edge_table'), 
-                pgr_texttopoints('2,0;2,1;3,1;2,2;4,1;4,2;2,3;3,2', 0),
-                'edge_table')
-    ),
-    1
-);
-
diff --git a/src/common/test/pgtap/checkVertTab.test.sql b/src/common/test/pgtap/checkVertTab.test.sql
new file mode 100644
index 0000000..b6103de
--- /dev/null
+++ b/src/common/test/pgtap/checkVertTab.test.sql
@@ -0,0 +1,30 @@
+
+\i setup.sql
+
+SELECT plan(12);
+
+
+SET client_min_messages  to WARNING;
+
+SELECT has_column( 'edge_table_vertices_pgr', 'cnt', '1' );
+SELECT has_column( 'edge_table_vertices_pgr', 'chk', '2' );
+SELECT results_eq( 'SELECT  3, * FROM  _pgr_checkVertTab(''edge_table_vertices_pgr'', ''{"id","cnt","chk"}''::text[]) ',
+    'SELECT 3, ''public''::TEXT,''edge_table_vertices_pgr''::TEXT');
+SELECT has_column( 'edge_table_vertices_pgr', 'cnt', '4' );
+SELECT has_column( 'edge_table_vertices_pgr', 'chk', '5' );
+
+SELECT hasnt_column( 'edge_table', 'cnt', '6' );
+SELECT hasnt_column( 'edge_table', 'chk', '7' );
+SELECT has_column( 'edge_table', 'id', '8' );
+SELECT results_eq( 'SELECT  9, * FROM  _pgr_checkVertTab(''edge_table'', ''{"id","cnt","chk"}''::text[]) ',
+    'SELECT 9, ''public''::TEXT,''edge_table''::TEXT');
+SELECT has_column( 'edge_table', 'cnt', '10' );
+SELECT has_column( 'edge_table', 'chk', '11' );
+
+SELECT throws_ok('SELECT  * FROM  _pgr_checkVertTab(''no_table'', ''{"id","cnt","chk"}''::text[])',
+    'P0001', 'raise_exception', '12');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/common/test/pgtap/getColumnName.test.sql b/src/common/test/pgtap/getColumnName.test.sql
new file mode 100644
index 0000000..2d96f1f
--- /dev/null
+++ b/src/common/test/pgtap/getColumnName.test.sql
@@ -0,0 +1,62 @@
+
+\i setup.sql
+
+SELECT plan(32);
+
+SET client_min_messages  to WARNING;
+SET search_path TO "$user", public;
+
+CREATE schema s1;
+CREATE TABLE streets (id SERIAL PRIMARY KEY,source INTEGER,target INTEGER);
+CREATE TABLE "Streets" (GID SERIAL PRIMARY KEY,SOURCE INTEGER,TARGET INTEGER);
+CREATE TABLE s1.streets ("ID" SERIAL PRIMARY KEY,sour INTEGER,targ INTEGER);
+CREATE TABLE s1."Streets" ("ID" SERIAL PRIMARY KEY,"SOURCE" INTEGER,"Target" INTEGER);
+
+SELECT  results_eq('SELECT _pgr_getColumnName (''streets'',''id''), 1', 'SELECT ''id''::TEXT, 1');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''streets'',''ID''), 2', 'SELECT ''id''::TEXT,2');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''Streets'',''gid''), 3', 'SELECT ''gid''::TEXT,3');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''Streets'',''GID''), 4', 'SELECT ''gid''::TEXT,4');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''Streets'',''ID''), 5', 'SELECT NULL::TEXT,5');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1.streets'',''ID''), 6', 'SELECT ''ID''::TEXT,6');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1.streets'',''id''), 7', 'SELECT NULL::TEXT,7');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1.Streets'',''id''), 8', 'SELECT NULL::TEXT,8'); 
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1.Streets'',''ID''), 9', 'SELECT ''ID''::TEXT,9');  
+
+SET search_path TO  s1,public;
+SELECT  results_eq('SELECT _pgr_getColumnName (''public.streets'',''ID''), 10', 'SELECT ''id''::TEXT,10');
+SELECT  results_eq('SELECT _pgr_getColumnName (''public.Streets'',''GID''), 11', 'SELECT ''gid''::TEXT,11');
+
+SELECT  results_eq('SELECT _pgr_getColumnName (''streets'',''ID''), 12', 'SELECT ''ID''::TEXT,12');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''streets'',''id''), 13', 'SELECT NULL::TEXT,13');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''Streets'',''id''), 14', 'SELECT NULL::TEXT,14'); 
+SELECT  results_eq('SELECT _pgr_getColumnName (''Streets'',''ID''), 15', 'SELECT ''ID''::TEXT,15');
+
+SET search_path TO "$user", public;
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''streets'',''id''), 16', 'SELECT ''id''::TEXT,16');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''streets'',''ID''), 17', 'SELECT ''id''::TEXT,17');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''Streets'',''gid''), 18', 'SELECT ''gid''::TEXT,18');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''Streets'',''GID''), 19', 'SELECT ''gid''::TEXT,19');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''Streets'',''ID''), 20', 'SELECT NULL::TEXT,20');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''streets'',''ID''), 21', 'SELECT ''ID''::TEXT,21');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''streets'',''id''), 22', 'SELECT NULL::TEXT,22');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''Streets'',''id''), 23', 'SELECT NULL::TEXT,23'); 
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''Streets'',''ID''), 24', 'SELECT ''ID''::TEXT,24');  
+
+SET search_path TO  s1,public;
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''streets'',''ID''), 25', 'SELECT ''id''::TEXT,25');
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''Streets'',''GID''), 26', 'SELECT ''gid''::TEXT,26');
+
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''streets'',''ID''), 27', 'SELECT ''ID''::TEXT,27');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''streets'',''id''), 28', 'SELECT NULL::TEXT,28');  
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''Streets'',''id''), 29', 'SELECT NULL::TEXT,29'); 
+SELECT  results_eq('SELECT _pgr_getColumnName (''s1'',''Streets'',''ID''), 30', 'SELECT ''ID''::TEXT,30');
+
+-- becuase this dont test for schema or TABLE names the expected results are NULL
+SELECT  results_eq('SELECT _pgr_getColumnName (''publIc'',''Streets'',''gid''), 31', 'SELECT NULL::TEXT,31');
+SELECT  results_eq('SELECT _pgr_getColumnName (''public'',''StrEets'',''gid''), 32', 'SELECT NULL::TEXT,32');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/common/test/pgtap/getColumnType.test.sql b/src/common/test/pgtap/getColumnType.test.sql
new file mode 100644
index 0000000..50e4126
--- /dev/null
+++ b/src/common/test/pgtap/getColumnType.test.sql
@@ -0,0 +1,51 @@
+
+\i setup.sql
+
+SELECT plan(21);
+
+
+set client_min_messages  to warning;
+
+CREATE SCHEMA s1;
+CREATE TABLE streets (id SERIAL PRIMARY KEY, source DOUBLE PRECISION, target REAL);
+CREATE TABLE "Streets" (GID bigSERIAL PRIMARY KEY, SOURCE TEXT, TARGET INTEGER);
+CREATE TABLE s1.streets ("ID" SERIAL PRIMARY KEY, sour DOUBLE PRECISION, targ REAL);
+CREATE TABLE s1."Streets" ("ID" SERIAL PRIMARY KEY, "SOURCE" INTEGER, "Target" INTEGER);
+
+set client_min_messages  to notice;
+SELECT  results_eq('SELECT _pgr_getColumnType (''streets'', ''id''),  1', 'SELECT ''integer''::TEXT,  1');
+SELECT  results_eq('SELECT _pgr_getColumnType (''streets'', ''source''),  2', 'SELECT ''double precision''::TEXT,  2');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''streets'', ''target''),  3', 'SELECT ''real''::TEXT,  3');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''Streets'', ''GID''),  4', 'SELECT ''bigint''::TEXT,  4');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''Streets'', ''SOURCE''),  5', 'SELECT ''text''::TEXT,  5');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''Streets'', ''TARGET''),  6', 'SELECT ''integer''::TEXT,  6');  
+
+SELECT  results_eq('SELECT _pgr_getColumnType (''s1.streets'', ''ID''),  7', 'SELECT ''integer''::TEXT, 7');
+SELECT  results_eq('SELECT _pgr_getColumnType (''s1.streets'', ''sour''),  8',  'SELECT ''double precision''::TEXT,  8');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''s1.streets'', ''targ''),  9',  'SELECT ''real''::TEXT,  9');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''s1.Streets'', ''ID''),  10', 'SELECT ''integer''::TEXT,  10');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''s1.Streets'', ''SOURCE''),  11', 'SELECT ''integer''::TEXT,  11');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''s1.Streets'', ''Target''),  12', 'SELECT ''integer''::TEXT,  12');  
+
+SET search_path TO  s1, public;
+SELECT  results_eq('SELECT _pgr_getColumnType (''public.streets'', ''ID''),  13', 'SELECT ''integer''::TEXT, 13');
+SELECT  results_eq('SELECT _pgr_getColumnType (''public.Streets'', ''GID''),  14', 'SELECT ''bigint''::TEXT, 14');
+
+SELECT  results_eq('SELECT _pgr_getColumnType (''streets'', ''ID''),  15',  'SELECT ''integer''::TEXT, 15');  
+SELECT  results_eq('SELECT _pgr_getColumnType (''Streets'', ''ID''),  16',  'SELECT ''integer''::TEXT, 16');
+
+SET search_path TO "$user",  public;
+--NULL when TABLE or column doesnt exist
+SELECT  results_eq('SELECT _pgr_getColumnType (''Streets'', ''data'', 0),  17',  'SELECT NULL::TEXT,  17');
+SELECT  results_eq('SELECT _pgr_getColumnType (''strats'', ''id'', 0),  18',  'SELECT NULL::TEXT,  18');
+
+-- becuase this dont test for schema or TABLE names the expected results are NULL
+SELECT  results_eq('SELECT _pgr_getColumnType (''publIc'', ''Streets'', ''gid''),  19', 'SELECT NULL::TEXT,  19');
+SELECT  results_eq('SELECT _pgr_getColumnType (''public'', ''StrEets'', ''gid''),  20',  'SELECT  NULL::TEXT,  20');
+SELECT  results_eq('SELECT _pgr_getColumnType (''public'', ''Streets'', ''data''),  21',  'SELECT  NULL::TEXT,  21');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
+
diff --git a/src/common/test/pgtap/getTableName.test.sql b/src/common/test/pgtap/getTableName.test.sql
new file mode 100644
index 0000000..9c39759
--- /dev/null
+++ b/src/common/test/pgtap/getTableName.test.sql
@@ -0,0 +1,79 @@
+
+\i setup.sql
+
+SELECT plan(35);
+
+set client_min_messages  to warning;
+
+SET search_path TO "$user", public;
+
+create schema s1;
+create schema s2;
+create schema "S2";
+create schema s3;
+create table streets (id serial PRIMARY KEY,source integer,target integer);
+create table "Streets" (ID serial PRIMARY KEY,SOURCE integer,TARGET integer);
+create table s1.streets ("ID" serial PRIMARY KEY,sour integer,targ integer);
+create table s1."Streets" ("ID" serial PRIMARY KEY,"SOURCE" integer,"Target" integer);
+create table s2."Streets" (id serial ,source integer,target integer);
+create table "S2".streets (id serial ,source integer,target integer);
+create table s3."Streets" (id serial ,source integer,target integer);
+create table s3."sTreets" (id serial ,source integer,target integer);
+create table s3."StrEets" (id serial ,source integer,target integer);
+
+set client_min_messages to warning;
+
+SELECT  results_eq('SELECT 1, sname, tname from  _pgr_getTableName(''StreEts'')', 'SELECT 1, ''public''::TEXT, ''streets''::TEXT '); --public.streets
+SELECT  results_eq('SELECT 2, sname, tname  from _pgr_getTableName(''Streets'')', 'SELECT 2, ''public''::TEXT, ''Streets''::TEXT');  --public.Streets
+SELECT  results_eq('SELECT 3, sname, tname  from _pgr_getTableName(''streEts'')', 'SELECT 3, ''public''::TEXT, ''streets''::TEXT');  --public.streets
+SELECT  results_eq('SELECT 4, sname, tname  from _pgr_getTableName(''streEts1'')', 'SELECT 4, ''public''::TEXT, NULL::TEXT  ');     --public.<null>
+
+SELECT  results_eq('SELECT 5, sname, tname  from _pgr_getTableName(''s1.StreEts'')', 'SELECT 5, ''s1''::TEXT, ''streets''::TEXT');         --s1.streets
+SELECT  results_eq('SELECT 6, sname, tname  from _pgr_getTableName(''s1.Streets'')', 'SELECT 6, ''s1''::TEXT, ''Streets''::TEXT');         --s1.Streets
+SELECT  results_eq('SELECT 7, sname, tname  from _pgr_getTableName(''S1.streEts'')', 'SELECT 7, ''s1''::TEXT, ''streets''::TEXT');         --s1.streets
+SELECT  results_eq('SELECT 8, sname, tname from _pgr_getTableName(''S1.streEts1'')', 'SELECT 8, ''s1''::TEXT, NULL::TEXT::TEXT');         --s1.<null>
+
+SELECT  results_eq('SELECT 9, sname, tname from _pgr_getTableName(''s2.StreEts'')', 'SELECT 9, ''s2''::TEXT, NULL::TEXT::TEXT');         --s2.<null>
+SELECT  results_eq('SELECT 10, sname, tname  from _pgr_getTableName(''s2.Streets'')', 'SELECT 10, ''s2''::TEXT, ''Streets''::TEXT');         --s2.Streets
+SELECT  results_eq('SELECT 11, sname, tname from _pgr_getTableName(''S2.streEts'')', 'SELECT 11, ''S2''::TEXT, ''streets''::TEXT');         --S2.streets
+
+
+SELECT  results_eq('SELECT 12, sname, tname  from _pgr_getTableName(''s3.Streets'')', 'SELECT 12, ''s3''::TEXT, ''Streets''::TEXT');         --s3.Streets
+SELECT  results_eq('SELECT 13, sname, tname  from _pgr_getTableName(''s3.sTreets'')', 'SELECT 13, ''s3''::TEXT, ''sTreets''::TEXT');         --s3.sTreets
+SELECT  results_eq('SELECT 14, sname, tname  from _pgr_getTableName(''s3.StrEets'')', 'SELECT 14, ''s3''::TEXT, ''StrEets''::TEXT');         --s3.StrEets
+
+SELECT  results_eq('SELECT 15, sname, tname from _pgr_getTableName(''s3.streets'')', 'SELECT 15, ''s3''::TEXT, NULL::TEXT');         --s3.<null>
+SELECT  results_eq('SELECT 16, sname, tname from _pgr_getTableName(''s3.streetS'')', 'SELECT 16, ''s3''::TEXT, NULL::TEXT');         --s3.<null>
+SELECT  results_eq('SELECT 17, sname, tname from _pgr_getTableName(''S3.streEts1'')', 'SELECT 17, ''s3''::TEXT, NULL::TEXT');         --s3.<null>
+
+SET search_path TO s1,public;
+
+SELECT  results_eq('SELECT 18, sname, tname  from _pgr_getTableName(''StreEts'')', 'SELECT 18, ''s1''::TEXT, ''streets''::TEXT');         --s1.streets
+SELECT  results_eq('SELECT 19, sname, tname  from _pgr_getTableName(''Streets'')', 'SELECT 19, ''s1''::TEXT, ''Streets''::TEXT');         --s1.Streets
+SELECT  results_eq('SELECT 20, sname, tname  from _pgr_getTableName(''streEts'')', 'SELECT 20, ''s1''::TEXT, ''streets''::TEXT');         --s1.streets
+SELECT  results_eq('SELECT 21, sname, tname from _pgr_getTableName(''streEts1'')', 'SELECT 21, ''s1''::TEXT, NULL::TEXT');         --s1.<null>
+
+SELECT  results_eq('SELECT 22, sname, tname  from _pgr_getTableName(''s1.StreEts'')', 'SELECT 22, ''s1''::TEXT, ''streets''::TEXT');         --s1.streets
+SELECT  results_eq('SELECT 23, sname, tname  from _pgr_getTableName(''s1.Streets'')', 'SELECT 23, ''s1''::TEXT, ''Streets''::TEXT');         --s1.Streets
+SELECT  results_eq('SELECT 24, sname, tname  from _pgr_getTableName(''S1.streEts'')', 'SELECT 24, ''s1''::TEXT, ''streets''::TEXT');         --s1.streets
+SELECT  results_eq('SELECT 25, sname, tname from _pgr_getTableName(''S1.streEts1'')', 'SELECT 25, ''s1''::TEXT, NULL::TEXT');         --s1.<null>
+
+SELECT  results_eq('SELECT 26, sname, tname from _pgr_getTableName(''s2.StreEts'')', 'SELECT 26, ''s2''::TEXT, NULL::TEXT');         --s2.<null>
+SELECT  results_eq('SELECT 27, sname, tname  from _pgr_getTableName(''s2.Streets'')', 'SELECT 27, ''s2''::TEXT, ''Streets''::TEXT');         --s2.Streets
+SELECT  results_eq('SELECT 28, sname,  tname  from _pgr_getTableName(''S2.streEts'')', 'SELECT 28, ''S2''::TEXT, ''streets''::TEXT');         --S2.streets
+
+
+SELECT  results_eq('SELECT 29, sname, tname  from _pgr_getTableName(''s3.Streets'')', 'SELECT 29, ''s3''::TEXT, ''Streets''::TEXT');         --s3.Streets
+SELECT  results_eq('SELECT 30, sname, tname  from _pgr_getTableName(''s3.sTreets'')', 'SELECT 30, ''s3''::TEXT, ''sTreets''::TEXT');         --s3.sTreets
+SELECT  results_eq('SELECT 31, sname, tname  from _pgr_getTableName(''s3.StrEets'')', 'SELECT 31, ''s3''::TEXT, ''StrEets''::TEXT');         --s3.StrEets
+SELECT  results_eq('SELECT 32, sname, tname from _pgr_getTableName(''s3.streets'')', 'SELECT 32, ''s3''::TEXT, NULL::TEXT');         --s3.<null>
+SELECT  results_eq('SELECT 33, sname, tname from _pgr_getTableName(''s3.streetS'')', 'SELECT 33, ''s3''::TEXT, NULL::TEXT');         --s3.<null>
+SELECT  results_eq('SELECT 34, sname, tname from _pgr_getTableName(''S3.streEts1'')', 'SELECT 34, ''s3''::TEXT, NULL::TEXT');         --s3.<null>
+
+SELECT  results_eq('SELECT 35, sname, tname from _pgr_getTableName(''S4.streEts1'')', 'SELECT 35, NULL::TEXT, NULL::TEXT');         --<null>.<null>
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/common/test/pgtap/isColumnInTable.test.sql b/src/common/test/pgtap/isColumnInTable.test.sql
new file mode 100644
index 0000000..bffe5d5
--- /dev/null
+++ b/src/common/test/pgtap/isColumnInTable.test.sql
@@ -0,0 +1,87 @@
+
+\i setup.sql
+
+SELECT plan(56);
+
+CREATE SCHEMA s1;
+CREATE SCHEMA s2;
+CREATE SCHEMA "S2";
+CREATE SCHEMA s3;
+CREATE TABLE streets (id SERIAL PRIMARY KEY,source INTEGER,target INTEGER);
+CREATE TABLE "Streets" (ID SERIAL PRIMARY KEY,SOURCE INTEGER,TARGET INTEGER);
+CREATE TABLE s1.streets ("ID" SERIAL PRIMARY KEY,sour INTEGER,targ INTEGER);
+CREATE TABLE s1."Streets" ("ID" SERIAL PRIMARY KEY,"SOURCE" INTEGER,"Target" INTEGER);
+CREATE TABLE s2."Streets" (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE "S2".streets (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE s3."Streets" (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE s3."sTreets" (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE s3."StrEets" (id SERIAL ,source INTEGER,target INTEGER);
+
+
+SELECT  results_eq('SELECT 1,   _pgr_isColumnInTable(''streets'', ''id'')',       'SELECT 1, true');
+SELECT  results_eq('SELECT 2,   _pgr_isColumnInTable(''streets'', ''source'')',   'SELECT 2, true');
+SELECT  results_eq('SELECT 3,   _pgr_isColumnInTable(''streets'', ''target'')',   'SELECT 3, true');
+SELECT  results_eq('SELECT 4,   _pgr_isColumnInTable(''streets'', ''ID'')',       'SELECT 4, true');
+SELECT  results_eq('SELECT 5,   _pgr_isColumnInTable(''streets'', ''Source'')',   'SELECT 5, true');
+SELECT  results_eq('SELECT 6,   _pgr_isColumnInTable(''streets'', ''Target'')',   'SELECT 6, true');
+SELECT  results_eq('SELECT 7,   _pgr_isColumnInTable(''Streets'', ''id'')',       'SELECT 7, true');
+SELECT  results_eq('SELECT 8,   _pgr_isColumnInTable(''Streets'', ''source'')',   'SELECT 8, true');
+SELECT  results_eq('SELECT 9,   _pgr_isColumnInTable(''Streets'', ''target'')',   'SELECT 9, true');
+SELECT  results_eq('SELECT 10,   _pgr_isColumnInTable(''Streets'', ''ID'')',      'SELECT 10, true');
+SELECT  results_eq('SELECT 11,   _pgr_isColumnInTable(''Streets'', ''SOURCE'')',  'SELECT 11, true');
+SELECT  results_eq('SELECT 12,   _pgr_isColumnInTable(''Streets'', ''Target'')',  'SELECT 12, true');
+SELECT  results_eq('SELECT 13,   _pgr_isColumnInTable(''s1.streets'', ''ID'')',   'SELECT 13, true');
+SELECT  results_eq('SELECT 14,   _pgr_isColumnInTable(''s1.streets'', ''Targ'')', 'SELECT 14, true');
+SELECT  results_eq('SELECT 15,   _pgr_isColumnInTable(''s1.Streets'', ''ID'')',   'SELECT 15, true');
+SELECT  results_eq('SELECT 16,   _pgr_isColumnInTable(''s1.Streets'', ''SOURCE'')',   'SELECT 16, true');
+SELECT  results_eq('SELECT 17,   _pgr_isColumnInTable(''s1.Streets'', ''Target'')',   'SELECT 17, true');
+
+
+SELECT  results_eq('SELECT 18,   _pgr_isColumnInTable(''streets'', ''Targ'')',      'SELECT 18, false');
+SELECT  results_eq('SELECT 19,   _pgr_isColumnInTable(''Streets'', ''Targ'')',      'SELECT 19, false');
+SELECT  results_eq('SELECT 20,   _pgr_isColumnInTable(''s1.STREETS'', ''id'')',     'SELECT 20, false');
+SELECT  results_eq('SELECT 21,   _pgr_isColumnInTable(''s1.STREETS'', ''source'')', 'SELECT 21, false');
+SELECT  results_eq('SELECT 22,   _pgr_isColumnInTable(''s1.stReets'', ''target'')', 'SELECT 22, false');
+SELECT  results_eq('SELECT 23,   _pgr_isColumnInTable(''s1.streets'', ''SOURCE'')', 'SELECT 23, false');
+SELECT  results_eq('SELECT 24,   _pgr_isColumnInTable(''s1.streets'', ''Target'')', 'SELECT 24, false');
+SELECT  results_eq('SELECT 25,   _pgr_isColumnInTable(''s1.Streets'', ''id'')',     'SELECT 25, false');
+SELECT  results_eq('SELECT 26,   _pgr_isColumnInTable(''s1.Streets'', ''source'')', 'SELECT 26, false');
+SELECT  results_eq('SELECT 27,   _pgr_isColumnInTable(''s1.Streets'', ''target'')', 'SELECT 27, false');
+SELECT  results_eq('SELECT 28,   _pgr_isColumnInTable(''s1.Streets'', ''Targ'')',   'SELECT 28, false');
+
+SET search_path TO s1,public;
+
+SELECT  results_eq('SELECT 29,   _pgr_isColumnInTable(''streets'', ''ID'')',        'SELECT 29, true');
+SELECT  results_eq('SELECT 30,   _pgr_isColumnInTable(''streets'', ''Targ'')',      'SELECT 30, true');
+SELECT  results_eq('SELECT 31,   _pgr_isColumnInTable(''Streets'', ''ID'')',        'SELECT 31, true');
+SELECT  results_eq('SELECT 32,   _pgr_isColumnInTable(''Streets'', ''SOURCE'')',    'SELECT 32, true');
+SELECT  results_eq('SELECT 33,   _pgr_isColumnInTable(''Streets'', ''Target'')',    'SELECT 33, true');
+SELECT  results_eq('SELECT 34,   _pgr_isColumnInTable(''s1.streets'', ''ID'')',     'SELECT 34, true');
+SELECT  results_eq('SELECT 35,   _pgr_isColumnInTable(''s1.streets'', ''Targ'')',   'SELECT 35, true');
+SELECT  results_eq('SELECT 36,   _pgr_isColumnInTable(''s1.Streets'', ''ID'')',     'SELECT 36, true');
+SELECT  results_eq('SELECT 37,   _pgr_isColumnInTable(''s1.Streets'', ''SOURCE'')', 'SELECT 37, true');
+SELECT  results_eq('SELECT 38,   _pgr_isColumnInTable(''s1.Streets'', ''Target'')', 'SELECT 38, true');
+
+SELECT  results_eq('SELECT 39,   _pgr_isColumnInTable(''streets'', ''id'')',        'SELECT 39, false');
+SELECT  results_eq('SELECT 40,   _pgr_isColumnInTable(''streets'', ''source'')',    'SELECT 40, false');
+SELECT  results_eq('SELECT 41,   _pgr_isColumnInTable(''streets'', ''target'')',    'SELECT 41, false');
+SELECT  results_eq('SELECT 42,   _pgr_isColumnInTable(''streets'', ''Source'')',    'SELECT 42, false');
+SELECT  results_eq('SELECT 43,   _pgr_isColumnInTable(''streets'', ''Target'')',    'SELECT 43, false');
+SELECT  results_eq('SELECT 44,   _pgr_isColumnInTable(''Streets'', ''id'')',        'SELECT 44, false');
+SELECT  results_eq('SELECT 45,   _pgr_isColumnInTable(''Streets'', ''source'')',    'SELECT 45, false');
+SELECT  results_eq('SELECT 46,   _pgr_isColumnInTable(''Streets'', ''target'')',    'SELECT 46, false');
+SELECT  results_eq('SELECT 47,   _pgr_isColumnInTable(''Streets'', ''Targ'')',      'SELECT 47, false');
+SELECT  results_eq('SELECT 48,   _pgr_isColumnInTable(''s1.STREETS'', ''id'')',     'SELECT 48, false');
+SELECT  results_eq('SELECT 49,   _pgr_isColumnInTable(''s1.STREETS'', ''source'')', 'SELECT 49, false');
+SELECT  results_eq('SELECT 50,   _pgr_isColumnInTable(''s1.stReets'', ''target'')', 'SELECT 50, false');
+SELECT  results_eq('SELECT 51,   _pgr_isColumnInTable(''s1.streets'', ''SOURCE'')', 'SELECT 51, false');
+SELECT  results_eq('SELECT 52,   _pgr_isColumnInTable(''s1.streets'', ''Target'')', 'SELECT 52, false');
+SELECT  results_eq('SELECT 53,   _pgr_isColumnInTable(''s1.Streets'', ''id'')',     'SELECT 53, false');
+SELECT  results_eq('SELECT 54,   _pgr_isColumnInTable(''s1.Streets'', ''source'')', 'SELECT 54, false');
+SELECT  results_eq('SELECT 55,   _pgr_isColumnInTable(''s1.Streets'', ''target'')', 'SELECT 55, false');
+SELECT  results_eq('SELECT 56,   _pgr_isColumnInTable(''s1.Streets'', ''Targ'')',   'SELECT 56, false');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/common/test/pgtap/isColumnIndexed.test.sql b/src/common/test/pgtap/isColumnIndexed.test.sql
new file mode 100644
index 0000000..4d630f3
--- /dev/null
+++ b/src/common/test/pgtap/isColumnIndexed.test.sql
@@ -0,0 +1,97 @@
+
+\i setup.sql
+
+SELECT plan(60);
+
+CREATE SCHEMA s1;
+CREATE SCHEMA s2;
+CREATE SCHEMA "S2";
+CREATE SCHEMA s3;
+CREATE TABLE streets (id SERIAL PRIMARY KEY,source INTEGER,target INTEGER);
+CREATE TABLE "Streets" (ID SERIAL PRIMARY KEY,SOURCE INTEGER,TARGET INTEGER);
+CREATE TABLE s1.streets ("ID" SERIAL PRIMARY KEY,sour INTEGER,targ INTEGER);
+CREATE TABLE s1."Streets" ("ID" SERIAL PRIMARY KEY,"SOURCE" INTEGER,"Target" INTEGER);
+CREATE TABLE s2."Streets" (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE "S2".streets (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE s3."Streets" (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE s3."sTreets" (id SERIAL ,source INTEGER,target INTEGER);
+CREATE TABLE s3."StrEets" (id SERIAL ,source INTEGER,target INTEGER);
+
+
+
+SELECT  results_eq('SELECT 1, _pgr_isColumnIndexed(''streets'',''id'')',    'SELECT 1, true');
+SELECT  results_eq('SELECT 2, _pgr_isColumnIndexed(''streets'',''id'')',    'SELECT 2, true');
+SELECT  results_eq('SELECT 3, _pgr_isColumnIndexed(''streets'',''ID'')',    'SELECT 3, true');
+SELECT  results_eq('SELECT 4, _pgr_isColumnIndexed(''Streets'',''ID'')',    'SELECT 4, true');
+SELECT  results_eq('SELECT 5, _pgr_isColumnIndexed(''s1.streets'',''ID'')', 'SELECT 5, true');
+SELECT  results_eq('SELECT 6, _pgr_isColumnIndexed(''s1.Streets'',''ID'')', 'SELECT 6, true');
+
+SELECT  results_eq('SELECT 7, _pgr_isColumnIndexed(''Streets'',''id'')',     'SELECT 7, true');
+SELECT  results_eq('SELECT 8, _pgr_isColumnIndexed(''Streets'',''ID'')',     'SELECT 8, true');
+SELECT  results_eq('SELECT 9, _pgr_isColumnIndexed(''s1.streets'',''ID'')',  'SELECT 9, true');
+SELECT  results_eq('SELECT 10, _pgr_isColumnIndexed(''s1.Streets'',''ID'')', 'SELECT 10, true');
+
+SELECT  results_eq('SELECT 11, _pgr_isColumnIndexed(''streets'',''source'')', 'SELECT 11, false');
+SELECT  results_eq('SELECT 12, _pgr_isColumnIndexed(''streets'',''target'')', 'SELECT 12, false');
+SELECT  results_eq('SELECT 13, _pgr_isColumnIndexed(''streets'',''Source'')', 'SELECT 13, false');
+SELECT  results_eq('SELECT 14, _pgr_isColumnIndexed(''streets'',''Target'')', 'SELECT 14, false');
+SELECT  results_eq('SELECT 15, _pgr_isColumnIndexed(''streets'',''Targ'')',   'SELECT 15, false');
+SELECT  results_eq('SELECT 16, _pgr_isColumnIndexed(''Streets'',''source'')', 'SELECT 16, false');
+SELECT  results_eq('SELECT 17, _pgr_isColumnIndexed(''Streets'',''target'')', 'SELECT 17, false');
+SELECT  results_eq('SELECT 18, _pgr_isColumnIndexed(''Streets'',''SOURCE'')', 'SELECT 18, false');
+SELECT  results_eq('SELECT 19, _pgr_isColumnIndexed(''Streets'',''Target'')', 'SELECT 19, false');
+SELECT  results_eq('SELECT 20, _pgr_isColumnIndexed(''Streets'',''Targ'')',   'SELECT 20, false');
+
+SELECT  results_eq('SELECT 21, _pgr_isColumnIndexed(''s1.STREETS'',''id'')',     'SELECT 21, false');
+SELECT  results_eq('SELECT 22, _pgr_isColumnIndexed(''s1.STREETS'',''source'')', 'SELECT 22, false');
+SELECT  results_eq('SELECT 23, _pgr_isColumnIndexed(''s1.stReets'',''target'')', 'SELECT 23, false');
+SELECT  results_eq('SELECT 24, _pgr_isColumnIndexed(''s1.streets'',''SOURCE'')', 'SELECT 24, false');
+SELECT  results_eq('SELECT 25, _pgr_isColumnIndexed(''s1.streets'',''Target'')', 'SELECT 25, false');
+SELECT  results_eq('SELECT 26, _pgr_isColumnIndexed(''s1.streets'',''Targ'')',   'SELECT 26, false');
+SELECT  results_eq('SELECT 27, _pgr_isColumnIndexed(''s1.Streets'',''id'')',     'SELECT 27, false');
+SELECT  results_eq('SELECT 28, _pgr_isColumnIndexed(''s1.Streets'',''source'')', 'SELECT 28, false');
+SELECT  results_eq('SELECT 29, _pgr_isColumnIndexed(''s1.Streets'',''target'')', 'SELECT 29, false');
+SELECT  results_eq('SELECT 30, _pgr_isColumnIndexed(''s1.Streets'',''SOURCE'')', 'SELECT 30, false');
+
+SELECT  results_eq('SELECT 31, _pgr_isColumnIndexed(''s1.Streets'',''Target'')', 'SELECT 31, false');
+SELECT  results_eq('SELECT 32, _pgr_isColumnIndexed(''s1.Streets'',''Targ'')', 'SELECT 32, false');
+
+SET search_path TO s1,public;
+
+SELECT  results_eq('SELECT 33, _pgr_isColumnIndexed(''streets'',''ID'')',       'SELECT 33, true');
+SELECT  results_eq('SELECT 34, _pgr_isColumnIndexed(''Streets'',''ID'')',       'SELECT 34, true');
+SELECT  results_eq('SELECT 35, _pgr_isColumnIndexed(''s1.streets'',''ID'')',    'SELECT 35, true');
+SELECT  results_eq('SELECT 36, _pgr_isColumnIndexed(''s1.Streets'',''ID'')',    'SELECT 36, true');
+SELECT  results_eq('SELECT 37, _pgr_isColumnIndexed(''streets'',''id'')',       'SELECT 37, false');
+SELECT  results_eq('SELECT 38, _pgr_isColumnIndexed(''streets'',''source'')',   'SELECT 38, false');
+SELECT  results_eq('SELECT 39, _pgr_isColumnIndexed(''streets'',''target'')',   'SELECT 39, false');
+SELECT  results_eq('SELECT 40, _pgr_isColumnIndexed(''streets'',''Source'')',   'SELECT 40, false');
+
+SELECT  results_eq('SELECT 41, _pgr_isColumnIndexed(''streets'',''Target'')',   'SELECT 41, false');
+SELECT  results_eq('SELECT 42, _pgr_isColumnIndexed(''streets'',''Targ'')',     'SELECT 42, false');
+SELECT  results_eq('SELECT 43, _pgr_isColumnIndexed(''Streets'',''id'')',       'SELECT 43, false');
+SELECT  results_eq('SELECT 44, _pgr_isColumnIndexed(''Streets'',''source'')',   'SELECT 44, false');
+SELECT  results_eq('SELECT 45, _pgr_isColumnIndexed(''Streets'',''target'')',   'SELECT 45, false');
+SELECT  results_eq('SELECT 46, _pgr_isColumnIndexed(''Streets'',''SOURCE'')',   'SELECT 46, false');
+SELECT  results_eq('SELECT 47, _pgr_isColumnIndexed(''Streets'',''Target'')',   'SELECT 47, false');
+SELECT  results_eq('SELECT 48, _pgr_isColumnIndexed(''Streets'',''Targ'')',     'SELECT 48, false');
+SELECT  results_eq('SELECT 49, _pgr_isColumnIndexed(''s1.STREETS'',''id'')',    'SELECT 49, false');
+SELECT  results_eq('SELECT 50, _pgr_isColumnIndexed(''s1.STREETS'',''source'')', 'SELECT 50, false');
+
+SELECT  results_eq('SELECT 51, _pgr_isColumnIndexed(''s1.stReets'',''target'')', 'SELECT 51, false');
+SELECT  results_eq('SELECT 52, _pgr_isColumnIndexed(''s1.streets'',''SOURCE'')', 'SELECT 52, false');
+SELECT  results_eq('SELECT 53, _pgr_isColumnIndexed(''s1.streets'',''Target'')', 'SELECT 53, false');
+SELECT  results_eq('SELECT 54, _pgr_isColumnIndexed(''s1.streets'',''Targ'')',   'SELECT 54, false');
+SELECT  results_eq('SELECT 55, _pgr_isColumnIndexed(''s1.Streets'',''id'')',     'SELECT 55, false');
+SELECT  results_eq('SELECT 56, _pgr_isColumnIndexed(''s1.Streets'',''source'')', 'SELECT 56, false');
+SELECT  results_eq('SELECT 57, _pgr_isColumnIndexed(''s1.Streets'',''target'')', 'SELECT 57, false');
+SELECT  results_eq('SELECT 58, _pgr_isColumnIndexed(''s1.Streets'',''SOURCE'')', 'SELECT 58, false');
+SELECT  results_eq('SELECT 59, _pgr_isColumnIndexed(''s1.Streets'',''Target'')', 'SELECT 59, false');
+SELECT  results_eq('SELECT 60, _pgr_isColumnIndexed(''s1.Streets'',''Targ'')',   'SELECT 60, false');
+
+
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/common/test/pgtap/no_underscored-2x.test.sql b/src/common/test/pgtap/no_underscored-2x.test.sql
new file mode 100644
index 0000000..c7f68c2
--- /dev/null
+++ b/src/common/test/pgtap/no_underscored-2x.test.sql
@@ -0,0 +1,60 @@
+
+\i setup.sql
+
+
+SELECT plan(18);
+
+set client_min_messages to WARNING;
+SELECT  results_eq('SELECT  1, sname, tname  FROM pgr_getTableName(''EDGe_table'')', 
+    'SELECT 1, ''public''::TEXT, ''edge_table''::TEXT ');
+SELECT  results_eq('SELECT  2, sname, tname FROM pgr_getTableName(''EDes2'')',
+    'SELECT 2, ''public''::TEXT, NULL::TEXT ');
+
+
+SELECT  results_eq('SELECT  3,  pgr_getColumnName(''EDGe_table'', ''SOuRce'')' ,
+    'SELECT 3, ''source''::TEXT ');
+SELECT  results_eq('SELECT  4,  pgr_getColumnName(''EDes2'', ''SOuRce'') ',
+    'SELECT 4,  NULL::TEXT ');
+SELECT  results_eq('SELECT  5,  pgr_getColumnName(''EDes2'', ''SOuce'') ',
+    'SELECT 5,  NULL::TEXT ');
+SELECT  results_eq('SELECT  6,  pgr_getColumnName(''EDes2'', ''SOuce'') ',
+    'SELECT 6,  NULL::TEXT ');
+
+
+SELECT  results_eq('SELECT  7, pgr_isColumnInTable(''EDGe_table'', ''SOuRce'') ',
+    'SELECT 7, true ');
+SELECT  results_eq('SELECT  8, pgr_isColumnInTable(''EDes2'', ''SOuRce'')',
+    'SELECT 8,  false ');
+SELECT  results_eq('SELECT  9, pgr_isColumnInTable(''EDes2'', ''SOuce'')',
+    'SELECT 9,  false ');
+SELECT  results_eq('SELECT  10, pgr_isColumnInTable(''EDes2'', ''SOuce'')',
+    'SELECT 10,  false ');
+
+
+SELECT  results_eq('SELECT  11, pgr_isColumnIndexed(''EDGe_table'', ''id'') ',
+    'SELECT 11, true ');
+SELECT  results_eq('SELECT  12, pgr_isColumnIndexed(''EDGe_table'', ''X1'') ',
+    'SELECT 12,  false ');
+
+
+SELECT  results_eq('SELECT  13, pgr_versionless(''2.1.0foobar23'', ''2.1'') ',
+    'SELECT 13,  true ');
+SELECT  results_eq('SELECT  14, pgr_versionless(''2.1.0foobar23'', ''2.1-rc1'') ',
+    'SELECT 14,  true ');
+SELECT  results_eq('SELECT  15, pgr_versionless(''2.1.0foobar23'', ''2.1-beta'') ',
+    'SELECT 15,  true ');
+
+
+SELECT  results_eq('SELECT  16, pgr_quote_ident(''idname.text'') ',
+    'SELECT 16,  ''idname.text''::TEXT ');
+
+SELECT  results_eq('SELECT  17, pgr_startPoint(the_geom)::TEXT  FROM edge_table where id = 1 ',
+    'SELECT 17, ''010100000000000000000000400000000000000000''::TEXT ');
+
+SELECT  results_eq('SELECT  18, pgr_endPoint(the_geom)::TEXT  FROM edge_table where id = 1 ', 
+    'SELECT 18, ''01010000000000000000000040000000000000F03F''::TEXT ');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/common/test/test.conf b/src/common/test/test.conf
index c38fdd3..a178654 100644
--- a/src/common/test/test.conf
+++ b/src/common/test/test.conf
@@ -3,32 +3,18 @@
 %main::tests = (
     'any' => {
         'comment' => 'pgr_createTopology, pgr_analyzegraph, and pgr_analyzeOneway tests for any versions.',
-        'data' => ['common-any-00.data', 'common-any-01.data', 'common-any-02.data'],
+        'data' => ['sampledata.data'],
         'tests' => [qw( 
-versionless-any-01 common-any-01 common-any-02  
-common-any-03 
-common-any-04 
+            versionless-any-01
+            )],
 
-common-any-05
-createTopology-any-01 
-createVerticesTable-any-01 
-gettablename-any-01
-pgrouting_conversion_tools-any-01
-
-pgrouting_dmatrix_tools-any-01
-pgr_getColumnName_any_01
-pgr_getColumnType_any_01
-pgr_checkVertTab_any_01
-no_underscored-2x
-isColumnIndexed-any
-isColumnInTable-any
-)],
+        'documentation' => [qw(
+            )],
 
         'dummyStorage' => [qw(
-incrementalCreateTopology_any_01
-)]
+            )]
 
-        },
+    },
 # 'vpg-vpgis' => {}, # for version specific tests
 # '8-1' => {}, # for pg 8.x and postgis 1.x
 # '9.2-2.1' => {}, # for pg 9.2 and postgis 2.1
diff --git a/src/common/test/versionless-any-01.test.sql b/src/common/test/versionless-any-01.test.sql
index fce5de1..710e0b5 100644
--- a/src/common/test/versionless-any-01.test.sql
+++ b/src/common/test/versionless-any-01.test.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 -- these should all be true
 select _pgr_versionless('2.1.0foobar23', '2.1');
 select _pgr_versionless('2.1.0foobar23', '2.1-rc1');
diff --git a/src/common/tester/test1.c b/src/common/tester/test1.c
index 30d49cc..3e2a9d9 100644
--- a/src/common/tester/test1.c
+++ b/src/common/tester/test1.c
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 #define PGR_LOGGER_ON
 #define PGR_LOGGER_LOC
diff --git a/src/common/tester/test2.cpp b/src/common/tester/test2.cpp
index 30d49cc..3e2a9d9 100644
--- a/src/common/tester/test2.cpp
+++ b/src/common/tester/test2.cpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 #define PGR_LOGGER_ON
 #define PGR_LOGGER_LOC
diff --git a/src/contraction/doc/contraction.rst b/src/contraction/doc/contraction.rst
new file mode 100644
index 0000000..680e196
--- /dev/null
+++ b/src/contraction/doc/contraction.rst
@@ -0,0 +1,414 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+
+.. _contraction:
+
+Contraction
+===============================================================================
+
+Contracting a graph becomes a crucial operation when talking about big graphs like
+the graphs involved in routing across cities, countries, continents or the whole world.
+
+The contraction level and contraction operations can become very complex, as the complexity
+of the graphs grows.
+
+For this proposal, we are making our contraction algorithm simple as possible so that
+more contraction operations can be added in the future.
+
+We are not aiming with this work to implement all the possible contraction operations
+but to give a framework such that adding a contraction operation can be easily achieved.
+
+For this contraction proposal I am only making 2 operations:
+
+ 1. dead end contraction: vertices have one incoming edge
+ 2. linear contraction: vertices have one incomming and one outgoing edge
+   
+
+And with the additional characteristics:
+
+  - The user can forbid to contract a particular set of nodes or edges.
+  - The user can decide how many times the cycle can be done.
+  - If possible, the user can decide the order of the operations on a cycle.
+
+.. note:: Work on progress in contraction branch
+
+
+The contraction skeleton
+-------------------------------------------------------------------------------
+
+In general we have an initial set up that may involve analizing the graph given as input and setting the
+non contractable nodes or edges. We have a cycle that will go and perform a contraction operation
+until while possible, and then move to the next contraction operation.
+Adding a new operation then becomes an "easy" task; more things might be involved, because the
+charachteristics of the graph change each time its contracted, so some interaction between contractions
+has to be implemented also.
+
+Procedure
+---------
+
+* For contracting, we are going to cycle as follows
+
+.. code-block:: none
+
+    input: G(V,E);
+    removed_vertices = {};
+
+
+    <initial set up>
+    do N times {
+
+        while ( <conditions for 1> ) {
+            < contraction operation 1 >
+        }
+       
+        while ( <conditions for 2> ) {
+            < contraction operation 2>
+        }
+        .....
+    }
+
+    output: G'(V',E'), removed_vertices
+
+
+
+Contraction operations for this implementation
+-------------------------------------------------------------------------------
+
+Dead end contraction
++++++++++++++++++++++
+
+Characteristics:
+
+  - :math:`V1`: set of vertices with 1 incoming edge in increasing order of id:
+
+    - Edges with the same identifier are considered the same edge
+      and if it has the `reverse_cost` valid the outgoing edge is ignored
+
+.. code-block:: none
+
+
+    while ( V1 is not empty ) {
+
+        delete vertex of V1
+        the deleted vertex add it to removed_vertices
+        vertex that leads to removed vertex, inherits the removed vertex
+
+        <adjust any conditions that might affect other contraction operation>
+    }
+
+
+
+Linear contraction
++++++++++++++++++++++
+
+Characteristics:
+
+  - :math:`V2`: vertex with 1 incoming edge and 1 outgoing edge:
+
+    - The outgoing edge must have different identifier of the incomming edge
+
+.. code-block:: none
+
+    while ( V2 is not empty ) {
+
+        delete vertex of V2
+        create edge (shortcut)
+        the deleted vertex add it to removed_vertices
+        inewly created edge, inherits the removed vertex
+
+        <adjust any conditions that might affect other contraction operations>
+    }
+
+
+Notation
+++++++++++
+
+* V: is the set of vertices
+* E: is the set of edges
+* G: is the graph
+* :math:`V1`: is the set of *dead end* vertices 
+* :math:`V2`: is the set of *linear* vertices
+* removed_vertices: is the set of removed vertices
+
+The contracted graph will be represented with two parameters, the modified Graph, and the removed_vertices set.
+
+removed_vertices = {(v,1):{2}, (e,-1):{3}}.
+
+
+The above notation indicates:
+  - Vertex 2 is removed, and belongs to vertex 1 subgraph
+  - Vertex 3 is removed, and belongs to edge -1 subgraph
+
+
+Examples
+-------------------------------------------------------------------------------
+
+For simplicity all the edges in the examples have unit weight.
+
+Dead End
++++++++++++++++++
+
+* Perform dead end contraction operation first and then linear contraction
+* 1 cycle of contraction.
+
+.. image:: images/twoNodesoneEdge_a.png
+
+:Input:  G = {V:{1, 2}, E:{(1, 2)}}
+
+:initial set up:
+
+.. code-block:: none
+
+    removed_vertices={}
+    V1 = {2}
+    V2 = {}
+
+
+:procedure:
+
+.. code-block:: none
+
+    V1 = {2} is not empty
+
+        V1 = {}
+        V2 = {}
+        G = {V:{1}, E:{}}
+        removed_vertices = {(v, 1):{2}}.
+
+    V1 is empty
+
+Since V1 is empty we go on to the next contraction operation
+    
+.. code-block:: none
+
+    V2 is empty
+    
+
+So we do not perform any linear contraction operation.
+
+:Results:
+
+.. code-block:: none
+
+    G = {V:{1}, E:{}}
+    removed_vertices = {(v, 1):{2}}
+
+Visualy the results are
+    
+.. image:: images/twoNodesoneEdge_b.png
+
+
+
+Linear contraction
+++++++++++++++++++++
+
+* Perform linear contraction operation first and then dead end contraction
+* 1 cycle of contraction.
+
+.. image:: images/threeNodestwoEdges_a.png
+
+
+:Input: G = {V:{1, 2, 3}, E:{(1, 2), (2, 3)}}
+
+
+:initial set up:
+
+.. code-block:: none
+
+    removed_vertices={}
+    V1 = {3}
+    V2 = {2}
+
+:procedure:
+
+.. code-block:: none
+
+    V2 = {2} is not empty
+
+        V1 = {3}
+        removed_vertices = {(e, -1):{2}}
+        V2 = {}
+        G = {V:{1, 3}, E:{-1(1,3,c=2)}}
+
+    V2 is empty
+
+.. image:: images/threeNodestwoEdges_b.png
+
+Since V2 is empty we go on to the next contraction operation
+    
+.. code-block:: none
+
+    V1 = {3} is not empty
+
+        V1 = {}
+        V2 = {}
+        removed_vertices = {(v, 1):{3, 2}}.
+        G = {V:{1}, E:{}}
+
+    V1 is empty
+
+
+:Results:
+
+.. code-block:: none
+
+    removed_vertices = {(v, 1):{3, 2}}.
+    G = {V:{1}, E:{}}
+
+Visualy the results are
+    
+.. image:: images/threeNodestwoEdges_c.png
+ 
+
+
+Sample Data
+++++++++++++++++++++++++
+
+* Perform dead end contraction operation first and then linear contraction
+* 1 cycle of contraction.
+
+.. image:: images/undirected_sampledata_a.png
+
+:Input:  G = {V:{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}, 
+         E:{1(1, 2), 2(2,3), 3(3,4), 4(2,5), 5(3,6), 6(7,8), 7(8,5), 8(5,6),
+         9(6,9), 10(5,10), 11(6,11), 12(10,11), 13(11,12), 14(10,13), 15(9,12),
+         16(4,9), 17(14,15), 18(16,17)}}
+
+:initial set up:
+
+.. code-block:: none
+
+    removed_vertices={}
+    V1 = {1,7,13,14,15,16,17}
+    V2 = {4,8,12}
+
+
+:procedure:
+
+.. code-block:: none
+
+    V1 = {1,7,13,14,15,16,17} is not empty
+
+        V1 = {7,13,14,15,16,17}
+        V2 = {2,4,8,12}
+        G = {V:{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}, 
+        E:{2(2,3), 3(3,4), 4(2,5), 5(3,6), 6(7,8), 7(8,5), 8(5,6), 9(6,9),
+            10(5,10), 11(6,11), 12(10,11), 13(11,12), 14(10,13), 15(9,12), 16(4,9), 17(14,15), 18(16,17)}}
+        removed_vertices = {(v, 2):{1}}.
+
+    
+    V1 = {7,13,14,15,16,17} is not empty
+
+        V1 = {8,13,14,15,16,17}
+        V2 = {2,4,12}
+        G = {V:{2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}, 
+        E:{2(2,3), 3(3,4), 4(2,5), 5(3,6), 7(8,5), 8(5,6), 9(6,9), 10(5,10),
+            11(6,11), 12(10,11), 13(11,12), 14(10,13), 15(9,12), 16(4,9), 17(14,15), 18(16,17)}}
+        removed_vertices = {(v, 2):{1}, (v,8):{7}}.
+
+    V1 = {8,13,14,15,16,17} is not empty
+
+        V1 = {13,14,15,16,17}
+        V2 = {2,4,12}
+        G = {V:{2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17}, 
+        E:{2(2,3), 3(3,4), 4(2,5), 5(3,6), 8(5,6), 9(6,9), 10(5,10),
+             11(6,11), 12(10,11), 13(11,12), 14(10,13), 15(9,12), 16(4,9), 17(14,15), 18(16,17)}}
+        removed_vertices = {(v, 2):{1}, (v,5):{8,7}}.
+
+    V1 = {13,14,15,16,17} is not empty
+
+        V1 = {14,15,16,17}
+        V2 = {2,4,10,12}
+        G = {V:{2, 3, 4, 5, 6, 9, 10, 11, 12, 14, 15, 16, 17}, 
+        E:{2(2,3), 3(3,4), 4(2,5), 5(3,6), 8(5,6), 9(6,9), 10(5,10),
+             11(6,11), 12(10,11), 13(11,12), 15(9,12), 16(4,9), 17(14,15), 18(16,17)}}
+        removed_vertices = {(v, 2):{1}, (v,5):{8,7}, (v,10):{13}}.
+
+    V1 = {14,15,16,17} is not empty
+
+        V1 = {16,17}
+        V2 = {2,4,10,12}
+        G = {V:{2, 3, 4, 5, 6, 9, 10, 11, 12, 15, 16, 17}, 
+        E:{2(2,3), 3(3,4), 4(2,5), 5(3,6), 8(5,6), 9(6,9), 10(5,10),
+             11(6,11), 12(10,11), 13(11,12), 15(9,12), 16(4,9)}, 18(16,17)}
+        removed_vertices = {(v, 2):{1}, (v,5):{8,7}, (v,10):{13}, (v,15):{14}}.
+
+    V1 = {16,17} is not empty
+
+        V1 = {}
+        V2 = {2,4,10,12}
+        G = {V:{2, 3, 4, 5, 6, 9, 10, 11, 12, 15, 17}, 
+        E:{2(2,3), 3(3,4), 4(2,5), 5(3,6), 8(5,6), 9(6,9), 10(5,10),
+             11(6,11), 12(10,11), 13(11,12), 15(9,12), 16(4,9)}}
+        removed_vertices = {(v, 2):{1}, (v,5):{8,7}, (v,10):{13}, (v,15):{14}, (v,17):{16}}.
+
+    Since V1 is empty we go on to the next contraction operation
+    
+.. image:: images/undirected_sampledata_b.png
+
+.. code-block:: none
+
+    V2 = {2,4,10,12} is not empty
+
+        V1 = {}
+        V2 = {4,10,12}
+        G = {V:{3, 4, 5, 6, 9, 10, 11, 12, 15, 17}, 
+        E:{-1(3,5), 3(3,4), 5(3,6), 8(5,6), 9(6,9), 10(5,10),
+             11(6,11), 12(10,11), 13(11,12), 15(9,12), 16(4,9)}}
+        removed_vertices = {(e, -1):{1,2}, (v, 2):{1}, (v,5):{8,7}, (v,10):{13}, (v,15):{14}, (v,17):{16}}.
+
+    V2 = {4,10,12} is not empty
+
+        V1 = {}
+        V2 = {10,12}
+        G = {V:{3, 5, 6, 9, 10, 11, 12, 15, 17}, 
+        E:{-1(3,5),-2(3,9), 5(3,6), 8(5,6), 9(6,9), 10(5,10),
+             11(6,11), 12(10,11), 13(11,12), 15(9,12)}}
+        removed_vertices = {(e, -1):{1,2}, (e, -2):{4}, (v, 2):{1}, (v,5):{8,7}, (v,10):{13}, (v,15):{14}, (v,17):{16}}.
+
+    V2 = {10,12} is not empty
+
+        V1 = {}
+        V2 = {12}
+        G = {V:{3, 5, 6, 9, 11, 12, 15, 17}, 
+        E:{-1(3,5),-2(3,9), -3(5,11), 5(3,6), 8(5,6), 9(6,9),
+             11(6,11), 13(11,12), 15(9,12)}}
+        removed_vertices = {(e, -1):{1,2}, (e, -2):{4}, (e,-3):{10,13}, (v, 2):{1}, (v,5):{8,7}, (v,15):{14}, (v,17):{16}}.
+
+    V2 = {12} is not empty
+
+        V1 = {}
+        V2 = {}
+        G = {V:{3, 5, 6, 9, 11, 15, 17}, 
+        E:{-1(3,5),-2(3,9), -3(5,11), -4(9,11), 5(3,6), 8(5,6), 9(6,9), 11(6,11)}}
+        removed_vertices = {(e, -1):{1,2}, (e, -2):{4}, (e,-3):{10,13}, (e, -4):{12},
+             (v, 2):{1}, (v,5):{8,7}, (v,15):{14}, (v,17):{16}}.
+
+Since V1 and V2 are empty we stop our contraction here. 
+
+:Results:
+
+.. code-block:: none
+
+    G = {V:{3, 5, 6, 9, 11, 15, 17}, 
+    E:{-1(3,5),-2(3,9), -3(5,11), -4(9,11), 5(3,6), 8(5,6), 9(6,9), 11(6,11)}}
+    removed_vertices = {(e, -1):{1,2}, (e, -2):{4}, (e,-3):{10,13}, (e, -4):{12},
+         (v, 2):{1}, (v,5):{8,7}, (v,15):{14}, (v,17):{16}}.
+
+Visualy the results are
+    
+.. image:: images/undirected_sampledata_c.png
+
+
+References
+++++++++++++++++++++++++++
+
+* http://www.cs.cmu.edu/afs/cs/academic/class/15210-f12/www/lectures/lecture16.pdf
+* http://algo2.iti.kit.edu/documents/routeplanning/geisberger_dipl.pdf
diff --git a/src/contraction/doc/images/threeNodestwoEdges_a.png b/src/contraction/doc/images/threeNodestwoEdges_a.png
new file mode 100644
index 0000000..d032e36
Binary files /dev/null and b/src/contraction/doc/images/threeNodestwoEdges_a.png differ
diff --git a/src/contraction/doc/images/threeNodestwoEdges_b.png b/src/contraction/doc/images/threeNodestwoEdges_b.png
new file mode 100644
index 0000000..8c05c16
Binary files /dev/null and b/src/contraction/doc/images/threeNodestwoEdges_b.png differ
diff --git a/src/contraction/doc/images/threeNodestwoEdges_c.png b/src/contraction/doc/images/threeNodestwoEdges_c.png
new file mode 100644
index 0000000..7ca8579
Binary files /dev/null and b/src/contraction/doc/images/threeNodestwoEdges_c.png differ
diff --git a/src/contraction/doc/images/twoNodesoneEdge_a.png b/src/contraction/doc/images/twoNodesoneEdge_a.png
new file mode 100644
index 0000000..5cfd295
Binary files /dev/null and b/src/contraction/doc/images/twoNodesoneEdge_a.png differ
diff --git a/src/contraction/doc/images/twoNodesoneEdge_b.png b/src/contraction/doc/images/twoNodesoneEdge_b.png
new file mode 100644
index 0000000..b24993b
Binary files /dev/null and b/src/contraction/doc/images/twoNodesoneEdge_b.png differ
diff --git a/src/contraction/doc/images/undirected_sampledata_a.png b/src/contraction/doc/images/undirected_sampledata_a.png
new file mode 100644
index 0000000..f2aea03
Binary files /dev/null and b/src/contraction/doc/images/undirected_sampledata_a.png differ
diff --git a/src/contraction/doc/images/undirected_sampledata_b.png b/src/contraction/doc/images/undirected_sampledata_b.png
new file mode 100644
index 0000000..5fe691d
Binary files /dev/null and b/src/contraction/doc/images/undirected_sampledata_b.png differ
diff --git a/src/contraction/doc/images/undirected_sampledata_c.png b/src/contraction/doc/images/undirected_sampledata_c.png
new file mode 100644
index 0000000..0fb96a4
Binary files /dev/null and b/src/contraction/doc/images/undirected_sampledata_c.png differ
diff --git a/src/convinience/doc/convenience.rst b/src/convinience/doc/convenience.rst
new file mode 100644
index 0000000..0139dab
--- /dev/null
+++ b/src/convinience/doc/convenience.rst
@@ -0,0 +1,61 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _convenience_functions:
+
+Convenience Functions
+===============================================================================
+
+.. warning::  This are proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+The following functions are general purpose convenience functions that might
+be useful when building a larger application or handling input from say an
+Ajax handler.
+
+  -  :ref:`pgr_point_to_edgenode` - convert a point geometry to a ``vertex_id`` based on closest edge.
+  -  :ref:`pgr_flip_edges` - flip the edges in an array of geometries so the connect end to end.
+  -  :ref:`pgr_text_to_points` - convert a string of ``x,y;x,y;...`` locations into point geometries.
+  -  :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
+
+Distance Matrix Functions
+===============================================================================
+
+These function my be helpful when you need to create or manipulate distance matricies, like for TSP or VRP related problems.
+
+ - :ref:`pgr_points_to_dmatrix` - Create a distance matrix from an array of points.
+ - :ref:`pgr_vids_to_dmatrix` - Create a distance matrix from an array of ``vertix_id``.
+ - :ref:`pgr_vids_to_dmatrix2` - Create a distance matrix from an array of ``vertix_id``.
+
+See also
+--------
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
+
+.. toctree::
+  :hidden:
+
+  pgr_pointToEdgeNode
+  pgr_flipEdges
+  pgr_textToPoints
+  pgr_pointsToVids
+
+  pgr_pointsToDMatrix
+  pgr_vidsToDMatrix
+  pgr_vidsToDMatrix2
+
diff --git a/src/convinience/doc/doc-conversion.queries b/src/convinience/doc/doc-conversion.queries
new file mode 100644
index 0000000..b03de81
--- /dev/null
+++ b/src/convinience/doc/doc-conversion.queries
@@ -0,0 +1,87 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License AS published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_pointtoedgenode('edge_table', 'POINT(2 0)'::geometry, 0.02);
+ pgr_pointtoedgenode 
+---------------------
+                   1
+(1 row)
+
+SELECT * FROM pgr_pointtoedgenode('edge_table', 'POINT(3 2)'::geometry, 0.02);
+ pgr_pointtoedgenode 
+---------------------
+                   6
+(1 row)
+
+--q2
+SELECT st_astext(e) FROM (SELECT unnest(pgr_flipedges(ARRAY[
+'LINESTRING(2 1,2 2)'::geometry,
+'LINESTRING(2 2,2 3)'::geometry,
+'LINESTRING(2 2,2 3)'::geometry,
+'LINESTRING(2 2,3 2)'::geometry,
+'LINESTRING(3 2,4 2)'::geometry,
+'LINESTRING(4 1,4 2)'::geometry,
+'LINESTRING(3 1,4 1)'::geometry,
+'LINESTRING(2 1,3 1)'::geometry,
+'LINESTRING(2 0,2 1)'::geometry,
+'LINESTRING(2 0,2 1)'::geometry]::geometry[])) AS e) AS foo;
+      st_astext      
+---------------------
+ LINESTRING(2 1,2 2)
+ LINESTRING(2 2,2 3)
+ LINESTRING(2 3,2 2)
+ LINESTRING(2 2,3 2)
+ LINESTRING(3 2,4 2)
+ LINESTRING(4 2,4 1)
+ LINESTRING(4 1,3 1)
+ LINESTRING(3 1,2 1)
+ LINESTRING(2 1,2 0)
+ LINESTRING(2 0,2 1)
+(10 rows)
+
+--q3
+SELECT ST_AsText(g) FROM 
+    (SELECT unnest(pgr_texttopoints('2,0;2,1;3,1;2,2', 0)) AS g) AS foo;
+ st_astext  
+------------
+ POINT(2 0)
+ POINT(2 1)
+ POINT(3 1)
+ POINT(2 2)
+(4 rows)
+
+--q4
+SELECT * FROM pgr_pointstovids(
+    pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
+    'edge_table'
+);
+ pgr_pointstovids 
+------------------
+ {1,2,3,5}
+(1 row)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/convinience/doc/doc-matrix.queries b/src/convinience/doc/doc-matrix.queries
new file mode 100644
index 0000000..ab3e782
--- /dev/null
+++ b/src/convinience/doc/doc-matrix.queries
@@ -0,0 +1,100 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_pointstodmatrix(pgr_texttopoints('2,0;2,1;3,1;2,2', 0));
+                                              dmatrix                                              |    ids    
+---------------------------------------------------------------------------------------------------+-----------
+ {{0,1,1.4142135623731,2},{1,0,1,1},{1.4142135623731,1,0,1.4142135623731},{2,1,1.4142135623731,0}} | {1,2,3,4}
+(1 row)
+
+--q1.1
+SELECT * from pgr_tsp(
+    (SELECT dMatrix FROM pgr_pointstodmatrix(pgr_texttopoints('2,0;2,1;3,1;2,2', 0))
+    ),
+    1
+);
+ seq | id 
+-----+----
+   0 |  1
+   1 |  3
+   2 |  2
+   3 |  0
+(4 rows)
+
+--q2
+SELECT * FROM pgr_vidstodmatrix(
+    ARRAY[1,2,3,5],
+    ARRAY(select the_geom FROM edge_table_vertices_pgr WHERE id in (1,2,3,5)),
+    'edge_table'
+);
+                  dmatrix                  |    ids    
+-------------------------------------------+-----------
+ {{0,1,4,2},{1,0,3,1},{4,3,0,2},{2,1,2,0}} | {1,2,3,5}
+(1 row)
+
+--q2.1
+SELECT * FROM pgr_vidstodmatrix(
+    pgr_pointstovids(pgr_texttopoints('2,0;2,1;3,1;2,2', 0), 'edge_table'),
+    pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
+    'edge_table');
+                  dmatrix                  |    ids    
+-------------------------------------------+-----------
+ {{0,1,4,2},{1,0,3,1},{4,3,0,2},{2,1,2,0}} | {1,2,3,5}
+(1 row)
+
+--q2.2
+SELECT * FROM pgr_tsp(
+    (SELECT dMatrix FROM pgr_vidstodmatrix(
+        pgr_pointstovids(pgr_texttopoints('2,0;2,1;3,1;2,2', 0), 'edge_table'),
+        pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
+        'edge_table')
+    ),
+    1
+);
+ seq | id 
+-----+----
+   0 |  1
+   1 |  2
+   2 |  3
+   3 |  0
+(4 rows)
+
+--q3
+SELECT * FROM pgr_vidsToDMatrix(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    array[1,2,3,5],
+    true, true, false);
+             pgr_vidstodmatrix             
+-------------------------------------------
+ {{0,1,6,2},{1,0,5,1},{2,1,0,2},{2,1,4,0}}
+(1 row)
+
+SELECT * FROM pgr_vidsToDMatrix(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    array[1,2,3,5],
+    true, true, true);
+             pgr_vidstodmatrix             
+-------------------------------------------
+ {{0,1,4,2},{1,0,3,1},{4,3,0,3},{2,1,3,0}}
+(1 row)
+
+--q4
+SELECT * FROM pgr_tsp(
+    (SELECT pgr_vidsToDMatrix(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+        array[1,2,3,5],
+        true, true, true)
+    ),
+    1
+);
+ seq | id 
+-----+----
+   0 |  1
+   1 |  2
+   2 |  3
+   3 |  0
+(4 rows)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/convinience/doc/pgr_flipEdges.rst b/src/convinience/doc/pgr_flipEdges.rst
new file mode 100644
index 0000000..a4160e4
--- /dev/null
+++ b/src/convinience/doc/pgr_flipEdges.rst
@@ -0,0 +1,78 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_flip_edges:
+
+pgr_flipEdges
+==============================================================================
+
+.. index::
+        single: flipEdges(ga geometry[]) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_flipEdges`` - 
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+Synopsis
+------------------------------------------------------------------------------
+
+The function returns:
+
+  - ``geometry[]`` An array of the input geometries with the geometries flipped end to end such that the geometries are oriented as a path from start to end.
+
+.. code-block:: sql
+
+        geometry[] pgr_flipEdges(ga geometry[])
+
+
+Description
+-----------------------------------------------------------------------------
+
+Given an array of linestrings that are supposedly connected end to end like the results of a route, check the edges and flip any end for end if they do not connect with the previous seegment and return the array with the segments flipped as appropriate.
+
+.. rubric:: Parameters
+
+:ga: ``geometry[]`` An array of geometries, like the results of a routing query.
+
+.. warning::
+
+    * No checking is done for edges that do not connect.
+    * Input geometries MUST be LINESTRING or MULTILINESTRING.
+    * Only the first LINESTRING of a MULTILINESTRING is considered.
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+.. literalinclude:: doc-conversion.queries
+   :start-after: --q2
+   :end-before: --q3
+
+See also
+--------
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/convinience/doc/pgr_pointToEdgeNode.rst b/src/convinience/doc/pgr_pointToEdgeNode.rst
new file mode 100644
index 0000000..e270455
--- /dev/null
+++ b/src/convinience/doc/pgr_pointToEdgeNode.rst
@@ -0,0 +1,92 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_point_to_edgenode:
+
+pgr_pointToEdgeNode
+==============================================================================
+
+.. index::
+        single: pointToEdgeNode(edges text, pnt geometry, tol float8) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_pointToEdgeNode`` - Converts a point to a ``vertex_id`` based on closest edge.
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+
+Synopsis
+------------------------------------------------------------------------------
+
+The function returns:
+
+  - ``integer`` that is the vertex id of the closest edge in the ``edges`` table within the ``tol`` tolerance of ``pnt``. The vertex is selected by projection the ``pnt`` onto the edge and selecting which vertex is closer along the edge.
+
+.. code-block:: sql
+
+        integer pgr_pointToEdgeNode(edges text, pnt geometry, tol float8)
+
+
+Description
+-----------------------------------------------------------------------------
+
+Given an table ``edges`` with a spatial index on ``the_geom`` and a point geometry search for the closest edge within ``tol`` distance to the edges then compute the projection of the point onto the line segment and select source or target based on whether the projected point is closer to the respective end and return the source or target value.
+
+.. rubric:: Parameters
+
+The function accepts the following parameters:
+
+:edges: ``text`` The name of the edge table or view. (may contain the schema name AS well).
+:pnt: ``geometry`` A point geometry object in the same SRID as ``edges``.
+:tol: ``float8`` The maximum search distance for an edge.
+
+.. warning::
+
+    If no edge is within tol distance then return -1
+
+The ``edges`` table must have the following columns:
+
+    * ``source``
+    * ``target``
+    * ``the_geom``
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+.. literalinclude:: doc-conversion.queries
+   :start-after: --q1
+   :end-before: --q2
+
+The example uses the :ref:`sampledata` network.
+
+See Also
+-----------------------------------------------------------------------------
+
+* :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
+
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/convinience/doc/pgr_pointsToDMatrix.rst b/src/convinience/doc/pgr_pointsToDMatrix.rst
new file mode 100644
index 0000000..a921e42
--- /dev/null
+++ b/src/convinience/doc/pgr_pointsToDMatrix.rst
@@ -0,0 +1,90 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_points_to_dmatrix:
+
+pgr_pointsToDMatrix
+==============================================================================
+
+.. index::
+        single: pointsToDMatrix(pnts geometry[], OUT dmatrix double precision[], OUT ids integer[]) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_pointsToDMatrix`` - Creates a distance matrix from an array of points.
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+
+Synopsis
+------------------------------------------------------------------------------
+
+Create a distance symetric distance matrix suitable for TSP using Euclidean distances based on the st_distance(). You might want to create a variant of this the uses st_distance_sphere() or st_distance_spheriod() or some other function.
+
+The function returns:
+
+  - ``record`` - with two fields as describe here
+        * :dmatrix: ``float8[]`` - the distance matrix suitable to pass to pgrTSP() function.
+        * :ids: ``integer[]`` - an array of ids for the distance matrix.
+
+.. code-block:: sql
+
+        record pgr_pointsToDMatrix(pnts geometry[], OUT dmatrix double precision[], OUT ids integer[])
+
+
+Description
+-----------------------------------------------------------------------------
+
+.. rubric:: Paramters
+
+:pnts: ``geometry[]`` - An array of point geometries.
+
+.. warning::
+
+    The generated matrix will be symmetric as required for pgr_TSP.
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q1
+   :end-before: --q1.1
+
+This example shows how this can be used in the context of feeding the results into pgr_tsp() function.
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q1.1
+   :end-before: --q2
+
+
+See Also
+-----------------------------------------------------------------------------
+
+* :ref:`pgr_vids_to_dmatrix` - convert a point geometry to the closest vertex_id of an edge..
+* :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
+
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/convinience/doc/pgr_pointsToVids.rst b/src/convinience/doc/pgr_pointsToVids.rst
new file mode 100644
index 0000000..2bbab03
--- /dev/null
+++ b/src/convinience/doc/pgr_pointsToVids.rst
@@ -0,0 +1,85 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_points_to_vids:
+
+pgr_pointsToVids
+==============================================================================
+
+.. index::
+        single: pointsToVids(pnts geometry[], edges text, tol float8 DEFAULT(0.01)) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_pointsToVids`` - Converts an array of point geometries into vertex ids.
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+Synopsis
+------------------------------------------------------------------------------
+
+Given an array of point geometries and an edge table and a max search tol distance the function converts points into vertex ids using pgr_pointtoedgenode().
+
+The function returns:
+
+  - ``integer[]`` - An array of ``vertex_id``.
+
+.. code-block:: sql
+
+        integer[] pgr_pointsToVids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
+
+
+Description
+-----------------------------------------------------------------------------
+
+.. rubric:: Paramters
+
+:pnts: ``geometry[]`` - An array of point geometries.
+:edges: ``text`` - The edge table to be used for the conversion.
+:tol: ``float8`` - The maximum search distance for locating the closest edge.
+
+.. warning::
+
+    You need to check the results for any vids=-1 which indicates if failed to locate an edge.
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+.. literalinclude:: doc-conversion.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+This example uses the :ref:`sampledata` network.
+
+
+See Also
+-----------------------------------------------------------------------------
+
+* :ref:`pgr_point_to_edgenode` - convert a point geometry to the closest vertex_id of an edge..
+
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/convinience/doc/pgr_textToPoints.rst b/src/convinience/doc/pgr_textToPoints.rst
new file mode 100644
index 0000000..96524cc
--- /dev/null
+++ b/src/convinience/doc/pgr_textToPoints.rst
@@ -0,0 +1,77 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_text_to_points:
+
+pgr_textToPoints
+==============================================================================
+
+.. index::
+        single: textToPoints(pnts text, srid integer DEFAULT(4326)) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_textToPoints`` - Converts a text string of the format "x,y;x,y;x,y;..." into and array of point geometries.
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+Synopsis
+------------------------------------------------------------------------------
+
+Given a text string of the format "x,y;x,y;x,y;..." and the srid to use, split the string and create and array point geometries. 
+
+The function returns:
+
+  - 
+
+.. code-block:: sql
+
+        integer pgr_textToPoints(pnts text, srid integer DEFAULT(4326))
+
+
+Description
+-----------------------------------------------------------------------------
+
+.. rubric:: Paramters
+
+:pnts: ``text`` A text string of the format "x,y;x,y;x,y;..." where x is longitude and y is latitude if use values in lat-lon.
+:srid: ``integer`` The SRID to use when constructing the point geometry. If the paratmeter is absent it defaults to ``SRID:4326``.
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+.. literalinclude:: doc-conversion.queries
+   :start-after: --q3
+   :end-before: --q4
+
+
+See Also
+-----------------------------------------------------------------------------
+
+* :ref:`pgr_point_to_edgenode` - convert a point geometry to a ``node_id`` based on closest edge.
+* :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/convinience/doc/pgr_vidsToDMatrix.rst b/src/convinience/doc/pgr_vidsToDMatrix.rst
new file mode 100644
index 0000000..c6c2199
--- /dev/null
+++ b/src/convinience/doc/pgr_vidsToDMatrix.rst
@@ -0,0 +1,107 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_vids_to_dmatrix:
+
+pgr_vidsToDMatrix
+==============================================================================
+
+.. index::
+        single: vidsToDMatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1), OUT dmatrix double precision[], OUT ids integer[]) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_vidsToDMatrix`` - Creates a distances matrix from an array of ``vertex_id``.
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+
+Synopsis
+------------------------------------------------------------------------------
+
+This function takes an array of ``vertex_id``, the original array of points used to generate the array of ``vertex_id``, an edge table name and a tol. It then computes kdijkstra() distances for each vertex to all the other vertices and creates a symmetric distance matrix suitable for TSP. The pnt array and the tol are used to establish a BBOX for limiting selection of edges. The extents of the points is expanded by tol.
+
+The function returns:
+
+  - ``record`` - with two fields as describe here
+        * :dmatrix: ``float8[]`` - the distance matrix suitable to pass to pgrTSP() function.
+        * :ids: ``integer[]`` - an array of ids for the distance matrix.
+                  
+
+.. code-block:: sql
+
+        record pgr_vidsToDMatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1), OUT dmatrix double precision[], OUT ids integer[])
+
+
+Description
+-----------------------------------------------------------------------------
+
+.. rubric:: Paramters
+
+:vids: ``integer[]`` - An array of ``vertex_id``.
+:pnts: ``geometry[]`` - An array of point geometries that approximates the extents of the ``vertex_id``.
+:edges: ``text`` - The edge table to be used for the conversion.
+:tol: ``float8`` - The amount to expand the BBOX extents of ``pnts`` when building the graph.
+
+.. warning::
+
+    * we compute a symmetric matrix because TSP requires that so the distances are better the Euclidean but but are not perfect
+    * kdijkstra() can fail to find a path between some of the vertex ids. We to not detect this other than the cost might get set to -1.0, so the dmatrix shoule be checked for this as it makes it invalid for TSP
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+This example uses existing data of points.
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q2
+   :end-before: --q2.1
+
+This example uses points that are not part of the graph.
+    - :ref:`pgr_text_to_points` - is used to convert the locations into point geometries.
+    - :ref:`pgr_points_to_vids` - to convert the array of point geometries into vertex ids.
+
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q2.1
+   :end-before: --q2.2
+
+
+This example shows how this can be used in the context of feeding the results into pgr_tsp() function.
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q2.2
+   :end-before: --q3
+
+This example uses the :ref:`sampledata` network.
+
+
+See Also
+-----------------------------------------------------------------------------
+
+* :ref:`pgr_text_to_points` - Create an array of points from a text string.
+* :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/src/convinience/doc/pgr_vidsToDMatrix2.rst b/src/convinience/doc/pgr_vidsToDMatrix2.rst
new file mode 100644
index 0000000..04e524a
--- /dev/null
+++ b/src/convinience/doc/pgr_vidsToDMatrix2.rst
@@ -0,0 +1,98 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_vids_to_dmatrix2:
+
+pgr_vidsToDMatrix
+==============================================================================
+
+.. index::
+        single: vidsToDMatrix(IN sql text, IN vids integer[], IN directed boolean, IN has_reverse_cost boolean, IN want_symmetric boolean, OUT dmatrix double precision[]) --proposed
+
+
+Name
+------------------------------------------------------------------------------
+
+``pgr_vidsToDMatrix`` - Creates a distances matrix from an array of ``vertex_id``.
+
+.. warning::  This is a proposed function
+
+     - Is not officially in the release.
+     - Name could change.
+     - Signature could change.
+     - Needs testing.
+     - Functionality could change.
+
+
+Synopsis
+------------------------------------------------------------------------------
+
+This function takes an array of ``vertex_id``, a ``sql`` statement to select the edges, and some boolean arguments to control the behavior. It then computes kdijkstra() distances for each vertex to all the other vertices and creates a distance matrix suitable for TSP.
+
+The function returns:
+
+    * :dmatrix: ``float8[]`` - the distance matrix suitable to pass to pgr_TSP() function.
+
+.. code-block:: sql
+
+        pgr_vidsToDMatrix(IN sql text, IN vids integer[], IN directed boolean, IN has_reverse_cost boolean, IN want_symmetric boolean, OUT dmatrix double precision[])
+
+
+
+Description
+-----------------------------------------------------------------------------
+
+.. rubric:: Paramters
+
+:sql: ``text`` - A SQL statement to select the edges needed for the solution.
+:vids: ``integer[]`` - An array of ``vertex_id``.
+:directed: ``boolean`` - A flag to indicate if the graph is directed.
+:has_reverse_cost: ``boolean`` - A flag to indicate if the SQL has a column ``reverse_cost``.
+:want_symmetric: ``boolean`` - A flag to indicate if you want a symmetric or asymmetric matrix. You will need a symmetric matrix for pgr_TSP(). If the matriix is asymmetric, the then the cell(i,j) and cell(j,i) will be set to the average of those two cells except if one or the other are -1.0 then it will take the value of the other cell. If both are negative they will be left alone.
+
+.. warning::
+
+    * kdijkstra() can fail to find a path between some of the vertex ids. We to not detect this other than the cost might get set to -1.0, so the dmatrix shoule be checked for this as it makes it invalid for TSP
+
+
+
+.. rubric:: History
+
+* Proposed in version 2.1.0
+
+
+Examples
+-----------------------------------------------------------------------------
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q3
+   :end-before: --q4
+
+
+This example shows how this can be used in the context of feeding the results into pgr_tsp() function.
+
+.. literalinclude:: doc-matrix.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+This example uses the :ref:`sampledata` network.
+
+
+See Also
+-----------------------------------------------------------------------------
+
+* :ref:`pgr_vids_to_dmatrix` -  - Creates a distances matrix from an array of ``vertex_id``.
+* :ref:`pgr_text_to_points` - Create an array of points from a text string.
+* :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/src/convinience/sql/CMakeLists.txt b/src/convinience/sql/CMakeLists.txt
new file mode 100644
index 0000000..6620990
--- /dev/null
+++ b/src/convinience/sql/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_conversion_tools.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_dmatrix_tools.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/pgr_vidsToDMatrix_dir.sql
+)
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/convinience/sql/pgr_vidsToDMatrix_dir.sql b/src/convinience/sql/pgr_vidsToDMatrix_dir.sql
new file mode 100644
index 0000000..6f95723
--- /dev/null
+++ b/src/convinience/sql/pgr_vidsToDMatrix_dir.sql
@@ -0,0 +1,29 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; IF not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+CREATE OR REPLACE FUNCTION pgr_vidsToDMatrix(sql text,
+    vids integer[], dir bool, has_rcost bool, want_symmetric bool)
+RETURNS float8[]
+AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'manytomany_dijkstra_dmatrix'
+LANGUAGE C STABLE STRICT;
diff --git a/src/convinience/sql/pgrouting_conversion_tools.sql b/src/convinience/sql/pgrouting_conversion_tools.sql
new file mode 100644
index 0000000..8c9acb5
--- /dev/null
+++ b/src/convinience/sql/pgrouting_conversion_tools.sql
@@ -0,0 +1,183 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+create or replace function pgr_pointtoedgenode(edges text, pnt geometry, tol float8)
+    returns integer as
+$body$
+/*
+ *  pgr_pointtoedgenode(edges text, pnt geometry, tol float8)
+ *
+ *  Given and table of edges with a spatial index on the_geom
+ *  and a point geometry search for the closest edge within tol distance to the edges
+ *  then compute the projection of the point onto the line segment and select source or target
+ *  based on whether the projected point is closer to the respective end and return source or target.
+ *  If no edge is within tol distance then return -1
+*/
+declare
+    rr record;
+    pct float;
+    debuglevel text;
+    
+begin
+    -- find the closest edge within tol distance
+    execute 'select * from ' || _pgr_quote_ident(edges) || 
+            ' where st_dwithin(''' || pnt::text ||
+            '''::geometry, the_geom, ' || tol || ') order by st_distance(''' || pnt::text ||
+            '''::geometry, the_geom) asc limit 1' into rr;
+
+    if rr.the_geom is not null then
+        -- deal with MULTILINESTRINGS
+        if geometrytype(rr.the_geom)='MULTILINESTRING' THEN
+            rr.the_geom := ST_GeometryN(rr.the_geom, 1);
+        end if;
+
+        -- project the point onto the linestring
+        execute 'show client_min_messages' into debuglevel;
+        SET client_min_messages='ERROR';
+        pct := st_line_locate_point(rr.the_geom, pnt);
+        execute 'set client_min_messages  to '|| debuglevel;
+
+        -- return the node we are closer to
+        if pct < 0.5 then
+            return rr.source;
+        else
+            return rr.target;
+        end if;
+    else
+        -- return a failure to find an edge within tol distance
+        return -1;
+    end if;
+end;
+$body$
+  language plpgsql volatile
+  cost 5;
+
+
+----------------------------------------------------------------------------
+
+create or replace function pgr_flipedges(ga geometry[])
+    returns geometry[] as
+$body$
+/*
+ *  pgr_flipedges(ga geometry[])
+ *
+ *  Given an array of linestrings that are supposedly connected end to end like the results
+ *  of a route, check the edges and flip any end for end if they do not connect with the
+ *  previous seegment and return the array with the segments flipped as appropriate.
+ *
+ *  NOTE: no error checking is done for conditions like adjacent edges are not connected.
+*/
+declare
+    nn integer;
+    i integer;
+    g geometry;
+    
+begin
+    -- get the count of edges, and return if only one edge
+    nn := array_length(ga, 1);
+    if nn=1 then
+        return ga;
+    end if;
+
+    -- determine if first needs to be flipped
+    g := _pgr_startpoint(ga[1]);
+
+    -- if the start of the first is connected to the second then it needs to be flipped
+    if _pgr_startpoint(ga[2])=g or _pgr_endpoint(ga[2])=g then
+        ga[1] := st_reverse(ga[1]);
+    end if;
+    g := _pgr_endpoint(ga[1]);
+
+    -- now if  the end of the last edge matchs the end of the current edge we need to flip it
+    for i in 2 .. nn loop
+        if _pgr_endpoint(ga[i])=g then
+            ga[i] := st_reverse(ga[i]);
+        end if;
+        -- save the end of this edge into the last end for the next cycle
+        g := _pgr_endpoint(ga[i]);
+    end loop;
+
+    return ga;
+end;
+$body$
+    language plpgsql immutable;
+
+
+------------------------------------------------------------------------------
+
+create or replace function pgr_texttopoints(pnts text, srid integer DEFAULT(4326))
+    returns geometry[] as
+$body$
+/*
+ *  pgr_texttopoints(pnts text, srid integer DEFAULT(4326))
+ *
+ *  Given a text string of the format "x,y;x,y;x,y;..." and the srid to use,
+ *  split the string and create and array point geometries
+*/
+declare
+    a text[];
+    t text;
+    p geometry;
+    g geometry[];
+    
+begin
+    -- convert commas to space and split on ';'
+    a := string_to_array(replace(pnts, ',', ' '), ';');
+    -- convert each 'x y' into a point geometry and concattenate into a new array
+    for t in select unnest(a) loop
+        p := st_pointfromtext('POINT(' || t || ')', srid);
+        g := g || p;
+    end loop;
+
+    return g;
+end;
+$body$
+    language plpgsql immutable;
+
+-----------------------------------------------------------------------
+
+create or replace function pgr_pointstovids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
+    returns integer[] as
+$body$
+/*
+ *  pgr_pointstovids(pnts geometry[], edges text, tol float8 DEFAULT(0.01))
+ *
+ *  Given an array of point geometries and an edge table and a max search tol distance
+ *  convert points into vertex ids using pgr_pointtoedgenode()
+ *
+ *  NOTE: You need to check the results for any vids=-1 which indicates if failed to locate an edge
+*/
+declare
+    v integer[];
+    g geometry;
+    
+begin
+    -- cycle through each point and locate the nearest edge and vertex on that edge
+    for g in select unnest(pnts) loop
+        v := v || pgr_pointtoedgenode(edges, g, tol);
+    end loop;
+
+    return v;
+end;
+$body$
+    language plpgsql stable;
+
diff --git a/src/convinience/sql/pgrouting_dmatrix_tools.sql b/src/convinience/sql/pgrouting_dmatrix_tools.sql
new file mode 100644
index 0000000..8f23f70
--- /dev/null
+++ b/src/convinience/sql/pgrouting_dmatrix_tools.sql
@@ -0,0 +1,142 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+create or replace function pgr_pointstodmatrix(pnts geometry[], mode integer default (0), OUT dmatrix double precision[], OUT ids integer[])
+    returns record as
+$body$
+/*
+ *  pgr_pointstodmatrix(pnts geometry[], OUT dmatrix double precision[], OUT ids integer[])
+ *
+ *  Create a distance symetric distance matrix suitable for TSP using Euclidean distances
+ *  based on the st_distance(). You might want to create a variant of this the uses st_distance_sphere()
+ *  or st_distance_spheriod() or some other function.
+ *
+*/
+declare
+    r record;
+    
+begin
+    dmatrix := array[]::double precision[];
+    ids := array[]::integer[];
+
+    -- create an id for each point in the array and unnest it into a table nodes in the with clause
+    for r in with nodes as (select row_number() over()::integer as id, p from (select unnest(pnts) as p) as foo)
+        -- compute a row of distances
+        select i, array_agg(dist) as arow from (
+            select a.id as i, b.id as j, 
+                case when mode=0
+                    then st_distance(a.p, b.p)
+                    else st_distance_sphere(a.p, b.p)
+                end as dist
+              from nodes a, nodes b
+             order by a.id, b.id
+           ) as foo group by i order by i loop
+
+        -- you must concat an array[array[]] to make dmatrix[][]
+        -- concat the row of distances to the dmatrix
+        dmatrix := array_cat(dmatrix, array[r.arow]);
+        ids := ids || array[r.i];
+    end loop;
+end;
+$body$
+    language plpgsql stable;
+
+
+------------------------------------------------------------------------------
+
+create or replace function pgr_vidstodmatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1), OUT dmatrix double precision[], OUT ids integer[])
+    returns record as
+$body$
+/*
+ *  pgr_vidstodmatrix(IN vids integer[], IN pnts geometry[], IN edges text, tol float8 DEFAULT(0.1),
+ *                    OUT dmatrix double precision[], OUT ids integer[])
+ *
+ *  This function thats an array vertex ids, the original array of points, the edge table name and a tol.
+ *  It then computes kdijkstra() distances for each vertex to all the other vertices and creates a symmetric
+ *  distances matrix suitable for TSP. The pnt array and the tol are used to establish a BBOX for limiteding
+ *  selection of edges.the extents of the points is expanded by tol.
+ *
+ *  NOTES:
+ *  1. we compute a symmetric matrix because TSP requires that so the distances are better the Euclidean but
+ *     but are not perfect
+ *  2. kdijkstra() can fail to find a path between some of the vertex ids. We to not detect this other than
+ *     the cost might get set to -1.0, so the dmatrix shoule be checked for this as it makes it invalid for TSP
+ *
+*/
+declare
+    i integer;
+    j integer;
+    nn integer;
+    rr record;
+    bbox geometry;
+    t float8[];
+
+begin
+    -- check if the input arrays has any -1 values, maybe this whould be a raise exception
+    if vids @> ARRAY[-1] then
+    raise notice 'Some vids are undefined (-1)!';
+    dmatrix := null;
+    ids := null;
+    return;
+    end if;
+
+    ids := vids;
+
+    -- get the count of nodes
+    nn := array_length(vids,1);
+
+    -- zero out a dummy row
+    for i in 1 .. nn loop
+        t := t || 0.0::float8;
+    end loop;
+
+    -- using the dummy row, zero out the whole matrix
+    for i in 1 .. nn loop
+    dmatrix := dmatrix || ARRAY[t];
+    end loop;
+
+    for i in 1 .. nn-1 loop
+        j := i;
+        -- compute the bbox for the point needed for this row
+        select st_expand(st_collect(pnts[id]), tol) into bbox
+          from (select generate_series as id from generate_series(i, nn)) as foo;
+
+        -- compute kdijkstra() for this row
+        for rr in execute 'select * from pgr_dijkstracost($1, $2, $3, false)'
+                  using 'select id, source, target, cost from ' || edges || 
+                        ' where the_geom && ''' || bbox::text || '''::geometry'::text, vids[i], vids[i+1:nn] loop
+
+            -- TODO need to check that all node were reachable from source
+            -- I think unreachable paths between nodes returns cost=-1.0
+
+            -- populate the matrix with the cost values, remember this is symmetric
+            j := j + 1;
+            -- raise notice 'cost(%,%)=%', i, j, rr.agg_cost;
+            dmatrix[i][j] := rr.agg_cost;
+            dmatrix[j][i] := rr.agg_cost;
+        end loop;
+    end loop;
+
+end;
+$body$
+    language plpgsql stable cost 200;
+
diff --git a/src/convinience/test/doc-conversion.result b/src/convinience/test/doc-conversion.result
new file mode 100644
index 0000000..2bdf71c
--- /dev/null
+++ b/src/convinience/test/doc-conversion.result
@@ -0,0 +1,22 @@
+--q1
+1
+6
+--q2
+LINESTRING(2 1,2 2)
+LINESTRING(2 2,2 3)
+LINESTRING(2 3,2 2)
+LINESTRING(2 2,3 2)
+LINESTRING(3 2,4 2)
+LINESTRING(4 2,4 1)
+LINESTRING(4 1,3 1)
+LINESTRING(3 1,2 1)
+LINESTRING(2 1,2 0)
+LINESTRING(2 0,2 1)
+--q3
+POINT(2 0)
+POINT(2 1)
+POINT(3 1)
+POINT(2 2)
+--q4
+{1,2,3,5}
+--q5
diff --git a/src/convinience/test/doc-conversion.test.sql b/src/convinience/test/doc-conversion.test.sql
new file mode 100644
index 0000000..a1f80ec
--- /dev/null
+++ b/src/convinience/test/doc-conversion.test.sql
@@ -0,0 +1,50 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License AS published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+BEGIN;
+\echo --q1
+SELECT * FROM pgr_pointtoedgenode('edge_table', 'POINT(2 0)'::geometry, 0.02);
+SELECT * FROM pgr_pointtoedgenode('edge_table', 'POINT(3 2)'::geometry, 0.02);
+
+\echo --q2
+SELECT st_astext(e) FROM (SELECT unnest(pgr_flipedges(ARRAY[
+'LINESTRING(2 1,2 2)'::geometry,
+'LINESTRING(2 2,2 3)'::geometry,
+'LINESTRING(2 2,2 3)'::geometry,
+'LINESTRING(2 2,3 2)'::geometry,
+'LINESTRING(3 2,4 2)'::geometry,
+'LINESTRING(4 1,4 2)'::geometry,
+'LINESTRING(3 1,4 1)'::geometry,
+'LINESTRING(2 1,3 1)'::geometry,
+'LINESTRING(2 0,2 1)'::geometry,
+'LINESTRING(2 0,2 1)'::geometry]::geometry[])) AS e) AS foo;
+\echo --q3
+SELECT ST_AsText(g) FROM 
+    (SELECT unnest(pgr_texttopoints('2,0;2,1;3,1;2,2', 0)) AS g) AS foo;
+
+\echo --q4
+SELECT * FROM pgr_pointstovids(
+    pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
+    'edge_table'
+);
+\echo --q5
+ROLLBACK;
diff --git a/src/convinience/test/doc-matrix.result b/src/convinience/test/doc-matrix.result
new file mode 100644
index 0000000..abab630
--- /dev/null
+++ b/src/convinience/test/doc-matrix.result
@@ -0,0 +1,25 @@
+--q1
+{{0,1,1.4142135623731,2},{1,0,1,1},{1.4142135623731,1,0,1.4142135623731},{2,1,1.4142135623731,0}}|{1,2,3,4}
+--q1.1
+0|1
+1|3
+2|2
+3|0
+--q2
+{{0,1,4,2},{1,0,3,1},{4,3,0,2},{2,1,2,0}}|{1,2,3,5}
+--q2.1
+{{0,1,4,2},{1,0,3,1},{4,3,0,2},{2,1,2,0}}|{1,2,3,5}
+--q2.2
+0|1
+1|2
+2|3
+3|0
+--q3
+{{0,1,6,2},{1,0,5,1},{2,1,0,2},{2,1,4,0}}
+{{0,1,4,2},{1,0,3,1},{4,3,0,3},{2,1,3,0}}
+--q4
+0|1
+1|2
+2|3
+3|0
+--q5
diff --git a/src/convinience/test/doc-matrix.test.sql b/src/convinience/test/doc-matrix.test.sql
new file mode 100644
index 0000000..94a26ec
--- /dev/null
+++ b/src/convinience/test/doc-matrix.test.sql
@@ -0,0 +1,57 @@
+BEGIN;
+
+\echo --q1
+SELECT * FROM pgr_pointstodmatrix(pgr_texttopoints('2,0;2,1;3,1;2,2', 0));
+
+\echo --q1.1
+SELECT * from pgr_tsp(
+    (SELECT dMatrix FROM pgr_pointstodmatrix(pgr_texttopoints('2,0;2,1;3,1;2,2', 0))
+    ),
+    1
+);
+
+\echo --q2
+
+SELECT * FROM pgr_vidstodmatrix(
+    ARRAY[1,2,3,5],
+    ARRAY(select the_geom FROM edge_table_vertices_pgr WHERE id in (1,2,3,5)),
+    'edge_table'
+);
+
+\echo --q2.1
+SELECT * FROM pgr_vidstodmatrix(
+    pgr_pointstovids(pgr_texttopoints('2,0;2,1;3,1;2,2', 0), 'edge_table'),
+    pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
+    'edge_table');
+
+\echo --q2.2
+SELECT * FROM pgr_tsp(
+    (SELECT dMatrix FROM pgr_vidstodmatrix(
+        pgr_pointstovids(pgr_texttopoints('2,0;2,1;3,1;2,2', 0), 'edge_table'),
+        pgr_texttopoints('2,0;2,1;3,1;2,2', 0),
+        'edge_table')
+    ),
+    1
+);
+\echo --q3
+SELECT * FROM pgr_vidsToDMatrix(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    array[1,2,3,5],
+    true, true, false);
+
+SELECT * FROM pgr_vidsToDMatrix(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    array[1,2,3,5],
+    true, true, true);
+\echo --q4
+SELECT * FROM pgr_tsp(
+    (SELECT pgr_vidsToDMatrix(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+        array[1,2,3,5],
+        true, true, true)
+    ),
+    1
+);
+\echo --q5
+
+ROLLBACK;
diff --git a/src/convinience/test/pgtap/flipEdges-types-check.sql b/src/convinience/test/pgtap/flipEdges-types-check.sql
new file mode 100644
index 0000000..e043917
--- /dev/null
+++ b/src/convinience/test/pgtap/flipEdges-types-check.sql
@@ -0,0 +1,13 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(2);
+
+-- RECEIVES 1 PARAMETERS
+
+SELECT has_function('pgr_flipedges',ARRAY['geometry[]']);
+SELECT function_returns('pgr_flipedges', 'geometry[]','Returns geometry[]');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/convinience/test/pgtap/pointToEdgeNode-types-check.sql b/src/convinience/test/pgtap/pointToEdgeNode-types-check.sql
new file mode 100644
index 0000000..6fc7e1e
--- /dev/null
+++ b/src/convinience/test/pgtap/pointToEdgeNode-types-check.sql
@@ -0,0 +1,14 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(3);
+
+-- PARAMETERS
+
+SELECT has_function('pgr_pointtoedgenode',ARRAY['text', 'geometry', 'double precision']);
+SELECT hasnt_function('pgr_pointtoedgenode',ARRAY['text', 'geometry']);
+SELECT function_returns('pgr_pointtoedgenode', 'integer','Returns integer');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/convinience/test/pgtap/pointsToDMatrix-types-check.sql b/src/convinience/test/pgtap/pointsToDMatrix-types-check.sql
new file mode 100644
index 0000000..0e246f2
--- /dev/null
+++ b/src/convinience/test/pgtap/pointsToDMatrix-types-check.sql
@@ -0,0 +1,14 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(3);
+
+-- PARAMETERS
+SELECT todo('Fix: code or documentation',3);
+SELECT has_function('pgr_pointstodmatrix',ARRAY['geometry[]']);
+SELECT hasnt_function('pgr_pointstodmatrix',ARRAY['geometry[]', 'integer']);
+SELECT function_returns('pgr_pointstodmatrix',ARRAY['geometry[]'],'record');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/convinience/test/pgtap/pointsToVids-types-check.sql b/src/convinience/test/pgtap/pointsToVids-types-check.sql
new file mode 100644
index 0000000..74f60c9
--- /dev/null
+++ b/src/convinience/test/pgtap/pointsToVids-types-check.sql
@@ -0,0 +1,13 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(2);
+
+-- PARAMETERS
+
+SELECT has_function('pgr_pointstovids',ARRAY['geometry[]', 'text', 'double precision']);
+SELECT function_returns('pgr_pointstovids',ARRAY['geometry[]', 'text', 'double precision'],'integer[]');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/convinience/test/pgtap/textToPoints-types-check.sql b/src/convinience/test/pgtap/textToPoints-types-check.sql
new file mode 100644
index 0000000..12f25d6
--- /dev/null
+++ b/src/convinience/test/pgtap/textToPoints-types-check.sql
@@ -0,0 +1,15 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATIONS INFORMATION
+
+SELECT plan(2);
+
+-- PARAMETERS
+
+SELECT has_function('pgr_texttopoints',ARRAY['text', 'integer']);
+
+SELECT todo('Documentation''s signature says it returns an integer',1); 
+SELECT function_returns('pgr_texttopoints', ARRAY['text', 'integer'], 'integer');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/convinience/test/pgtap/vidsToDMatrix-types-check.sql b/src/convinience/test/pgtap/vidsToDMatrix-types-check.sql
new file mode 100644
index 0000000..2648277
--- /dev/null
+++ b/src/convinience/test/pgtap/vidsToDMatrix-types-check.sql
@@ -0,0 +1,17 @@
+
+\i setup.sql
+-- TESTING DOCUMNETATION INFORMATION
+
+SELECT plan(4);
+
+-- PARAMETERS
+
+SELECT has_function('pgr_vidstodmatrix',ARRAY['integer[]', 'geometry[]', 'text','double precision']);
+SELECT function_returns('pgr_vidstodmatrix',ARRAY['integer[]', 'geometry[]', 'text','double precision'],'record');
+
+--pgr_vidsToDMatrix(IN sql text, IN vids integer[], IN directed boolean, IN has_reverse_cost boolean, IN want_symmetric boolean, OUT dmatrix double precision[])
+SELECT has_function('pgr_vidstodmatrix',ARRAY['text','integer[]', 'boolean', 'boolean', 'boolean']);
+SELECT function_returns('pgr_vidstodmatrix',ARRAY['text','integer[]', 'boolean', 'boolean', 'boolean'],'double precision[]');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/convinience/test/test.conf b/src/convinience/test/test.conf
new file mode 100644
index 0000000..04fc77f
--- /dev/null
+++ b/src/convinience/test/test.conf
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+    'any' => {
+        'comment' => 'pgr_createTopology, pgr_analyzegraph, and pgr_analyzeOneway tests for any versions.',
+        'data' => ['sampledata.data'],
+        'tests' => [qw( 
+            vidstodmatrix-any-01
+            doc-matrix
+            doc-conversion
+
+            )],
+
+        'documentation' => [qw(
+            doc-matrix
+            doc-conversion
+            )],
+
+        'dummyStorage' => [qw(
+            )]
+
+    },
+# 'vpg-vpgis' => {}, # for version specific tests
+# '8-1' => {}, # for pg 8.x and postgis 1.x
+# '9.2-2.1' => {}, # for pg 9.2 and postgis 2.1
+);
+
+1;
diff --git a/src/convinience/test/vidstodmatrix-any-01.result b/src/convinience/test/vidstodmatrix-any-01.result
new file mode 100644
index 0000000..139be2f
--- /dev/null
+++ b/src/convinience/test/vidstodmatrix-any-01.result
@@ -0,0 +1,2 @@
+{{0,2,4,4,5,5},{2,0,2,2,3,3},{4,2,0,2,3,5},{6,4,6,0,1,3},{5,3,5,3,0,2},{3,3,5,3,2,0}}
+{{0,2,4,5,5,4},{2,0,2,3,3,3},{4,2,0,4,4,5},{5,3,4,0,2,3},{5,3,4,2,0,2},{4,3,5,3,2,0}}
diff --git a/src/convinience/test/vidstodmatrix-any-01.test.sql b/src/convinience/test/vidstodmatrix-any-01.test.sql
new file mode 100644
index 0000000..e6d217c
--- /dev/null
+++ b/src/convinience/test/vidstodmatrix-any-01.test.sql
@@ -0,0 +1,34 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+BEGIN;
+    select * from pgr_vidsToDMatrix(
+        'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+        array[1,5,13,11,12,4],
+        true, true, false);
+
+    select * from pgr_vidsToDMatrix(
+        'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+        array[1,5,13,11,12,4],
+        true, true, true);
+    ROLLBACK
diff --git a/src/dijkstra/CMakeLists.txt b/src/dijkstra/CMakeLists.txt
deleted file mode 100644
index 29971dd..0000000
--- a/src/dijkstra/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-SET(PACKAGE_SQL_FILES "")
-ADD_SUBDIRECTORY(sql)
-SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
-#MESSAGE("core/dijkstra: ${PACKAGE_SQL_FILES}")
-SUBDIRS(doc src test)
diff --git a/src/dijkstra/demo/boost_demo.sql b/src/dijkstra/demo/boost_demo.sql
new file mode 100644
index 0000000..9b7eede
--- /dev/null
+++ b/src/dijkstra/demo/boost_demo.sql
@@ -0,0 +1,80 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*
+DEMO from:
+ http://www.boost.org/doc/libs/1_59_0/libs/graph/example/dijkstra-example.cpp
+ const int num_nodes = 5;
+  enum nodes { A, B, C, D, E }; = 1
+  char name[] = "ABCDE";
+  Edge edge_array[] = { Edge(A, C), Edge(B, B), Edge(B, D), Edge(B, E),
+    Edge(C, B), Edge(C, D), Edge(D, E), Edge(E, A), Edge(E, B)
+  };
+  int weights[] = { 1, 2, 1, 2, 7, 3, 1, 1, 1 };
+*/
+
+DROP TABLE IF EXISTS table1;
+CREATE TABLE table1 (
+    id SERIAL,
+    source INTEGER,
+    target INTEGER,
+    source_name TEXT,
+    target_name TEXT,
+    cost FLOAT
+);
+DROP TABLE IF EXISTS table1_vertices;
+CREATE TABLE table1_vertices (
+    vid SERIAL,
+    name TEXT
+);
+
+INSERT INTO table1_vertices (name) VALUES ('A');
+INSERT INTO table1_vertices (name) VALUES ('B');
+INSERT INTO table1_vertices (name) VALUES ('C');
+INSERT INTO table1_vertices (name) VALUES ('D');
+INSERT INTO table1_vertices (name) VALUES ('E');
+
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('A', 'C', 1);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('B', 'B', 2);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('B', 'D', 1);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('B', 'E', 2);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('C', 'B', 7);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('C', 'D', 3);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('D', 'E', 1);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('E', 'A', 1);
+INSERT INTO table1 (source_name, target_name, cost) VALUES ('E', 'B', 1);
+
+UPDATE table1 
+  SET source = table1_vertices.vid
+FROM table1_vertices
+WHERE source_name = name;
+
+UPDATE table1 SET target = table1_vertices.vid
+FROM table1_vertices
+WHERE target_name = name;
+
+-- Their output starts with 0 so we substract 1 to the vid
+-- pgrouting: no paths or 0 length (aka I am there, so no path) are not included
+SELECT end_vid-1, agg_cost FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM table1',
+    1, ARRAY[1, 2, 3, 4, 5], true) where edge < 0 order by end_vid;
+
diff --git a/src/dijkstra/demo/hanoslav_demo.sql b/src/dijkstra/demo/hanoslav_demo.sql
new file mode 100644
index 0000000..235d50c
--- /dev/null
+++ b/src/dijkstra/demo/hanoslav_demo.sql
@@ -0,0 +1,97 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*
+DEMO from:
+http://hansolav.net/sql/graphs.html
+*/
+
+SET client_min_messages TO WARNING;
+
+DROP TABLE IF EXISTS table1_vertices;
+CREATE TABLE table1_vertices (
+    vid SERIAL PRIMARY KEY,
+    name TEXT
+);
+
+DROP TABLE IF EXISTS table1;
+CREATE TABLE table1 (
+    id SERIAL,
+    source INTEGER REFERENCES table1_vertices(vid),
+    target INTEGER REFERENCES table1_vertices(vid),
+    cost FLOAT
+);
+
+INSERT INTO table1_vertices (name) VALUES ('Seatle');
+INSERT INTO table1_vertices (name) VALUES ('San Francisco');
+INSERT INTO table1_vertices (name) VALUES ('Las Vegas');
+INSERT INTO table1_vertices (name) VALUES ('Los Angeles');
+INSERT INTO table1_vertices (name) VALUES ('Denver');
+INSERT INTO table1_vertices (name) VALUES ('Minneapolis');
+INSERT INTO table1_vertices (name) VALUES ('Dallas');
+INSERT INTO table1_vertices (name) VALUES ('Chicago');
+INSERT INTO table1_vertices (name) VALUES ('Washington D.C.');
+INSERT INTO table1_vertices (name) VALUES ('Boston');
+INSERT INTO table1_vertices (name) VALUES ('Nueva York');
+INSERT INTO table1_vertices (name) VALUES ('Miami');
+
+INSERT INTO table1 (source, target, cost) VALUES ( 1,  2, 1306);
+INSERT INTO table1 (source, target, cost) VALUES ( 1,  5, 2161);
+INSERT INTO table1 (source, target, cost) VALUES ( 1,  6, 2661);
+INSERT INTO table1 (source, target, cost) VALUES ( 2,  3,  919);
+INSERT INTO table1 (source, target, cost) VALUES ( 2,  4,  629);
+INSERT INTO table1 (source, target, cost) VALUES ( 3,  4,  435);
+INSERT INTO table1 (source, target, cost) VALUES ( 3,  5, 1225);
+INSERT INTO table1 (source, target, cost) VALUES ( 3,  7, 1983);
+INSERT INTO table1 (source, target, cost) VALUES ( 5,  6, 1483);
+INSERT INTO table1 (source, target, cost) VALUES ( 5,  7, 1258);
+INSERT INTO table1 (source, target, cost) VALUES ( 6,  7, 1532);
+INSERT INTO table1 (source, target, cost) VALUES ( 6,  8,  661);
+INSERT INTO table1 (source, target, cost) VALUES ( 7,  9, 2113);
+INSERT INTO table1 (source, target, cost) VALUES ( 7, 12, 2161);
+INSERT INTO table1 (source, target, cost) VALUES ( 8,  9, 1145);
+INSERT INTO table1 (source, target, cost) VALUES ( 8, 10, 1613);
+INSERT INTO table1 (source, target, cost) VALUES ( 9, 10,  725);
+INSERT INTO table1 (source, target, cost) VALUES ( 9, 11,  383);
+INSERT INTO table1 (source, target, cost) VALUES ( 9, 12, 1709);
+INSERT INTO table1 (source, target, cost) VALUES (10, 11,  338);
+INSERT INTO table1 (source, target, cost) VALUES (11, 12, 2145);
+
+SET client_min_messages TO NOTICE;
+
+-- Their output starts with 0 so we substract 1 to the vid
+-- pgrouting: no paths or 0 length (aka I am there, so no path) are not included
+SELECT  name, cost, agg_cost  FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM table1',
+    1,  6, true)
+    JOIN table1_vertices ON (node = vid) ORDER BY seq;
+
+SELECT  name, cost, agg_cost  FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM table1',
+    1,  11, true)
+    JOIN table1_vertices ON (node = vid) ORDER BY seq;
+
+select end_vid, array_to_string( array_agg(name ORDER BY seq),','), array_agg(node ORDER BY seq) 
+FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM table1',
+    1,  ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], true)
+JOIN table1_vertices ON (node = vid) GROUP BY end_vid; 
diff --git a/src/dijkstra/demo/wiki_demo.sql b/src/dijkstra/demo/wiki_demo.sql
new file mode 100644
index 0000000..0010e82
--- /dev/null
+++ b/src/dijkstra/demo/wiki_demo.sql
@@ -0,0 +1,49 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/*
+DEMO from:
+https://en.wikipedia.org/wiki/Dijkstra's_algorithm
+*/
+
+DROP TABLE IF EXISTS table1;
+CREATE TABLE table1 (
+    id SERIAL,
+    source INTEGER,
+    target INTEGER,
+    cost FLOAT
+);
+
+INSERT INTO table1 (source, target, cost) VALUES (1, 2, 7);
+INSERT INTO table1 (source, target, cost) VALUES (1, 3, 9);
+INSERT INTO table1 (source, target, cost) VALUES (1, 6, 14);
+INSERT INTO table1 (source, target, cost) VALUES (2, 3, 10);
+INSERT INTO table1 (source, target, cost) VALUES (2, 4, 15);
+INSERT INTO table1 (source, target, cost) VALUES (3, 6, 2);
+INSERT INTO table1 (source, target, cost) VALUES (3, 4, 11);
+INSERT INTO table1 (source, target, cost) VALUES (4, 5, 6);
+INSERT INTO table1 (source, target, cost) VALUES (5, 6, 9);
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM table1',
+    1, 5, false);
+
diff --git a/src/dijkstra/doc/dijkstra-v2.queries b/src/dijkstra/doc/dijkstra-v2.queries
new file mode 100644
index 0000000..a5dcc34
--- /dev/null
+++ b/src/dijkstra/doc/dijkstra-v2.queries
@@ -0,0 +1,51 @@
+SET client_min_messages TO notice;
+SET
+--q1
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2,3, true, false);
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+(0 rows)
+
+--q2
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2,3, true, true);
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   2 |   4 |    1
+   1 |   5 |   8 |    1
+   2 |   6 |   9 |    1
+   3 |   9 |  16 |    1
+   4 |   4 |   3 |    1
+   5 |   3 |  -1 |    0
+(6 rows)
+
+--q3
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+     2, 3, false, false);
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   2 |   4 |    1
+   1 |   5 |   8 |    1
+   2 |   6 |   5 |    1
+   3 |   3 |  -1 |    0
+(4 rows)
+
+--q4
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+     2, 3, false, true);
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   2 |   2 |    1
+   1 |   3 |  -1 |    0
+(2 rows)
+
+--q5
diff --git a/src/dijkstra/doc/dijkstra.rst b/src/dijkstra/doc/dijkstra.rst
new file mode 100644
index 0000000..5fedbd2
--- /dev/null
+++ b/src/dijkstra/doc/dijkstra.rst
@@ -0,0 +1,114 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _dijkstra:
+
+pgr_dijkstra - Shortest Path Dijkstra
+===============================================================================
+
+  - :ref:`pgr_dijkstra` - Dijkstra's algorithm for the shortest paths.
+  - :ref:`pgr_dijkstraCost` -Get the aggregate cost of the shortest paths.
+
+
+.. toctree::
+        :hidden:
+
+        ./pgr_dijkstra
+        ./pgr_dijkstraCost
+
+The problem definition
+======================
+
+
+Given the following query:
+
+
+pgr_dijkstra(:math:`sql, start_{vid}, end_{vid}, directed`)
+
+where  :math:`sql = \{(id_i, source_i, target_i, cost_i, reverse\_cost_i)\}`
+
+and
+
+  - :math:`source = \bigcup source_i`,
+  - :math:`target = \bigcup target_i`,
+
+The graphs are defined as follows:
+
+.. rubric:: Directed graph
+
+The weighted directed graph, :math:`G_d(V,E)`, is definied by:
+
+* the set of vertices  :math:`V`
+
+  - :math:`V = source \cup target \cup {start_{vid}} \cup  {end_{vid}}`
+
+* the set of edges :math:`E`
+
+  - :math:`E = \begin{cases} &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} &\quad  \text{ if } reverse\_cost = \varnothing \\ \\ &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} &\quad \text{ if } reverse\_cost \neq \varnothing \\ \end{cases}`
+
+
+
+.. rubric:: Undirected graph
+
+The weighted undirected graph, :math:`G_u(V,E)`, is definied by:
+
+* the set of vertices  :math:`V`
+
+  - :math:`V = source \cup target \cup {start_v{vid}} \cup  {end_{vid}}`
+
+
+* the set of edges :math:`E`
+
+  - :math:`E = \begin{cases} &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, cost_i) \text{ when } cost >=0 \}  &\quad  \text{ if } reverse\_cost = \varnothing \\ \\ &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} \\ \cup &\{(source_i, target_i, reverse\_cost_i) \text{ when } reverse\_co [...]
+
+
+
+.. rubric:: The problem
+
+Given:
+
+  - :math:`start_{vid} \in V` a starting vertex
+  - :math:`end_{vid} \in V` an ending vertex
+  - :math:`G(V,E) = \begin{cases}  G_d(V,E) &\quad \text{ if } directed = true \\ G_u(V,E) &\quad \text{ if } directed = false \\ \end{cases}`
+
+Then:
+
+.. math:: \text{pgr_dijkstra}(sql, start_{vid}, end_{vid}, directed) =
+  \begin{cases}
+  \text{shortest path } \boldsymbol{\pi} \text{ between } start_{vid} \text{and } end_{vid} &\quad \text{if } \exists  \boldsymbol{\pi}  \\
+  \varnothing &\quad \text{otherwise} \\
+  \end{cases}
+
+:math:`\boldsymbol{\pi} = \{(path_\seq_i, node_i, edge_i, cost_i, agg\_cost_i)\}`
+
+where:
+  - :math:`path_\seq_i = i`
+  - :math:`path_\seq_{| \pi |} = | \pi |`
+  - :math:`node_i \in V`
+  - :math:`node_1 = start_{vid}`
+  - :math:`node_{| \pi |}  = end_{vid}`
+  - :math:`\forall i \neq | \pi |, \quad (node_i, node_{i+1}, cost_i) \in E`
+  - :math:`edge_i  = \begin{cases}  id_{(node_i, node_{i+1},cost_i)}  &\quad  \text{when } i \neq | \pi | \\ -1 &\quad  \text{when } i = | \pi | \\ \end{cases}`
+  - :math:`cost_i = cost_{(node_i, node_{i+1})}`
+  - :math:`agg\_cost_i  = \begin{cases}  0   &\quad  \text{when } i = 1  \\ \displaystyle\sum_{k=1}^{i}  cost_{(node_{k-1}, node_k)}  &\quad  \text{when } i \neq 1 \\ \end{cases}`
+
+
+
+In other words: The algorithm returns a the shortest path between :math:`start_{vid}` and :math:`end_{vid}` , if it exists, in terms of a sequence of nodes  and of edges,
+  - :math:`path_\seq` indicates the relative position in the path of the :math:`node` or :math:`edge`.
+  - :math:`cost` is the cost of the edge to be used to go to the next node.
+  - :math:`agg\_cost` is the cost from the :math:`start_{vid}` up to the node.
+
+
+If there is no path, the resulting set is empty.
+
+
+
+
+
diff --git a/src/dijkstra/doc/dijkstra_v2.rst b/src/dijkstra/doc/dijkstra_v2.rst
deleted file mode 100644
index 205fa25..0000000
--- a/src/dijkstra/doc/dijkstra_v2.rst
+++ /dev/null
@@ -1,159 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_dijkstra_v2:
-
-pgr_dijkstra (V 2.0)- Shortest Path Dijkstra
-===============================================================================
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_dijkstra`` — Returns the shortest path using Dijkstra algorithm.
-
-
-.. index:: 
-	single: dijkstra(sql, source, target, directed, has_rcost) -- deprecated
-
-Synopsis
--------------------------------------------------------------------------------
-
-Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956. It is a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-	pgr_costResult[] pgr_dijkstra(text sql, integer source, integer target, 
-	                           boolean directed, boolean has_rcost);
-
-.. warning:: This signature is being deprecated in version 2.1, Please use it
-             without the ``has_rcost`` flag instead:
-
-             ``pgr_dijkstra(sql, source, target, directed)``
-
-             See :ref:`pgr_dijkstra_v3`
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT id, source, target, cost [,reverse_cost] FROM edge_table
-
-
-	:id: ``int4`` identifier of the edge
-	:source: ``int4`` identifier of the source vertex
-	:target: ``int4`` identifier of the target vertex
-	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-	:reverse_cost: ``float8`` (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:target: ``int4`` id of the end point
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   node ID
-:id2:   edge ID (``-1`` for the last row)
-:cost:  cost to traverse from ``id1`` using ``id2``
-
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-
-
-Examples: Directed
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-        SELECT seq, id1 AS node, id2 AS edge, cost 
-                FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2,3, true, false
-                );
-
-         seq | node | edge | cost 
-        -----+------+------+------
-        (0 rows)
-
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-        SELECT seq, id1 AS node, id2 AS edge, cost 
-                FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2,3, true, true
-                );
-         seq | node | edge | cost 
-        -----+------+------+------
-           0 |    2 |    4 |    1
-           1 |    5 |    8 |    1
-           2 |    6 |    9 |    1
-           3 |    9 |   16 |    1
-           4 |    4 |    3 |    1
-           5 |    3 |   -1 |    0
-        (6 rows)
-
-
-
-
-
-Examples: Undirected
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-       SELECT seq, id1 AS node, id2 AS edge, cost 
-                FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        2, 3, false, false
-                );
-        seq | node | edge | cost 
-       -----+------+------+------
-          0 |    2 |    4 |    1
-          1 |    5 |    8 |    1
-          2 |    6 |    5 |    1
-          3 |    3 |   -1 |    0
-       (4 rows)
-
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-       SELECT seq, id1 AS node, id2 AS edge, cost 
-                FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, 3, false, true
-                );
-        seq | node | edge | cost 
-       -----+------+------+------
-          0 |    2 |    2 |    1
-          1 |    3 |   -1 |    0
-       (2 rows)
-
-
-The queries use the :ref:`sampledata` network.
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
diff --git a/src/dijkstra/doc/dijkstra_v3.rst b/src/dijkstra/doc/dijkstra_v3.rst
deleted file mode 100644
index 8a5659e..0000000
--- a/src/dijkstra/doc/dijkstra_v3.rst
+++ /dev/null
@@ -1,811 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_dijkstra_v3:
-
-pgr_dijkstra - Shortest Path Dijkstra
-===============================================================================
-
-``pgr_dijkstra`` — Returns the shortest path(s) using Dijkstra algorithm.
-In particular, the Dijkstra algorithm implemented by Boost.Graph.
-
-.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
-   :target: http://www.boost.org/libs/graph
-
-   Boost Graph Inside
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956.
-It is a graph search algorithm that solves the shortest path problem for
-a graph with non-negative edge path costs, producing a shortest path from 
-a starting vertex (``start_vid``) to an ending vertex (``end_vid``).
-This implementation can be used with a directed graph and an undirected graph.
-
-Signatures
-===============================================================================
-
-.. index:: 
-	single: dijkstra(edges_sql, start_vid, end_vid)
-
-.. rubric:: Minimal signature
-
-The minimal signature is for a **directed** graph from one ``start_vid`` to one ``end_vid``:
-
-.. code-block:: sql
-
-      pgr_dijkstra(text edges_sql, bigint start_vid, bigint end_vid)
-	 RETURNS SET OF (seq, path_seq, node, edge, cost, agg_cost) or EMPTY SET
-
-
-
-
-.. index:: 
-	single: dijkstra(edges_sql, start_vid, end_vid, directed)
-
-.. rubric:: Dijkstra 1 to 1
-
-
-This signature performs a Dijkstra from one ``start_vid`` to one ``end_vid``:
-  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
-  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
-
-.. code-block:: sql
-
-      pgr_dijkstra(text edges_sql, bigint start_vid, bigint end_vid,
-			 boolean directed:=true);
-	 RETURNS SET OF (seq, path_seq, node, edge, cost, agg_cost) or EMPTY SET
-
-
-
-
-.. index:: 
-	single: dijkstra(edges_sql, start_vids, end_vid, directed)
-
-.. rubric:: Dijkstra many to 1:
-
-.. code-block:: sql
-
-      pgr_dijkstra(text edges_sql, array[ANY_INTEGER] start_vids, bigint end_vid,
-			 boolean directed:=true);
-	 RETURNS SET OF (seq, path_seq, start_vid, node, edge, cost, agg_cost) or EMPTY SET
-
-This signature performs a Dijkstra from each ``start_vid`` in  ``start_vids`` to one ``end_vid``:
-  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
-  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
-
-Using this signature, will load once the graph and perform several one to one Dijkstra
-where the ending vertex is fixed.
-The result is the union of the results of the one to one dijkstra.
-
-The extra ``start_vid`` in the result is used to distinguish to which path it belongs.
-
-
-
-
-
-.. index:: 
-	single: dijkstra(edges_sql, start_vid, end_vids, directed)
-
-.. rubric:: Dijkstra 1 to many:
-
-.. code-block:: sql
-
-       pgr_dijkstra(text edges_sql, bigint start_vid, array[ANY_INTEGER] end_vids,
-			 boolean directed:=true);
-	 RETURNS SET OF (seq, path_seq, end_vid, node, edge, cost, agg_cost) or EMPTY SET
-
-This signature performs a Dijkstra from one ``start_vid`` to each ``end_vid`` in ``end_vids``:
-  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
-  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
-
-Using this signature, will load once the graph and perform several 1 to 1 Dijkstra
-where the starting vertex is fixed.
-The result is the union of the results of the one to one dijkstra.
-
-The extra ``end_vid`` in the result is used to distinguish to which path it belongs.
-
-
-
-.. index:: 
-	single: dijkstra(edges_sql, start_vids, end_vids, directed)
-
-.. rubric:: Dijkstra many to many:
-
-.. code-block:: sql
-
-       pgr_dijkstra(text edges_sql, array[ANY_INTEGER] start_vids, array[ANY_INTEGER] end_vids,
-			 boolean directed:=true);
-	 RETURNS SET OF (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost) or EMPTY SET
-
-This signature performs a Dijkstra from each ``start_vid`` in  ``start_vids`` to each ``end_vid`` in ``end_vids``:
-  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
-  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
-
-
-Using this signature, will load once the graph and perform all combinations 
-for starting vertices and ending vertices.
-
-The extra ``start_vid`` and ``end_vid`` in the result is used to distinguish to which path it belongs.
-
-
-Description of the Signatures
-=============================
-
-Description of the SQL query
--------------------------------------------------------------------------------
-
-:edges_sql: an SQL query, which should return a set of rows with the following columns:
-
-	:id: ``ANY-INTEGER`` identifier of the edge.
-	:source: ``ANY-INTEGER`` identifier of the first end point vertex of the edge.
-	:target: ``ANY-INTEGER`` identifier of the second end pont vertex of the edge.
-	:cost: ``ANY-NUMERICAL`` weight of the edge `(source, target)`, if negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
-	:reverse_cost: ``ANY-NUMERICAL`` (optional) weight of the edge `(target, source)`, if negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
-
-Where:
-
-:ANY-INTEGER: smallint, int, bigint
-:ANY-NUMERICAL: smallint, int, bigint, real, float
-
-For example:
-
-.. code-block:: sql
-
-    SELECT id, source, target, cost, reverse_cost from edge_table where geom && ST_Expand(ST_SetSRID(ST_Point(45, 34), 4326), 0.1)
-
-
-Description of the parameters of the signatures
--------------------------------------------------------------------------------
-
-:sql: SQL query as decribed above.
-:start_vid: ``BIGINT`` identifier of the starting vertex of the path.
-:start_vids: ``array[ANY-INTEGER]`` array of identifiers of starting vertices.
-:end_vid: ``BIGINT`` identifier of the ending vertex of the path.
-:end_vids: ``array[ANY-INTEGER]`` array of identifiers of ending vertices.
-:directed: ``boolean`` (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
-
-
-Description of the return values
--------------------------------------------------------------------------------
-
-Returns set of ``(seq [, start_vid] [, end_vid] , node, edge, cost, agg_cost)``
-
-:seq: ``INT``  isequential value starting from **1**.
-:path_seq: ``INT``  relative position in the path. Has value **1** for the begining of a path.
-:start_vid: ``BIGINT`` id of the starting vertex. Used when multiple starting vetrices are in the query.
-:end_vid: ``BIGINT`` id of the ending vertex. Used when multiple ending vertices are in the query.
-:node: ``BIGINT`` id of the node in the path from start_vid to end_v.
-:edge: ``BIGINT`` id of the edge used to go from ``node`` to the next node in the path sequence. ``-1`` for the last node of the path. 
-:cost: ``FLOAT`` cost to traverse from ``node`` using ``edge`` to the next node in the path sequence.
-:agg_cost:  ``FLOAT`` total cost from ``start_v`` to ``node``.
-
-
-Examples
-========
-
-The examples of this section are based on the :ref:`sampledata` network.
-
-The examples include combinations from starting vertices 2 and 11 to ending vertices 3 and 5 in a directed and
-undirected graph with and with out reverse_cost.
-
-Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
---------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig1`
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, 3
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |    8 |    1 |        1
-       3 |        3 |    6 |    9 |    1 |        2
-       4 |        4 |    9 |   16 |    1 |        3
-       5 |        5 |    4 |    3 |    1 |        4
-       6 |        6 |    3 |   -1 |    0 |        5
-    (6 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, 5
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |   -1 |    0 |        1
-    (2 rows)
-
-When you pass an array we get a combined result:
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3,5]
-    );
-
-    seq | path_seq | end_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+------+------+------+----------
-      1 |        1 |       3 |    2 |    4 |    1 |        0
-      2 |        2 |       3 |    5 |    8 |    1 |        1
-      3 |        3 |       3 |    6 |    9 |    1 |        2
-      4 |        4 |       3 |    9 |   16 |    1 |        3
-      5 |        5 |       3 |    4 |    3 |    1 |        4
-      6 |        6 |       3 |    3 |   -1 |    0 |        5
-      7 |        1 |       5 |    2 |    4 |    1 |        0
-      8 |        2 |       5 |    5 |   -1 |    0 |        1
-   (8 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            11, 3
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |   11 |   13 |    1 |        0
-       2 |        2 |   12 |   15 |    1 |        1
-       3 |        3 |    9 |   16 |    1 |        2
-       4 |        4 |    4 |    3 |    1 |        3
-       5 |        5 |    3 |   -1 |    0 |        4
-    (5 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            11, 5
-            );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |   11 |   13 |    1 |        0
-       2 |        2 |   12 |   15 |    1 |        1
-       3 |        3 |    9 |    9 |    1 |        2
-       4 |        4 |    6 |    8 |    1 |        3
-       5 |        5 |    5 |   -1 |    0 |        4
-    (5 rows)
-
-Some other combinations.
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2,11], 5
-    );
-
-    seq | path_seq | start_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+------+------+------+----------
-      1 |        1 |         2 |    2 |    4 |    1 |        0
-      2 |        2 |         2 |    5 |   -1 |    0 |        1
-      3 |        1 |        11 |   11 |   13 |    1 |        0
-      4 |        2 |        11 |   12 |   15 |    1 |        1
-      5 |        3 |        11 |    9 |    9 |    1 |        2
-      6 |        4 |        11 |    6 |    8 |    1 |        3
-      7 |        5 |        11 |    5 |   -1 |    0 |        4
-   (7 rows)
-
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2, 11], array[3,5]
-    );
-    seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+-------+------+------+------+----------
-      1 |        1 |         2 |     3 |    2 |    4 |    1 |        0
-      2 |        2 |         2 |     3 |    5 |    8 |    1 |        1
-      3 |        3 |         2 |     3 |    6 |    9 |    1 |        2
-      4 |        4 |         2 |     3 |    9 |   16 |    1 |        3
-      5 |        5 |         2 |     3 |    4 |    3 |    1 |        4
-      6 |        6 |         2 |     3 |    3 |   -1 |    0 |        5
-      7 |        1 |         2 |     5 |    2 |    4 |    1 |        0
-      8 |        2 |         2 |     5 |    5 |   -1 |    0 |        1
-      9 |        1 |        11 |     3 |   11 |   13 |    1 |        0
-     10 |        2 |        11 |     3 |   12 |   15 |    1 |        1
-     11 |        3 |        11 |     3 |    9 |   16 |    1 |        2
-     12 |        4 |        11 |     3 |    4 |    3 |    1 |        3
-     13 |        5 |        11 |     3 |    3 |   -1 |    0 |        4
-     14 |        1 |        11 |     5 |   11 |   13 |    1 |        0
-     15 |        2 |        11 |     5 |   12 |   15 |    1 |        1
-     16 |        3 |        11 |     5 |    9 |    9 |    1 |        2
-     17 |        4 |        11 |     5 |    6 |    8 |    1 |        3
-     18 |        5 |        11 |     5 |    5 |   -1 |    0 |        4
-   (18 rows)
-
-
-
-
-Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig2`
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, 3,
-            false
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    2 |    1 |        0
-       2 |        2 |    3 |   -1 |    0 |        1
-    (2 rows)
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, 5,
-            false
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |   -1 |    0 |        1
-    (2 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            11, 3,
-            false
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |   11 |   11 |    1 |        0
-       2 |        2 |    6 |    5 |    1 |        1
-       3 |        3 |    3 |   -1 |    0 |        2
-    (3 rows)
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            11, 5,
-            false
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |   11 |   11 |    1 |        0
-       2 |        2 |    6 |    8 |    1 |        1
-       3 |        3 |    5 |   -1 |    0 |        2
-    (3 rows)
-
-
-       
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2,11], 5,
-            false
-            );
-    seq | path_seq | start_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+------+------+------+----------
-      1 |        1 |         2 |    2 |    4 |    1 |        0
-      2 |        2 |         2 |    5 |   -1 |    0 |        1
-      3 |        1 |        11 |   11 |   11 |    1 |        0
-      4 |        2 |        11 |    6 |    8 |    1 |        1
-      5 |        3 |        11 |    5 |   -1 |    0 |        2
-   (5 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3,5],
-            false
-    );
-    seq | path_seq | end_vid | node | edge | cost | agg_cost 
-   -----+----------+-------+------+------+------+----------
-      1 |        1 |       3 |    2 |    2 |    1 |        0
-      2 |        2 |       3 |    3 |   -1 |    0 |        1
-      3 |        1 |       5 |    2 |    4 |    1 |        0
-      4 |        2 |       5 |    5 |   -1 |    0 |        1
-   (4 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2, 11], array[3,5],
-            false
-    );
-    seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+-------+------+------+------+----------
-      1 |        1 |         2 |       3 |    2 |    2 |    1 |        0
-      2 |        2 |         2 |       3 |    3 |   -1 |    0 |        1
-      3 |        1 |         2 |       5 |    2 |    4 |    1 |        0
-      4 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
-      5 |        1 |        11 |       3 |   11 |   11 |    1 |        0
-      6 |        2 |        11 |       3 |    6 |    5 |    1 |        1
-      7 |        3 |        11 |       3 |    3 |   -1 |    0 |        2
-      8 |        1 |        11 |       5 |   11 |   11 |    1 |        0
-      9 |        2 |        11 |       5 |    6 |    8 |    1 |        1
-     10 |        3 |        11 |       5 |    5 |   -1 |    0 |        2
-   (10 rows)
-
-    
-
-Examples for queries marked as ``directed`` with ``cost`` column
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig3`
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, 3
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-    (0 rows)
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, 5
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |   -1 |    0 |        1
-    (2 rows)
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            11, 3
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-    (0 rows)
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            11, 5
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-    (0 rows)
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            array[2,11], 5
-    );
-     seq | path_seq | start_vid | node | edge | cost | agg_cost 
-    -----+----------+---------+------+------+------+----------
-       1 |        1 |         2 |    2 |    4 |    1 |        0
-       2 |        2 |         2 |    5 |   -1 |    0 |        1
-    (2 rows)
-   
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, array[3,5]
-    );
-     seq | path_seq | end_vid | node | edge | cost | agg_cost 
-    -----+----------+-------+------+------+------+----------
-       1 |        1 |       5 |    2 |    4 |    1 |        0
-       2 |        2 |       5 |    5 |   -1 |    0 |        1
-      (2 rows)
-   
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            array[2, 11], array[3,5]
-    );
-     seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
-    -----+----------+---------+-------+------+------+------+----------
-       1 |        1 |         2 |       5 |    2 |    4 |    1 |        0
-       2 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
-    (2 rows)
-
-    
-
-Examples for queries marked as ``undirected`` with ``cost`` column
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig4`
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost FROM edge_table',
-		2, 3,
-        false
-    );
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |    8 |    1 |        1
-       3 |        3 |    6 |    5 |    1 |        2
-       4 |        4 |    3 |   -1 |    0 |        3
-    (4 rows)
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			2, 5,
-                    false
-	);
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |   -1 |    0 |        1
-    (2 rows)
-
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			11, 3,
-                    false
-		);
-	 seq | path_seq | node | edge | cost | agg_cost 
-	-----+----------+------+------+------+----------
-       1 |        1 |   11 |   11 |    1 |        0
-       2 |        2 |    6 |    5 |    1 |        1
-       3 |        3 |    3 |   -1 |    0 |        2
-    (3 rows)
-
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			11, 5,
-                    false
-		);
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |   11 |   11 |    1 |        0
-       2 |        2 |    6 |    8 |    1 |        1
-       3 |        3 |    5 |   -1 |    0 |        2
-    (3 rows)
-
-       
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			array[2,11], 5,
-            false
-	);
-    seq | path_seq | start_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+------+------+------+----------
-      1 |        1 |         2 |    2 |    4 |    1 |        0
-      2 |        2 |         2 |    5 |   -1 |    0 |        1
-      3 |        1 |        11 |   11 |   11 |    1 |        0
-      4 |        2 |        11 |    6 |    8 |    1 |        1
-      5 |        3 |        11 |    5 |   -1 |    0 |        2
-   (5 rows)
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			2, array[3,5],
-            false
-	);
-    seq | path_seq | end_vid | node | edge | cost | agg_cost 
-   -----+----------+-------+------+------+------+----------
-      1 |        1 |       3 |    2 |    4 |    1 |        0
-      2 |        2 |       3 |    5 |    8 |    1 |        1
-      3 |        3 |       3 |    6 |    5 |    1 |        2
-      4 |        4 |       3 |    3 |   -1 |    0 |        3
-      5 |        1 |       5 |    2 |    4 |    1 |        0
-      6 |        2 |       5 |    5 |   -1 |    0 |        1
-   (6 rows)
-
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			array[2, 11], array[3,5],
-            false
-	);
-    seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+-------+------+------+------+----------
-      1 |        1 |         2 |       3 |    2 |    4 |    1 |        0
-      2 |        2 |         2 |       3 |    5 |    8 |    1 |        1
-      3 |        3 |         2 |       3 |    6 |    5 |    1 |        2
-      4 |        4 |         2 |       3 |    3 |   -1 |    0 |        3
-      5 |        1 |         2 |       5 |    2 |    4 |    1 |        0
-      6 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
-      7 |        1 |        11 |       3 |   11 |   11 |    1 |        0
-      8 |        2 |        11 |       3 |    6 |    5 |    1 |        1
-      9 |        3 |        11 |       3 |    3 |   -1 |    0 |        2
-     10 |        1 |        11 |       5 |   11 |   11 |    1 |        0
-     11 |        2 |        11 |       5 |    6 |    8 |    1 |        1
-     12 |        3 |        11 |       5 |    5 |   -1 |    0 |        2
-   (12 rows)
-
-
-
-
-Equvalences between signatures
-------------------------------
-
-.. code-block:: sql
-
-    -- V2
-	SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-        true,    -- directed flag
-        true      -- has_rcost
-	);
-
-     seq | id1 | id2 | cost 
-    -----+-----+-----+------
-       0 |   2 |   4 |    1
-       1 |   5 |   8 |    1
-       2 |   6 |   9 |    1
-       3 |   9 |  16 |    1
-       4 |   4 |   3 |    1
-       5 |   3 |  -1 |    0
-      (6 rows)
-
-
-    -- V3
-	SELECT * FROM pgr_dijkstra(
-           'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-        true     -- directed flag
-	);
-
-
-	SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2,3 
-	);
-
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    4 |    1 |        0
-       2 |        2 |    5 |    8 |    1 |        1
-       3 |        3 |    6 |    9 |    1 |        2
-       4 |        4 |    9 |   16 |    1 |        3
-       5 |        5 |    4 |    3 |    1 |        4
-       6 |        6 |    3 |   -1 |    0 |        5
-    (6 rows)
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3],
-            true     
-    );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3]
-    );
-
-    seq | path_seq | end_vid | node | edge | cost | agg_cost 
-   -----+----------+-------+------+------+------+----------
-      1 |        1 |       3 |    2 |    4 |    1 |        0
-      2 |        2 |       3 |    5 |    8 |    1 |        1
-      3 |        3 |       3 |    6 |    9 |    1 |        2
-      4 |        4 |       3 |    9 |   16 |    1 |        3
-      5 |        5 |       3 |    4 |    3 |    1 |        4
-      6 |        6 |       3 |    3 |   -1 |    0 |        5
-   (6 rows)
-
-       
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2], array[3],
-            true
-    );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2], array[3]
-    );
-    seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+-------+------+------+------+----------
-      1 |        1 |         2 |     3 |    2 |    4 |    1 |        0
-      2 |        2 |         2 |     3 |    5 |    8 |    1 |        1
-      3 |        3 |         2 |     3 |    6 |    9 |    1 |        2
-      4 |        4 |         2 |     3 |    9 |   16 |    1 |        3
-      5 |        5 |         2 |     3 |    4 |    3 |    1 |        4
-      6 |        6 |         2 |     3 |    3 |   -1 |    0 |        5
-   (6 rows)
-
-
-
-
-
-Equivalences  between signatures 
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-    -- V2
-	SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-            false,    -- directed flag
-            true      -- has_rcost
-	);
-
-     seq | id1 | id2 | cost 
-    -----+-----+-----+------
-       0 |   2 |   2 |    1
-       1 |   3 |  -1 |    0
-    (2 rows)
-
-
-    -- V3
-	SELECT * FROM pgr_dijkstra(
-           'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-            false     -- directed flag
-	);
-
-     seq | path_seq | node | edge | cost | agg_cost 
-    -----+----------+------+------+------+----------
-       1 |        1 |    2 |    2 |    1 |        0
-       2 |        2 |    3 |   -1 |    0 |        1
-    (2 rows)
-
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3],
-            false     
-    );
-    seq | path_seq | end_vid | node | edge | cost | agg_cost 
-   -----+----------+-------+------+------+------+----------
-      1 |        1 |       3 |    2 |    2 |    1 |        0
-      2 |        2 |       3 |    3 |   -1 |    0 |        1
-   (2 rows)
-
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2], 3,
-            false
-    );
-    seq | path_seq | start_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+------+------+------+----------
-      1 |        1 |         2 |    2 |    2 |    1 |        0
-      2 |        2 |         2 |    3 |   -1 |    0 |        1
-   (2 rows)
-   
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2], array[3],
-            false
-    );
-    seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
-   -----+----------+---------+-------+------+------+------+----------
-      1 |        1 |         2 |       3 |    2 |    2 |    1 |        0
-      2 |        2 |         2 |       3 |    3 |   -1 |    0 |        1
-   (2 rows)
-
-
-
-The queries use the :ref:`sampledata` network.
-
-.. rubric:: History
-
-* Renamed in version 2.0.0 
-* Added functionality in version 2.1.0
-
-
-See Also
--------------------------------------------------------------------------------
-
-* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
-
-.. rubric:: Indices and tables
-
-* :ref:`genindex`
-* :ref:`search`
-
diff --git a/src/dijkstra/doc/doc-pgr_dijkstra.queries b/src/dijkstra/doc/doc-pgr_dijkstra.queries
new file mode 100644
index 0000000..ce09ec8
--- /dev/null
+++ b/src/dijkstra/doc/doc-pgr_dijkstra.queries
@@ -0,0 +1,614 @@
+-- q1
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |    8 |    1 |        1
+   3 |        3 |    6 |    9 |    1 |        2
+   4 |        4 |    9 |   16 |    1 |        3
+   5 |        5 |    4 |    3 |    1 |        4
+   6 |        6 |    3 |   -1 |    0 |        5
+(6 rows)
+
+-- q2
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    2 |    1 |        0
+   2 |        2 |    3 |   -1 |    0 |        1
+(2 rows)
+
+-- q3
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, ARRAY[3,5],
+    FALSE
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |       3 |    6 |    5 |    1 |        2
+   4 |        4 |       3 |    3 |   -1 |    0 |        3
+   5 |        1 |       5 |    2 |    4 |    1 |        0
+   6 |        2 |       5 |    5 |   -1 |    0 |        1
+(6 rows)
+
+-- q4
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], 5
+);
+ seq | path_seq | start_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |         2 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |    5 |   -1 |    0 |        1
+   3 |        1 |        11 |   11 |   13 |    1 |        0
+   4 |        2 |        11 |   12 |   15 |    1 |        1
+   5 |        3 |        11 |    9 |    9 |    1 |        2
+   6 |        4 |        11 |    6 |    8 |    1 |        3
+   7 |        5 |        11 |    5 |   -1 |    0 |        4
+(7 rows)
+
+-- q5
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], ARRAY[3,5],
+    FALSE
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    2 |    1 |        0
+   2 |        2 |         2 |       3 |    3 |   -1 |    0 |        1
+   3 |        1 |         2 |       5 |    2 |    4 |    1 |        0
+   4 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
+   5 |        1 |        11 |       3 |   11 |   11 |    1 |        0
+   6 |        2 |        11 |       3 |    6 |    5 |    1 |        1
+   7 |        3 |        11 |       3 |    3 |   -1 |    0 |        2
+   8 |        1 |        11 |       5 |   11 |   11 |    1 |        0
+   9 |        2 |        11 |       5 |    6 |    8 |    1 |        1
+  10 |        3 |        11 |       5 |    5 |   -1 |    0 |        2
+(10 rows)
+
+-- q6
+-- q7
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |    8 |    1 |        1
+   3 |        3 |    6 |    9 |    1 |        2
+   4 |        4 |    9 |   16 |    1 |        3
+   5 |        5 |    4 |    3 |    1 |        4
+   6 |        6 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 5
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3,5]
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |       3 |    6 |    9 |    1 |        2
+   4 |        4 |       3 |    9 |   16 |    1 |        3
+   5 |        5 |       3 |    4 |    3 |    1 |        4
+   6 |        6 |       3 |    3 |   -1 |    0 |        5
+   7 |        1 |       5 |    2 |    4 |    1 |        0
+   8 |        2 |       5 |    5 |   -1 |    0 |        1
+(8 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 3
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   11 |   13 |    1 |        0
+   2 |        2 |   12 |   15 |    1 |        1
+   3 |        3 |    9 |   16 |    1 |        2
+   4 |        4 |    4 |    3 |    1 |        3
+   5 |        5 |    3 |   -1 |    0 |        4
+(5 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 5
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   11 |   13 |    1 |        0
+   2 |        2 |   12 |   15 |    1 |        1
+   3 |        3 |    9 |    9 |    1 |        2
+   4 |        4 |    6 |    8 |    1 |        3
+   5 |        5 |    5 |   -1 |    0 |        4
+(5 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], 5
+);
+ seq | path_seq | start_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |         2 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |    5 |   -1 |    0 |        1
+   3 |        1 |        11 |   11 |   13 |    1 |        0
+   4 |        2 |        11 |   12 |   15 |    1 |        1
+   5 |        3 |        11 |    9 |    9 |    1 |        2
+   6 |        4 |        11 |    6 |    8 |    1 |        3
+   7 |        5 |        11 |    5 |   -1 |    0 |        4
+(7 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5]
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |         2 |       3 |    6 |    9 |    1 |        2
+   4 |        4 |         2 |       3 |    9 |   16 |    1 |        3
+   5 |        5 |         2 |       3 |    4 |    3 |    1 |        4
+   6 |        6 |         2 |       3 |    3 |   -1 |    0 |        5
+   7 |        1 |         2 |       5 |    2 |    4 |    1 |        0
+   8 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
+   9 |        1 |        11 |       3 |   11 |   13 |    1 |        0
+  10 |        2 |        11 |       3 |   12 |   15 |    1 |        1
+  11 |        3 |        11 |       3 |    9 |   16 |    1 |        2
+  12 |        4 |        11 |       3 |    4 |    3 |    1 |        3
+  13 |        5 |        11 |       3 |    3 |   -1 |    0 |        4
+  14 |        1 |        11 |       5 |   11 |   13 |    1 |        0
+  15 |        2 |        11 |       5 |   12 |   15 |    1 |        1
+  16 |        3 |        11 |       5 |    9 |    9 |    1 |        2
+  17 |        4 |        11 |       5 |    6 |    8 |    1 |        3
+  18 |        5 |        11 |       5 |    5 |   -1 |    0 |        4
+(18 rows)
+
+-- q8
+-- q9
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    2 |    1 |        0
+   2 |        2 |    3 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 5,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 3,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   11 |   11 |    1 |        0
+   2 |        2 |    6 |    5 |    1 |        1
+   3 |        3 |    3 |   -1 |    0 |        2
+(3 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 5,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   11 |   11 |    1 |        0
+   2 |        2 |    6 |    8 |    1 |        1
+   3 |        3 |    5 |   -1 |    0 |        2
+(3 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], 5,
+    FALSE
+);
+ seq | path_seq | start_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |         2 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |    5 |   -1 |    0 |        1
+   3 |        1 |        11 |   11 |   11 |    1 |        0
+   4 |        2 |        11 |    6 |    8 |    1 |        1
+   5 |        3 |        11 |    5 |   -1 |    0 |        2
+(5 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3,5],
+    FALSE
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    2 |    1 |        0
+   2 |        2 |       3 |    3 |   -1 |    0 |        1
+   3 |        1 |       5 |    2 |    4 |    1 |        0
+   4 |        2 |       5 |    5 |   -1 |    0 |        1
+(4 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5],
+    FALSE
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    2 |    1 |        0
+   2 |        2 |         2 |       3 |    3 |   -1 |    0 |        1
+   3 |        1 |         2 |       5 |    2 |    4 |    1 |        0
+   4 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
+   5 |        1 |        11 |       3 |   11 |   11 |    1 |        0
+   6 |        2 |        11 |       3 |    6 |    5 |    1 |        1
+   7 |        3 |        11 |       3 |    3 |   -1 |    0 |        2
+   8 |        1 |        11 |       5 |   11 |   11 |    1 |        0
+   9 |        2 |        11 |       5 |    6 |    8 |    1 |        1
+  10 |        3 |        11 |       5 |    5 |   -1 |    0 |        2
+(10 rows)
+
+-- q10
+-- q11
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 3
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+(0 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 5
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 3
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+(0 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 5
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+(0 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2,11], 5
+);
+ seq | path_seq | start_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |         2 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |    5 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, ARRAY[3,5]
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       5 |    2 |    4 |    1 |        0
+   2 |        2 |       5 |    5 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5]
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       5 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
+(2 rows)
+
+-- q12
+-- q13
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 3,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |    8 |    1 |        1
+   3 |        3 |    6 |    5 |    1 |        2
+   4 |        4 |    3 |   -1 |    0 |        3
+(4 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 5,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 3,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   11 |   11 |    1 |        0
+   2 |        2 |    6 |    5 |    1 |        1
+   3 |        3 |    3 |   -1 |    0 |        2
+(3 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 5,
+    FALSE
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   11 |   11 |    1 |        0
+   2 |        2 |    6 |    8 |    1 |        1
+   3 |        3 |    5 |   -1 |    0 |        2
+(3 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2,11], 5,
+    FALSE
+);
+ seq | path_seq | start_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |         2 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |    5 |   -1 |    0 |        1
+   3 |        1 |        11 |   11 |   11 |    1 |        0
+   4 |        2 |        11 |    6 |    8 |    1 |        1
+   5 |        3 |        11 |    5 |   -1 |    0 |        2
+(5 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, ARRAY[3,5],
+    FALSE
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |       3 |    6 |    5 |    1 |        2
+   4 |        4 |       3 |    3 |   -1 |    0 |        3
+   5 |        1 |       5 |    2 |    4 |    1 |        0
+   6 |        2 |       5 |    5 |   -1 |    0 |        1
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5],
+    FALSE
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |         2 |       3 |    6 |    5 |    1 |        2
+   4 |        4 |         2 |       3 |    3 |   -1 |    0 |        3
+   5 |        1 |         2 |       5 |    2 |    4 |    1 |        0
+   6 |        2 |         2 |       5 |    5 |   -1 |    0 |        1
+   7 |        1 |        11 |       3 |   11 |   11 |    1 |        0
+   8 |        2 |        11 |       3 |    6 |    5 |    1 |        1
+   9 |        3 |        11 |       3 |    3 |   -1 |    0 |        2
+  10 |        1 |        11 |       5 |   11 |   11 |    1 |        0
+  11 |        2 |        11 |       5 |    6 |    8 |    1 |        1
+  12 |        3 |        11 |       5 |    5 |   -1 |    0 |        2
+(12 rows)
+
+-- q14
+-- q15
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    TRUE     
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |    8 |    1 |        1
+   3 |        3 |    6 |    9 |    1 |        2
+   4 |        4 |    9 |   16 |    1 |        3
+   5 |        5 |    4 |    3 |    1 |        4
+   6 |        6 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2,3 
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    4 |    1 |        0
+   2 |        2 |    5 |    8 |    1 |        1
+   3 |        3 |    6 |    9 |    1 |        2
+   4 |        4 |    9 |   16 |    1 |        3
+   5 |        5 |    4 |    3 |    1 |        4
+   6 |        6 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3],
+    TRUE     
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |       3 |    6 |    9 |    1 |        2
+   4 |        4 |       3 |    9 |   16 |    1 |        3
+   5 |        5 |       3 |    4 |    3 |    1 |        4
+   6 |        6 |       3 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3]
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |       3 |    6 |    9 |    1 |        2
+   4 |        4 |       3 |    9 |   16 |    1 |        3
+   5 |        5 |       3 |    4 |    3 |    1 |        4
+   6 |        6 |       3 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], ARRAY[3],
+    TRUE
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |         2 |       3 |    6 |    9 |    1 |        2
+   4 |        4 |         2 |       3 |    9 |   16 |    1 |        3
+   5 |        5 |         2 |       3 |    4 |    3 |    1 |        4
+   6 |        6 |         2 |       3 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], ARRAY[3]
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    4 |    1 |        0
+   2 |        2 |         2 |       3 |    5 |    8 |    1 |        1
+   3 |        3 |         2 |       3 |    6 |    9 |    1 |        2
+   4 |        4 |         2 |       3 |    9 |   16 |    1 |        3
+   5 |        5 |         2 |       3 |    4 |    3 |    1 |        4
+   6 |        6 |         2 |       3 |    3 |   -1 |    0 |        5
+(6 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2, 3,
+    TRUE,    
+    TRUE      
+);
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   2 |   4 |    1
+   1 |   5 |   8 |    1
+   2 |   6 |   9 |    1
+   3 |   9 |  16 |    1
+   4 |   4 |   3 |    1
+   5 |   3 |  -1 |    0
+(6 rows)
+
+-- q16
+-- q17
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE     
+);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |    2 |    2 |    1 |        0
+   2 |        2 |    3 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3],
+    FALSE     
+);
+ seq | path_seq | end_vid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |       3 |    2 |    2 |    1 |        0
+   2 |        2 |       3 |    3 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], 3,
+    FALSE
+);
+ seq | path_seq | start_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |         2 |    2 |    2 |    1 |        0
+   2 |        2 |         2 |    3 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], ARRAY[3],
+    FALSE
+);
+ seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |         2 |       3 |    2 |    2 |    1 |        0
+   2 |        2 |         2 |       3 |    3 |   -1 |    0 |        1
+(2 rows)
+
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE,    
+    TRUE      
+);
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   2 |   2 |    1
+   1 |   3 |  -1 |    0
+(2 rows)
+
+-- q18
diff --git a/src/dijkstra/doc/doc-pgr_dijkstraCost.queries b/src/dijkstra/doc/doc-pgr_dijkstraCost.queries
new file mode 100644
index 0000000..6cb2411
--- /dev/null
+++ b/src/dijkstra/doc/doc-pgr_dijkstraCost.queries
@@ -0,0 +1,83 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    2, 3);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         2 |       3 |        5
+(1 row)
+
+--q2
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    2, 3, false);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         2 |       3 |        1
+(1 row)
+
+--q3
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[2, 7], 3);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         2 |       3 |        5
+         7 |       3 |        6
+(2 rows)
+
+--q4
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    2, ARRAY[3, 11]);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         2 |       3 |        5
+         2 |      11 |        3
+(2 rows)
+
+--q5
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[2, 7], ARRAY[3, 11]);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         2 |       3 |        5
+         2 |      11 |        3
+         7 |       3 |        6
+         7 |      11 |        4
+(4 rows)
+
+--q6
+SELECT * FROM pgr_dijkstraCost(
+        'select id, source, target, cost, reverse_cost from edge_table',
+            ARRAY[5, 3, 4, 3, 3, 4], ARRAY[3, 5, 3, 4]);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         3 |       4 |        3
+         3 |       5 |        2
+         4 |       3 |        1
+         4 |       5 |        3
+         5 |       3 |        4
+         5 |       4 |        3
+(6 rows)
+
+--q7
+SELECT * FROM pgr_dijkstraCost(
+        'select id, source, target, cost, reverse_cost from edge_table',
+            ARRAY[5, 3, 4], ARRAY[5, 3, 4]);
+ start_vid | end_vid | agg_cost 
+-----------+---------+----------
+         3 |       4 |        3
+         3 |       5 |        2
+         4 |       3 |        1
+         4 |       5 |        3
+         5 |       3 |        4
+         5 |       4 |        3
+(6 rows)
+
+--q8
+ROLLBACK
+ROLLBACK
diff --git a/src/dijkstra/doc/doc-pgr_dijkstraVia.queries b/src/dijkstra/doc/doc-pgr_dijkstraVia.queries
new file mode 100644
index 0000000..205789d
--- /dev/null
+++ b/src/dijkstra/doc/doc-pgr_dijkstraVia.queries
@@ -0,0 +1,128 @@
+--q00
+SELECT * FROM pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 3, 9]
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |         1 |       3 |    1 |    1 |    1 |        0 |              0
+   2 |       1 |        2 |         1 |       3 |    2 |    4 |    1 |        1 |              1
+   3 |       1 |        3 |         1 |       3 |    5 |    8 |    1 |        2 |              2
+   4 |       1 |        4 |         1 |       3 |    6 |    9 |    1 |        3 |              3
+   5 |       1 |        5 |         1 |       3 |    9 |   16 |    1 |        4 |              4
+   6 |       1 |        6 |         1 |       3 |    4 |    3 |    1 |        5 |              5
+   7 |       1 |        7 |         1 |       3 |    3 |   -1 |    0 |        6 |              6
+   8 |       2 |        1 |         3 |       9 |    3 |    5 |    1 |        0 |              6
+   9 |       2 |        2 |         3 |       9 |    6 |    9 |    1 |        1 |              7
+  10 |       2 |        3 |         3 |       9 |    9 |   -2 |    0 |        2 |              8
+(10 rows)
+
+-- q0
+SELECT * FROM pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 3, 9], false, strict:=true, U_turn_on_edge:=false
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |         1 |       3 |    1 |    1 |    1 |        0 |              0
+   2 |       1 |        2 |         1 |       3 |    2 |    2 |    1 |        1 |              1
+   3 |       1 |        3 |         1 |       3 |    3 |   -1 |    0 |        2 |              2
+   4 |       2 |        1 |         3 |       9 |    3 |    3 |    1 |        0 |              2
+   5 |       2 |        2 |         3 |       9 |    4 |   16 |    1 |        1 |              3
+   6 |       2 |        3 |         3 |       9 |    9 |   -2 |    0 |        2 |              4
+(6 rows)
+
+-- q1
+SELECT * FROM pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |         1 |       5 |    1 |    1 |    1 |        0 |              0
+   2 |       1 |        2 |         1 |       5 |    2 |    4 |    1 |        1 |              1
+   3 |       1 |        3 |         1 |       5 |    5 |   -1 |    0 |        2 |              2
+   4 |       2 |        1 |         5 |       3 |    5 |    8 |    1 |        0 |              2
+   5 |       2 |        2 |         5 |       3 |    6 |    9 |    1 |        1 |              3
+   6 |       2 |        3 |         5 |       3 |    9 |   16 |    1 |        2 |              4
+   7 |       2 |        4 |         5 |       3 |    4 |    3 |    1 |        3 |              5
+   8 |       2 |        5 |         5 |       3 |    3 |   -1 |    0 |        4 |              6
+   9 |       3 |        1 |         3 |       9 |    3 |    5 |    1 |        0 |              6
+  10 |       3 |        2 |         3 |       9 |    6 |    9 |    1 |        1 |              7
+  11 |       3 |        3 |         3 |       9 |    9 |   -1 |    0 |        2 |              8
+  12 |       4 |        1 |         9 |       4 |    9 |   16 |    1 |        0 |              8
+  13 |       4 |        2 |         9 |       4 |    4 |   -2 |    0 |        1 |              9
+(13 rows)
+
+-- q2
+SELECT agg_cost FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+) 
+WHERE path_id = 3 AND edge <0;
+ agg_cost 
+----------
+        2
+(1 row)
+
+-- q3
+SELECT route_agg_cost FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+)
+WHERE path_id = 3 AND edge < 0;
+ route_agg_cost 
+----------------
+              8
+(1 row)
+
+-- q4
+SELECT row_number() over () as node_seq, node 
+FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+) 
+WHERE edge <> -1 ORDER BY seq;
+ node_seq | node 
+----------+------
+        1 |    1
+        2 |    2
+        3 |    5
+        4 |    6
+        5 |    9
+        6 |    4
+        7 |    3
+        8 |    6
+        9 |    9
+       10 |    4
+(10 rows)
+
+-- q5
+SELECT path_id, route_agg_cost FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+) 
+WHERE edge < 0;
+ path_id | route_agg_cost 
+---------+----------------
+       1 |              2
+       2 |              6
+       3 |              8
+       4 |              9
+(4 rows)
+
+-- q6
+SELECT seq, route_agg_cost, node, agg_cost ,
+CASE WHEN edge = -1 THEN 'visits'
+ELSE 'passes in front'
+END as status
+FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4])
+WHERE node = 9 and (agg_cost  <> 0 or seq = 1);
+ seq | route_agg_cost | node | agg_cost |     status      
+-----+----------------+------+----------+-----------------
+   6 |              4 |    9 |        2 | passes in front
+  11 |              8 |    9 |        2 | visits
+(2 rows)
+
diff --git a/src/dijkstra/doc/index.rst b/src/dijkstra/doc/index.rst
deleted file mode 100644
index e48c6f5..0000000
--- a/src/dijkstra/doc/index.rst
+++ /dev/null
@@ -1,120 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_dijkstra:
-
-pgr_dijkstra - Shortest Path Dijkstra
-===============================================================================
-
-Version 2.0 (deprecated)
-------------------------
-
-  -  :ref:`pgr_dijkstra<pgr_dijkstra_v2>` - Shortest Path Dijkstra
-
-Version 2.1
-------------------
-
-  -  :ref:`pgr_dijkstra<pgr_dijkstra_v3>` - Shortest Path Dijkstra
-
-The problem definition
-======================
-
-
-Given the following query:
-
-
-pgr_dijkstra(:math:`sql, start_{vid}, end_{vid}, directed`)
-
-where  :math:`sql = \{(id_i, source_i, target_i, cost_i, reverse\_cost_i)\}`
-
-and
-
-  - :math:`source = \bigcup source_i`,
-  - :math:`target = \bigcup target_i`,
-
-The graphs are defined as follows:
-
-.. rubric:: Directed graph
-
-The weighted directed graph, :math:`G_d(V,E)`, is definied by:
-
-* the set of vertices  :math:`V`
-
-  - :math:`V = source \cup target \cup {start_{vid}} \cup  {end_{vid}}`
-
-* the set of edges :math:`E`
-
-  - :math:`E = \begin{cases} &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} &\quad  \text{ if } reverse\_cost = \varnothing \\ \\ &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} &\quad \text{ if } reverse\_cost \neq \varnothing \\ \end{cases}`
-
-
-
-.. rubric:: Undirected graph
-
-The weighted undirected graph, :math:`G_u(V,E)`, is definied by:
-
-* the set of vertices  :math:`V`
-
-  - :math:`V = source \cup target \cup {start_v{vid}} \cup  {end_{vid}}`
-
-
-* the set of edges :math:`E`
-
-  - :math:`E = \begin{cases} &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, cost_i) \text{ when } cost >=0 \}  &\quad  \text{ if } reverse\_cost = \varnothing \\ \\ &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} \\ \cup &\{(source_i, target_i, reverse\_cost_i) \text{ when } reverse\_co [...]
-
-
-
-.. rubric:: The problem
-
-Given:
-
-  - :math:`start_{vid} \in V` a starting vertex
-  - :math:`end_{vid} \in V` an ending vertex
-  - :math:`G(V,E) = \begin{cases}  G_d(V,E) &\quad \text{ if } directed = true \\ G_u(V,E) &\quad \text{ if } directed = false \\ \end{cases}`
-
-Then:
-
-.. math:: \text{pgr_dijkstra}(sql, start_{vid}, end_{vid}, directed) =
-  \begin{cases} 
-  \text{shortest path } \boldsymbol{\pi} \text{ between } start_{vid} \text{and } end_{vid} &\quad \text{if } \exists  \boldsymbol{\pi}  \\
-  \varnothing &\quad \text{otherwise} \\
-  \end{cases}
-
-:math:`\boldsymbol{\pi} = \{(path_\seq_i, node_i, edge_i, cost_i, agg\_cost_i)\}`
-
-where:
-  - :math:`path_\seq_i = i`
-  - :math:`path_\seq_{| \pi |} = | \pi |`
-  - :math:`node_i \in V`
-  - :math:`node_1 = start_{vid}`
-  - :math:`node_{| \pi |}  = end_{vid}`
-  - :math:`\forall i \neq | \pi |, \quad (node_i, node_{i+1}, cost_i) \in E`
-  - :math:`edge_i  = \begin{cases}  id_{(node_i, node_{i+1},cost_i)}  &\quad  \text{when } i \neq | \pi | \\ -1 &\quad  \text{when } i = | \pi | \\ \end{cases}`
-  - :math:`cost_i = cost_{(node_i, node_{i+1})}`
-  - :math:`agg\_cost_i  = \begin{cases}  0   &\quad  \text{when } i = 1  \\ \displaystyle\sum_{k=1}^{i}  cost_{(node_{k-1}, node_k)}  &\quad  \text{when } i \neq 1 \\ \end{cases}`
-
-
-
-In other words: The algorithm returns a the shortest path between :math:`start_{vid}` and :math:`end_{vid}` , if it exists, in terms of a sequence of nodes  and of edges,
-  - :math:`path_\seq` indicates the relative position in the path of the :math:`node` or :math:`edge`.
-  - :math:`cost` is the cost of the edge to be used to go to the next node.
-  - :math:`agg\_cost` is the cost from the :math:`start_{vid}` up to the node.
-
-
-If there is no path, the resulting set is empty.
-
-
-
-
-
-.. toctree::
-        :hidden: 
-
-        ./dijkstra_v2
-        ./dijkstra_v3
-
diff --git a/src/dijkstra/doc/pgr_dijkstra.rst b/src/dijkstra/doc/pgr_dijkstra.rst
new file mode 100644
index 0000000..d285162
--- /dev/null
+++ b/src/dijkstra/doc/pgr_dijkstra.rst
@@ -0,0 +1,357 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_dijkstra:
+
+pgr_dijkstra
+===============================================================================
+
+``pgr_dijkstra`` — Returns the shortest path(s) using Dijkstra algorithm.
+In particular, the Dijkstra algorithm implemented by Boost.Graph.
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html
+
+   Boost Graph Inside
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956.
+It is a graph search algorithm that solves the shortest path problem for
+a graph with non-negative edge path costs, producing a shortest path from
+a starting vertex (``start_vid``) to an ending vertex (``end_vid``).
+This implementation can be used with a directed graph and an undirected graph.
+
+Characteristics:
+----------------
+
+The main Characteristics are:
+  - Process is done only on edges with positive costs.
+  - Values are returned when there is a path.
+
+    - When the starting vertex and ending vertex are the same, there is no path.
+
+      - The `agg_cost` the non included values `(v, v)` is `0`
+
+    - When the starting vertex and ending vertex are the different and there is no path:
+
+      - The `agg_cost` the non included values `(u, v)` is :math:`\infty`
+
+  - For optimization purposes, any duplicated value in the `start_vids` or `end_vids` are ignored.
+
+  - The returned values are ordered:
+
+    - `start_vid` ascending
+    - `end_vid` ascending
+
+  - Runing time: :math:`O(| start\_vids | * (V \log V + E))`
+
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+    pgr_dijkstra(edges_sql, start_vid,  end_vid)
+    pgr_dijkstra(edges_sql, start_vid,  end_vid,  directed:=true)
+    pgr_dijkstra(edges_sql, start_vid,  end_vids, directed:=true)
+    pgr_dijkstra(edges_sql, start_vids, end_vid,  directed:=true)
+    pgr_dijkstra(edges_sql, start_vids, end_vids, directed:=true)
+
+    RETURNS SET OF (seq, path_seq [, start_vid] [, end_vid], node, edge, cost, agg_cost)
+        OR EMPTY SET
+
+
+Signatures
+===============================================================================
+
+.. index::
+    single: dijkstra(edges_sql, start_vid, end_vid)
+
+Minimal signature
+-----------------
+
+.. code-block:: none
+
+    pgr_dijkstra(TEXT edges_sql, BIGINT start_vid, BIGINT end_vid)
+    RETURNS SET OF (seq, path_seq, node, edge, cost, agg_cost) or EMPTY SET
+
+The minimal signature is for a **directed** graph from one ``start_vid`` to one ``end_vid``:
+
+:Example:
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q1
+   :end-before: -- q2
+
+
+.. index::
+    single: dijkstra(edges_sql, start_vid, end_vid, directed:=TRUE)
+
+Dijkstra One to One
+-------------------
+
+.. code-block:: none
+
+    pgr_dijkstra(TEXT edges_sql, BIGINT start_vid, BIGINT end_vid,
+        BOOLEAN directed:=true);
+    RETURNS SET OF (seq, path_seq, node, edge, cost, agg_cost) or EMPTY SET
+
+This signature finds the shortest path from one ``start_vid`` to one ``end_vid``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+:Example:
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q2
+   :end-before: -- q3
+
+
+.. index::
+    single: dijkstra(edges_sql, start_vid, end_vids, directed:=TRUE)
+
+Dijkstra One to many
+--------------------
+
+.. code-block:: none
+
+    pgr_dijkstra(TEXT edges_sql, BIGINT start_vid, ARRAY[ANY_INTEGER] end_vids,
+        BOOLEAN directed:=true);
+    RETURNS SET OF (seq, path_seq, end_vid, node, edge, cost, agg_cost) or EMPTY SET
+
+This signature finds the shortest path from one ``start_vid`` to each ``end_vid`` in ``end_vids``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+Using this signature, will load once the graph and perform a one to one `pgr_dijkstra`
+where the starting vertex is fixed, and stop when all ``end_vids`` are reached.
+
+  - The result is equivalent to the union of the results of the one to one `pgr_dijkstra`.
+  - The extra ``end_vid`` in the result is used to distinguish to which path it belongs.
+
+:Example:
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q3
+   :end-before: -- q4
+
+
+
+
+.. index::
+    single: dijkstra(edges_sql, start_vids, end_vid, directed)
+
+Dijkstra Many to One
+--------------------
+
+.. code-block:: none
+
+    pgr_dijkstra(TEXT edges_sql, ARRAY[ANY_INTEGER] start_vids, BIGINT end_vid,
+        BOOLEAN directed:=true);
+    RETURNS SET OF (seq, path_seq, start_vid, node, edge, cost, agg_cost) or EMPTY SET
+
+This signature finds the shortest path from each ``start_vid`` in  ``start_vids`` to one ``end_vid``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+Using this signature, will load once the graph and perform several one to one `pgr_dijkstra`
+where the ending vertex is fixed.
+
+  - The result is the union of the results of the one to one `pgr_dijkstra`.
+  - The extra ``start_vid`` in the result is used to distinguish to which path it belongs.
+
+:Example:
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q4
+   :end-before: -- q5
+
+
+
+.. index::
+    single: dijkstra(edges_sql, start_vids, end_vids, directed)
+
+Dijkstra Many to Many
+---------------------
+
+.. code-block:: none
+
+    pgr_dijkstra(TEXT edges_sql, ARRAY[ANY_INTEGER] start_vids, ARRAY[ANY_INTEGER] end_vids,
+        BOOLEAN directed:=true);
+    RETURNS SET OF (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost) or EMPTY SET
+
+This signature finds the shortest path from each ``start_vid`` in  ``start_vids`` to each ``end_vid`` in ``end_vids``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+Using this signature, will load once the graph and perform several one to Many `pgr_dijkstra`
+for all ``start_vids``.
+
+  - The result is the union of the results of the one to one `pgr_dijkstra`.
+  - The extra ``start_vid`` in the result is used to distinguish to which path it belongs.
+
+The extra ``start_vid`` and ``end_vid`` in the result is used to distinguish to which path it belongs.
+
+:Example:
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q5
+   :end-before: -- q6
+
+Description of the Signatures
+=============================
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+:edges_sql: an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                  Description
+================  ===================   =================================================
+**id**            ``ANY-INTEGER``       Identifier of the edge.
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, If negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, If negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+
+Where:
+
+:ANY-INTEGER: SMALLINT, INTEGER, BIGINT
+:ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+============== ====================== =================================================
+Column         Type                   Description
+============== ====================== =================================================
+**sql**        ``TEXT``               SQL query as decribed above.
+**start_vid**  ``BIGINT``             Identifier of the starting vertex of the path.
+**start_vids** ``ARRAY[ANY-INTEGER]`` Array of identifiers of starting vertices.
+**end_vid**    ``BIGINT``             Identifier of the ending vertex of the path.
+**end_vids**   ``ARRAY[ANY-INTEGER]`` Array of identifiers of ending vertices.
+**directed**   ``BOOLEAN``            (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+============== ====================== =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq, path_seq [, start_vid] [, end_vid], node, edge, cost, agg_cost)``
+
+============== ========== =================================================
+Column         Type       Description
+============== ========== =================================================
+**seq**        ``INT``    Sequential value starting from **1**.
+**path_seq**   ``INT``    Relative position in the path. Has value **1** for the begining of a path.
+**start_vid**  ``BIGINT`` Identifier of the starting vertex. Used when multiple starting vetrices are in the query.
+**end_vid**    ``BIGINT`` Identifier of the ending vertex. Used when multiple ending vertices are in the query.
+**node**       ``BIGINT`` Identifier of the node in the path from ``start_vid`` to ``end_vid``.
+**edge**       ``BIGINT`` Identifier of the edge used to go from ``node`` to the next node in the path sequence. ``-1`` for the last node of the path.
+**cost**       ``FLOAT``  Cost to traverse from ``node`` using ``edge`` to the next node in the path sequence.
+**agg_cost**   ``FLOAT``  Aggregate cost from ``start_v`` to ``node``.
+============== ========== =================================================
+
+
+Examples
+========
+
+The examples of this section are based on the :ref:`sampledata` network.
+
+The examples include combinations from starting vertices 2 and 11 to ending vertices 3 and 5 in a directed and
+undirected graph with and with out reverse_cost.
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+--------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q7
+   :end-before: -- q8
+
+
+
+Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig2`
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q9
+   :end-before: -- q10
+
+
+Examples for queries marked as ``directed`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig3`
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q11
+   :end-before: -- q12
+
+
+Examples for queries marked as ``undirected`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig4`
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q13
+   :end-before: -- q14
+
+
+Equvalences between signatures
+------------------------------
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+The examples in this section use the following :ref:`fig1`
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q15
+   :end-before: -- q16
+
+
+Equvalences between signatures
+------------------------------
+
+Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
+The examples in this section use the following :ref:`fig2`
+
+.. literalinclude:: doc-pgr_dijkstra.queries
+   :start-after: -- q17
+   :end-before: -- q18
+
+
+The queries use the :ref:`sampledata` network.
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+* Added functionality in version 2.1.0
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/dijkstra/doc/pgr_dijkstraCost.rst b/src/dijkstra/doc/pgr_dijkstraCost.rst
new file mode 100644
index 0000000..eb37eaa
--- /dev/null
+++ b/src/dijkstra/doc/pgr_dijkstraCost.rst
@@ -0,0 +1,301 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_dijkstraCost:
+
+pgr_dijkstraCost 
+===============================================================================
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+``pgr_dijkstraCost``
+
+Using Dijkstra algorithm implemented by Boost.Graph, and extract only the
+aggregate cost of the shortest path(s) found, for the combination of vertices given.
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html
+
+   Boost Graph Inside
+
+The ``pgr_dijkstraCost`` algorithm, is a good choice to calculate the sum of the costs
+of the shortest path for a subset of pairs of nodes of the graph.
+We make use of the Boost's implementation of dijkstra which runs in
+:math:`O(V \log V + E)` time.
+
+Characteristics:
+----------------
+
+The main Characteristics are:
+  - It does not return a path.
+  - Returns the sum of the costs of the shortest path for pair combination of nodes in the graph.
+  - Process is done only on edges with positive costs.
+  - Values are returned when there is a path.
+
+    - The returned values are in the form of a set of `(start_vid, end_vid, agg_cost)`.
+
+    - When the starting vertex and ending vertex are the same, there is no path.
+
+      - The `agg_cost` int the non included values `(v, v)` is `0`
+
+    - When the starting vertex and ending vertex are the different and there is no path.
+
+      - The `agg_cost` in the non included values `(u, v)` is :math:`\infty`
+
+  - Let be the case the values returned are stored in a table, so the unique index would be the pair:
+    `(start_vid, end_vid)`.
+
+  - For undirected graphs, the results are symetric.
+
+    - The  `agg_cost` of `(u, v)` is the same as for `(v, u)`.
+
+  - Any duplicated value in the `start_vids` or `end_vids` is ignored.
+
+  - The returned values are ordered:
+
+    - `start_vid` ascending
+    - `end_vid` ascending
+
+  - Runing time: :math:`O(| start\_vids | * (V \log V + E))`
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+     pgr_dijkstraCost(edges_sql, start_vid, end_vid);
+     pgr_dijkstraCost(edges_sql, start_vid, end_vid, directed);
+     pgr_dijkstraCost(edges_sql, start_vids, end_vid, directed);
+     pgr_dijkstraCost(edges_sql, start_vid, end_vids, directed);
+     pgr_dijkstraCost(edges_sql, start_vids, end_vids, directed);
+
+	 RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+
+
+Signatures
+===============================================================================
+
+.. index::
+	single: dijkstraCost(edges_sql, start_vid, end_vid)
+
+Minimal signature
+-----------------
+
+The minimal signature is for a **directed** graph from one ``start_vid`` to one ``end_vid``:
+
+.. code-block:: none
+
+     pgr_dijkstraCost(TEXT edges_sql, BIGINT start_vid, BIGINT end_vid)
+	 RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+
+.. rubric:: Example
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+
+.. index::
+	single: dijkstraCost(edges_sql, start_vid, end_vid, directed)
+
+pgr_dijkstraCost One to One
+--------------------------------
+
+
+This signature performs a Dijkstra from one ``start_vid`` to one ``end_vid``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+.. code-block:: none
+
+    pgr_dijkstraCost(TEXT edges_sql, BIGINT start_vid, BIGINT end_vid,
+			 BOOLEAN directed:=true);
+	RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+.. rubric:: Example
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+    :start-after: --q2
+    :end-before: --q3
+
+
+
+.. index::
+	single: dijkstraCost(edges_sql, start_vids, end_vid, directed)
+
+pgr_dijkstraCost Many to One
+--------------------------------
+
+.. code-block:: none
+
+    pgr_dijkstraCost(TEXT edges_sql, array[ANY_INTEGER] start_vids, BIGINT end_vid,
+			 BOOLEAN directed:=true);
+	RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+This signature performs a Dijkstra from each ``start_vid`` in  ``start_vids`` to one ``end_vid``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+
+.. rubric:: Example
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+    :start-after: --q3
+    :end-before: --q4
+
+
+
+
+.. index::
+    single: dijkstraCost(edges_sql, start_vid, end_vids, directed)
+
+pgr_dijkstraCost One to Many
+--------------------------------
+
+.. code-block:: none
+
+    pgr_dijkstraCost(TEXT edges_sql, BIGINT start_vid, array[ANY_INTEGER] end_vids,
+	    BOOLEAN directed:=true);
+	RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+This signature performs a Dijkstra from one ``start_vid`` to each ``end_vid`` in ``end_vids``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+
+.. rubric:: Example
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+
+
+
+.. index::
+	single: dijkstraCost(edges_sql, start_vids, end_vids, directed)
+
+.. rubric:: pgr_dijkstraCost Many to Many
+
+.. code-block:: none
+
+    pgr_dijkstraCost(TEXT edges_sql, array[ANY_INTEGER] start_vids, array[ANY_INTEGER] end_vids,
+	    BOOLEAN directed:=true);
+	RETURNS SET OF (start_vid, end_vid, agg_cost) or EMPTY SET
+
+This signature performs a Dijkstra from each ``start_vid`` in  ``start_vids`` to each ``end_vid`` in ``end_vids``:
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+Example
+-------
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+   :start-after: --q5
+   :end-before: --q6
+
+
+
+Description of the Signatures
+=============================
+
+Description of the edge's SQL query
+-----------------------------------
+
+:edges_sql: is a ``TEXT`` that containes an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                      Description
+================  ===================   =================================================
+**id**            ``ANY-INTEGER``       Identifier of the edge.
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, if negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, if negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+
+Where:
+
+:ANY-INTEGER: SMALLINT, INTEGER, BIGINT
+:ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, real, float
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+================  ====================== =================================================
+Column            Type                   Description
+================  ====================== =================================================
+**edges_sql**           ``TEXT``               SQL query as decribed above.
+**start_vid**     ``BIGINT``             Identifier of the starting vertex of the path.
+**end_vid**       ``BIGINT``             Identifier of the ending vertex of the path.
+**start_vids**    ``array[ANY-INTEGER]`` Array of identifiers of starting vertices.
+**end_vids**      ``array[ANY-INTEGER]`` Array of identifiers of ending vertices.
+**directed**      ``BOOLEAN``            (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+================  ====================== =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(start_vid, end_vid, agg_cost)``
+
+============= ============= =================================================
+Column        Type          Description
+============= ============= =================================================
+**start_vid** ``BIGINT``    Identifier of the starting vertex.
+**end_vid**   ``BIGINT``    Identifier of the ending vertex.
+**agg_cost**  ``FLOAT``     Aggregate cost of the shortest path from ``start_vid`` to ``end_vid``.
+============= ============= =================================================
+
+
+Examples
+========
+
+:Example 1:
+
+Repeated values are ignored, and arrays are sorted
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+    :start-after: --q6
+    :end-before: --q7
+
+:Example 2:
+
+`start_vids` are the same as `end_vids`
+
+.. literalinclude:: doc-pgr_dijkstraCost.queries
+    :start-after: --q7
+    :end-before: --q8
+
+
+The queries use the :ref:`sampledata` network.
+
+.. rubric:: History
+
+* New in version  2.2.0
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/dijkstra/doc/pgr_dijkstraVia.rst b/src/dijkstra/doc/pgr_dijkstraVia.rst
new file mode 100644
index 0000000..3bfa3ec
--- /dev/null
+++ b/src/dijkstra/doc/pgr_dijkstraVia.rst
@@ -0,0 +1,206 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_dijkstraVia:
+
+pgr_dijkstraVia
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_dijkstraVia`` — Using dijkstra algorithm, it finds the route that goes through
+a list of vertices.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+   
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Given a list of vertices and a graph, this function is equivalent to finding the
+shortest path between :math:`vertex_i` and :math:`vertex_{i+1}` for all :math:`i < size\_of(vertex_via)`.
+The paths represents the sections of the route.
+
+.. note:: This is a proposed function for version 2.3
+
+Signatrue Summary
+-----------------
+
+.. code-block:: none
+
+    pgr_dijkstraVia(edges_sql, via_vertices)
+    pgr_dijkstraVia(edges_sql, via_vertices, directed:=true, strict:=false, U_turn_on_edge:=true)
+
+    RETURNS SET OF (seq, path_pid, path_seq, start_vid, end_vid,
+        node, edge, cost, agg_cost, route_agg_cost) or EMPTY SET
+
+Signatures
+===============================================================================
+
+.. index:: 
+    single: dijkstraVia(edges_sql, via_vertices) -proposed
+
+Minimal Signature
+---------------------------------
+
+.. code-block:: none
+
+    pgr_dijkstraVia(edges_sql, via_vertices)
+    RETURNS SET OF (seq, path_pid, path_seq, start_vid, end_vid,
+        node, edge, cost, agg_cost, route_agg_cost) or EMPTY SET
+
+:Example: Find the route that visits the vertices 1 3 9  in that order
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: --q00
+    :end-before: -- q0
+
+.. index:: 
+    single: dijkstraVia(edges_sql, via_vertices, strict:=false, U_turn_on_edge:=true, directed:=true) -proposed
+
+Complete Signature
+------------------
+
+.. code-block:: none
+
+    pgr_dijkstraVia(edges_sql, via_vertices, directed:=true, strict:=false, U_turn_on_edge:=true)
+    RETURNS SET OF (seq, path_pid, path_seq, start_vid, end_vid,
+        node, edge, cost, agg_cost, route_agg_cost) or EMPTY SET
+
+
+:Example: Find the route that visits the vertices 1 3 9  in that order on an undirected graph, avoiding U-turns when possible
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q0
+    :end-before: -- q1
+
+
+Description of the Signature
+============================
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+:edges_sql: is an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                      Description
+================  ===================   =================================================
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, if negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, if negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+Where:
+
+:ANY-INTEGER: SMALLINT, INTEGER, BIGINT
+:ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+Recives  ``(edges_sql, via_vertices, directed:=true, strict:=false, U_turn_on_edge:=true)``
+
+=================== ====================== =================================================
+Parameter           Type                   Description
+=================== ====================== =================================================
+**edges_sql**       ``TEXT``               SQL query as decribed above.
+**via_vertices**    ``ARRAY[ANY-INTEGER]`` Array of vertices identifiers
+**directed**        ``BOOLEAN``            (optional) Default is true (is directed). When set to false the graph is considered as Undirected
+**strict**          ``BOOLEAN``            (optional) ignores if a subsection of the route is missing and returns everything it found Default is true (is directed). When set to false the graph is considered as Undirected
+**U_turn_on_edge**  ``BOOLEAN``            (optional) Default is true (is directed). When set to false the graph is considered as Undirected
+=================== ====================== =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(start_vid, end_vid, agg_cost)``
+
+================== ============= =================================================
+Column             Type          Description
+================== ============= =================================================
+**seq**            ``BIGINT``    Sequential value starting from 1.
+**path_pid**       ``BIGINT``    Identifier of the path.
+**path_seq**       ``BIGINT``    Sequential value starting from 1 for the path.
+**start_vid**      ``BIGINT``    Identifier of the starting vertex of the path.
+**end_vid**        ``BIGINT``    Identifier of the ending vertex of the path.
+**node**           ``BIGINT``    Identifier of the node in the path from start_vid to end_vid.
+**edge**           ``BIGINT``    Identifier of the edge used to go from node to the next node in the path sequence. -1 for the last node of the path. -2 for the last node of the route.
+**cost**           ``FLOAT``     Cost to traverse from ``node`` using ``edge`` to the next node in the route sequence.
+**agg_cost**       ``FLOAT``     Total cost from ``start_vid`` to ``end_vid`` of the path.
+**route_agg_cost** ``FLOAT``     Total cost from ``start_vid`` of ``path_pid = 1`` to ``end_vid`` of the current ``path_pid`` .
+================== ============= =================================================
+
+
+Examples
+========
+
+:Example 1: Find the route that visits the vertices 1 5 3 9 4 in that order
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q1
+    :end-before: -- q2
+
+:Example 2: What's the aggregate cost of the third path?
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q2
+    :end-before: -- q3
+
+:Example 3: What's the route's aggregate cost of the route at the end of the third path?
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q3
+    :end-before: -- q4
+
+:Example 4: How are the nodes visited in the route?
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q4
+    :end-before: -- q5
+
+:Example 5: What are the aggregate costs of the route when the visited vertices are reached?
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q5
+    :end-before: -- q6
+
+:Example 6: show the route's seq and aggregate cost and a status of "passes in front" or "visits" node 9
+
+.. literalinclude:: doc-pgr_dijkstraVia.queries
+    :start-after: -- q6
+
+
+
+The queries use the :ref:`sampledata` network.
+
+.. rubric:: History
+
+* Proposed in version 2.2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/dijkstra/doc/pgr_dijkstra_v2.rst b/src/dijkstra/doc/pgr_dijkstra_v2.rst
new file mode 100644
index 0000000..c8f0e1e
--- /dev/null
+++ b/src/dijkstra/doc/pgr_dijkstra_v2.rst
@@ -0,0 +1,116 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_dijkstra_v2:
+
+pgr_dijkstra (V 2.0)- Shortest Path Dijkstra
+===============================================================================
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_dijkstra`` — Returns the shortest path using Dijkstra algorithm.
+
+
+.. index::
+	single: dijkstra(sql, source, target, directed, has_rcost) -- deprecated
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956. It is a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+	pgr_costResult[] pgr_dijkstra(text sql, integer source, integer target,
+	                           boolean directed, boolean has_rcost);
+
+.. warning:: This signature is being deprecated in version 2.1, Please use it
+             without the ``has_rcost`` flag instead:
+
+             ``pgr_dijkstra(sql, source, target, directed)``
+
+             See :ref:`pgr_dijkstra`
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT id, source, target, cost [,reverse_cost] FROM edge_table
+
+
+	:id: ``int4`` identifier of the edge
+	:source: ``int4`` identifier of the source vertex
+	:target: ``int4`` identifier of the target vertex
+	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+	:reverse_cost: ``float8`` (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:target: ``int4`` id of the end point
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   node ID
+:id2:   edge ID (``-1`` for the last row)
+:cost:  cost to traverse from ``id1`` using ``id2``
+
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+
+
+Examples: Directed
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+
+.. literalinclude:: dijkstra-v2.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+* With ``reverse_cost``
+
+.. literalinclude:: dijkstra-v2.queries
+   :start-after: --q2
+   :end-before: --q3
+
+
+
+Examples: Undirected
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+
+.. literalinclude:: dijkstra-v2.queries
+   :start-after: --q3
+   :end-before: --q4
+
+
+* With ``reverse_cost``
+
+.. literalinclude:: dijkstra-v2.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+The queries use the :ref:`sampledata` network.
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
diff --git a/src/dijkstra/sql/CMakeLists.txt b/src/dijkstra/sql/CMakeLists.txt
index a0c1705..f43a970 100644
--- a/src/dijkstra/sql/CMakeLists.txt
+++ b/src/dijkstra/sql/CMakeLists.txt
@@ -1,7 +1,8 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
     ${CMAKE_CURRENT_SOURCE_DIR}/dijkstra.sql
-#    ${CMAKE_CURRENT_SOURCE_DIR}/dijkstra_wrappers.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/dijkstraCost.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/dijkstraVia.sql
 )
 
 # set in parent scope
diff --git a/src/dijkstra/sql/dijkstra.sql b/src/dijkstra/sql/dijkstra.sql
index cd27154..33eb9ff 100644
--- a/src/dijkstra/sql/dijkstra.sql
+++ b/src/dijkstra/sql/dijkstra.sql
@@ -1,7 +1,12 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+mail: vicky_vergara at hotmail.com
+
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,143 +22,170 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 
-CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql text, start_vid bigint, end_vid bigint, directed boolean, has_rcost boolean,
-  OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
+CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql TEXT, start_vid BIGINT, end_vid BIGINT, directed BOOLEAN,
+    only_cost BOOLEAN DEFAULT false,
+  OUT seq integer, OUT path_seq integer, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
- '$libdir/librouting-2.1', 'shortest_path'
+ '$libdir/${PGROUTING_LIBRARY_NAME}', 'one_to_one_dijkstra'
     LANGUAGE c IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql text, start_vid bigint, end_vids anyarray, directed boolean, has_rcost boolean,
-  OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
- '$libdir/librouting-2.1', 'dijkstra_1_to_many'
-    LANGUAGE c IMMUTABLE STRICT;
+    -- One to many
 
-CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql text, start_vids anyarray, end_vids bigint, directed boolean, has_rcost boolean,
-  OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
- '$libdir/librouting-2.1', 'dijkstra_many_to_1'
-    LANGUAGE c IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, has_rcost boolean,
-  OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
+CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql TEXT, start_vid BIGINT, end_vids ANYARRAY, directed BOOLEAN DEFAULT true,
+    only_cost BOOLEAN DEFAULT false,
+  OUT seq integer, OUT path_seq integer, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
- '$libdir/librouting-2.1', 'dijkstra_many_to_many'
+ '$libdir/${PGROUTING_LIBRARY_NAME}', 'one_to_many_dijkstra'
     LANGUAGE c IMMUTABLE STRICT;
 
--- V2 signature
-CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql text, start_vid bigint, end_vid bigint, directed boolean, has_rcost boolean)
-  RETURNS SETOF pgr_costresult AS
-  $BODY$
-  DECLARE
-  has_reverse boolean;
-  BEGIN
-      -- raise notice 'This function signature will no longer be supported in V3';
-      has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);
-      if (has_reverse != has_rcost) then
-         if (has_reverse) then -- raise NOTICE 'has_rcost set to false but reverse_cost column found, Ignoring';
-         else raise EXCEPTION 'has_rcost set to true but reverse_cost not found';
-         end if;
-      end if;
-
-      return query SELECT seq-1 as seq, node::integer as id1, edge::integer as id2, cost
-                FROM _pgr_dijkstra(edges_sql, start_vid, end_vid, directed, has_rcost);
-  END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
 
+--  many to one
 
--- V3 signature
-CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql text, start_vid bigint, end_vid bigint,
-  OUT seq integer,  OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
-  $BODY$
-  DECLARE
-  has_rcost boolean;
-  BEGIN
-      -- raise notice 'This function signature belongs to  V3';
-      has_rcost =_pgr_parameter_check('dijkstra', edges_sql, true);
-      return query SELECT *
-         FROM _pgr_dijkstra(edges_sql, start_vid, end_vid, true, has_rcost);
-  END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
 
+CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql TEXT, start_vids ANYARRAY, end_vid BIGINT, directed BOOLEAN DEFAULT true,
+    only_cost BOOLEAN DEFAULT false,
+    OUT seq integer, OUT path_seq integer, OUT start_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'many_to_one_dijkstra'
+LANGUAGE c IMMUTABLE STRICT;
 
--- V3 signature
-CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql text, start_vid bigint, end_vid bigint, directed boolean,
-  OUT seq integer,  OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
-  $BODY$
-  DECLARE
-  has_rcost boolean;
-  BEGIN
-      -- raise notice 'This function signature belongs to  V3';
-      has_rcost =_pgr_parameter_check('dijkstra', edges_sql, true);
-      return query SELECT *
-         FROM _pgr_dijkstra(edges_sql, start_vid, end_vid, directed, has_rcost) a;
+--  many to many
+
+
+CREATE OR REPLACE FUNCTION _pgr_dijkstra(edges_sql TEXT, start_vids ANYARRAY, end_vids ANYARRAY, directed BOOLEAN DEFAULT true,
+    only_cost BOOLEAN DEFAULT false,
+    OUT seq integer, OUT path_seq integer, OUT start_vid BIGINT, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'many_to_many_dijkstra'
+LANGUAGE c IMMUTABLE STRICT;
+
+
+
+
+
+-- V2 signature
+CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql TEXT, start_vid INTEGER, end_vid INTEGER, directed BOOLEAN, has_rcost BOOLEAN)
+RETURNS SETOF pgr_costresult AS
+$BODY$
+DECLARE
+has_reverse BOOLEAN;
+sql TEXT;
+BEGIN
+    RAISE NOTICE 'Deprecated function';
+    has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);
+    sql = edges_sql;
+    IF (has_reverse != has_rcost) THEN
+        IF (has_reverse) THEN
+            sql = 'SELECT id, source, target, cost FROM (' || edges_sql || ') a';
+        ELSE
+            raise EXCEPTION 'has_rcost set to true but reverse_cost not found';
+        END IF;
+    END IF;
+
+    RETURN query SELECT seq-1 AS seq, node::integer AS id1, edge::integer AS id2, cost
+    FROM _pgr_dijkstra(sql, start_vid, end_vid, directed, false);
   END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
-
--- V3 signature for 1 to many
-CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql text, start_vid bigint, end_vids anyarray, directed boolean default true,
-  OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
-  $BODY$
-  DECLARE
-  has_rcost boolean;
-  BEGIN
-      has_rcost =_pgr_parameter_check('dijkstra', edges_sql, true);
-      return query SELECT *
-         FROM _pgr_dijkstra(edges_sql, start_vid, end_vids, directed, has_rcost);
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+-- V3 signature 1 to 1
+CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql TEXT, start_vid BIGINT, end_vid BIGINT,
+    OUT seq integer,  OUT path_seq integer, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+DECLARE
+ statement_txt record;
+ sql TEXT;
+BEGIN
+    RETURN query
+    SELECT * FROM _pgr_dijkstra(_pgr_get_statement($1), start_vid, end_vid, true, false);
+  END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+-- V3 signature 1 to 1
+CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql TEXT, start_vid BIGINT, end_vid BIGINT, directed BOOLEAN,
+    OUT seq integer,  OUT path_seq integer, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+DECLARE
+BEGIN
+    RETURN query SELECT *
+    FROM _pgr_dijkstra(_pgr_get_statement($1), start_vid, end_vid, directed, false);
   END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
 
 
--- V3 signature for many to 1
-CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql text, start_vids anyarray, end_vid bigint, directed boolean default true,
-  OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
-  $BODY$
-  DECLARE
-  has_rcost boolean;
-  BEGIN
-      has_rcost =_pgr_parameter_check('dijkstra', edges_sql, true);
-      return query SELECT * 
-         FROM _pgr_dijkstra(edges_sql, start_vids, end_vid, directed, has_rcost);
-  END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
 
 
--- V3 signature for many to many
-CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql text, start_vids anyarray, end_vids anyarray, directed boolean default true,
-  OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
-  $BODY$
-  DECLARE
-  has_rcost boolean;
-  BEGIN
-      has_rcost =_pgr_parameter_check('dijkstra', edges_sql, true);
-      return query SELECT * 
-         FROM _pgr_dijkstra(edges_sql, start_vids, end_vids, directed, has_rcost);
-  END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
+
+
+--     DIJKSTRA
+
+/***********************************
+        ONE TO MANY
+***********************************/
+
+CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql TEXT, start_vid BIGINT, end_vids ANYARRAY, directed BOOLEAN DEFAULT true,
+  OUT seq integer, OUT path_seq integer, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+    FROM _pgr_dijkstra(_pgr_get_statement($1), $2, $3, $4);
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+
+/***********************************
+        MANY TO ONE
+***********************************/
+
+CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql TEXT, start_vids ANYARRAY, end_vid BIGINT, directed BOOLEAN DEFAULT true,
+  OUT seq integer, OUT path_seq integer, OUT start_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+    FROM _pgr_dijkstra(_pgr_get_statement($1), $2, $3, $4);
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+
+/***********************************
+        MANY TO MANY
+***********************************/
+
+CREATE OR REPLACE FUNCTION pgr_dijkstra(edges_sql TEXT, start_vids ANYARRAY, end_vids ANYARRAY, directed BOOLEAN DEFAULT true,
+    OUT seq integer, OUT path_seq integer, OUT start_vid BIGINT, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost float, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+    FROM _pgr_dijkstra(_pgr_get_statement($1), $2, $3, $4);
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
diff --git a/src/dijkstra/sql/dijkstraCost.sql b/src/dijkstra/sql/dijkstraCost.sql
new file mode 100644
index 0000000..257573e
--- /dev/null
+++ b/src/dijkstra/sql/dijkstraCost.sql
@@ -0,0 +1,103 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+--     DIJKSTRA COST
+
+/***********************************
+        ONE TO ONE
+***********************************/
+CREATE OR REPLACE FUNCTION pgr_dijkstraCost(edges_sql TEXT, BIGINT, BIGINT, directed BOOLEAN DEFAULT true,
+    OUT start_vid BIGINT, OUT end_vid BIGINT, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    return query SELECT $2, $3, a.agg_cost
+    FROM _pgr_dijkstra($1, $2, $3, $4, true) a;
+  END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+/***********************************
+        ONE TO MANY
+***********************************/
+
+
+CREATE OR REPLACE FUNCTION pgr_dijkstraCost(edges_sql TEXT, BIGINT, end_vids ANYARRAY, directed BOOLEAN DEFAULT true,
+    OUT start_vid BIGINT, OUT end_vid BIGINT, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT $2, a.end_vid, a.agg_cost
+    FROM _pgr_dijkstra(_pgr_get_statement($1), $2, $3, $4, true) a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+/***********************************
+        MANY TO ONE
+***********************************/
+
+CREATE OR REPLACE FUNCTION pgr_dijkstraCost(edges_sql TEXT, start_vids ANYARRAY, BIGINT, directed BOOLEAN DEFAULT true,
+    OUT start_vid BIGINT, OUT end_vid BIGINT, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT a.start_vid, $3, a.agg_cost
+    FROM _pgr_dijkstra(_pgr_get_statement($1), $2, $3, $4, true) a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+
+/***********************************
+        MANY TO MANY
+***********************************/
+
+CREATE OR REPLACE FUNCTION pgr_dijkstraCost(edges_sql TEXT, start_vids ANYARRAY, end_vids ANYARRAY, directed BOOLEAN DEFAULT true,
+    OUT start_vid BIGINT, OUT end_vid BIGINT, OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT a.start_vid, a.end_vid, a.agg_cost
+    FROM _pgr_dijkstra(_pgr_get_statement($1), $2, $3, $4, true) a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+
diff --git a/src/dijkstra/sql/dijkstraVia.sql b/src/dijkstra/sql/dijkstraVia.sql
new file mode 100644
index 0000000..f18a54b
--- /dev/null
+++ b/src/dijkstra/sql/dijkstraVia.sql
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+File: dijkstraViaVertex.sql
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+CREATE OR REPLACE FUNCTION pgr_dijkstraVia(
+    edges_sql TEXT,
+    via_vertices ANYARRAY,
+    directed BOOLEAN DEFAULT TRUE,
+    strict BOOLEAN DEFAULT FALSE,
+    U_turn_on_edge BOOLEAN DEFAULT TRUE,
+
+
+    OUT seq INTEGER,
+    OUT path_id INTEGER,
+    OUT path_seq INTEGER,
+    OUT start_vid BIGINT,
+    OUT end_vid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT,
+    OUT route_agg_cost FLOAT)
+
+  RETURNS SETOF RECORD AS
+ '$libdir/${PGROUTING_LIBRARY_NAME}', 'dijkstraVia'
+    LANGUAGE c IMMUTABLE STRICT;
+
+
diff --git a/src/dijkstra/src/1_to_many_dijkstra.c b/src/dijkstra/src/1_to_many_dijkstra.c
deleted file mode 100644
index fe6d202..0000000
--- a/src/dijkstra/src/1_to_many_dijkstra.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*pgRouting
- *
- * File: 1_to_many_dijstra.c
- * Copyright (c) 2015 Celia Virginia Vergara Castillo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-// #define DEBUG
-
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "utils/array.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-
-#include "fmgr.h"
-#include "./../../common/src/pgr_types.h"
-#include "./../../common/src/postgres_connection.h"
-#include "./dijkstra_driver.h"
-
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-
-static int dijkstra_1_to_many_driver(
-          char* sql, int64_t start_vertex,
-          int64_t *end_vertex, int num,
-          bool directed, bool has_rcost,
-          pgr_path_element3_t **path, int *path_count) {
-  int SPIcode;
-  pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
-
-
-  char *err_msg = (char *)"";
-  int ret = -1;
-
-
-  SPIcode = pgr_get_data(sql, &edges, &total_tuples, has_rcost,
-               start_vertex, start_vertex);
-
-  if (SPIcode == -1) {
-    return SPIcode;
-  }
-
-  ret = do_pgr_dijkstra_1_to_many(edges, total_tuples,
-                        start_vertex, end_vertex, num,
-                        has_rcost, directed,
-                        path, path_count, &err_msg);
-
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-        errmsg("Error computing path: %s", err_msg)));
-  }
-
-
-  pfree(edges);
-  return pgr_finish(SPIcode, ret);
-}
-
-
-#ifndef _MSC_VER
-Datum dijkstra_1_to_many(PG_FUNCTION_ARGS);
-#else  // _MSC_VER
-PGDLLEXPORT Datum dijkstra_1_to_many(PG_FUNCTION_ARGS);
-#endif  // _MSC_VER
-
-
-PG_FUNCTION_INFO_V1(dijkstra_1_to_many);
-#ifndef _MSC_VER
-Datum
-#else  // _MSC_VER
-PGDLLEXPORT Datum
-#endif
-dijkstra_1_to_many(PG_FUNCTION_ARGS) {
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  pgr_path_element3_t  *ret_path = 0;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-      int64_t* targetsArr;
-      int num;
-
-      targetsArr = (int64_t*) pgr_get_bigIntArray(&num, PG_GETARG_ARRAYTYPE_P(2));
-      PGR_DBG("targetsArr size %d ", num);
-
-
-#ifdef DEBUG
-      int i;
-      for (i = 0; i < num; ++i) {
-        PGR_DBG("targetsArr[%d]=%li", i, targetsArr[i]);
-      }
-#endif
-
-      PGR_DBG("Calling dijkstra_1_to_many_driver");
-      dijkstra_1_to_many_driver(
-               pgr_text2char(PG_GETARG_TEXT_P(0)),
-               PG_GETARG_INT64(1),
-               targetsArr, num,
-               PG_GETARG_BOOL(3),
-               PG_GETARG_BOOL(4), &ret_path, &path_count);
-
-      free(targetsArr);
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = ret_path;
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
-            ereport(ERROR,
-                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                     errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-      funcctx->tuple_desc = tuple_desc;
-
-      MemoryContextSwitchTo(oldcontext);
-  }
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  ret_path = (pgr_path_element3_t*) funcctx->user_fctx;
-
-  /* do when there is more left to send */
-  if (call_cntr < max_calls) {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(7 * sizeof(Datum));
-      nulls = palloc(7 * sizeof(char));
-      // id, start_v, node, edge, cost, tot_cost
-      values[0] = Int32GetDatum(call_cntr + 1);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(ret_path[call_cntr].seq);
-      nulls[1] = ' ';
-      values[2] = Int64GetDatum(ret_path[call_cntr].to);
-      nulls[2] = ' ';
-      values[3] = Int64GetDatum(ret_path[call_cntr].vertex);
-      nulls[3] = ' ';
-      values[4] = Int64GetDatum(ret_path[call_cntr].edge);
-      nulls[4] = ' ';
-      values[5] = Float8GetDatum(ret_path[call_cntr].cost);
-      nulls[5] = ' ';
-      values[6] = Float8GetDatum(ret_path[call_cntr].tot_cost);
-      nulls[6] = ' ';
-
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-  } else {
-      /* do when there is no more left */
-      if (ret_path) free(ret_path);
-      SRF_RETURN_DONE(funcctx);
-  }
-}
-
diff --git a/src/dijkstra/src/CMakeLists.txt b/src/dijkstra/src/CMakeLists.txt
index 17b95aa..974cfe7 100644
--- a/src/dijkstra/src/CMakeLists.txt
+++ b/src/dijkstra/src/CMakeLists.txt
@@ -1,6 +1,13 @@
-ADD_LIBRARY(dijkstra OBJECT 
-                            dijkstra.c 
-                            1_to_many_dijkstra.c 
-                            many_to_1_dijkstra.c 
-                            many_to_many_dijkstra.c 
-                            dijkstra_driver.cpp)
+ADD_LIBRARY(dijkstra OBJECT
+        one_to_one_dijkstra.c
+        one_to_many_dijkstra.c
+        many_to_one_dijkstra.c
+        many_to_many_dijkstra.c
+        dijkstraVia.c
+
+
+        one_to_one_dijkstra_driver.cpp
+        one_to_many_dijkstra_driver.cpp
+        many_to_many_dijkstra_driver.cpp 
+        many_to_one_dijkstra_driver.cpp
+        dijkstraVia_driver.cpp)
diff --git a/src/dijkstra/src/dijkstra.c b/src/dijkstra/src/dijkstra.c
deleted file mode 100644
index 9653d99..0000000
--- a/src/dijkstra/src/dijkstra.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Shortest path algorithm for PostgreSQL
- *
- * Copyright (c) 2005 Sylvain Pasche
- *               2015 Celia Virginia Vergara Castillo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-
-#include "fmgr.h"
-#include "./../../common/src/pgr_types.h"
-#include "./../../common/src/postgres_connection.h"
-#include "./dijkstra_driver.h"
-
-#ifdef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-Datum shortest_path(PG_FUNCTION_ARGS);
-
-static int compute_shortest_path(char* sql, int64_t start_vertex,
-                                 int64_t end_vertex, bool directed,
-                                 bool has_rcost,
-                                 pgr_path_element3_t **path, int *path_count) {
-  int SPIcode = 0;
-  pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
-
-
-  char *err_msg = (char *)"";
-  int ret = -1;
-
-  if (start_vertex == end_vertex) {
-      PGR_DBG("Starting vertex and Ending Vertex are equal");
-      *path = noPathFound3(-1, path_count, (*path));
-      return 0;
-  }
-
-  PGR_DBG("Load data");
-
-  int readCode = pgr_get_data(sql, &edges, &total_tuples, has_rcost,
-               start_vertex, end_vertex);
-
-  if (readCode == -1 || total_tuples == 0) {
-    *path = noPathFound3(-1, path_count, (*path));
-    PGR_DBG("No edge tuples found");
-    pfree(edges);
-    return pgr_finish(SPIcode, ret);
-  }
-
-  if (total_tuples == 1 
-     && (edges[0].cost < 0 && edges[0].reverse_cost < 0)) {
-    PGR_DBG("One edge with cost == %f and reverse_cost == %f", edges[0].cost, edges[0].reverse_cost );
-    *path = noPathFound3(-1, path_count, (*path));
-    pfree(edges);
-    return pgr_finish(SPIcode, ret);
-  }
-
-  if (total_tuples == 1) {
-    PGR_DBG("One edge with cost == %f and reverse_cost == %f", edges[0].cost, edges[0].reverse_cost );
-    PGR_DBG("The soruce == %ld and target == %ld", edges[0].source, edges[0].target);
-    if ((edges[0].cost >= 0 && edges[0].source != start_vertex &&  edges[0].target != end_vertex) 
-        ||  (edges[0].reverse_cost >= 0 && edges[0].source != end_vertex &&  edges[0].target != start_vertex)) {
-      PGR_DBG("There must be a solution or empty for undirected");
-    }
-    if (edges[0].cost >= 0 && edges[0].source == start_vertex &&  edges[0].target == end_vertex) { 
-      PGR_DBG("Solution from source to target");
-    }
-    if (edges[0].reverse_cost >= 0 && edges[0].target == start_vertex &&  edges[0].source == end_vertex) { 
-      PGR_DBG("Solution from target to source");
-    }
-  }
-
-
-  PGR_DBG("Total %ld tuples in query:", total_tuples);
-
-  ret = do_pgr_dijkstra(edges, total_tuples,
-                        start_vertex, end_vertex,
-                        has_rcost, directed,
-                        path, path_count, &err_msg);
-
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-        errmsg("Error computing path: %s", err_msg)));
-  }
-
-  PGR_DBG("total records found %i\n", *path_count);
-  PGR_DBG("Exist Status = %i\n", ret);
-  PGR_DBG("Returned message = %s\n", err_msg);
-
-  pfree(edges);
-  return pgr_finish(SPIcode, ret);
-}
-
-
-PG_FUNCTION_INFO_V1(shortest_path);
-Datum
-shortest_path(PG_FUNCTION_ARGS) {
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  pgr_path_element3_t  *ret_path = 0;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-
-      compute_shortest_path(pgr_text2char(PG_GETARG_TEXT_P(0)),
-                                  PG_GETARG_INT64(1),
-                                  PG_GETARG_INT64(2),
-                                  PG_GETARG_BOOL(3),
-                                  PG_GETARG_BOOL(4), &ret_path, &path_count);
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = ret_path;
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
-            ereport(ERROR,
-                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                     errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-      funcctx->tuple_desc = tuple_desc;
-
-      MemoryContextSwitchTo(oldcontext);
-  }
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  ret_path = (pgr_path_element3_t*) funcctx->user_fctx;
-
-  /* do when there is more left to send */
-  if (call_cntr < max_calls) {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(6 * sizeof(Datum));
-      nulls = palloc(6 * sizeof(char));
-
-      values[0] = Int32GetDatum(ret_path[call_cntr].seq);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(ret_path[call_cntr].seq);
-      nulls[1] = ' ';
-      values[2] = Int64GetDatum(ret_path[call_cntr].vertex);
-      nulls[2] = ' ';
-      values[3] = Int64GetDatum(ret_path[call_cntr].edge);
-      nulls[3] = ' ';
-      values[4] = Float8GetDatum(ret_path[call_cntr].cost);
-      nulls[4] = ' ';
-      values[5] = Float8GetDatum(ret_path[call_cntr].tot_cost);
-      nulls[5] = ' ';
-
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-  } else {
-      /* do when there is no more left */
-      if (ret_path) free(ret_path);
-      SRF_RETURN_DONE(funcctx);
-  }
-}
-
diff --git a/src/dijkstra/src/dijkstraVia.c b/src/dijkstra/src/dijkstraVia.c
new file mode 100644
index 0000000..9bb4055
--- /dev/null
+++ b/src/dijkstra/src/dijkstraVia.c
@@ -0,0 +1,233 @@
+/*PGR-GNU*****************************************************************
+File: dijkstraViaVertex.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+/*
+  Uncomment when needed
+*/
+// #define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./dijkstraVia_driver.h"
+
+PG_FUNCTION_INFO_V1(dijkstraVia);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+dijkstraVia(PG_FUNCTION_ARGS);
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process( char* edges_sql,
+        int64_t *via_vidsArr,
+        size_t size_via_vidsArr,
+        bool directed,
+        bool strict,
+        bool U_turn_on_edge,
+        Routes_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges;
+    edges = NULL;
+    size_t total_tuples;
+    total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+    PGR_DBG("directed: %d", directed);
+    PGR_DBG("strict: %d", strict);
+    PGR_DBG("U_turn_on_edge: %d", U_turn_on_edge);
+
+
+    PGR_DBG("Starting processing");
+    clock_t start_t = clock();
+
+    char *err_msg = (char *)"";
+    do_pgr_dijkstraViaVertex(
+            edges,
+            total_tuples,
+            via_vidsArr,
+            size_via_vidsArr,
+            directed,
+            strict,
+            U_turn_on_edge,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing Dijkstra Via", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                             */
+/*******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+dijkstraVia(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t               call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    Routes_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   
+         * pgr_dijkstraVia(edges_sql text,
+         *   vertices anyarray,
+         *   directed boolean default true,
+         *   strict boolean default false,
+         *   U_turn_on_edge boolean default false,
+         *******************************************************************************/
+
+        PGR_DBG("Initializing arrays");
+        int64_t* via_vidsArr;
+        size_t size_via_vidsArr;
+        via_vidsArr = (int64_t*) pgr_get_bigIntArray(&size_via_vidsArr, PG_GETARG_ARRAYTYPE_P(1));
+        PGR_DBG("Via VertexArr size %ld ", size_via_vidsArr);
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                via_vidsArr, size_via_vidsArr,
+                PG_GETARG_BOOL(2),
+                PG_GETARG_BOOL(3),
+                PG_GETARG_BOOL(4),
+                &result_tuples,
+                &result_count);
+
+        PGR_DBG("Cleaning arrays");
+        free(via_vidsArr);
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (Routes_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        //    OUT seq BIGINT, OUT path_id BIGINT, OUT path_seq BIGINT, OUT start_vid BIGINT, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost FLOAT, OUT agg_cost FLOAT, OUT route_agg_cost FLOAT)
+
+        size_t numb_out = 10;
+        values = palloc(numb_out * sizeof(Datum));
+        nulls = palloc(numb_out * sizeof(char));
+        size_t i;
+        for(i = 0; i< numb_out; ++i) {
+            nulls[i] = ' ';
+        }
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].path_id);
+        values[2] = Int32GetDatum(result_tuples[call_cntr].path_seq + 1);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].start_vid);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].end_vid);
+        values[5] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[6] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[7] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[8] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        values[9] = Float8GetDatum(result_tuples[call_cntr].route_agg_cost);
+
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
diff --git a/src/dijkstra/src/dijkstraVia_driver.cpp b/src/dijkstra/src/dijkstraVia_driver.cpp
new file mode 100644
index 0000000..846f2ab
--- /dev/null
+++ b/src/dijkstra/src/dijkstraVia_driver.cpp
@@ -0,0 +1,243 @@
+/*PGR-GNU*****************************************************************
+File: dijkstraViaVertex_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_dijkstra.hpp"
+#include "./dijkstraVia_driver.h"
+#include "./../../common/src/memory_func.hpp"
+
+// #define DEBUG
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+
+template <class G>
+void
+pgr_dijkstraViaVertex(
+        G &graph,
+        const std::vector< int64_t > via_vertices,
+        std::deque< Path > &paths,
+        bool strict,
+        bool U_turn_on_edge,  //! true = u turns are allowed between paths
+        std::ostringstream &log) {    
+
+    if (via_vertices.size() == 0) {
+        return;
+    }
+
+    paths.clear();
+    int64_t prev_vertex = via_vertices[0];
+    Path path;
+    
+    //for (size_t i = 0; i < via_vertices.size() - 1; ++i) {
+    int64_t i = 0;
+    for (const auto &vertex : via_vertices) {
+        if (i == 0) {
+            prev_vertex = vertex; ++i;
+            continue;
+        }
+
+        // Delete uTurn edges only valid for paths that are not the first path
+        if (!U_turn_on_edge && i > 1) {
+
+            // we can only delete if there is was a path, that is at least one edge size
+            if (path.size() > 1) {
+                // Delete from the graph the last edge if its outgoing also
+                // edge to be removed = second to last edge path[i].edge;
+                int64_t edge_to_be_removed = path[path.size() - 2].edge;
+                int64_t last_vertex_of_path = prev_vertex;
+               // path.path[path.path.size() - 1].vertex;
+
+                // and the current vertex is not a dead end
+                if (graph.out_degree(last_vertex_of_path) > 1) {
+                log << "departing from " << last_vertex_of_path
+                    << " deleting edge " << edge_to_be_removed << "\n";
+                    graph.disconnect_out_going_edge(last_vertex_of_path, edge_to_be_removed);
+                }
+            }
+        }
+
+        path.clear();
+
+        log << "from " << prev_vertex << " to " << vertex << "\n";
+        pgr_dijkstra(graph, path, prev_vertex, vertex);
+
+        if (!U_turn_on_edge && i > 1) {
+            graph.restore_graph();
+            if (path.empty()) { 
+                /*
+                 *  no path was found with the deleted edge
+                 *  try with the edge back in the graph
+                 */
+                log << "WAS empty so again from " << prev_vertex << " to " << vertex << "\n";
+                pgr_dijkstra(graph, path, prev_vertex, vertex);
+            }
+        }
+
+        if (strict && path.empty()) {
+            paths.clear();
+            return;
+        }
+        paths.push_back(path);
+
+        /*
+         * got to the next
+         */
+        prev_vertex = vertex; ++i;
+    }
+}
+
+static
+void
+get_path(
+        int route_id,
+        int path_id,
+        const Path &path,
+        Routes_t **postgres_data,
+        double &route_cost,
+        size_t &sequence) {
+    int i = 0;
+    //for (size_t i = 0; i < path.size(); i++) {
+    for (const auto e : path) {
+        (*postgres_data)[sequence] = {
+            route_id,
+            path_id,
+            i,
+            path.start_id(),
+            path.end_id(),
+            e.node,
+            e.edge,
+            e.cost,
+            e.agg_cost,
+            route_cost};
+        route_cost += path[i].cost;
+        ++i;
+        ++sequence;
+    }
+}
+
+
+static
+size_t
+get_route(
+        Routes_t **ret_path,
+        const std::deque< Path > &paths) {
+    size_t sequence = 0;    //arrys index
+    int path_id = 1;    // id's in posgresql start with 1
+    int route_id = 1;   
+    double route_cost = 0;  // routes_agg_cost
+    for (const Path &path : paths) {
+        if (path.size() > 0)
+            get_path(route_id, path_id, path, ret_path, route_cost, sequence);
+        ++path_id;
+    }
+    return sequence;
+}
+
+// CREATE OR REPLACE FUNCTION pgr_dijkstraViaVertices(sql text, vertices anyarray, directed boolean default true,
+void
+do_pgr_dijkstraViaVertex(
+        pgr_edge_t  *data_edges,    size_t total_tuples,
+        int64_t  *via_vidsArr,      size_t size_via_vidsArr,
+        bool directed,
+        bool strict,
+        bool U_turn_on_edge,
+        Routes_t **return_tuples,   size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+
+        if (total_tuples == 1) {
+            log << "Requiered: more than one tuple\n";
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            *err_msg = strdup(log.str().c_str());
+            return;
+        }
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_tuples;
+
+        std::deque< Path >paths;
+        log << "Inserting vertices into a c++ vector structure\n";
+        std::vector< int64_t > via_vertices(via_vidsArr, via_vidsArr + size_via_vidsArr);
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(data_edges, total_tuples);
+            pgr_dijkstraViaVertex(digraph, via_vertices, paths, strict, U_turn_on_edge, log);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(data_edges, total_tuples);
+            pgr_dijkstraViaVertex(undigraph, via_vertices, paths, strict, U_turn_on_edge, log);
+        }
+
+        size_t count(count_tuples(paths));
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log << 
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return;
+        }
+
+        // get the space required to store all the paths
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (get_route(return_tuples, paths));
+        (*return_tuples)[count - 1].edge = -2;
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+    }
+}
+
+
+
+
+
diff --git a/src/dijkstra/src/dijkstraVia_driver.h b/src/dijkstra/src/dijkstraVia_driver.h
new file mode 100644
index 0000000..a0550b2
--- /dev/null
+++ b/src/dijkstra/src/dijkstraVia_driver.h
@@ -0,0 +1,53 @@
+/*PGR-GNU*****************************************************************
+File: dijkstraViaVertex.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_DIJKSTRAVIAVERTEX_SRC_DIJKSTRAVIAVERTEX_DRIVER_H_
+#define SRC_DIJKSTRAVIAVERTEX_SRC_DIJKSTRAVIAVERTEX_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    //  CREATE OR REPLACE FUNCTION pgr_dijkstraViaVertices(sql text, vertices anyarray, directed boolean default true,
+    void
+        do_pgr_dijkstraViaVertex(
+                pgr_edge_t  *data_edges,  size_t total_tuples,
+                int64_t  *via_vidsArr,    size_t size_via_vidsArr,
+                bool directed,
+                bool strict,
+                bool U_turn_on_edge,
+                Routes_t **return_tuples, size_t *return_count,
+                char ** err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_DIJKSTRAVIAVERTEX_SRC_DIJKSTRAVIAVERTEX_DRIVER_H_
diff --git a/src/dijkstra/src/dijkstra_driver.cpp b/src/dijkstra/src/dijkstra_driver.cpp
deleted file mode 100644
index db7a200..0000000
--- a/src/dijkstra/src/dijkstra_driver.cpp
+++ /dev/null
@@ -1,367 +0,0 @@
-/*PGR
-
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-// #define DEBUG
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-
-#include <sstream>
-#include <deque>
-#include <vector>
-#include "./pgr_dijkstra.hpp"
-#include "./dijkstra_driver.h"
-
-extern "C" {
-#include "postgres.h"
-#include "./../../common/src/pgr_types.h"
-#include "./../../common/src/postgres_connection.h"
-}
-
-
-// #include "./../../common/src/pgr_types.h"
-// #include "./../../common/src/postgres_connection.h"
-
-
-int do_pgr_dijkstra_many_to_many(pgr_edge_t  *data_edges, int64_t total_tuples,
-    int64_t  *start_vertex, int s_len, int64_t  *end_vertex, int e_len,
-    bool has_reverse_cost, bool directedFlag,
-    pgr_path_element3_t **ret_path, int *path_count,
-    char ** err_msg) {
-  try {
-    // in c code this should this must have been checked:
-    //  1) cant check anything
-    if (total_tuples == 1) {
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      *ret_path = NULL;
-      return 0;
-    }
-
-std::ostringstream log;
-    graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-    const int initial_size = 1;
-
-    std::deque< Path >paths;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::undirectedS,
-      boost_vertex_t, boost_edge_t > UndirectedGraph;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::bidirectionalS,
-      boost_vertex_t, boost_edge_t > DirectedGraph;
-
-    Pgr_dijkstra < DirectedGraph > digraph(gType, initial_size);
-    Pgr_dijkstra < UndirectedGraph > undigraph(gType, initial_size);
-
-    std::vector< int64_t > start_vertices(start_vertex, start_vertex + s_len);
-    std::vector< int64_t > end_vertices(end_vertex, end_vertex + e_len);
-    if (directedFlag) {
-      digraph.initialize_graph(data_edges, total_tuples);
-      digraph.dijkstra(paths, start_vertices, end_vertices);
-    } else {
-      undigraph.initialize_graph(data_edges, total_tuples);
-      undigraph.dijkstra(paths, start_vertices, end_vertices);
-    }
-
-    int count(count_tuples(paths));
-
-log << "count" << count;
-    if (count == 0) {
-      *err_msg = strdup(
-        "NOTICE: No paths found between any of the starting vertices and any of the Ending vertices");
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      return 0;
-    }
-
-
-    *ret_path = pgr_get_memory3(count, (*ret_path));
-    int sequence(collapse_paths(ret_path, paths));
-
-log << "sequence" << sequence;
-
-#if 1
-    *err_msg = strdup("OK");
-#else
-    *err_msg = strdup(log.str().c_str());
-#endif
-    *path_count = sequence;
-    return EXIT_SUCCESS;
-  } catch ( ... ) {
-    *err_msg = strdup("Caught unknown expection!");
-    return -1;
-  }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-int  do_pgr_dijkstra_many_to_1(pgr_edge_t *data_edges, int64_t total_tuples,
-    int64_t *start_vertex, int s_len, int64_t end_vertex,
-    bool has_reverse_cost, bool directedFlag,
-    pgr_path_element3_t **ret_path, int *path_count,
-    char **err_msg) {
-  try {
-    // in c code this should this must have been checked:
-    //  1) end_vertex is in the data_edges
-
-    #if 0  // set to 1 if needed
-    std::ostringstream log;
-    #endif
-    if (total_tuples == 1) {
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      *ret_path = NULL;
-      return 0;
-    }
-
-    graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-    const int initial_size = 1;
-
-    std::deque< Path >paths;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::undirectedS,
-      boost_vertex_t, boost_edge_t > UndirectedGraph;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::bidirectionalS,
-      boost_vertex_t, boost_edge_t > DirectedGraph;
-
-    Pgr_dijkstra < DirectedGraph > digraph(gType, initial_size);
-    Pgr_dijkstra < UndirectedGraph > undigraph(gType, initial_size);
-
-    std::vector< int64_t > start_vertices(start_vertex, start_vertex + s_len);
-
-    if (directedFlag) {
-      digraph.initialize_graph(data_edges, total_tuples);
-      digraph.dijkstra(paths, start_vertices, end_vertex);
-    } else {
-      undigraph.initialize_graph(data_edges, total_tuples);
-      undigraph.dijkstra(paths, start_vertices, end_vertex);
-    }
-
-
-    int count(count_tuples(paths));
-
-    if (count == 0) {
-      *err_msg = strdup(
-        "NOTICE: No paths found between any of the starting vertices and the Ending vertex");
-      *ret_path = noPathFound3(-1, path_count,  (*ret_path));
-      return 0;
-    }
-
-
-    *ret_path = pgr_get_memory3(count, (*ret_path));
-    int sequence(collapse_paths(ret_path, paths));
-
-
-    #if 1
-    *err_msg = strdup("OK");
-    #else
-    *err_msg = strdup(log.str().c_str());
-    #endif
-    *path_count = sequence;
-    return EXIT_SUCCESS;
-  } catch ( ... ) {
-    *err_msg = strdup("Caught unknown expection!");
-    return -1;
-  }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-int do_pgr_dijkstra_1_to_many(pgr_edge_t  *data_edges, int64_t total_tuples,
-    int64_t start_vertex, int64_t *end_vertex, int e_len,
-    bool has_reverse_cost, bool directedFlag,
-    pgr_path_element3_t **ret_path, int *path_count,
-    char **err_msg) {
-  try {
-    // in c code this should this must have been checked:
-    //  1) start_vertex is in the data_edges
-
-    if (total_tuples == 1) {
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      *ret_path = NULL;
-      return 0;
-    }
-    graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-    const int initial_size = 1;
-
-    std::deque< Path >paths;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::undirectedS,
-      boost_vertex_t, boost_edge_t > UndirectedGraph;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::bidirectionalS,
-      boost_vertex_t, boost_edge_t > DirectedGraph;
-
-    Pgr_dijkstra < DirectedGraph > digraph(gType, initial_size);
-    Pgr_dijkstra < UndirectedGraph > undigraph(gType, initial_size);
-
-
-    std::vector< int64_t > end_vertices(end_vertex, end_vertex + e_len);
-
-    if (directedFlag) {
-      digraph.initialize_graph(data_edges, total_tuples);
-      digraph.dijkstra(paths, start_vertex, end_vertices);
-    } else {
-      undigraph.initialize_graph(data_edges, total_tuples);
-      undigraph.dijkstra(paths, start_vertex, end_vertices);
-    }
-
-    int count(count_tuples(paths));
-
-    if (count == 0) {
-      *err_msg = strdup(
-        "NOTICE: No paths found between Starting and any of the Ending vertices");
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      return 0;
-    }
-
-
-    // get the space required to store all the paths
-    *ret_path = pgr_get_memory3(count, (*ret_path));
-    int sequence(collapse_paths(ret_path, paths));
-
-    #if 1
-      *err_msg = strdup("OK");
-    #else
-      *err_msg = strdup(log.str().c_str());
-    #endif
-
-    *path_count = sequence;
-    return EXIT_SUCCESS;
-  } catch ( ... ) {
-    *err_msg = strdup("Caught unknown expection!");
-    return -1;
-  }
-}
-
-
-
-
-
-
-
-
-
-
-
-int  do_pgr_dijkstra(pgr_edge_t  *data_edges, int64_t total_tuples,
-    int64_t  start_vertex, int64_t  end_vertex,
-    bool has_reverse_cost, bool directedFlag,
-    pgr_path_element3_t **ret_path, int *path_count,
-    char **err_msg) {
-  try {
-    // in c code this should have been checked:
-    //  1) start_vertex is in the data_edges  DONE
-    //  2) end_vertex is in the data_edges  DONE
-    //  3) start and end_vertex are different DONE
-
-    if (total_tuples == 1) {
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      *ret_path = NULL;
-      return 0;
-    }
-    graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-    const int initial_size = 1;
-
-    Path path;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::undirectedS,
-      boost_vertex_t, boost_edge_t > UndirectedGraph;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS,
-      boost::bidirectionalS,
-      boost_vertex_t, boost_edge_t > DirectedGraph;
-
-    Pgr_dijkstra < DirectedGraph > digraph(gType, initial_size);
-    Pgr_dijkstra < UndirectedGraph > undigraph(gType, initial_size);
-
-    if (directedFlag) {
-      digraph.initialize_graph(data_edges, total_tuples);
-      digraph.dijkstra(path, start_vertex, end_vertex);
-    } else {
-      undigraph.initialize_graph(data_edges, total_tuples);
-      undigraph.dijkstra(path, start_vertex, end_vertex);
-    }
-
-    int count(path.path.size());
-
-    if (count == 0) {
-      *err_msg = strdup(
-        "NOTICE: No path found between Starting and Ending vertices");
-      *ret_path = noPathFound3(-1, path_count, (*ret_path));
-      return 0;
-    }
-
-
-  
-    // get the space required to store all the paths
-    *ret_path = NULL;
-    *ret_path = pgr_get_memory3(count, (*ret_path));
-
-    int sequence = 0;
-    path.dpPrint(ret_path, sequence);
-
-    #if 1
-    *err_msg = strdup("OK");
-    #else
-    *err_msg = strdup(log.str().c_str());
-    #endif
-    *path_count = count;
-    return EXIT_SUCCESS;
-  } catch ( ... ) {
-    *err_msg = strdup("Caught unknown expection!");
-    return -1;
-  }
-}
-
-#if 0  // used for debugging
-std::ostringstream log;
-// move around this lines to force a return with an empty path and the log msg
-// cool for debugging
-if 0
-*err_msg = strdup(log.str().c_str());
-(*path_count) = 1;
-*ret_path = noPathFound3(start_vertex, (*ret_path));
-return -1;
-#endif
-
diff --git a/src/dijkstra/src/dijkstra_driver.h b/src/dijkstra/src/dijkstra_driver.h
deleted file mode 100644
index 92b91d3..0000000
--- a/src/dijkstra/src/dijkstra_driver.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*PGR
-
-file: dijkstra_driver.h
-
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#ifndef SRC_DIJKSTRA_SRC_DIJKSTRA_DRIVER_H_
-#define SRC_DIJKSTRA_SRC_DIJKSTRA_DRIVER_H_
-
-#include "./../../common/src/pgr_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int  do_pgr_dijkstra_many_to_many(pgr_edge_t  *data_edges, int64_t total_tuples,
-        int64_t  *start_vertex, int s_len, int64_t  *end_vertex, int e_len,
-        bool has_reverse_cost, bool directedFlag,
-        pgr_path_element3_t **ret_path, int *path_count,
-        char ** err_msg);
-
-int  do_pgr_dijkstra_many_to_1(pgr_edge_t  *data_edges, int64_t total_tuples,
-        int64_t  *start_vertex, int s_len, int64_t end_vertex,
-        bool has_reverse_cost, bool directedFlag,
-        pgr_path_element3_t **ret_path, int *path_count,
-        char ** err_msg);
-
-int  do_pgr_dijkstra_1_to_many(pgr_edge_t  *data_edges, int64_t total_tuples,
-        int64_t  start_vertex, int64_t  *end_vertex, int n_end,
-        bool has_reverse_cost, bool directedFlag,
-        pgr_path_element3_t **ret_path, int *path_count,
-        char ** err_msg);
-
-int  do_pgr_dijkstra(pgr_edge_t  * edges, int64_t total_tuples,
-       int64_t  start_vertex, int64_t end_vertex,
-       bool has_rcost, bool directed,
-       pgr_path_element3_t **ret_path, int *path_count,
-       char ** err_msg);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  //  SRC_DIJKSTRA_SRC_DIJKSTRA_DRIVER_H_
diff --git a/src/dijkstra/src/many_to_1_dijkstra.c b/src/dijkstra/src/many_to_1_dijkstra.c
deleted file mode 100644
index ea2735d..0000000
--- a/src/dijkstra/src/many_to_1_dijkstra.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*pgRouting
- *
- * File: many_to_1_dijkstra.c
- * Copyright (c) 2015 Celia Virginia Vergara Castillo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-// #define DEBUG
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "utils/array.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-
-#include "fmgr.h"
-#include "./../../common/src/pgr_types.h"
-#include "./../../common/src/postgres_connection.h"
-#include "./dijkstra_driver.h"
-
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-
-static int dijkstra_many_to_1_driver(
-          char* sql, int64_t *start_vertex, int num,
-          int64_t end_vertex,
-          bool directed, bool has_rcost,
-          pgr_path_element3_t **path, int *path_count) {
-  int SPIcode;
-  pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
-
-
-  char *err_msg = (char *)"";
-  int ret = -1;
-
-
-  SPIcode = pgr_get_data(sql, &edges, &total_tuples, has_rcost,
-               end_vertex, end_vertex);
-
-  if (SPIcode == -1) {
-    return SPIcode;
-  }
-
-  ret = do_pgr_dijkstra_many_to_1(edges, total_tuples,
-                        start_vertex, num, end_vertex,
-                        has_rcost, directed,
-                        path, path_count, &err_msg);
-
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-        errmsg("Error computing path: %s", err_msg)));
-  }
-
-  pfree(edges);
-  return pgr_finish(SPIcode, ret);
-}
-
-
-#ifndef _MSC_VER
-Datum dijkstra_many_to_1(PG_FUNCTION_ARGS);
-#else  // _MSC_VER
-PGDLLEXPORT Datum dijkstra_many_to_1(PG_FUNCTION_ARGS);
-#endif  // _MSC_VER
-
-
-PG_FUNCTION_INFO_V1(dijkstra_many_to_1);
-#ifndef _MSC_VER
-Datum
-#else  // _MSC_VER
-PGDLLEXPORT Datum
-#endif
-dijkstra_many_to_1(PG_FUNCTION_ARGS) {
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  pgr_path_element3_t  *ret_path = 0;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-      int64_t* sourcesArr;
-      int num;
-
-      sourcesArr = (int64_t*) pgr_get_bigIntArray(&num, PG_GETARG_ARRAYTYPE_P(1));
-      PGR_DBG("sourcesArr size %d ", num);
-
-      PGR_DBG("Calling dijkstra_many_to_1_driver");
-      dijkstra_many_to_1_driver(
-               pgr_text2char(PG_GETARG_TEXT_P(0)),
-               sourcesArr, num,
-               PG_GETARG_INT64(2),
-               PG_GETARG_BOOL(3),
-               PG_GETARG_BOOL(4), &ret_path, &path_count);
-
-      free(sourcesArr);
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = ret_path;
-
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
-            ereport(ERROR,
-                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                     errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-      funcctx->tuple_desc = tuple_desc;
-
-      MemoryContextSwitchTo(oldcontext);
-  }
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  ret_path = (pgr_path_element3_t*) funcctx->user_fctx;
-
-  /* do when there is more left to send */
-  if (call_cntr < max_calls) {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(7 * sizeof(Datum));
-      nulls = palloc(7 * sizeof(char));
-      // id, start_v, node, edge, cost, tot_cost
-      values[0] = Int32GetDatum(call_cntr + 1);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(ret_path[call_cntr].seq);
-      nulls[1] = ' ';
-      values[2] = Int64GetDatum(ret_path[call_cntr].from);
-      nulls[2] = ' ';
-      values[3] = Int64GetDatum(ret_path[call_cntr].vertex);
-      nulls[3] = ' ';
-      values[4] = Int64GetDatum(ret_path[call_cntr].edge);
-      nulls[4] = ' ';
-      values[5] = Float8GetDatum(ret_path[call_cntr].cost);
-      nulls[5] = ' ';
-      values[6] = Float8GetDatum(ret_path[call_cntr].tot_cost);
-      nulls[6] = ' ';
-
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-  } else {
-      /* do when there is no more left */
-      if (ret_path) free(ret_path);
-      SRF_RETURN_DONE(funcctx);
-  }
-}
-
diff --git a/src/dijkstra/src/many_to_many_dijkstra.c b/src/dijkstra/src/many_to_many_dijkstra.c
index 85c2d59..3a3401c 100644
--- a/src/dijkstra/src/many_to_many_dijkstra.c
+++ b/src/dijkstra/src/many_to_many_dijkstra.c
@@ -1,24 +1,33 @@
-/*pgRouting
- *
- * File: many_to_1_dijkstra.c
- * Copyright (c) 2015 Celia Virginia Vergara Castillo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-// #define DEBUG
+/*PGR-GNU*****************************************************************
+
+File: many_to_many_dijkstra.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
 #include "postgres.h"
 #include "executor/spi.h"
 #include "funcapi.h"
@@ -28,161 +37,210 @@
 #include "access/htup_details.h"
 #endif
 
+/*
+   Uncomment when needed
+   */
+
+// #define DEBUG
+
 #include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
 #include "./../../common/src/pgr_types.h"
 #include "./../../common/src/postgres_connection.h"
-#include "./dijkstra_driver.h"
-
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-
-static int dijkstra_many_to_many_driver(
-          char* sql,
-          int64_t *start_vertex, int s_len,
-          int64_t *end_vertex,   int e_len,
-          bool directed, bool has_rcost,
-          pgr_path_element3_t **path, int *path_count) {
-  int SPIcode = 0;
-  pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
-
-
-  char *err_msg = (char *)"";
-  int ret = -1;
-
-  pgr_get_data(sql, &edges, &total_tuples, has_rcost, -1, -1);
-
-  ret = do_pgr_dijkstra_many_to_many(edges, total_tuples,
-                        start_vertex, s_len, end_vertex, e_len,
-                        has_rcost, directed,
-                        path, path_count, &err_msg);
-
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-        errmsg("Error computing path: %s", err_msg)));
-  }
-
-  pfree(edges);
-  return pgr_finish(SPIcode, ret);
-}
-
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./many_to_many_dijkstra_driver.h"
 
+PG_FUNCTION_INFO_V1(many_to_many_dijkstra);
 #ifndef _MSC_VER
-Datum dijkstra_many_to_many(PG_FUNCTION_ARGS);
+Datum
 #else  // _MSC_VER
-PGDLLEXPORT Datum dijkstra_many_to_many(PG_FUNCTION_ARGS);
-#endif  // _MSC_VER
-
+PGDLLEXPORT Datum
+#endif
+many_to_many_dijkstra(PG_FUNCTION_ARGS);
+
+
+/******************************************************************************/
+/*                          MODIFY AS NEEDED                                  */
+static
+void
+process(
+        char* edges_sql,
+        int64_t *start_vidsArr, size_t size_start_vidsArr,
+        int64_t *end_vidsArr, size_t size_end_vidsArr,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    PGR_DBG("Starting processing");
+    clock_t start_t = clock();
+
+    char *err_msg = NULL;
+    do_pgr_many_to_many_dijkstra(
+            edges,
+            total_tuples,
+            start_vidsArr,
+            size_start_vidsArr,
+            end_vidsArr,
+            size_end_vidsArr,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing Dijkstra many to many", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                           */
+/*****************************************************************************/
 
-PG_FUNCTION_INFO_V1(dijkstra_many_to_many);
 #ifndef _MSC_VER
 Datum
 #else  // _MSC_VER
 PGDLLEXPORT Datum
 #endif
-dijkstra_many_to_many(PG_FUNCTION_ARGS) {
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  pgr_path_element3_t  *ret_path = 0;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-      int64_t* sourcesArr;
-      int64_t* targetsArr;
-      int s_len, e_len;
-
-      sourcesArr = (int64_t*) pgr_get_bigIntArray(&s_len, PG_GETARG_ARRAYTYPE_P(1));
-      targetsArr = (int64_t*) pgr_get_bigIntArray(&e_len, PG_GETARG_ARRAYTYPE_P(2));
-      PGR_DBG("sourcesArr size %d ", num);
-
-      PGR_DBG("Calling dijkstra_many_to_1_driver");
-      dijkstra_many_to_many_driver(
-               pgr_text2char(PG_GETARG_TEXT_P(0)),
-               sourcesArr, s_len,
-               targetsArr, e_len,
-               PG_GETARG_BOOL(3),
-               PG_GETARG_BOOL(4), &ret_path, &path_count);
-
-      free(sourcesArr);
-      free(targetsArr);
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = ret_path;
-
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+many_to_many_dijkstra(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // CREATE OR REPLACE FUNCTION pgr_dijkstra(
+        // sql text,
+        // start_vids anyarray,
+        // end_vids anyarray,
+        // directed boolean default true,
+
+        PGR_DBG("Initializing arrays");
+        int64_t* start_vidsArr;
+        size_t size_start_vidsArr;
+        start_vidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_start_vidsArr, PG_GETARG_ARRAYTYPE_P(1));
+        PGR_DBG("start_vidsArr size %d ", size_start_vidsArr);
+
+        int64_t* end_vidsArr;
+        size_t size_end_vidsArr;
+        end_vidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_end_vidsArr, PG_GETARG_ARRAYTYPE_P(2));
+        PGR_DBG("end_vidsArr size %d ", size_end_vidsArr);
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                start_vidsArr, size_start_vidsArr,
+                end_vidsArr, size_end_vidsArr,
+                PG_GETARG_BOOL(3),
+                PG_GETARG_BOOL(4),
+                &result_tuples,
+                &result_count);
+
+        PGR_DBG("Cleaning arrays");
+        free(end_vidsArr);
+        free(start_vidsArr);
+        /*                                                                   */
+        /*********************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc)
+                != TYPEFUNC_COMPOSITE) {
             ereport(ERROR,
                     (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                      errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-      funcctx->tuple_desc = tuple_desc;
-
-      MemoryContextSwitchTo(oldcontext);
-  }
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  ret_path = (pgr_path_element3_t*) funcctx->user_fctx;
-
-  /* do when there is more left to send */
-  if (call_cntr < max_calls) {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(8 * sizeof(Datum));
-      nulls = palloc(8 * sizeof(char));
-      // id, start_v, node, edge, cost, tot_cost
-      values[0] = Int32GetDatum(call_cntr + 1);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(ret_path[call_cntr].seq);
-      nulls[1] = ' ';
-      values[2] = Int64GetDatum(ret_path[call_cntr].from);
-      nulls[2] = ' ';
-      values[3] = Int64GetDatum(ret_path[call_cntr].to);
-      nulls[3] = ' ';
-      values[4] = Int64GetDatum(ret_path[call_cntr].vertex);
-      nulls[4] = ' ';
-      values[5] = Int64GetDatum(ret_path[call_cntr].edge);
-      nulls[5] = ' ';
-      values[6] = Float8GetDatum(ret_path[call_cntr].cost);
-      nulls[6] = ' ';
-      values[7] = Float8GetDatum(ret_path[call_cntr].tot_cost);
-      nulls[7] = ' ';
-
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-  } else {
-      /* do when there is no more left */
-      if (ret_path) free(ret_path);
-      SRF_RETURN_DONE(funcctx);
-  }
+                         "that cannot accept type record")));
+        }
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // OUT seq integer,
+        // OUT path_seq INTEGER,
+        // OUT start_vid,
+        // OUT end_vid BIGINT,
+        // OUT node bigint,
+        // OUT edge bigint,
+        // OUT cost float,
+        // OUT agg_cost float)
+
+        values = palloc(8 * sizeof(Datum));
+        nulls = palloc(8 * sizeof(char));
+
+        size_t i;
+        for (i = 0; i < 8; ++i) {
+            nulls[i] = ' ';
+        }
+
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[5] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[7] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
 }
 
diff --git a/src/dijkstra/src/many_to_many_dijkstra_driver.cpp b/src/dijkstra/src/many_to_many_dijkstra_driver.cpp
new file mode 100644
index 0000000..750af3d
--- /dev/null
+++ b/src/dijkstra/src/many_to_many_dijkstra_driver.cpp
@@ -0,0 +1,131 @@
+/*PGR-GNU*****************************************************************
+File: many_to_many_dijkstra_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include <set>
+#include "./pgr_dijkstra.hpp"
+#include "./many_to_many_dijkstra_driver.h"
+
+// #define DEBUG
+
+#include "../../common/src/memory_func.hpp"
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+// CREATE OR REPLACE FUNCTION pgr_dijkstra(
+// sql text,
+// start_vids anyarray,
+// end_vids anyarray,
+// directed boolean default true,
+void
+do_pgr_many_to_many_dijkstra(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        int64_t  *start_vidsArr,
+        size_t size_start_vidsArr,
+        int64_t  *end_vidsArr,
+        size_t size_end_vidsArr,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg) {
+    std::ostringstream log;
+    try {
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_tuples;
+
+        std::deque< Path >paths;
+        log << "Inserting vertices into a c++ vector structure\n";
+        std::set< int64_t >
+            s_start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
+        std::set< int64_t >
+            s_end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
+
+        std::vector< int64_t > start_vertices(s_start_vertices.begin(), s_start_vertices.end());
+        std::vector< int64_t > end_vertices(s_end_vertices.begin(), s_end_vertices.end());
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(data_edges, total_tuples);
+            pgr_dijkstra(digraph, paths, start_vertices, end_vertices, only_cost);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(data_edges, total_tuples);
+            pgr_dijkstra(undigraph, paths, start_vertices, end_vertices, only_cost);
+        }
+
+
+        size_t count(0);
+
+        count = count_tuples(paths);
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log <<
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return;
+        }
+
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (collapse_paths(return_tuples, paths));
+
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+
+        return;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+        return;
+    }
+}
+
+
+
+
+
diff --git a/src/dijkstra/src/many_to_many_dijkstra_driver.h b/src/dijkstra/src/many_to_many_dijkstra_driver.h
new file mode 100644
index 0000000..78b2ccf
--- /dev/null
+++ b/src/dijkstra/src/many_to_many_dijkstra_driver.h
@@ -0,0 +1,64 @@
+/*PGR-GNU*****************************************************************
+
+File: many_to_many_dijkstra_driver.h
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_DIJKSTRA_SRC_MANY_TO_MANY_DIJKSTRA_DRIVER_H_
+#define SRC_DIJKSTRA_SRC_MANY_TO_MANY_DIJKSTRA_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    //  CREATE OR REPLACE FUNCTION pgr_dijkstra(
+    //  sql text,
+    //  start_vids anyarray,
+    //  end_vids anyarray,
+    //  directed boolean default true,
+    void
+        do_pgr_many_to_many_dijkstra(
+                pgr_edge_t  *data_edges,
+                size_t total_tuples,
+                int64_t  *start_vidsArr,
+                size_t size_start_vidsArr,
+                int64_t  *end_vidsArr,
+                size_t size_end_vidsArr,
+                bool directed,
+                bool only_cost,
+                General_path_element_t **return_tuples,
+                size_t *return_count,
+                char ** err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_DIJKSTRA_SRC_MANY_TO_MANY_DIJKSTRA_DRIVER_H_
diff --git a/src/dijkstra/src/many_to_one_dijkstra.c b/src/dijkstra/src/many_to_one_dijkstra.c
new file mode 100644
index 0000000..67f3d00
--- /dev/null
+++ b/src/dijkstra/src/many_to_one_dijkstra.c
@@ -0,0 +1,238 @@
+/*PGR-GNU*****************************************************************
+
+File: many_to_one_dijkstra.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+/*
+ * Uncomment when needed
+ */
+
+// #define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./many_to_one_dijkstra_driver.h"
+
+PG_FUNCTION_INFO_V1(many_to_one_dijkstra);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+many_to_one_dijkstra(PG_FUNCTION_ARGS);
+/******************************************************************************/
+/*                          MODIFY AS NEEDED                                  */
+static
+void
+process(
+        char* edges_sql,
+        int64_t *start_vidsArr,
+        size_t size_start_vidsArr,
+        int64_t end_vid,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    PGR_DBG("Starting processing");
+    clock_t start_t = clock();
+
+    char *err_msg = NULL;
+    do_pgr_many_to_one_dijkstra(
+            edges,
+            total_tuples,
+            start_vidsArr,
+            size_start_vidsArr,
+            end_vid,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing Dijkstra many to one", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+many_to_one_dijkstra(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // CREATE OR REPLACE FUNCTION pgr_dijkstra(
+        // sql text,
+        // start_vids anyarray,
+        // end_vid BIGINT,
+        // directed BOOLEAN default true,
+
+        PGR_DBG("Initializing arrays");
+        int64_t* start_vidsArr;
+        size_t size_start_vidsArr;
+        start_vidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_start_vidsArr, PG_GETARG_ARRAYTYPE_P(1));
+        PGR_DBG("start_vidsArr size %ld ", size_start_vidsArr);
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                start_vidsArr, size_start_vidsArr,
+                PG_GETARG_INT64(2),
+                PG_GETARG_BOOL(3),
+                PG_GETARG_BOOL(4),
+                &result_tuples,
+                &result_count);
+
+        PGR_DBG("Cleaning arrays");
+        free(start_vidsArr);
+        /*                                                                   */
+        /*********************************************************************/
+
+        funcctx->max_calls = (uint32_t) result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc)
+                != TYPEFUNC_COMPOSITE) {
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+        }
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // OUT seq INTEGER,
+        // OUT path_seq INTEGER,
+        // OUT start_vid BIGINT,
+        // OUT end_vid BIGINT,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT)
+
+        values = palloc(7 * sizeof(Datum));
+        nulls = palloc(7 * sizeof(char));
+
+        size_t i;
+        for (i = 0; i < 7; ++i) {
+            nulls[i] = ' ';
+        }
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/dijkstra/src/many_to_one_dijkstra_driver.cpp b/src/dijkstra/src/many_to_one_dijkstra_driver.cpp
new file mode 100644
index 0000000..76ec49c
--- /dev/null
+++ b/src/dijkstra/src/many_to_one_dijkstra_driver.cpp
@@ -0,0 +1,126 @@
+/*PGR-GNU*****************************************************************
+File: many_to_one_dijkstra_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+Copyright (c) 2015 pgRouting developers
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_dijkstra.hpp"
+#include "./many_to_one_dijkstra_driver.h"
+
+// #define DEBUG
+
+#include "../../common/src/memory_func.hpp"
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+// CREATE OR REPLACE FUNCTION pgr_dijkstra(
+// sql text,
+// start_vids anyarray,
+// end_vid BIGINT,
+// directed BOOLEAN default true,
+void
+do_pgr_many_to_one_dijkstra(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        int64_t  *start_vidsArr,
+        size_t size_start_vidsArr,
+        int64_t end_vid,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg) {
+    std::ostringstream log;
+    try {
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_tuples;
+
+        std::deque< Path >paths;
+        log << "Inserting vertices into a c++ vector structure\n";
+        std::set< int64_t > s_start_vertices(start_vidsArr, start_vidsArr + size_start_vidsArr);
+        std::vector< int64_t > start_vertices(s_start_vertices.begin(), s_start_vertices.end());
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(data_edges, total_tuples);
+            pgr_dijkstra(digraph, paths, start_vertices, end_vid, only_cost);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(data_edges, total_tuples);
+            pgr_dijkstra(undigraph, paths, start_vertices, end_vid, only_cost);
+        }
+
+
+        size_t count(0);
+        count = count_tuples(paths);
+
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log <<
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return;
+        }
+
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (collapse_paths(return_tuples, paths));
+
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+
+        return;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+        return;
+    }
+}
+
+
+
+
+
diff --git a/src/dijkstra/src/many_to_one_dijkstra_driver.h b/src/dijkstra/src/many_to_one_dijkstra_driver.h
new file mode 100644
index 0000000..4179606
--- /dev/null
+++ b/src/dijkstra/src/many_to_one_dijkstra_driver.h
@@ -0,0 +1,62 @@
+/*PGR-GNU*****************************************************************
+File: many_to_one_dijkstra_driver.h
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_DIJKSTRA_SRC_MANY_TO_ONE_DIJKSTRA_DRIVER_H_
+#define SRC_DIJKSTRA_SRC_MANY_TO_ONE_DIJKSTRA_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    //  CREATE OR REPLACE FUNCTION pgr_dijkstra(
+    //  sql text,
+    //  start_vids anyarray,
+    //  end_vid BIGINT,
+    //  directed BOOLEAN default true,
+    void
+        do_pgr_many_to_one_dijkstra(
+                pgr_edge_t  *data_edges,
+                size_t total_tuples,
+                int64_t  *start_vidsArr,
+                size_t size_start_vidsArr,
+                int64_t end_vid,
+                bool directed,
+                bool only_cost,
+                General_path_element_t **return_tuples,
+                size_t *return_count,
+                char ** err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_DIJKSTRA_SRC_MANY_TO_ONE_DIJKSTRA_DRIVER_H_
diff --git a/src/dijkstra/src/one_to_many_dijkstra.c b/src/dijkstra/src/one_to_many_dijkstra.c
new file mode 100644
index 0000000..5fd2843
--- /dev/null
+++ b/src/dijkstra/src/one_to_many_dijkstra.c
@@ -0,0 +1,238 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_dijkstra.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer:
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+/*
+ * Uncomment when needed
+ */
+
+// #define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./one_to_many_dijkstra_driver.h"
+
+PG_FUNCTION_INFO_V1(one_to_many_dijkstra);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_many_dijkstra(PG_FUNCTION_ARGS);
+
+
+/******************************************************************************/
+/*                          MODIFY AS NEEDED                                  */
+static
+void
+process(
+        char* edges_sql,
+        int64_t start_vid,
+        int64_t *end_vidsArr,
+        size_t size_end_vidsArr,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    PGR_DBG("Starting processing");
+    clock_t start_t = clock();
+
+    char *err_msg = NULL;
+    do_pgr_one_to_many_dijkstra(
+            edges,
+            total_tuples,
+            start_vid,
+            end_vidsArr,
+            size_end_vidsArr,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing Dijkstra one to many", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_many_dijkstra(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /**********************************************************************/
+        /*                          MODIFY AS NEEDED                          */
+        // CREATE OR REPLACE FUNCTION pgr_dijkstra(sql text,
+        // start_vid bigint,
+        // end_vids anyarray,
+        // directed boolean default true,
+        // only_cost boolean default false
+
+        PGR_DBG("Initializing arrays");
+        int64_t* end_vidsArr;
+        size_t size_end_vidsArr;
+        end_vidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_end_vidsArr, PG_GETARG_ARRAYTYPE_P(2));
+        PGR_DBG("targetsArr size %ld ", size_end_vidsArr);
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                PG_GETARG_INT64(1),
+                end_vidsArr, size_end_vidsArr,
+                PG_GETARG_BOOL(3),
+                PG_GETARG_BOOL(4),
+                &result_tuples,
+                &result_count);
+
+        PGR_DBG("Cleaning arrays");
+        free(end_vidsArr);
+        /*                                                                    */
+        /**********************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc)
+                != TYPEFUNC_COMPOSITE) {
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+        }
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*********************************************************************/
+        /*                          MODIFY AS NEEDED                         */
+        // OUT seq integer,
+        // OUT path_seq INTEGER,
+        // OUT end_vid BIGINT,
+        // OUT node bigint,
+        // OUT edge bigint,
+        // OUT cost float,
+        // OUT agg_cost float)
+
+        values = palloc(7 * sizeof(Datum));
+        nulls = palloc(7 * sizeof(char));
+
+
+        size_t i;
+        for (i = 0; i < 7; ++i) {
+            nulls[i] = ' ';
+        }
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].end_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/dijkstra/src/one_to_many_dijkstra_driver.cpp b/src/dijkstra/src/one_to_many_dijkstra_driver.cpp
new file mode 100644
index 0000000..153247d
--- /dev/null
+++ b/src/dijkstra/src/one_to_many_dijkstra_driver.cpp
@@ -0,0 +1,118 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_dijkstra_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_dijkstra.hpp"
+#include "./one_to_many_dijkstra_driver.h"
+
+// #define DEBUG
+#include "../../common/src/memory_func.hpp"
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+// CREATE OR REPLACE FUNCTION pgr_dijkstra(sql text, start_vid bigint, end_vids anyarray, directed boolean default true,
+void
+do_pgr_one_to_many_dijkstra(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        int64_t start_vid,
+        int64_t  *end_vidsArr,
+        size_t size_end_vidsArr,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg) {
+  std::ostringstream log;
+  try {
+    graphType gType = directed? DIRECTED: UNDIRECTED;
+    const auto initial_size = total_tuples;
+
+    std::deque< Path >paths;
+    log << "Inserting vertices into a c++ vector structure\n";
+    std::set< int64_t > s_end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
+    std::vector< int64_t > end_vertices(s_end_vertices.begin(), s_end_vertices.end());
+
+
+    if (directed) {
+        log << "Working with directed Graph\n";
+        Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+        digraph.graph_insert_data(data_edges, total_tuples);
+        pgr_dijkstra(digraph, paths, start_vid, end_vertices, only_cost);
+    } else {
+        log << "Working with Undirected Graph\n";
+        Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+        undigraph.graph_insert_data(data_edges, total_tuples);
+        pgr_dijkstra(undigraph, paths, start_vid, end_vertices, only_cost);
+    }
+
+    size_t count(0);
+    count = count_tuples(paths);
+
+
+    if (count == 0) {
+        (*return_tuples) = NULL;
+        (*return_count) = 0;
+        log <<
+            "No paths found between Starting and any of the Ending vertices\n";
+        *err_msg = strdup(log.str().c_str());
+        return;
+    }
+
+    (*return_tuples) = get_memory(count, (*return_tuples));
+    log << "Converting a set of paths into the tuples\n";
+    (*return_count) = (collapse_paths(return_tuples, paths));
+
+#ifndef DEBUG
+    *err_msg = strdup("OK");
+#else
+    *err_msg = strdup(log.str().c_str());
+#endif
+
+    return;
+  } catch ( ... ) {
+      log << "Caught unknown expection!\n";
+      *err_msg = strdup("Caught unknown expection!\n");
+      return;
+  }
+}
+
+
+
+
+
diff --git a/src/dijkstra/src/one_to_many_dijkstra_driver.h b/src/dijkstra/src/one_to_many_dijkstra_driver.h
new file mode 100644
index 0000000..ff73f50
--- /dev/null
+++ b/src/dijkstra/src/one_to_many_dijkstra_driver.h
@@ -0,0 +1,62 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_dijkstra_driver.h
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_DIJKSTRA_SRC_ONE_TO_MANY_DIJKSTRA_DRIVER_H_
+#define SRC_DIJKSTRA_SRC_ONE_TO_MANY_DIJKSTRA_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    // CREATE OR REPLACE FUNCTION pgr_dijkstra(
+    // sql text,
+    // start_vid bigint,
+    // end_vids anyarray,
+    // directed boolean default true,
+    void
+        do_pgr_one_to_many_dijkstra(
+                pgr_edge_t  *data_edges,
+                size_t total_tuples,
+                int64_t start_vid,
+                int64_t  *end_vidsArr,
+                size_t size_end_vidsArr,
+                bool directed,
+                bool only_cost,
+                General_path_element_t **return_tuples,
+                size_t *return_count,
+                char **err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_DIJKSTRA_SRC_ONE_TO_MANY_DIJKSTRA_DRIVER_H_
diff --git a/src/dijkstra/src/one_to_one_dijkstra.c b/src/dijkstra/src/one_to_one_dijkstra.c
new file mode 100644
index 0000000..c86ca99
--- /dev/null
+++ b/src/dijkstra/src/one_to_one_dijkstra.c
@@ -0,0 +1,231 @@
+/*PGR-GNU*****************************************************************
+File: one_to_one_dijkstra.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer:
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+/*
+  Uncomment when needed
+*/
+// #define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./one_to_one_dijkstra_driver.h"
+
+PG_MODULE_MAGIC;
+
+PG_FUNCTION_INFO_V1(one_to_one_dijkstra);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_one_dijkstra(PG_FUNCTION_ARGS);
+
+/******************************************************************************/
+/*                          MODIFY AS NEEDED                                  */
+static
+void
+process(
+        char* edges_sql,
+        int64_t start_vid,
+        int64_t end_vid,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+
+    if (start_vid == end_vid) {
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    size_t total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    PGR_DBG("Starting processing");
+    clock_t start_t = clock();
+    char *err_msg = NULL;
+    do_pgr_one_to_one_dijkstra(
+            edges,
+            total_tuples,
+            start_vid,
+            end_vid,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+
+    time_msg(" processing Dijkstra one to one", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_one_dijkstra(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /**********************************************************************/
+        /*                          MODIFY AS NEEDED                          */
+        // CREATE OR REPLACE FUNCTION pgr_dijkstra(
+        // sql text, start_vids BIGINT,
+        // end_vid BIGINT,
+        // directed BOOLEAN default true,
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                PG_GETARG_INT64(1),
+                PG_GETARG_INT64(2),
+                PG_GETARG_BOOL(3),
+                PG_GETARG_BOOL(4),
+                &result_tuples,
+                &result_count);
+
+        /*                                                                    */
+        /**********************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc)
+                != TYPEFUNC_COMPOSITE) {
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+        }
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /**********************************************************************/
+        /*                          MODIFY AS NEEDED                          */
+        // OUT seq INTEGER,
+        // OUT path_seq INTEGER,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT
+
+        values = palloc(6 * sizeof(Datum));
+        nulls = palloc(6 * sizeof(char));
+
+
+        size_t i;
+        for (i = 0; i < 6; ++i) {
+            nulls[i] = ' ';
+        }
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[4] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /**********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/dijkstra/src/one_to_one_dijkstra_driver.cpp b/src/dijkstra/src/one_to_one_dijkstra_driver.cpp
new file mode 100644
index 0000000..df1ae8d
--- /dev/null
+++ b/src/dijkstra/src/one_to_one_dijkstra_driver.cpp
@@ -0,0 +1,120 @@
+/*PGR-GNU*****************************************************************
+File: one_to_one_dijkstra_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_dijkstra.hpp"
+#include "./one_to_one_dijkstra_driver.h"
+
+//#define DEBUG
+
+#include "../../common/src/memory_func.hpp"
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+// CREATE OR REPLACE FUNCTION pgr_dijkstra(
+// sql text,
+// start_vids BIGINT,
+// end_vid BIGINT,
+//  directed BOOLEAN default true,
+
+void
+do_pgr_one_to_one_dijkstra(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        int64_t start_vid,
+        int64_t end_vid,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg) {
+  std::ostringstream log;
+  try {
+      graphType gType = directed? DIRECTED: UNDIRECTED;
+      const auto initial_size = total_tuples;
+
+      Path path;
+
+      if (directed) {
+          log << "Working with directed Graph\n";
+          Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+          digraph.graph_insert_data(data_edges, total_tuples);
+          pgr_dijkstra(digraph, path, start_vid, end_vid, only_cost);
+      } else {
+          log << "Working with Undirected Graph\n";
+          Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+          undigraph.graph_insert_data(data_edges, total_tuples);
+          pgr_dijkstra(undigraph, path, start_vid, end_vid, only_cost);
+      }
+
+      size_t count(0);
+
+      count = path.size();
+
+      if (count == 0) {
+          (*return_tuples) = NULL;
+          (*return_count) = 0;
+          log <<
+              "No paths found between Starting and any of the Ending vertices\n";
+          *err_msg = strdup(log.str().c_str());
+          return;
+      }
+
+      (*return_tuples) = get_memory(count, (*return_tuples));
+      size_t sequence = 0;
+      path.generate_postgres_data(return_tuples, sequence);
+      (*return_count) = sequence;
+
+#ifndef DEBUG
+      *err_msg = strdup("OK");
+#else
+      *err_msg = strdup(log.str().c_str());
+#endif
+
+      return;
+  } catch ( ... ) {
+      log << "Caught unknown expection!\n";
+      *err_msg = strdup(log.str().c_str());
+      return;
+  }
+}
+
+
+
+
+
diff --git a/src/dijkstra/src/one_to_one_dijkstra_driver.h b/src/dijkstra/src/one_to_one_dijkstra_driver.h
new file mode 100644
index 0000000..a5c052c
--- /dev/null
+++ b/src/dijkstra/src/one_to_one_dijkstra_driver.h
@@ -0,0 +1,62 @@
+/*PGR-GNU*****************************************************************
+File: one_to_one_dijkstra_driver.h
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_DIJKSTRA_SRC_ONE_TO_ONE_DIJKSTRA_DRIVER_H_
+#define SRC_DIJKSTRA_SRC_ONE_TO_ONE_DIJKSTRA_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//  CREATE OR REPLACE FUNCTION pgr_dijkstra(
+//  sql text,
+//  start_vid BIGINT,
+//  end_vid BIGINT,
+//  directed BOOLEAN default true,
+
+    void
+        do_pgr_one_to_one_dijkstra(
+                pgr_edge_t  *data_edges,
+                size_t total_tuples,
+                int64_t start_vid,
+                int64_t end_vid,
+                bool directed,
+                bool only_cost,
+                General_path_element_t **return_tuples,
+                size_t *return_count,
+                char ** err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_DIJKSTRA_SRC_ONE_TO_ONE_DIJKSTRA_DRIVER_H_
diff --git a/src/dijkstra/src/pgr_dijkstra.hpp b/src/dijkstra/src/pgr_dijkstra.hpp
index c9d6ee7..61dcbef 100644
--- a/src/dijkstra/src/pgr_dijkstra.hpp
+++ b/src/dijkstra/src/pgr_dijkstra.hpp
@@ -1,8 +1,13 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,15 +22,21 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
+
+#pragma once
 
-#ifndef SRC_DIJKSTRA_SRC_PGR_DIJKSTRA_H_
-#define SRC_DIJKSTRA_SRC_PGR_DIJKSTRA_H_
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#ifdef unlink
+#undef unlink
+#endif
+#endif
 
 
 #include <deque>
 #include <vector>
-#include <set>
 
 #include <boost/config.hpp>
 
@@ -35,341 +46,685 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 #include "./../../common/src/basePath_SSEC.hpp"
 #include "./../../common/src/baseGraph.hpp"
-#include "postgres.h"
+#if 0
+#include "./../../common/src/signalhandler.h"
+#endif
 
-template < class G >
-class Pgr_dijkstra
-  :public Pgr_base_graph<G> {
- public:
-    //! \brief the constructor
-    explicit Pgr_dijkstra(graphType gtype, const int initial_size)
-     :Pgr_base_graph<G>(gtype, initial_size) {}
 
+template < class G > class Pgr_dijkstra;
+// user's functions
+// for development
 
-    /*! \brief Perfom the inizialization of the graph
-     For Dijkstra  only requieres the data insertion.
+template < class G >
+void pgr_drivingDistance(
+        G &graph,
+        std::deque< Path > &paths,
+        std::vector< int64_t > start_vids,
+        double distance,
+        bool equicost) {
+    Pgr_dijkstra< G > fn_dijkstra;
+    fn_dijkstra.drivingDistance(graph, paths, start_vids, distance, equicost);
+}
 
-     Any other different initialization needs a different function.
-     \param[in] data_edges
-     \param[in] count
-    */
-    void
-    initialize_graph(pgr_edge_t *data_edges, int64_t count) {
-          this->graph_insert_data(data_edges, count);
-    }
 
-    void
-    dijkstra(Path &path, int64_t start_vertex, int64_t end_vertex) {
-      typedef typename boost::graph_traits < G >::vertex_descriptor V;
+template < class G >
+void
+pgr_drivingDistance(
+        G &graph,
+        Path &path,
+        int64_t  source,
+        double distance) {
+    Pgr_dijkstra< G > fn_dijkstra;
+    fn_dijkstra.drivingDistance(graph, path, source, distance);
+}
 
-      // adjust predecessors and distances vectors
-      this->predecessors.clear();
-      this->distances.clear();
 
-      this->predecessors.resize(boost::num_vertices(this->graph));
-      this->distances.resize(boost::num_vertices(this->graph));
+template < class G >
+void
+pgr_dijkstra(
+        G &graph,
+        Path &path,
+        int64_t source,
+        int64_t target,
+        bool only_cost = false) {
+    Pgr_dijkstra< G > fn_dijkstra;
+    fn_dijkstra.dijkstra(graph, path, source, target, only_cost);
+}
 
-      // get the graphs source and target
-      V v_source;
-      V v_target;
+template < class G >
+void
+pgr_dijkstra(
+        G &graph,
+        std::deque<Path> &paths,
+        int64_t  source,
+        const std::vector< int64_t > &targets,
+        bool only_cost = false) {
+    Pgr_dijkstra< G > fn_dijkstra;
+    fn_dijkstra.dijkstra(graph, paths, source, targets, only_cost);
+}
 
-      if (!this->get_gVertex(start_vertex, v_source)
-          || !this->get_gVertex(end_vertex, v_target)) {
-           // path.clear();
-           return;
-      }
+template < class G >
+void
+pgr_dijkstra(G &graph,
+        std::deque<Path> &paths,
+        const std::vector< int64_t > &sources,
+        int64_t  target,
+        bool only_cost = false) {
+    Pgr_dijkstra< G > fn_dijkstra;
+    fn_dijkstra.dijkstra(graph, paths, sources, target, only_cost);
+}
+
+template < class G >
+void
+pgr_dijkstra(
+        G &graph, std::deque<Path> &paths,
+        const std::vector< int64_t > &sources,
+        const std::vector< int64_t > &targets,
+        bool only_cost = false) {
+    Pgr_dijkstra< G > fn_dijkstra;
+    fn_dijkstra.dijkstra(graph, paths, sources, targets, only_cost);
+}
 
-      // perform the algorithm
-      dijkstra_1_to_1(v_source, v_target);
 
-      // get the results
-      this->get_path(path, v_source, v_target);
-      return;
-    }
 
+//******************************************
 
+template < class G >
+class Pgr_dijkstra {
+ public:
+     typedef typename G::V V;
+
+     //! @name drivingDistance
+     //@{
+     //! 1 to distance
+     void drivingDistance(
+             G &graph,
+             Path &path,
+             int64_t start_vertex,
+             double distance);
 
 
-    // preparation for 1 to many
-    void
-    dijkstra(std::deque< Path > &paths,
+     //! many to distance
+     void drivingDistance(
+             G &graph, std::deque< Path > &paths,
+             std::vector< int64_t > start_vertex,
+             double distance,
+             bool equiCostFlag);
+     //@}
+
+     //! @name Dijkstra
+     //@{
+     //! one to one
+     void dijkstra(
+             G &graph,
+             Path &path,
+             int64_t start_vertex,
+             int64_t end_vertex,
+             bool only_cost = false);
+
+     //! Many to one
+     void dijkstra(
+             G &graph,
+             std::deque< Path > &paths,
+             const std::vector < int64_t > &start_vertex,
+             int64_t end_vertex,
+             bool only_cost = false);
+
+     //! Many to Many
+     void dijkstra(
+             G &graph,
+             std::deque< Path > &paths,
+             const std::vector< int64_t > &start_vertex,
+             const std::vector< int64_t > &end_vertex,
+             bool only_cost = false);
+
+     //! one to Many
+     void dijkstra(
+             G &graph,
+             std::deque< Path > &paths,
              int64_t start_vertex,
-             std::vector< int64_t > end_vertex) {
-      typedef typename boost::graph_traits < G >::vertex_descriptor V;
+             const std::vector< int64_t > &end_vertex,
+             bool only_cost = false);
+     //@}
 
-      // adjust predecessors and distances vectors
-      this->predecessors.clear();
-      this->distances.clear();
+ private:
+     //! Call to Dijkstra  1 source to 1 target
+     bool dijkstra_1_to_1(
+             G &graph,
+             V source,
+             V target);
+
+     //! Call to Dijkstra  1 source to distance
+     bool dijkstra_1_to_distance(
+             G &graph,
+             V source,
+             double distance);
+
+     //! Call to Dijkstra  1 source to many targets
+     bool dijkstra_1_to_many(
+             G &graph,
+             V source,
+             const std::vector< V > &targets);
+
+     void get_nodesInDistance(
+             G &graph,
+             Path &path,
+             V source,
+             double distance);
+
+     void clear() {
+         predecessors.clear();
+         distances.clear();
+         nodesInDistance.clear();
+     }
+
+
+     void get_path(
+             const G &graph,
+             V source,
+             V target,
+             Path &path) const;
+     void get_cost(
+             const G &graph,
+             V source,
+             V target,
+             Path &path) const;
+
+
+     // used when multiple goals
+     void get_path(
+             const G &graph,
+             std::deque< Path > &paths,
+             V source,
+             std::vector< V > &targets) const;
+
+     void get_cost(
+             const G &graph,
+             std::deque< Path > &paths,
+             V source,
+             std::vector< V > &targets) const;
+
+
+     //! @name Variables
+     //@{
+     struct found_goals{};  //!< exception for termination
+     std::vector< V > predecessors;
+     std::vector< double > distances;
+     std::deque< V > nodesInDistance;
+     //@}
+
+     //! @name Stopping classes
+     //@{
+     //! class for stopping when 1 target is found
+     class dijkstra_one_goal_visitor : public boost::default_dijkstra_visitor {
+      public:
+          explicit dijkstra_one_goal_visitor(V goal) : m_goal(goal) {}
+          template <class B_G>
+              void examine_vertex(V &u, B_G &g) {
+#if 0
+                  REG_SIGINT;
+                  THROW_ON_SIGINT;
+#endif
+                  if (u == m_goal) throw found_goals();
+                  num_edges(g);
+              }
+      private:
+          V m_goal;
+     };
+
+     //! class for stopping when all targets are found
+     class dijkstra_many_goal_visitor : public boost::default_dijkstra_visitor {
+      public:
+          explicit dijkstra_many_goal_visitor(std::vector< V > goals)
+              :m_goals(goals.begin(), goals.end()) {}
+          template <class B_G>
+              void examine_vertex(V u, B_G &g) {
+#if 0
+                  REG_SIGINT;
+                  THROW_ON_SIGINT;
+#endif
+                  auto s_it = m_goals.find(u);
+                  if (s_it == m_goals.end()) return;
+                  // we found one more goal
+                  m_goals.erase(s_it);
+                  if (m_goals.size() == 0) throw found_goals();
+                  num_edges(g);
+              }
+      private:
+          std::set< V > m_goals;
+     };
+
+
+     //! class for stopping when a distance/cost has being surpassed
+     class dijkstra_distance_visitor : public boost::default_dijkstra_visitor {
+      public:
+          explicit dijkstra_distance_visitor(
+                  double distance_goal,
+                  std::deque< V > &nodesInDistance,
+                  std::vector< double > &distances) :
+              m_distance_goal(distance_goal),
+              m_nodes(nodesInDistance),
+              m_dist(distances) {
+              }
+          template <class B_G>
+              void examine_vertex(V u, B_G &g) {
+#if 0
+                  REG_SIGINT;
+                  THROW_ON_SIGINT;
+#endif
+                  m_nodes.push_back(u);
+                  if (m_dist[u] >= m_distance_goal) throw found_goals();
+                  num_edges(g);
+              }
+      private:
+          double m_distance_goal;
+          std::deque< V > &m_nodes;
+          std::vector< double > &m_dist;
+     };
+
+
+     //@}
+};
 
-      this->predecessors.resize(boost::num_vertices(this->graph));
-      this->distances.resize(boost::num_vertices(this->graph));
 
-      // get the graphs source and target
-      V v_source;
-      if (!this->get_gVertex(start_vertex, v_source)) {
-        // paths.clear();
-        return;
-      }
-
-      std::set< V > v_targets;
-      for (unsigned int i = 0; i < end_vertex.size(); i++) {
-          V v_target;
-          if (this->get_gVertex(end_vertex[i], v_target)) {
-            v_targets.insert(v_target);
-          }
-      }
-
-      // perform the algorithm
-      dijkstra_1_to_many(v_source, v_targets);
-
-      // get the results // route id are the targets
-      this->get_path(paths, v_source, v_targets);
-      return;
-    }
+/******************** IMPLEMENTTION ******************/
 
-    // preparation for many to 1
-    void
-    dijkstra(std::deque< Path > &paths,
-             std::vector < int64_t > start_vertex,
-             int64_t end_vertex) {
-      typedef typename boost::graph_traits < G >::vertex_descriptor V;
 
-      // adjust predecessors and distances vectors
-      this->predecessors.clear();
-      this->distances.clear();
+template < class G >
+void
+Pgr_dijkstra< G >::get_nodesInDistance(
+        G &graph,
+        Path &path,
+        V source,
+        double distance) {
+    path.clear();
+    double cost;
+    int64_t edge_id;
+    Path r_path(graph[source].id, graph[source].id);
+    for (V i = 0; i < distances.size(); ++i) {
+        if (distances[i] <= distance) {
+            cost = distances[i] - distances[predecessors[i]];
+            edge_id = graph.get_edge_id(predecessors[i], i, cost);
+            r_path.push_back(
+                    {graph[i].id,
+                    edge_id, cost,
+                    distances[i]});
+        }
+    }
+    path = r_path;
+}
 
-      this->predecessors.resize(boost::num_vertices(this->graph));
-      this->distances.resize(boost::num_vertices(this->graph));
 
-      // get the graphs source and target
-      V v_target;
-      if (!this->get_gVertex(end_vertex, v_target)) {
-        // paths.clear();
+template < class G >
+void
+Pgr_dijkstra< G >::get_path(
+        const G &graph,
+        std::deque< Path > &paths,
+        V source,
+        std::vector< V > &targets) const {
+    Path path;
+    typename std::vector< V >::iterator s_it;
+    for (s_it = targets.begin(); s_it != targets.end(); ++s_it) {
+        path.clear();
+        get_path(graph, source, *s_it, path);
+        paths.push_back(path);
+    }
+}
+
+template < class G >
+void
+Pgr_dijkstra< G >::get_path(
+        const G &graph,
+        V source,
+        V target,
+        Path &r_path) const {
+    // backup of the target
+    V target_back = target;
+    uint64_t from(graph.graph[source].id);
+    uint64_t to(graph.graph[target].id);
+
+    // no path was found
+    if (target == predecessors[target]) {
+        r_path.clear();
         return;
-      }
-
-      std::set< V > v_sources;
-      for (unsigned int i = 0; i < start_vertex.size(); i++) {
-          V v_source;
-          if (!this->get_gVertex(start_vertex[i], v_source)) {
-            // paths.clear();
-            return;
-          }
-          v_sources.insert(v_source);
-      }
-
-      // perform the algorithm // a call for each of the sources
-      for (const auto &v_source : v_sources) {
-         Path path;
-         dijkstra_1_to_1(v_source, v_target);
-         this->get_path(path, v_source, v_target);
-         paths.push_back(path);
-      }
-      return;
     }
 
-    // preparation for many to many
-    void
-    dijkstra(std::deque< Path > &paths,
-             std::vector< int64_t > start_vertex,
-              std::vector< int64_t > end_vertex) {
-      // a call to 1 to many is faster for each of the sources
-      for (const auto &start : start_vertex) {
-         dijkstra(paths, start, end_vertex);
-      }
-      return;
+    // findout how large is the path
+    int64_t result_size = 1;
+    while (target != source) {
+        if (target == predecessors[target]) break;
+        result_size++;
+        target = predecessors[target];
     }
 
+    // recover the target
+    target = target_back;
+
+    // variables that are going to be stored
+    int64_t vertex_id;
+    int64_t edge_id;
+    double cost;
+
+    // working from the last to the beginning
+
+    // initialize the sequence
+    auto seq = result_size;
+    // the last stop is the target
+    Path path(from, to);
+    path.push_front(
+            {graph.graph[target].id, -1,
+            0,  distances[target]});
+
+    while (target != source) {
+        // we are done when the predecesor of the target is the target
+        if (target == predecessors[target]) break;
+        // values to be inserted in the path
+        --seq;
+        cost = distances[target] - distances[predecessors[target]];
+        vertex_id = graph.graph[predecessors[target]].id;
+        edge_id = graph.get_edge_id(predecessors[target], target, cost);
+
+        path.push_front({vertex_id, edge_id,
+                cost, (distances[target] - cost)});
+        target = predecessors[target];
+    }
+    r_path = path;
+    return;
+}
 
+template < class G >
+void
+Pgr_dijkstra< G >::get_cost(
+        const G &graph,
+        std::deque< Path > &paths,
+        V source,
+        std::vector< V > &targets) const {
+    Path path;
+    for (auto s_it = targets.begin(); s_it != targets.end(); ++s_it) {
+        path.clear();
+        get_cost(graph, source, *s_it, path);
+        paths.push_back(path);
+    }
+}
 
-    // preparation for 1 to distance
-    void
-    dijkstra_dd(Path &path, int64_t start_vertex, float8 distance) {
-      typedef typename boost::graph_traits < G >::vertex_descriptor V;
 
-      // adjust predecessors and distances vectors
-      this->predecessors.clear();
-      this->distances.clear();
-      this->nodesInDistance.clear();
+template < class G >
+void
+Pgr_dijkstra< G >::get_cost(
+        const G &graph,
+        V source,
+        V target,
+        Path &r_path) const {
+    // backup of the target
+    int64_t from(graph.graph[source].id);
+    int64_t to(graph.graph[target].id);
+
+    // no path was found
+    if (target == predecessors[target]) {
+        r_path.clear();
+    } else {
+        Path path(from, to);
+        path.push_front(
+                {to, -1, distances[target], distances[target]});
+        r_path = path;
+    }
+}
 
-      this->predecessors.resize(boost::num_vertices(this->graph));
-      this->distances.resize(boost::num_vertices(this->graph));
+template < class G >
+// preparation for many to distance
+void
+Pgr_dijkstra< G >::drivingDistance(G &graph, std::deque< Path > &paths,
+        std::vector< int64_t > start_vertex,
+        double distance,
+        bool equicost) {
+    clear();
+
+    predecessors.resize(graph.num_vertices());
+    distances.resize(graph.num_vertices());
+
+
+    // perform the algorithm
+    for (const auto &vertex : start_vertex) {
+        Path path;
+        drivingDistance(graph, path, vertex, distance);
+        paths.push_back(path);
+    }
+    if (equicost) {
+        equi_cost(paths);
+    }
+}
+
+template < class G >
+void
+Pgr_dijkstra< G >::drivingDistance(
+        G &graph,
+        Path &path,
+        int64_t start_vertex,
+        double distance) {
+
+
+    clear();
+
+    predecessors.resize(graph.num_vertices());
+    distances.resize(graph.num_vertices());
+
+    // get source;
+    V v_source;
+    if (!graph.get_gVertex(start_vertex, v_source)) {
+        /* The node has to be in the path*/
+        Path p(start_vertex, start_vertex);
+        p.push_back({start_vertex, -1, 0, 0});
+        path = p;
+        return;
+    }
 
-      // get ource;
-      V v_source;
-      if (!this->get_gVertex(start_vertex, v_source)) {
+    dijkstra_1_to_distance(graph, v_source, distance); 
+    get_nodesInDistance(graph, path, v_source, distance);
+    std::sort(path.begin(), path.end(),
+            [](const Path_t &l, const  Path_t &r)
+            {return l.node < r.node;});
+    std::stable_sort(path.begin(), path.end(),
+            [](const Path_t &l, const  Path_t &r)
+            {return l.agg_cost < r.agg_cost;});
+    return;
+}
+
+//! Dijkstra 1 to 1
+template < class G >
+void
+Pgr_dijkstra< G >::dijkstra(
+        G &graph,
+        Path &path,
+        int64_t start_vertex,
+        int64_t end_vertex,
+        bool only_cost) {
+    clear();
+
+    // adjust predecessors and distances vectors
+    predecessors.resize(graph.num_vertices());
+    distances.resize(graph.num_vertices());
+
+    // get the graphs source and target
+    V v_source;
+    V v_target;
+
+    if (!graph.get_gVertex(start_vertex, v_source)
+            || !graph.get_gVertex(end_vertex, v_target)) {
         path.clear();
         return;
-      }
+    }
+
+    // perform the algorithm
+    dijkstra_1_to_1(graph, v_source, v_target);
+
+    // get the results
+    if (only_cost) {
+        get_cost(graph, v_source, v_target, path);
+    } else {
+        get_path(graph, v_source, v_target, path);
+    }
+    return;
+}
+
+//! Dijkstra 1 to many
+template < class G >
+void
+Pgr_dijkstra< G >::dijkstra(
+        G &graph,
+        std::deque< Path > &paths,
+        int64_t start_vertex,
+        const std::vector< int64_t > &end_vertex,
+        bool only_cost) {
+    // adjust predecessors and distances vectors
+    clear();
+
+    predecessors.resize(graph.num_vertices());
+    distances.resize(graph.num_vertices());
+
+    // get the graphs source and target
+    V v_source;
+    if (!graph.get_gVertex(start_vertex, v_source)) {
+        // paths.clear();
+        return;
+    }
 
-      // perform the algorithm
-      dijkstra_1_to_distance(v_source, distance);
+    std::set< V > s_v_targets;
+    for (const auto &vertex : end_vertex) {    
+        V v_target;
+        if (graph.get_gVertex(vertex, v_target)) {
+            s_v_targets.insert(v_target);
+        }
+    }
 
-      // get the results
-      this->get_nodesInDistance(path, v_source, distance);
-      return;
+    std::vector< V > v_targets(s_v_targets.begin(), s_v_targets.end());
+    // perform the algorithm
+    dijkstra_1_to_many(graph, v_source, v_targets);
+
+    // get the results // route id are the targets
+    if (only_cost) {
+        get_cost(graph, paths, v_source, v_targets);
+    } else {
+        get_path(graph, paths, v_source, v_targets);
     }
 
+    std::stable_sort(paths.begin(), paths.end(),
+            [](const Path &e1, const Path &e2)->bool {
+            return e1.end_id() < e2.end_id();
+            });
+
+    return;
+}
 
-    // preparation for many to distance
-    void
-    dijkstra_dd(std::deque< Path > &paths,
-                std::vector< int64_t > start_vertex,
-                float8 distance) {
-      typedef typename boost::graph_traits < G >::vertex_descriptor V;
-
-      // adjust predecessors and distances vectors
-      this->predecessors.clear();
-      this->distances.clear();
-      this->nodesInDistance.clear();
-
-      this->predecessors.resize(boost::num_vertices(this->graph));
-      this->distances.resize(boost::num_vertices(this->graph));
-
-      // get the graph's source
-      std::set< V > v_sources;
-      for (unsigned int i = 0; i < start_vertex.size(); i++) {
-          V v_source;
-          if (!this->get_gVertex(start_vertex[i], v_source)) {
-            paths.clear();
-            return;
-          }
-          v_sources.insert(v_source);
-      }
-
-      // perform the algorithm
-      for (const auto &v_source : v_sources) {
-        dijkstra_1_to_distance(v_source, distance);
+// preparation for many to 1
+template < class G >
+void
+Pgr_dijkstra< G >::dijkstra(
+        G &graph, std::deque< Path > &paths,
+        const std::vector < int64_t > &start_vertex,
+        int64_t end_vertex,
+        bool only_cost) {
+    // perform the algorithm // a call for each of the sources
+    for (const auto &start : start_vertex) {
         Path path;
-        this->get_nodesInDistance(path, v_source, distance);
+        // each call cleans the local structures
+        dijkstra(graph, path, start, end_vertex, only_cost);
         paths.push_back(path);
-      }
-
-      return;
     }
 
+    std::stable_sort(paths.begin(), paths.end(),
+            [](const Path &e1, const Path &e2)->bool {
+            return e1.start_id() < e2.start_id();
+            });
+    return;
+}
 
 
- private:
-    //! visitor that terminates when we find the goal
-    struct found_one_goal{};  //!< exception for termination
-
-    //! class for stopping when 1 target is found
-    template <class Vertex>
-    class dijkstra_one_goal_visitor
-      :public boost::default_dijkstra_visitor {
-     public:
-       explicit dijkstra_one_goal_visitor(Vertex goal) : m_goal(goal) {}
-       template <class Graph>
-       void examine_vertex(Vertex u, Graph& g) {
-         if (u == m_goal) throw found_one_goal();
-       }
-     private:
-       Vertex m_goal;
-    };
-
-
-    //! class for stopping when a distance/cost has being surpassed
-    template <class Vertex>
-    class dijkstra_distance_visitor
-      :public boost::default_dijkstra_visitor {
-     public:
-       explicit dijkstra_distance_visitor(float8 goal,
-               std::deque< Vertex > &nodesInDistance,
-               std::vector< float8 > &distances)
-         :m_goal(goal), m_nodes(nodesInDistance), m_dist(distances) {}
-       template <class Graph>
-       void examine_vertex(Vertex u, Graph& g) {
-         m_nodes.push_back(u);
-         if (m_dist[u] >= m_goal) throw found_one_goal();
-       }
-     private:
-       float8 m_goal;
-       std::deque< Vertex > &m_nodes;
-       std::vector< float8 > &m_dist;
-    };
-
-    //! visitor that terminates when we find  all goals
-    struct found_all_goals{};  //!< exception for termination
-
-    //! class for stopping when all targets are found
-    template <class V>
-    class dijkstra_many_goal_visitor
-      :public boost::default_dijkstra_visitor {
-     public:
-       explicit dijkstra_many_goal_visitor(std::set< V > goals)
-                :m_goals(goals) {}
-       template <class Graph>
-       void examine_vertex(V u, Graph &g) {
-         typename std::set< V >::iterator s_it;
-         s_it = m_goals.find(u);
-         if (s_it == m_goals.end()) return;
-         // we found one more goal
-         m_goals.erase(s_it);
-         if (m_goals.size() == 0) throw found_all_goals();
-       }
-     private:
-       std::set< V > m_goals;
-    };
-
-
-
-    //! Call to Dijkstra  1 source to many targets
-    template <class V>
-    bool
-    dijkstra_1_to_many(V source, std::set< V > targets) {
-      bool found = false;
-      try {
-      boost::dijkstra_shortest_paths(this->graph, source,
-          boost::predecessor_map(&this->predecessors[0])
-          .weight_map(get(&boost_edge_t::cost, this->graph))
-          .distance_map(&this->distances[0])
-          .visitor(dijkstra_many_goal_visitor< V >(targets)));
-      }
-      catch(found_all_goals &fg) {
-        found = true;  // Target vertex found
-      }
-      return found;
+// preparation for many to many
+template < class G >
+void
+Pgr_dijkstra< G >::dijkstra(
+        G &graph, std::deque< Path > &paths,
+        const std::vector< int64_t > &start_vertex,
+        const std::vector< int64_t > &end_vertex,
+        bool only_cost) {
+    // a call to 1 to many is faster for each of the sources
+    for (const auto &start : start_vertex) {
+        dijkstra(graph, paths, start, end_vertex, only_cost);
     }
 
-    //! Call to Dijkstra  1 source to 1 target
-    template <class V>
-    bool
-    dijkstra_1_to_1(V source, V target) {
-      bool found = false;
-      try {
-      boost::dijkstra_shortest_paths(this->graph, source,
-          boost::predecessor_map(&this->predecessors[0])
-          .weight_map(get(&boost_edge_t::cost, this->graph))
-          .distance_map(&this->distances[0])
-          .visitor(dijkstra_one_goal_visitor<V>(target)));
-      }
-      catch(found_one_goal &fg) {
+    std::sort(paths.begin(), paths.end(),
+            [](const Path &e1, const Path &e2)->bool {
+            return e1.end_id() < e2.end_id();
+            });
+    std::stable_sort(paths.begin(), paths.end(),
+            [](const Path &e1, const Path &e2)->bool {
+            return e1.start_id() < e2.start_id();
+            });
+    return;
+}
+
+
+//! Call to Dijkstra  1 source to 1 target
+template < class G >
+bool
+Pgr_dijkstra< G >::dijkstra_1_to_1(
+        G &graph,
+        V source,
+        V target) {
+    bool found = false;
+    try {
+        boost::dijkstra_shortest_paths(graph.graph, source,
+                boost::predecessor_map(&predecessors[0])
+                .weight_map(get(&boost_edge_t::cost, graph.graph))
+                .distance_map(&distances[0])
+                .visitor(dijkstra_one_goal_visitor(target)));
+    }
+    catch(found_goals &fg) {
         found = true;  // Target vertex found
-      }
-      return found;
     }
+    return found;
+}
+
 
-    //! Call to Dijkstra  1 source to distance
-    template <class V>
-    bool
-    dijkstra_1_to_distance(V source, float8 distance) {
-      bool found = false;
-      try {
-      boost::dijkstra_shortest_paths(this->graph, source,
-          boost::predecessor_map(&this->predecessors[0])
-          .weight_map(get(&boost_edge_t::cost, this->graph))
-          .distance_map(&this->distances[0])
-          .visitor(dijkstra_distance_visitor< V >(
-              distance,
-              this->nodesInDistance,
-              this->distances)));
-      }
-      catch(found_one_goal &fg) {
+//! Call to Dijkstra  1 source to distance
+template < class G >
+bool
+Pgr_dijkstra< G >::dijkstra_1_to_distance(G &graph, V source, double distance) {
+    bool found = false;
+    try {
+        boost::dijkstra_shortest_paths(graph.graph, source,
+                boost::predecessor_map(&predecessors[0])
+                .weight_map(get(&boost_edge_t::cost, graph.graph))
+                .distance_map(&distances[0])
+                .visitor(dijkstra_distance_visitor(
+                        distance,
+                        nodesInDistance,
+                        distances)));
+    }
+    catch(found_goals &fg) {
+        found = true;
+    }
+    return found;
+}
+
+//! Call to Dijkstra  1 source to many targets
+template <class G>
+bool
+Pgr_dijkstra< G >::dijkstra_1_to_many(
+        G &graph,
+        V source,
+        const std::vector< V > &targets) {
+    bool found = false;
+    try {
+        boost::dijkstra_shortest_paths(graph.graph, source,
+                boost::predecessor_map(&predecessors[0])
+                .weight_map(get(&boost_edge_t::cost, graph.graph))
+                .distance_map(&distances[0])
+                .visitor(dijkstra_many_goal_visitor(targets)));
+    }
+    catch(found_goals &fg) {
         found = true;  // Target vertex found
-      }
-      return found;
     }
-};
+    return found;
+}
 
-#endif  // SRC_DIJKSTRA_SRC_PGR_DIJKSTRA_H_
diff --git a/src/dijkstra/test/1_to_many.result b/src/dijkstra/test/1_to_many.result
deleted file mode 100644
index 37a056f..0000000
--- a/src/dijkstra/test/1_to_many.result
+++ /dev/null
@@ -1,32 +0,0 @@
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|9|1|2
-4|4|3|9|16|1|3
-5|5|3|4|3|1|4
-6|6|3|3|-1|0|5
-1|1|3|2|2|1|0
-2|2|3|3|-1|0|1
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|5|1|2
-4|4|3|3|-1|0|3
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|9|1|2
-4|4|3|9|16|1|3
-5|5|3|4|3|1|4
-6|6|3|3|-1|0|5
-7|1|5|2|4|1|0
-8|2|5|5|-1|0|1
-1|1|3|2|2|1|0
-2|2|3|3|-1|0|1
-3|1|5|2|4|1|0
-4|2|5|5|-1|0|1
-1|1|5|2|4|1|0
-2|2|5|5|-1|0|1
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|5|1|2
-4|4|3|3|-1|0|3
-5|1|5|2|4|1|0
-6|2|5|5|-1|0|1
diff --git a/src/dijkstra/test/1_to_many.test.sql b/src/dijkstra/test/1_to_many.test.sql
deleted file mode 100644
index a79a978..0000000
--- a/src/dijkstra/test/1_to_many.test.sql
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
--- Examples for :ref:`fig1-direct-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-     
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3]
-        );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3], false
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, array[3]
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, array[3], false
-        );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3,5]
-        );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            2, array[3,5], false
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, array[3,5]
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            2, array[3,5], false
-        );
-
-
diff --git a/src/dijkstra/test/dijkstra-dir-00.result b/src/dijkstra/test/dijkstra-dir-00.result
deleted file mode 100644
index 38c8853..0000000
--- a/src/dijkstra/test/dijkstra-dir-00.result
+++ /dev/null
@@ -1,35 +0,0 @@
-0|11|13|1
-1|12|15|1
-2|9|9|1
-3|8|8|1
-4|7|7|1
-5|6|6|1
-6|5|-1|0
-1|1|11|13|1|0
-2|2|12|15|1|1
-3|3|9|9|1|2
-4|4|8|8|1|3
-5|5|7|7|1|4
-6|6|6|6|1|5
-7|7|5|-1|0|6
-1|1|11|13|1|0
-2|2|12|15|1|1
-3|3|9|9|1|2
-4|4|8|8|1|3
-5|5|7|7|1|4
-6|6|6|6|1|5
-7|7|5|-1|0|6
-1|1|11|13|1|0
-2|2|12|15|1|1
-3|3|9|9|1|2
-4|4|8|8|1|3
-5|5|7|7|1|4
-6|6|6|6|1|5
-7|7|5|-1|0|6
-1|1|11|13|1|0
-2|2|12|15|1|1
-3|3|9|9|1|2
-4|4|8|8|1|3
-5|5|7|7|1|4
-6|6|6|6|1|5
-7|7|5|-1|0|6
diff --git a/src/dijkstra/test/dijkstra-dir-00.test.sql b/src/dijkstra/test/dijkstra-dir-00.test.sql
deleted file mode 100644
index 291f474..0000000
--- a/src/dijkstra/test/dijkstra-dir-00.test.sql
+++ /dev/null
@@ -1,43 +0,0 @@
--- all this queries are equivlent (give the same results)
-
--- include reverse_costs
--- convert -1 costs to a large number
--- ignores -1 costs
--- directed = true (DIRECTED)
--- autodetect reverse_cost
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost, 
-         case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost 
-       from edges1', 
-    11, 5, true, true);
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost, 
-         case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost 
-       from edges1', 
-    11, 5, true);
-
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         case when cost<=0 then 999 else cost end as cost, 
-         case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost 
-       from edges1', 
-    11, 5);
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         cost, 
-         reverse_cost 
-       from edges1', 
-    11, 5);
-
-
-select * from pgr_dijkstra(
-    'select * 
-       from edges1', 
-    11, 5);
-
diff --git a/src/dijkstra/test/dijkstra-dir-01.result b/src/dijkstra/test/dijkstra-dir-01.result
deleted file mode 100644
index 9aaa39c..0000000
--- a/src/dijkstra/test/dijkstra-dir-01.result
+++ /dev/null
@@ -1,20 +0,0 @@
-0|5|6|1
-1|6|7|1
-2|7|8|1
-3|8|11|1
-4|11|-1|0
-1|1|5|6|1|0
-2|2|6|7|1|1
-3|3|7|8|1|2
-4|4|8|11|1|3
-5|5|11|-1|0|4
-1|1|5|6|1|0
-2|2|6|7|1|1
-3|3|7|8|1|2
-4|4|8|11|1|3
-5|5|11|-1|0|4
-1|1|5|6|1|0
-2|2|6|7|1|1
-3|3|7|8|1|2
-4|4|8|11|1|3
-5|5|11|-1|0|4
diff --git a/src/dijkstra/test/dijkstra-dir-01.test.sql b/src/dijkstra/test/dijkstra-dir-01.test.sql
deleted file mode 100644
index c61717a..0000000
--- a/src/dijkstra/test/dijkstra-dir-01.test.sql
+++ /dev/null
@@ -1,35 +0,0 @@
--- all this queries are equivlent (give the same results)
-
--- DOES NOT include reverse_costs
--- convert -1 costs to a large number
--- ignores -1 costs
--- directed = false  (UNDIRECTED)
--- autodetect reverse_cost
-
--- no path found
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost 
-       from edges1', 
-    5, 11, true, false);
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost 
-       from edges1', 
-    5, 11 ,true);
-
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         case when cost<=0 then 999 else cost end as cost 
-       from edges1', 
-    5, 11);
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         cost
-       from edges1', 
-    5, 11);
-
diff --git a/src/dijkstra/test/dijkstra-undi-00.result b/src/dijkstra/test/dijkstra-undi-00.result
deleted file mode 100644
index 6fc5c9a..0000000
--- a/src/dijkstra/test/dijkstra-undi-00.result
+++ /dev/null
@@ -1,25 +0,0 @@
-0|11|11|1
-1|8|8|1
-2|7|7|1
-3|6|6|1
-4|5|-1|0
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
diff --git a/src/dijkstra/test/dijkstra-undi-00.test.sql b/src/dijkstra/test/dijkstra-undi-00.test.sql
deleted file mode 100644
index fe24eda..0000000
--- a/src/dijkstra/test/dijkstra-undi-00.test.sql
+++ /dev/null
@@ -1,43 +0,0 @@
--- all this queries are equivlent (give the same results)
-
--- include reverse_costs
--- convert -1 costs to a large number
--- ignores -1 costs
--- directed = false (UNDIRECTED)
--- autodetect reverse_cost
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost, 
-         case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost 
-       from edges1', 
-    11, 5, false, true);
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost, 
-         case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost 
-       from edges1', 
-    11, 5, false);
-
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         case when cost<=0 then 999 else cost end as cost, 
-         case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost 
-       from edges1', 
-    11, 5,false);
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         cost, 
-         reverse_cost 
-       from edges1', 
-    11, 5, false);
-
-
-select * from pgr_dijkstra(
-    'select * 
-       from edges1', 
-    11, 5, false);
-
diff --git a/src/dijkstra/test/dijkstra-undi-01.result b/src/dijkstra/test/dijkstra-undi-01.result
deleted file mode 100644
index 4cf32e2..0000000
--- a/src/dijkstra/test/dijkstra-undi-01.result
+++ /dev/null
@@ -1,20 +0,0 @@
-0|11|11|1
-1|8|8|1
-2|7|7|1
-3|6|6|1
-4|5|-1|0
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
-1|1|11|11|1|0
-2|2|8|8|1|1
-3|3|7|7|1|2
-4|4|6|6|1|3
-5|5|5|-1|0|4
diff --git a/src/dijkstra/test/dijkstra-undi-01.test.sql b/src/dijkstra/test/dijkstra-undi-01.test.sql
deleted file mode 100644
index c7c00c5..0000000
--- a/src/dijkstra/test/dijkstra-undi-01.test.sql
+++ /dev/null
@@ -1,33 +0,0 @@
-
--- DOES NOT include reverse_costs
--- convert -1 costs to a large number
--- ignores -1 costs
--- directed = false  (UNDIRECTED)
--- autodetect reverse_cost
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost 
-       from edges1', 
-    11, 5, false, false);
-
-select * from pgr_dijkstra(
-    'select id as id, source::int4, target::int4, 
-         case when cost<=0 then 999 else cost end as cost 
-       from edges1', 
-    11, 5, false);
-
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         case when cost<=0 then 999 else cost end as cost 
-       from edges1', 
-    11, 5, false);
-
-select * from pgr_dijkstra(
-    'select id, source, target, 
-         cost
-       from edges1', 
-    11, 5, false);
-
-
diff --git a/src/dijkstra/test/dijkstra-v2.result b/src/dijkstra/test/dijkstra-v2.result
index 9518c72..39b17e7 100644
--- a/src/dijkstra/test/dijkstra-v2.result
+++ b/src/dijkstra/test/dijkstra-v2.result
@@ -1,12 +1,21 @@
+--q1
+NOTICE:  Deprecated function
+--q2
+NOTICE:  Deprecated function
 0|2|4|1
 1|5|8|1
 2|6|9|1
 3|9|16|1
 4|4|3|1
 5|3|-1|0
+--q3
+NOTICE:  Deprecated function
 0|2|4|1
 1|5|8|1
 2|6|5|1
 3|3|-1|0
+--q4
+NOTICE:  Deprecated function
 0|2|2|1
 1|3|-1|0
+--q5
diff --git a/src/dijkstra/test/dijkstra-v2.test.sql b/src/dijkstra/test/dijkstra-v2.test.sql
index 1f7c86e..9615059 100644
--- a/src/dijkstra/test/dijkstra-v2.test.sql
+++ b/src/dijkstra/test/dijkstra-v2.test.sql
@@ -4,27 +4,23 @@
 ------------------------------------------------------------------------------------------------------
 ------------------------------------------------------------------------------------------------------
 
-SELECT seq, id1 AS node, id2 AS edge, cost
-        FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2,3, true, false
-        );
+\echo --q1
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2,3, true, false);
+\echo --q2
 
-SELECT seq, id1 AS node, id2 AS edge, cost
-        FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2,3, true, true
-        );
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2,3, true, true);
+\echo --q3
 
-SELECT seq, id1 AS node, id2 AS edge, cost
-         FROM pgr_dijkstra(
-                 'SELECT id, source, target, cost FROM edge_table',
-                 2, 3, false, false
-         );
-
-SELECT seq, id1 AS node, id2 AS edge, cost
-         FROM pgr_dijkstra(
-                 'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                 2, 3, false, true
-         );
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+     2, 3, false, false);
+\echo --q4
 
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+     2, 3, false, true);
+\echo --q5
diff --git a/src/dijkstra/test/dijkstra-v3.result b/src/dijkstra/test/dijkstra-v3.result
deleted file mode 100644
index 6ef73fb..0000000
--- a/src/dijkstra/test/dijkstra-v3.result
+++ /dev/null
@@ -1,175 +0,0 @@
-1|1|2|4|1|0
-2|2|5|8|1|1
-3|3|6|9|1|2
-4|4|9|16|1|3
-5|5|4|3|1|4
-6|6|3|-1|0|5
-1|1|2|4|1|0
-2|2|5|-1|0|1
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|9|1|2
-4|4|3|9|16|1|3
-5|5|3|4|3|1|4
-6|6|3|3|-1|0|5
-7|1|5|2|4|1|0
-8|2|5|5|-1|0|1
-1|1|11|13|1|0
-2|2|12|15|1|1
-3|3|9|16|1|2
-4|4|4|3|1|3
-5|5|3|-1|0|4
-1|1|11|13|1|0
-2|2|12|15|1|1
-3|3|9|9|1|2
-4|4|6|8|1|3
-5|5|5|-1|0|4
-1|1|2|2|4|1|0
-2|2|2|5|-1|0|1
-3|1|11|11|13|1|0
-4|2|11|12|15|1|1
-5|3|11|9|9|1|2
-6|4|11|6|8|1|3
-7|5|11|5|-1|0|4
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|9|1|2
-4|4|2|3|9|16|1|3
-5|5|2|3|4|3|1|4
-6|6|2|3|3|-1|0|5
-7|1|2|5|2|4|1|0
-8|2|2|5|5|-1|0|1
-9|1|11|3|11|13|1|0
-10|2|11|3|12|15|1|1
-11|3|11|3|9|16|1|2
-12|4|11|3|4|3|1|3
-13|5|11|3|3|-1|0|4
-14|1|11|5|11|13|1|0
-15|2|11|5|12|15|1|1
-16|3|11|5|9|9|1|2
-17|4|11|5|6|8|1|3
-18|5|11|5|5|-1|0|4
-1|1|2|2|1|0
-2|2|3|-1|0|1
-1|1|2|4|1|0
-2|2|5|-1|0|1
-1|1|11|11|1|0
-2|2|6|5|1|1
-3|3|3|-1|0|2
-1|1|11|11|1|0
-2|2|6|8|1|1
-3|3|5|-1|0|2
-1|1|2|2|4|1|0
-2|2|2|5|-1|0|1
-3|1|11|11|11|1|0
-4|2|11|6|8|1|1
-5|3|11|5|-1|0|2
-1|1|3|2|2|1|0
-2|2|3|3|-1|0|1
-3|1|5|2|4|1|0
-4|2|5|5|-1|0|1
-1|1|2|3|2|2|1|0
-2|2|2|3|3|-1|0|1
-3|1|2|5|2|4|1|0
-4|2|2|5|5|-1|0|1
-5|1|11|3|11|11|1|0
-6|2|11|3|6|5|1|1
-7|3|11|3|3|-1|0|2
-8|1|11|5|11|11|1|0
-9|2|11|5|6|8|1|1
-10|3|11|5|5|-1|0|2
-1|1|2|4|1|0
-2|2|5|-1|0|1
-1|1|2|2|4|1|0
-2|2|2|5|-1|0|1
-1|1|5|2|4|1|0
-2|2|5|5|-1|0|1
-1|1|2|5|2|4|1|0
-2|2|2|5|5|-1|0|1
-1|1|2|4|1|0
-2|2|5|8|1|1
-3|3|6|5|1|2
-4|4|3|-1|0|3
-1|1|2|4|1|0
-2|2|5|-1|0|1
-1|1|11|11|1|0
-2|2|6|5|1|1
-3|3|3|-1|0|2
-1|1|11|11|1|0
-2|2|6|8|1|1
-3|3|5|-1|0|2
-1|1|2|2|4|1|0
-2|2|2|5|-1|0|1
-3|1|11|11|11|1|0
-4|2|11|6|8|1|1
-5|3|11|5|-1|0|2
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|5|1|2
-4|4|3|3|-1|0|3
-5|1|5|2|4|1|0
-6|2|5|5|-1|0|1
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|5|1|2
-4|4|2|3|3|-1|0|3
-5|1|2|5|2|4|1|0
-6|2|2|5|5|-1|0|1
-7|1|11|3|11|11|1|0
-8|2|11|3|6|5|1|1
-9|3|11|3|3|-1|0|2
-10|1|11|5|11|11|1|0
-11|2|11|5|6|8|1|1
-12|3|11|5|5|-1|0|2
-0|2|4|1
-1|5|8|1
-2|6|9|1
-3|9|16|1
-4|4|3|1
-5|3|-1|0
-1|1|2|4|1|0
-2|2|5|8|1|1
-3|3|6|9|1|2
-4|4|9|16|1|3
-5|5|4|3|1|4
-6|6|3|-1|0|5
-1|1|2|4|1|0
-2|2|5|8|1|1
-3|3|6|9|1|2
-4|4|9|16|1|3
-5|5|4|3|1|4
-6|6|3|-1|0|5
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|9|1|2
-4|4|3|9|16|1|3
-5|5|3|4|3|1|4
-6|6|3|3|-1|0|5
-1|1|3|2|4|1|0
-2|2|3|5|8|1|1
-3|3|3|6|9|1|2
-4|4|3|9|16|1|3
-5|5|3|4|3|1|4
-6|6|3|3|-1|0|5
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|9|1|2
-4|4|2|3|9|16|1|3
-5|5|2|3|4|3|1|4
-6|6|2|3|3|-1|0|5
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|9|1|2
-4|4|2|3|9|16|1|3
-5|5|2|3|4|3|1|4
-6|6|2|3|3|-1|0|5
-0|2|2|1
-1|3|-1|0
-1|1|2|2|1|0
-2|2|3|-1|0|1
-1|1|3|2|2|1|0
-2|2|3|3|-1|0|1
-1|1|2|2|2|1|0
-2|2|2|3|-1|0|1
-1|1|2|3|2|2|1|0
-2|2|2|3|3|-1|0|1
diff --git a/src/dijkstra/test/dijkstra-v3.test.sql b/src/dijkstra/test/dijkstra-v3.test.sql
deleted file mode 100644
index ac79aa1..0000000
--- a/src/dijkstra/test/dijkstra-v3.test.sql
+++ /dev/null
@@ -1,276 +0,0 @@
-
--- Examples for :ref:`fig1-direct-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, 3
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, 5
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, array[3,5]
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        11, 3
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        11, 5
-                );
-
-       
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        array[2,11], 5
-                );
-
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        array[2, 11], array[3,5]
-                );
-
-
--- Examples for :ref:`fig2-undirect-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, 3,
-                        false
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, 5,
-                        false
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        11, 3,
-                        false
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        11, 5,
-                        false
-                );
-
-       
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        array[2,11], 5,
-                        false
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        2, array[3,5],
-                        false
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                        array[2, 11], array[3,5],
-                        false
-                );
-        
-
--- Examples for :ref:`fig3-direct-Cost` 
--------------------------------------------------------------------------------
-
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        2, 3
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        2, 5
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        11, 3
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        11, 5
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        array[2,11], 5
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        2, array[3,5]
-                );
-
-        SELECT * FROM pgr_dijkstra(
-                        'SELECT id, source, target, cost FROM edge_table',
-                        array[2, 11], array[3,5]
-                );
-        
-
-
-
--- Examples for :ref:`fig4-undirect-Cost` 
--------------------------------------------------------------------------------
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			2, 3,
-                        false
-		);
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			2, 5,
-                        false
-		);
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			11, 3,
-                        false
-		);
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			11, 5,
-                        false
-		);
-
-       
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			array[2,11], 5,
-                        false
-		);
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			2, array[3,5],
-                        false
-		);
-
-	SELECT * FROM pgr_dijkstra(
-			'SELECT id, source, target, cost FROM edge_table',
-			array[2, 11], array[3,5],
-                        false
-		);
-
-
-
-
--- Equivalences for :ref:`fig1-direct-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-        -- V2
-	SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-                true,    -- directed flag
-                true      -- has_rcost
-	);
-
-        -- V3
-	SELECT * FROM pgr_dijkstra(
-               'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-                true     -- directed flag
-	);
-
-
-	SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2,3 
-	);
-
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2, array[3],
-                true     
-        );
-
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2, array[3]
-        );
-
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                array[2], array[3],
-                true
-        );
-
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                array[2], array[3]
-        );
-
-
-
--- Equivalences for :ref:`fig2-undirect-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-        -- V2
-	SELECT * FROM pgr_dijkstra(
-		'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-                false,    -- directed flag
-                true      -- has_rcost
-	);
-
-
-        -- V3
-	SELECT * FROM pgr_dijkstra(
-               'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-		2, 3,
-                false     -- directed flag
-	);
-
-
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                2, array[3],
-                false     
-        );
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                array[2], 3,
-                false
-        );
-
-        SELECT * FROM pgr_dijkstra(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                array[2], array[3],
-                false
-        );
-
-
diff --git a/src/dijkstra/test/dijkstra.data b/src/dijkstra/test/dijkstra.data
deleted file mode 100644
index 341990c..0000000
--- a/src/dijkstra/test/dijkstra.data
+++ /dev/null
@@ -1,84 +0,0 @@
-BEGIN;
---
--- PostgreSQL database dump
---
-
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET escape_string_warning = off;
-
-SET search_path = public, pg_catalog;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: edges1; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS edges1 CASCADE;
-
-CREATE TABLE edges1 (
-    id integer NOT NULL,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    to_cost double precision,
-    rule text,
-    the_geom geometry,
-    CONSTRAINT enforce_dims_the_geom CHECK ((st_ndims(the_geom) = 2)),
-    CONSTRAINT enforce_geotype_the_geom CHECK (((geometrytype(the_geom) = 'LINESTRING'::text) OR (the_geom IS NULL)))
---    , CONSTRAINT enforce_srid_the_geom CHECK ((st_srid(the_geom) = (0)))
-);
-
-
-
---
--- Data for Name: edges1; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY edges1 (id, dir, source, target, cost, reverse_cost, x1, y1, x2, y2, to_cost, rule, the_geom) FROM stdin WITH NULL '__NULL__';
-1	B	1	2	1	1	2	0	2	1	__NULL__	__NULL__	010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2	TF	2	3	-1	1	2	1	3	1	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3	TF	3	4	-1	1	3	1	4	1	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4	B	2	7	1	1	2	1	2	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5	FT	3	8	1	-1	3	1	3	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6	B	5	6	1	1	0	2	1	2	__NULL__	__NULL__	01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7	B	6	7	1	1	1	2	2	2	__NULL__	__NULL__	010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8	B	7	8	1	1	2	2	3	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9	B	8	9	1	1	3	2	4	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10	B	7	10	1	1	2	2	2	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11	FT	8	11	1	-1	3	2	3	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12	FT	10	11	1	-1	2	3	3	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13	FT	11	12	1	-1	3	3	4	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14	B	10	13	1	1	2	3	2	4	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15	B	9	12	1	1	4	2	4	3	__NULL__	__NULL__	0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16	B	4	9	1	1	4	1	4	2	__NULL__	__NULL__	0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-\.
-
-
-
---
--- Name: edges1_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY edges1
-    ADD CONSTRAINT edges1_pkey PRIMARY KEY (id);
-
-select pgr_createVerticesTable('edges1');
-
---
--- PostgreSQL database dump complete
---
-COMMIT;
-
-
diff --git a/src/dijkstra/test/doc-pgr_dijkstra.result b/src/dijkstra/test/doc-pgr_dijkstra.result
new file mode 100644
index 0000000..72a9caf
--- /dev/null
+++ b/src/dijkstra/test/doc-pgr_dijkstra.result
@@ -0,0 +1,226 @@
+-- q1
+1|1|2|4|1|0
+2|2|5|8|1|1
+3|3|6|9|1|2
+4|4|9|16|1|3
+5|5|4|3|1|4
+6|6|3|-1|0|5
+-- q2
+1|1|2|2|1|0
+2|2|3|-1|0|1
+-- q3
+1|1|3|2|4|1|0
+2|2|3|5|8|1|1
+3|3|3|6|5|1|2
+4|4|3|3|-1|0|3
+5|1|5|2|4|1|0
+6|2|5|5|-1|0|1
+-- q4
+1|1|2|2|4|1|0
+2|2|2|5|-1|0|1
+3|1|11|11|13|1|0
+4|2|11|12|15|1|1
+5|3|11|9|9|1|2
+6|4|11|6|8|1|3
+7|5|11|5|-1|0|4
+-- q5
+1|1|2|3|2|2|1|0
+2|2|2|3|3|-1|0|1
+3|1|2|5|2|4|1|0
+4|2|2|5|5|-1|0|1
+5|1|11|3|11|11|1|0
+6|2|11|3|6|5|1|1
+7|3|11|3|3|-1|0|2
+8|1|11|5|11|11|1|0
+9|2|11|5|6|8|1|1
+10|3|11|5|5|-1|0|2
+-- q6
+-- q7
+1|1|2|4|1|0
+2|2|5|8|1|1
+3|3|6|9|1|2
+4|4|9|16|1|3
+5|5|4|3|1|4
+6|6|3|-1|0|5
+1|1|2|4|1|0
+2|2|5|-1|0|1
+1|1|3|2|4|1|0
+2|2|3|5|8|1|1
+3|3|3|6|9|1|2
+4|4|3|9|16|1|3
+5|5|3|4|3|1|4
+6|6|3|3|-1|0|5
+7|1|5|2|4|1|0
+8|2|5|5|-1|0|1
+1|1|11|13|1|0
+2|2|12|15|1|1
+3|3|9|16|1|2
+4|4|4|3|1|3
+5|5|3|-1|0|4
+1|1|11|13|1|0
+2|2|12|15|1|1
+3|3|9|9|1|2
+4|4|6|8|1|3
+5|5|5|-1|0|4
+1|1|2|2|4|1|0
+2|2|2|5|-1|0|1
+3|1|11|11|13|1|0
+4|2|11|12|15|1|1
+5|3|11|9|9|1|2
+6|4|11|6|8|1|3
+7|5|11|5|-1|0|4
+1|1|2|3|2|4|1|0
+2|2|2|3|5|8|1|1
+3|3|2|3|6|9|1|2
+4|4|2|3|9|16|1|3
+5|5|2|3|4|3|1|4
+6|6|2|3|3|-1|0|5
+7|1|2|5|2|4|1|0
+8|2|2|5|5|-1|0|1
+9|1|11|3|11|13|1|0
+10|2|11|3|12|15|1|1
+11|3|11|3|9|16|1|2
+12|4|11|3|4|3|1|3
+13|5|11|3|3|-1|0|4
+14|1|11|5|11|13|1|0
+15|2|11|5|12|15|1|1
+16|3|11|5|9|9|1|2
+17|4|11|5|6|8|1|3
+18|5|11|5|5|-1|0|4
+-- q8
+-- q9
+1|1|2|2|1|0
+2|2|3|-1|0|1
+1|1|2|4|1|0
+2|2|5|-1|0|1
+1|1|11|11|1|0
+2|2|6|5|1|1
+3|3|3|-1|0|2
+1|1|11|11|1|0
+2|2|6|8|1|1
+3|3|5|-1|0|2
+1|1|2|2|4|1|0
+2|2|2|5|-1|0|1
+3|1|11|11|11|1|0
+4|2|11|6|8|1|1
+5|3|11|5|-1|0|2
+1|1|3|2|2|1|0
+2|2|3|3|-1|0|1
+3|1|5|2|4|1|0
+4|2|5|5|-1|0|1
+1|1|2|3|2|2|1|0
+2|2|2|3|3|-1|0|1
+3|1|2|5|2|4|1|0
+4|2|2|5|5|-1|0|1
+5|1|11|3|11|11|1|0
+6|2|11|3|6|5|1|1
+7|3|11|3|3|-1|0|2
+8|1|11|5|11|11|1|0
+9|2|11|5|6|8|1|1
+10|3|11|5|5|-1|0|2
+-- q10
+-- q11
+1|1|2|4|1|0
+2|2|5|-1|0|1
+1|1|2|2|4|1|0
+2|2|2|5|-1|0|1
+1|1|5|2|4|1|0
+2|2|5|5|-1|0|1
+1|1|2|5|2|4|1|0
+2|2|2|5|5|-1|0|1
+-- q12
+-- q13
+1|1|2|4|1|0
+2|2|5|8|1|1
+3|3|6|5|1|2
+4|4|3|-1|0|3
+1|1|2|4|1|0
+2|2|5|-1|0|1
+1|1|11|11|1|0
+2|2|6|5|1|1
+3|3|3|-1|0|2
+1|1|11|11|1|0
+2|2|6|8|1|1
+3|3|5|-1|0|2
+1|1|2|2|4|1|0
+2|2|2|5|-1|0|1
+3|1|11|11|11|1|0
+4|2|11|6|8|1|1
+5|3|11|5|-1|0|2
+1|1|3|2|4|1|0
+2|2|3|5|8|1|1
+3|3|3|6|5|1|2
+4|4|3|3|-1|0|3
+5|1|5|2|4|1|0
+6|2|5|5|-1|0|1
+1|1|2|3|2|4|1|0
+2|2|2|3|5|8|1|1
+3|3|2|3|6|5|1|2
+4|4|2|3|3|-1|0|3
+5|1|2|5|2|4|1|0
+6|2|2|5|5|-1|0|1
+7|1|11|3|11|11|1|0
+8|2|11|3|6|5|1|1
+9|3|11|3|3|-1|0|2
+10|1|11|5|11|11|1|0
+11|2|11|5|6|8|1|1
+12|3|11|5|5|-1|0|2
+-- q14
+-- q15
+1|1|2|4|1|0
+2|2|5|8|1|1
+3|3|6|9|1|2
+4|4|9|16|1|3
+5|5|4|3|1|4
+6|6|3|-1|0|5
+1|1|2|4|1|0
+2|2|5|8|1|1
+3|3|6|9|1|2
+4|4|9|16|1|3
+5|5|4|3|1|4
+6|6|3|-1|0|5
+1|1|3|2|4|1|0
+2|2|3|5|8|1|1
+3|3|3|6|9|1|2
+4|4|3|9|16|1|3
+5|5|3|4|3|1|4
+6|6|3|3|-1|0|5
+1|1|3|2|4|1|0
+2|2|3|5|8|1|1
+3|3|3|6|9|1|2
+4|4|3|9|16|1|3
+5|5|3|4|3|1|4
+6|6|3|3|-1|0|5
+1|1|2|3|2|4|1|0
+2|2|2|3|5|8|1|1
+3|3|2|3|6|9|1|2
+4|4|2|3|9|16|1|3
+5|5|2|3|4|3|1|4
+6|6|2|3|3|-1|0|5
+1|1|2|3|2|4|1|0
+2|2|2|3|5|8|1|1
+3|3|2|3|6|9|1|2
+4|4|2|3|9|16|1|3
+5|5|2|3|4|3|1|4
+6|6|2|3|3|-1|0|5
+NOTICE:  Deprecated function
+0|2|4|1
+1|5|8|1
+2|6|9|1
+3|9|16|1
+4|4|3|1
+5|3|-1|0
+-- q16
+-- q17
+1|1|2|2|1|0
+2|2|3|-1|0|1
+1|1|3|2|2|1|0
+2|2|3|3|-1|0|1
+1|1|2|2|2|1|0
+2|2|2|3|-1|0|1
+1|1|2|3|2|2|1|0
+2|2|2|3|3|-1|0|1
+NOTICE:  Deprecated function
+0|2|2|1
+1|3|-1|0
+-- q18
diff --git a/src/dijkstra/test/doc-pgr_dijkstra.test.sql b/src/dijkstra/test/doc-pgr_dijkstra.test.sql
new file mode 100644
index 0000000..4bf410d
--- /dev/null
+++ b/src/dijkstra/test/doc-pgr_dijkstra.test.sql
@@ -0,0 +1,267 @@
+
+\echo -- q1
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3
+);
+\echo -- q2
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE
+);
+\echo -- q3
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, ARRAY[3,5],
+    FALSE
+);
+\echo -- q4
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], 5
+);
+\echo -- q5
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], ARRAY[3,5],
+    FALSE
+);
+\echo -- q6
+
+
+-- Examples for :ref:`fig1-direct-Cost-Reverse` 
+-------------------------------------------------------------------------------
+
+\echo -- q7
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 5
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3,5]
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 3
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 5
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], 5
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5]
+);
+\echo -- q8
+
+
+-- Examples for :ref:`fig2-undirect-Cost-Reverse` 
+-------------------------------------------------------------------------------
+
+
+\echo -- q9
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 5,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 3,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    11, 5,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2,11], 5,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3,5],
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5],
+    FALSE
+);
+\echo -- q10
+
+
+-- Examples for :ref:`fig3-direct-Cost` 
+-------------------------------------------------------------------------------
+
+
+\echo -- q11
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 3
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 5
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 3
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 5
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2,11], 5
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, ARRAY[3,5]
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5]
+);
+\echo -- q12
+
+
+-- Examples for :ref:`fig4-undirect-Cost` 
+-------------------------------------------------------------------------------
+
+\echo -- q13
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 3,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 5,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 3,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    11, 5,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2,11], 5,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, ARRAY[3,5],
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost FROM edge_table',
+    ARRAY[2, 11], ARRAY[3,5],
+    FALSE
+);
+\echo -- q14
+
+
+
+
+-- Equivalences for :ref:`fig1-direct-Cost-Reverse` 
+-------------------------------------------------------------------------------
+
+\echo -- q15
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    TRUE     -- directed flag
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2,3 
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3],
+    TRUE     
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3]
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], ARRAY[3],
+    TRUE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], ARRAY[3]
+);
+-- Version 2.0
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2, 3,
+    TRUE,    -- directed flag
+    TRUE      -- has_rcost
+);
+\echo -- q16
+
+
+
+-- Equivalences for :ref:`fig2-undirect-Cost-Reverse` 
+-------------------------------------------------------------------------------
+
+
+\echo -- q17
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE     -- directed flag
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[3],
+    FALSE     
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], 3,
+    FALSE
+);
+SELECT * FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    ARRAY[2], ARRAY[3],
+    FALSE
+);
+-- Version 2.0
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    2, 3,
+    FALSE,    -- directed flag
+    TRUE      -- has_rcost
+);
+\echo -- q18
+
+
diff --git a/src/dijkstra/test/doc-pgr_dijkstraCost.result b/src/dijkstra/test/doc-pgr_dijkstraCost.result
new file mode 100644
index 0000000..3be3c5f
--- /dev/null
+++ b/src/dijkstra/test/doc-pgr_dijkstraCost.result
@@ -0,0 +1,30 @@
+--q1
+2|3|5
+--q2
+2|3|1
+--q3
+2|3|5
+7|3|6
+--q4
+2|3|5
+2|11|3
+--q5
+2|3|5
+2|11|3
+7|3|6
+7|11|4
+--q6
+3|4|3
+3|5|2
+4|3|1
+4|5|3
+5|3|4
+5|4|3
+--q7
+3|4|3
+3|5|2
+4|3|1
+4|5|3
+5|3|4
+5|4|3
+--q8
diff --git a/src/dijkstra/test/doc-pgr_dijkstraCost.test.sql b/src/dijkstra/test/doc-pgr_dijkstraCost.test.sql
new file mode 100644
index 0000000..eb274b1
--- /dev/null
+++ b/src/dijkstra/test/doc-pgr_dijkstraCost.test.sql
@@ -0,0 +1,38 @@
+BEGIN;
+\echo --q1
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    2, 3);
+
+\echo --q2
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    2, 3, false);
+
+\echo --q3
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[2, 7], 3);
+
+\echo --q4
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    2, ARRAY[3, 11]);
+
+\echo --q5
+SELECT * FROM pgr_dijkstraCost(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[2, 7], ARRAY[3, 11]);
+
+\echo --q6
+SELECT * FROM pgr_dijkstraCost(
+        'select id, source, target, cost, reverse_cost from edge_table',
+            ARRAY[5, 3, 4, 3, 3, 4], ARRAY[3, 5, 3, 4]);
+
+\echo --q7
+SELECT * FROM pgr_dijkstraCost(
+        'select id, source, target, cost, reverse_cost from edge_table',
+            ARRAY[5, 3, 4], ARRAY[5, 3, 4]);
+
+\echo --q8
+ROLLBACK
diff --git a/src/dijkstra/test/doc-pgr_dijkstraVia.result b/src/dijkstra/test/doc-pgr_dijkstraVia.result
new file mode 100644
index 0000000..941eb37
--- /dev/null
+++ b/src/dijkstra/test/doc-pgr_dijkstraVia.result
@@ -0,0 +1,55 @@
+--q00
+1|1|1|1|3|1|1|1|0|0
+2|1|2|1|3|2|4|1|1|1
+3|1|3|1|3|5|8|1|2|2
+4|1|4|1|3|6|9|1|3|3
+5|1|5|1|3|9|16|1|4|4
+6|1|6|1|3|4|3|1|5|5
+7|1|7|1|3|3|-1|0|6|6
+8|2|1|3|9|3|5|1|0|6
+9|2|2|3|9|6|9|1|1|7
+10|2|3|3|9|9|-2|0|2|8
+-- q0
+1|1|1|1|3|1|1|1|0|0
+2|1|2|1|3|2|2|1|1|1
+3|1|3|1|3|3|-1|0|2|2
+4|2|1|3|9|3|3|1|0|2
+5|2|2|3|9|4|16|1|1|3
+6|2|3|3|9|9|-2|0|2|4
+-- q1
+1|1|1|1|5|1|1|1|0|0
+2|1|2|1|5|2|4|1|1|1
+3|1|3|1|5|5|-1|0|2|2
+4|2|1|5|3|5|8|1|0|2
+5|2|2|5|3|6|9|1|1|3
+6|2|3|5|3|9|16|1|2|4
+7|2|4|5|3|4|3|1|3|5
+8|2|5|5|3|3|-1|0|4|6
+9|3|1|3|9|3|5|1|0|6
+10|3|2|3|9|6|9|1|1|7
+11|3|3|3|9|9|-1|0|2|8
+12|4|1|9|4|9|16|1|0|8
+13|4|2|9|4|4|-2|0|1|9
+-- q2
+2
+-- q3
+8
+-- q4
+1|1
+2|2
+3|5
+4|6
+5|9
+6|4
+7|3
+8|6
+9|9
+10|4
+-- q5
+1|2
+2|6
+3|8
+4|9
+-- q6
+6|4|9|2|passes in front
+11|8|9|2|visits
diff --git a/src/dijkstra/test/doc-pgr_dijkstraVia.test.sql b/src/dijkstra/test/doc-pgr_dijkstraVia.test.sql
new file mode 100644
index 0000000..15eb97b
--- /dev/null
+++ b/src/dijkstra/test/doc-pgr_dijkstraVia.test.sql
@@ -0,0 +1,61 @@
+-- documentation queries
+\echo --q00
+SELECT * FROM pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 3, 9]
+);
+\echo -- q0
+SELECT * FROM pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 3, 9], false, strict:=true, U_turn_on_edge:=false
+);
+
+\echo -- q1
+SELECT * FROM pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+);
+
+\echo -- q2
+SELECT agg_cost FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+) 
+WHERE path_id = 3 AND edge <0;
+
+
+\echo -- q3
+SELECT route_agg_cost FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+)
+WHERE path_id = 3 AND edge < 0;
+
+
+\echo -- q4
+SELECT row_number() over () as node_seq, node 
+FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+) 
+WHERE edge <> -1 ORDER BY seq;
+
+
+\echo -- q5
+SELECT path_id, route_agg_cost FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4]
+) 
+WHERE edge < 0;
+
+
+\echo -- q6
+SELECT seq, route_agg_cost, node, agg_cost ,
+CASE WHEN edge = -1 THEN 'visits'
+ELSE 'passes in front'
+END as status
+FROM  pgr_dijkstraVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+    ARRAY[1, 5, 3, 9, 4])
+WHERE node = 9 and (agg_cost  <> 0 or seq = 1);
+
diff --git a/src/dijkstra/test/issue-353.result b/src/dijkstra/test/issue-353.result
index 737ce00..b4686ec 100644
--- a/src/dijkstra/test/issue-353.result
+++ b/src/dijkstra/test/issue-353.result
@@ -1,24 +1,4 @@
-1|1|2|5|2|4|1|0
-2|2|2|5|5|-1|0|1
-3|1|2|6|2|4|1|0
-4|2|2|6|5|8|1|1
-5|3|2|6|6|-1|0|2
-6|1|7|5|7|6|1|0
-7|2|7|5|8|7|1|1
-8|3|7|5|5|-1|0|2
-9|1|7|6|7|6|1|0
-10|2|7|6|8|7|1|1
-11|3|7|6|5|8|1|2
-12|4|7|6|6|-1|0|3
-1|1|2|5|2|4|1|0
-2|2|2|5|5|-1|0|1
-3|1|2|6|2|4|1|0
-4|2|2|6|5|8|1|1
-5|3|2|6|6|-1|0|2
-6|1|7|5|7|6|1|0
-7|2|7|5|8|7|1|1
-8|3|7|5|5|-1|0|2
-9|1|7|6|7|6|1|0
-10|2|7|6|8|7|1|1
-11|3|7|6|5|8|1|2
-12|4|7|6|6|-1|0|3
+1..3
+ok 1 - 1
+ok 2 - 2
+ok 3 - 3
diff --git a/src/dijkstra/test/issue-353.test.sql b/src/dijkstra/test/issue-353.test.sql
deleted file mode 100644
index f7da593..0000000
--- a/src/dijkstra/test/issue-353.test.sql
+++ /dev/null
@@ -1,8 +0,0 @@
--- test for issue 353
-
-select * from pgr_dijkstra( 'select id, source, target, cost from edge_table',
-     array[2,7], array[5,6]);
-select * from pgr_dijkstra( 'select id, source, target, cost from edge_table', 
-    array[2,7], array[17,18]);
-select * from pgr_dijkstra( 'select id, source, target, cost from edge_table', 
-array[2,7], array[5,6,17,18]);
diff --git a/src/dijkstra/test/many_to_1.test.sql b/src/dijkstra/test/many_to_1.test.sql
index 075aff2..d44b5c5 100644
--- a/src/dijkstra/test/many_to_1.test.sql
+++ b/src/dijkstra/test/many_to_1.test.sql
@@ -1,5 +1,4 @@
 
-
 -- Examples for :ref:`fig1-direct-Cost-Reverse` 
 -------------------------------------------------------------------------------
 
diff --git a/src/dijkstra/test/many_to_many.result b/src/dijkstra/test/many_to_many.result
deleted file mode 100644
index 3b463fe..0000000
--- a/src/dijkstra/test/many_to_many.result
+++ /dev/null
@@ -1,54 +0,0 @@
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|9|1|2
-4|4|2|3|9|16|1|3
-5|5|2|3|4|3|1|4
-6|6|2|3|3|-1|0|5
-1|1|2|3|2|2|1|0
-2|2|2|3|3|-1|0|1
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|5|1|2
-4|4|2|3|3|-1|0|3
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|9|1|2
-4|4|2|3|9|16|1|3
-5|5|2|3|4|3|1|4
-6|6|2|3|3|-1|0|5
-7|1|2|5|2|4|1|0
-8|2|2|5|5|-1|0|1
-9|1|11|3|11|13|1|0
-10|2|11|3|12|15|1|1
-11|3|11|3|9|16|1|2
-12|4|11|3|4|3|1|3
-13|5|11|3|3|-1|0|4
-14|1|11|5|11|13|1|0
-15|2|11|5|12|15|1|1
-16|3|11|5|9|9|1|2
-17|4|11|5|6|8|1|3
-18|5|11|5|5|-1|0|4
-1|1|2|3|2|2|1|0
-2|2|2|3|3|-1|0|1
-3|1|2|5|2|4|1|0
-4|2|2|5|5|-1|0|1
-5|1|11|3|11|11|1|0
-6|2|11|3|6|5|1|1
-7|3|11|3|3|-1|0|2
-8|1|11|5|11|11|1|0
-9|2|11|5|6|8|1|1
-10|3|11|5|5|-1|0|2
-1|1|2|5|2|4|1|0
-2|2|2|5|5|-1|0|1
-1|1|2|3|2|4|1|0
-2|2|2|3|5|8|1|1
-3|3|2|3|6|5|1|2
-4|4|2|3|3|-1|0|3
-5|1|2|5|2|4|1|0
-6|2|2|5|5|-1|0|1
-7|1|11|3|11|11|1|0
-8|2|11|3|6|5|1|1
-9|3|11|3|3|-1|0|2
-10|1|11|5|11|11|1|0
-11|2|11|5|6|8|1|1
-12|3|11|5|5|-1|0|2
diff --git a/src/dijkstra/test/many_to_many.test.sql b/src/dijkstra/test/many_to_many.test.sql
deleted file mode 100644
index 8bd747f..0000000
--- a/src/dijkstra/test/many_to_many.test.sql
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
--- Examples for :ref:`fig1-direct-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2], array[3]
-        );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2], array[3], false
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            array[2], array[3]
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            array[2], array[3], false
-        );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2,11], array[3,5]
-        );
-
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-            array[2,11], array[3,5], false
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            array[2,11], array[3,5]
-        );
-
-    SELECT * FROM pgr_dijkstra(
-            'SELECT id, source, target, cost FROM edge_table',
-            array[2,11], array[3,5], false
-        );
-
-
diff --git a/src/dijkstra/test/pgtap/dijkstra-types-check.sql b/src/dijkstra/test/pgtap/dijkstra-types-check.sql
new file mode 100644
index 0000000..d10f945
--- /dev/null
+++ b/src/dijkstra/test/pgtap/dijkstra-types-check.sql
@@ -0,0 +1,322 @@
+
+\i setup.sql
+
+SET client_min_messages TO WARNING;
+
+SELECT plan(46);
+
+SELECT can(ARRAY['pgr_dijkstra']);
+
+SELECT todo_start('remove on version 3.0');
+--V2.0
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','integer','integer','boolean','boolean'],'Remove old signature on version 3.0');
+SELECT todo_end();
+
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','bigint','integer','boolean','boolean']);
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','integer','bigint','boolean','boolean']);
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','bigint','bigint','boolean','boolean']);
+
+
+
+
+
+--V2.1+
+SELECT has_function('pgr_dijkstra', ARRAY['text','bigint','bigint','boolean']);
+SELECT has_function('pgr_dijkstra', ARRAY['text','bigint','anyarray','boolean']);
+SELECT has_function('pgr_dijkstra', ARRAY['text','anyarray','bigint','boolean']);
+SELECT has_function('pgr_dijkstra', ARRAY['text','anyarray','anyarray','boolean']);
+
+SELECT function_returns('pgr_dijkstra', ARRAY['text','bigint','bigint','boolean'],'setof record');
+SELECT function_returns('pgr_dijkstra', ARRAY['text','bigint','anyarray','boolean'],'setof record');
+SELECT function_returns('pgr_dijkstra', ARRAY['text','anyarray','bigint','boolean'],'setof record');
+SELECT function_returns('pgr_dijkstra', ARRAY['text','anyarray','anyarray','boolean'],'setof record');
+
+-- testing for the 4 signatures that they return the correct names & columns
+-- Preparing
+PREPARE v21q00 AS
+SELECT pg_typeof(seq)::text AS t1, pg_typeof(path_seq)::text AS t2,
+    pg_typeof(node)::text AS t5, pg_typeof(edge)::text AS t6,
+    pg_typeof(cost)::text AS t7, pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstra(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            2, 3, true) ) AS a
+    limit 1
+;
+PREPARE v21q01 AS
+SELECT  'integer'::text AS t1,'integer'::text AS t2,
+    'bigint'::text AS t5, 'bigint'::text AS t6,
+    'double precision'::text AS t7, 'double precision'::text AS t8;
+
+PREPARE v21q10 AS
+SELECT pg_typeof(seq)::text AS t1, pg_typeof(path_seq)::text AS t2,
+    pg_typeof(end_vid)::text AS t4,
+    pg_typeof(node)::text AS t5, pg_typeof(edge)::text AS t6,
+    pg_typeof(cost)::text AS t7, pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstra(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            2, ARRAY[3], true) ) AS a
+    limit 1
+;
+PREPARE v21q11 AS
+SELECT  'integer'::text AS t1,'integer'::text AS t2,
+    'bigint'::text AS t4,
+    'bigint'::text AS t5, 'bigint'::text AS t6,
+    'double precision'::text AS t7, 'double precision'::text AS t8;
+
+
+PREPARE v21q20 AS
+SELECT pg_typeof(seq)::text AS t1, pg_typeof(path_seq)::text AS t2,
+    pg_typeof(start_vid)::text AS t3,
+    pg_typeof(node)::text AS t5, pg_typeof(edge)::text AS t6,
+    pg_typeof(cost)::text AS t7, pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstra(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            ARRAY[2], 3, true) ) AS a
+    limit 1
+;
+PREPARE v21q21 AS
+SELECT  'integer'::text AS t1,'integer'::text AS t2,
+    'bigint'::text AS t3,
+    'bigint'::text AS t5, 'bigint'::text AS t6,
+    'double precision'::text AS t7, 'double precision'::text AS t8;
+
+PREPARE v21q30 AS
+SELECT pg_typeof(seq)::text AS t1, pg_typeof(path_seq)::text AS t2,
+    pg_typeof(start_vid)::text AS t3, pg_typeof(end_vid)::text AS t4,
+    pg_typeof(node)::text AS t5, pg_typeof(edge)::text AS t6,
+    pg_typeof(cost)::text AS t7, pg_typeof(agg_cost)::TEXT AS t8
+    FROM ( 
+        SELECT * FROM pgr_dijkstra(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            ARRAY[2], ARRAY[3], true) ) AS a
+    limit 1
+;
+PREPARE v21q31 AS
+SELECT  'integer'::text AS t1,'integer'::text AS t2,
+    'bigint'::text AS t3, 'bigint'::text AS t4,
+    'bigint'::text AS t5, 'bigint'::text AS t6,
+    'double precision'::text AS t7, 'double precision'::text AS t8;
+
+-- testing
+SELECT set_eq('v21q00', 'v21q01','1 to 1: Expected returning, columns names & types');
+SELECT set_eq('v21q10', 'v21q11','1 to many: Expected returning, columns names & types');
+SELECT set_eq('v21q20', 'v21q21','many to 1: Expected returning, columns names & types');
+SELECT set_eq('v21q30', 'v21q31','many to many: Expected returning, columns names & types');
+
+
+-- CHECKING WORKS WITH & WITOUT REVERSE COST
+
+PREPARE v20q1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, true);
+PREPARE v20q3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v20q1','with reverse cost 1');
+SELECT lives_ok('v20q3','with reverse cost 3');
+
+PREPARE v20q5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, true);
+
+PREPARE v20q6 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+
+SELECT lives_ok('v20q5','without reverse cost 1');
+SELECT lives_ok('v20q6','without reverse cost 2');
+
+-- V2.0
+-- CHECKING INNER QUERY
+-- ANY-INTEGER, ANY-INTEGER, ANY-INTEGER, ANY-NUMERIC, [ANY-NUMERIC]
+
+/* TEST USES THE EDGES_INPUT FOR 5 PARAMETERS */
+
+--id ANY-INTEGER
+PREPARE v200id1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::FLOAT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::REAL, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::TEXT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200id1',
+    'lives because id is SMALLINT');
+SELECT lives_ok('v200id2',
+    'lives because id is BIGINT');
+SELECT throws_ok('v200id3',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is REAL');
+SELECT throws_ok('v200id4',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is FLOAT');
+SELECT throws_ok('v200id5',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is TEXT');
+
+--source is only integer
+PREPARE v200s1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::REAL, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::FLOAT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::TEXT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200s1',
+    'lives because source is SMALLINT');
+SELECT lives_ok('v200s2',
+    'lives because source is BIGINT');
+SELECT throws_ok('v200s3',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because source is REAL');
+SELECT throws_ok('v200s4',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because source is FLOAT');
+SELECT throws_ok('v200s5',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because id is TEXT');
+
+
+--target is only integer
+PREPARE v200t1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::FLOAT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::REAL, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::TEXT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200t1',
+    'lives because target is SMALLINT');
+SELECT lives_ok('v200t2',
+    'lives because target is BIGINT');
+SELECT throws_ok('v200t3',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is REAL');
+SELECT throws_ok('v200t4',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is FLOAT');
+SELECT throws_ok('v200t5',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is TEXT');
+
+-- cost
+PREPARE v200c1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT FROM edge_table',
+    2, 3, false);
+PREPARE v200c2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER FROM edge_table',
+    2, 3, false);
+PREPARE v200c3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT FROM edge_table',
+    2, 3, false);
+PREPARE v200c4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL FROM edge_table',
+    2, 3, false);
+PREPARE v200c5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::TEXT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200c1',
+    'lives because cost is SMALLINT');
+SELECT lives_ok('v200c2',
+    'lives because cost is INTEGER');
+SELECT lives_ok('v200c3',
+    'lives because cost is BIGINT');
+SELECT lives_ok('v200c4',
+    'lives because cost is REAL');
+SELECT throws_ok('v200c5',
+    'XX000','Unexpected Column ''cost'' type. Expected ANY-NUMERICAL',
+    'throws because cost is TEXT');
+
+-- reverse_cost
+PREPARE v200r1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table',
+    2, 3, false);
+PREPARE v200r2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::INTEGER FROM edge_table',
+    2, 3, false);
+PREPARE v200r3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::BIGINT FROM edge_table',
+    2, 3, false);
+PREPARE v200r4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::REAL FROM edge_table',
+    2, 3, false);
+PREPARE v200r5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::TEXT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200r1',
+    'lives because reverse_cost is SMALLINT');
+SELECT lives_ok('v200r2',
+    'lives because reverse_cost is INTEGER');
+SELECT lives_ok('v200r3',
+    'lives because reverse_cost is BIGINT');
+SELECT lives_ok('v200r4',
+    'lives because reverse_cost is REAL');
+SELECT throws_ok('v200r5',
+    'XX000','Unexpected Column ''reverse_cost'' type. Expected ANY-NUMERICAL',
+    'throws because reverse_cost is TEXT');
+
+    SELECT finish();
+    ROLLBACK;
diff --git a/src/dijkstra/test/pgtap/dijkstraCost-types-check.sql b/src/dijkstra/test/pgtap/dijkstraCost-types-check.sql
new file mode 100644
index 0000000..6ff2bb7
--- /dev/null
+++ b/src/dijkstra/test/pgtap/dijkstraCost-types-check.sql
@@ -0,0 +1,302 @@
+
+\i setup.sql
+
+SET client_min_messages TO WARNING;
+
+SELECT plan(41);
+
+
+--V2.2+
+SELECT has_function('pgr_dijkstracost', ARRAY['text','bigint','bigint','boolean']);
+SELECT has_function('pgr_dijkstracost', ARRAY['text','bigint','anyarray','boolean']);
+SELECT has_function('pgr_dijkstracost', ARRAY['text','anyarray','bigint','boolean']);
+SELECT has_function('pgr_dijkstracost', ARRAY['text','anyarray','anyarray','boolean']);
+
+SELECT function_returns('pgr_dijkstracost', ARRAY['text','bigint','bigint','boolean'],'setof record');
+SELECT function_returns('pgr_dijkstracost', ARRAY['text','bigint','anyarray','boolean'],'setof record');
+SELECT function_returns('pgr_dijkstracost', ARRAY['text','anyarray','bigint','boolean'],'setof record');
+SELECT function_returns('pgr_dijkstracost', ARRAY['text','anyarray','anyarray','boolean'],'setof record');
+
+-- testing for the 4 signatures that they return the correct names & columns
+-- Preparing
+PREPARE v21q00 AS
+SELECT 
+    pg_typeof(start_vid)::text AS t3, pg_typeof(end_vid)::text AS t4,
+    pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstracost(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            2, 3, true) ) AS a
+    limit 1
+;
+PREPARE v21q01 AS
+SELECT  
+    'bigint'::text AS t3, 'bigint'::text AS t4,
+    'double precision'::text AS t8;
+
+PREPARE v21q10 AS
+SELECT 
+    pg_typeof(start_vid)::text AS t3, pg_typeof(end_vid)::text AS t4,
+    pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstracost(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            2, ARRAY[3], true) ) AS a
+    limit 1
+;
+PREPARE v21q11 AS
+SELECT  
+    'bigint'::text AS t3, 'bigint'::text AS t4,
+    'double precision'::text AS t8;
+
+
+PREPARE v21q20 AS
+SELECT 
+    pg_typeof(start_vid)::text AS t3, pg_typeof(end_vid)::text AS t4,
+    pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstracost(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            ARRAY[2], 3, true) ) AS a
+    limit 1
+;
+PREPARE v21q21 AS
+SELECT  
+    'bigint'::text AS t3, 'bigint'::text AS t4,
+    'double precision'::text AS t8;
+
+PREPARE v21q30 AS
+SELECT 
+    pg_typeof(start_vid)::text AS t3, pg_typeof(end_vid)::text AS t4,
+    pg_typeof(agg_cost)::TEXT AS t8 
+    FROM ( 
+        SELECT * FROM pgr_dijkstracost(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            ARRAY[2], ARRAY[3], true) ) AS a
+    limit 1
+;
+PREPARE v21q31 AS
+SELECT  
+    'bigint'::text AS t3, 'bigint'::text AS t4,
+    'double precision'::text AS t8;
+
+-- testing
+SELECT set_eq('v21q00', 'v21q01','1 to 1: Expected returning, columns names & types');
+SELECT set_eq('v21q10', 'v21q11','1 to many: Expected returning, columns names & types');
+SELECT set_eq('v21q20', 'v21q21','many to 1: Expected returning, columns names & types');
+SELECT set_eq('v21q30', 'v21q31','many to many: Expected returning, columns names & types');
+
+
+-- CHECKING WORKS WITH & WITOUT REVERSE COST
+
+PREPARE v20q1 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, true);
+PREPARE v20q3 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v20q1','with reverse cost 1');
+SELECT lives_ok('v20q3','with reverse cost 3');
+
+PREPARE v20q5 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, true);
+
+PREPARE v20q6 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+
+SELECT lives_ok('v20q5','without reverse cost 1');
+SELECT lives_ok('v20q6','without reverse cost 2');
+
+-- V2.0
+-- CHECKING INNER QUERY
+-- ANY-INTEGER, ANY-INTEGER, ANY-INTEGER, ANY-NUMERIC, [ANY-NUMERIC]
+
+/* TEST USES THE EDGES_INPUT FOR 5 PARAMETERS */
+
+--id ANY-INTEGER
+PREPARE v200id1 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id2 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id3 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::FLOAT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id4 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::REAL, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200id5 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::TEXT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200id1',
+    'lives because id is SMALLINT');
+SELECT lives_ok('v200id2',
+    'lives because id is BIGINT');
+SELECT throws_ok('v200id3',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is REAL');
+SELECT throws_ok('v200id4',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is FLOAT');
+SELECT throws_ok('v200id5',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is TEXT');
+
+--source is only integer
+PREPARE v200s1 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s2 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s3 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::REAL, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s4 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::FLOAT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200s5 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::TEXT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200s1',
+    'lives because source is SMALLINT');
+SELECT lives_ok('v200s2',
+    'lives because source is BIGINT');
+SELECT throws_ok('v200s3',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because source is REAL');
+SELECT throws_ok('v200s4',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because source is FLOAT');
+SELECT throws_ok('v200s5',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because id is TEXT');
+
+
+--target is only integer
+PREPARE v200t1 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t2 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t3 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::FLOAT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t4 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::REAL, cost::FLOAT FROM edge_table',
+    2, 3, false);
+PREPARE v200t5 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::TEXT, cost::FLOAT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200t1',
+    'lives because target is SMALLINT');
+SELECT lives_ok('v200t2',
+    'lives because target is BIGINT');
+SELECT throws_ok('v200t3',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is REAL');
+SELECT throws_ok('v200t4',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is FLOAT');
+SELECT throws_ok('v200t5',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is TEXT');
+
+-- cost
+PREPARE v200c1 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT FROM edge_table',
+    2, 3, false);
+PREPARE v200c2 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER FROM edge_table',
+    2, 3, false);
+PREPARE v200c3 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT FROM edge_table',
+    2, 3, false);
+PREPARE v200c4 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL FROM edge_table',
+    2, 3, false);
+PREPARE v200c5 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::TEXT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200c1',
+    'lives because cost is SMALLINT');
+SELECT lives_ok('v200c2',
+    'lives because cost is INTEGER');
+SELECT lives_ok('v200c3',
+    'lives because cost is BIGINT');
+SELECT lives_ok('v200c4',
+    'lives because cost is REAL');
+SELECT throws_ok('v200c5',
+    'XX000','Unexpected Column ''cost'' type. Expected ANY-NUMERICAL',
+    'throws because cost is TEXT');
+
+-- reverse_cost
+PREPARE v200r1 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table',
+    2, 3, false);
+PREPARE v200r2 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::INTEGER FROM edge_table',
+    2, 3, false);
+PREPARE v200r3 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::BIGINT FROM edge_table',
+    2, 3, false);
+PREPARE v200r4 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::REAL FROM edge_table',
+    2, 3, false);
+PREPARE v200r5 AS
+SELECT * FROM pgr_dijkstracost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::TEXT FROM edge_table',
+    2, 3, false);
+
+SELECT lives_ok('v200r1',
+    'lives because reverse_cost is SMALLINT');
+SELECT lives_ok('v200r2',
+    'lives because reverse_cost is INTEGER');
+SELECT lives_ok('v200r3',
+    'lives because reverse_cost is BIGINT');
+SELECT lives_ok('v200r4',
+    'lives because reverse_cost is REAL');
+SELECT throws_ok('v200r5',
+    'XX000','Unexpected Column ''reverse_cost'' type. Expected ANY-NUMERICAL',
+    'throws because reverse_cost is TEXT');
+
+    SELECT finish();
+    ROLLBACK;
diff --git a/src/dijkstra/test/pgtap/dijkstraV2-types-check.sql b/src/dijkstra/test/pgtap/dijkstraV2-types-check.sql
new file mode 100644
index 0000000..3d83836
--- /dev/null
+++ b/src/dijkstra/test/pgtap/dijkstraV2-types-check.sql
@@ -0,0 +1,279 @@
+
+\i setup.sql
+
+SET client_min_messages TO WARNING;
+
+SELECT plan(40);
+
+SELECT can(ARRAY['pgr_dijkstra']);
+
+--V2.0
+SELECT has_function('pgr_dijkstra', ARRAY['text','integer','integer','boolean','boolean']);
+SELECT function_returns('pgr_dijkstra', ARRAY['text','integer','integer','boolean','boolean'],'setof pgr_costresult');
+PREPARE v20q00 AS
+SELECT pg_typeof(seq)::text AS seq_t, pg_typeof(id1)::text AS id1_t, pg_typeof(id2)::text AS id2_1, pg_typeof(cost)::text AS cost_t 
+    FROM ( 
+        SELECT * FROM pgr_dijkstra(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            2, 3, true, true) ) AS a
+    limit 1
+;
+PREPARE v20q01 AS
+SELECT  'integer'::text AS seq_t,'integer'::text AS id1_t,'integer'::text AS id2_1,'double precision'::text AS cost_t;
+SELECT set_eq('v20q00', 'v20q01','Expected returning, columns names & types');
+
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','bigint','integer','boolean','boolean']);
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','integer','bigint','boolean','boolean']);
+SELECT hasnt_function('pgr_dijkstra', ARRAY['text','bigint','bigint','boolean','boolean']);
+
+
+
+--V2.0
+--CHECKING INNER QUERY
+-- INTEGER, INTEGER, INTEGER, FLOAT, [FLOAT]
+
+PREPARE v20q1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, true, true);
+PREPARE v20q2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, true, false);
+PREPARE v20q3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v20q4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    2, 3, false, false);
+
+SELECT lives_ok('v20q1','with reverse cost 1');
+SELECT lives_ok('v20q2','with reverse cost 2');
+SELECT lives_ok('v20q3','with reverse cost 3');
+SELECT lives_ok('v20q4','with reverse cost 4');
+
+PREPARE v20q5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, true, false);
+
+PREPARE v20q6 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, false);
+
+PREPARE v20q7 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, true, true);
+
+PREPARE v20q8 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+
+SELECT lives_ok('v20q5','without reverse cost 1');
+SELECT lives_ok('v20q6','without reverse cost 2');
+SELECT throws_ok('v20q7',
+    'P0001','has_rcost set to true but reverse_cost not found',
+    'without reverse cost 3');
+SELECT throws_ok('v20q8',
+    'P0001','has_rcost set to true but reverse_cost not found',
+    'without reverse cost 3');
+
+
+--id only integer
+PREPARE v200id1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200id2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200id3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200id4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200id5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::TEXT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+
+SELECT throws_ok('v200id1',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because id is SMALLINT');
+SELECT throws_ok('v200id2',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because id is BIGINT');
+SELECT throws_ok('v200id3',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because id is REAL');
+SELECT throws_ok('v200id4',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because id is FLOAT');
+SELECT throws_ok('v200id5',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because id is TEXT');
+
+--source is only integer
+PREPARE v200s1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200s2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200s3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::REAL, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200s4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::FLOAT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200s5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::TEXT, target::INTEGER, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+
+SELECT throws_ok('v200s1',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because source is SMALLINT');
+SELECT throws_ok('v200s2',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because source is BIGINT');
+SELECT throws_ok('v200s3',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because source is REAL');
+SELECT throws_ok('v200s4',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because source is FLOAT');
+SELECT throws_ok('v200s5',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because id is TEXT');
+
+
+--target is only integer
+PREPARE v200t1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200t2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200t3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::FLOAT, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200t4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::REAL, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200t5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::TEXT, cost::FLOAT FROM edge_table',
+    2, 3, false, true);
+
+SELECT throws_ok('v200t1',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because target is SMALLINT');
+SELECT throws_ok('v200t2',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because target is BIGINT');
+SELECT throws_ok('v200t3',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because target is REAL');
+SELECT throws_ok('v200t4',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because target is FLOAT');
+SELECT throws_ok('v200t5',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because target is TEXT');
+
+-- cost
+PREPARE v200c1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200c2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER FROM edge_table',
+    2, 3, false, true);
+PREPARE v200c3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200c4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL FROM edge_table',
+    2, 3, false, true);
+PREPARE v200c5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::TEXT FROM edge_table',
+    2, 3, false, true);
+
+SELECT throws_ok('v200c1',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because cost is SMALLINT');
+SELECT throws_ok('v200c2',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because cost is INTEGER');
+SELECT throws_ok('v200c3',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because cost is BIGINT');
+SELECT throws_ok('v200c4',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because cost is REAL');
+SELECT throws_ok('v200c5',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because cost is TEXT');
+
+-- reverse_cost
+PREPARE v200r1 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200r2 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::INTEGER FROM edge_table',
+    2, 3, false, true);
+PREPARE v200r3 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::BIGINT FROM edge_table',
+    2, 3, false, true);
+PREPARE v200r4 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::REAL FROM edge_table',
+    2, 3, false, true);
+PREPARE v200r5 AS
+SELECT * FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::TEXT FROM edge_table',
+    2, 3, false, true);
+
+SELECT throws_ok('v200r1',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because reverse_cost is SMALLINT');
+SELECT throws_ok('v200r2',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because reverse_cost is INTEGER');
+SELECT throws_ok('v200r3',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because reverse_cost is BIGINT');
+SELECT throws_ok('v200r4',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because reverse_cost is REAL');
+SELECT throws_ok('v200r5',
+    'XX000','Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    'throws because reverse_cost is TEXT');
+
+    SELECT finish();
+    ROLLBACK;
diff --git a/src/dijkstra/test/pgtap/dijkstraVia-equivalenceDijkstra.test.sql b/src/dijkstra/test/pgtap/dijkstraVia-equivalenceDijkstra.test.sql
new file mode 100644
index 0000000..51eb3da
--- /dev/null
+++ b/src/dijkstra/test/pgtap/dijkstraVia-equivalenceDijkstra.test.sql
@@ -0,0 +1,207 @@
+
+\i setup.sql
+
+SELECT plan(8);
+
+
+
+--Examples for queries marked AS ``directed`` with ``cost`` and ``reverse_cost`` columns
+----------------------------------------------------------------------------------------
+PREPARE q1 AS
+WITH
+union_data AS (
+    (SELECT 1 AS path_id,* FROM pgr_dijkstra(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+            ARRAY[1], ARRAY[3]))
+
+    UNION
+
+    (SELECT 2 AS path_id,* FROM pgr_dijkstra(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+            ARRAY[3], ARRAY[11]
+))),
+data AS (SELECT * FROM union_data ORDER BY path_id, path_seq)
+
+SELECT ((row_number() over())) AS seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
+FROM data ORDER BY path_id, path_seq;
+
+PREPARE q2 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[1, 3, 11]
+    );
+
+PREPARE q3 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[1, 3, 11],
+        directed:=TRUE
+    );
+
+SELECT set_eq('q1', 'q2', '1: union of dijkstra is the same AS pgr_dijkstraVia');
+SELECT set_eq('q2', 'q3', '2: with directed:=TRUE is the same AS no flag');
+
+
+
+-- Examples for queries marked AS ``undirected`` with ``cost`` and ``reverse_cost`` columns
+----------------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------
+PREPARE q11 AS
+WITH
+union_data AS (
+    (SELECT 1 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+            ARRAY[1], ARRAY[3],
+            FALSE))
+
+    UNION
+
+    (SELECT 2 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+            ARRAY[3], ARRAY[11],
+            FALSE))),
+data AS (SELECT * FROM union_data ORDER BY path_id, path_seq)
+
+SELECT ((row_number() over())) AS seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
+FROM data ORDER BY path_id, path_seq;
+
+
+PREPARE q12 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[1, 3, 11],
+        directed:=FALSE
+    );
+
+SELECT set_eq('q11','q12', '3: union of dijkstra is the same AS pgr_dijkstraVia');
+
+
+-- Examples for queries marked AS ``directed`` with ``cost`` column
+----------------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------
+PREPARE q21 AS
+WITH
+union_data AS (
+    (SELECT 1 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost FROM edge_table',
+            ARRAY[1], ARRAY[3]))
+    UNION
+
+    (SELECT 2 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost FROM edge_table',
+            ARRAY[3], ARRAY[11]))),
+data AS (SELECT * FROM union_data ORDER BY path_id, path_seq)
+
+SELECT ((row_number() over())) AS seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
+FROM data ORDER BY path_id, path_seq;
+
+
+
+PREPARE q22 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[1, 3, 11]
+    );
+
+PREPARE q23 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[1, 3, 11],
+        directed:=TRUE
+    );
+
+
+SELECT set_eq('q21','q22', '4: union of dijkstra is the same AS pgr_dijkstraVia');
+SELECT set_eq('q22','q23', '5: with directed:=TRUE is the same AS no flag');
+
+
+-- Examples for queries marked AS ``undirected`` with ``cost`` column
+----------------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------
+PREPARE q31 AS
+WITH
+union_data AS (
+    (SELECT 1 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost FROM edge_table',
+            ARRAY[1], ARRAY[3],
+            FALSE))
+
+    UNION
+
+    (SELECT 2 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost FROM edge_table',
+            ARRAY[3], ARRAY[11],
+            directed:=FALSE))),
+data AS (SELECT * FROM union_data ORDER BY path_id, path_seq)
+
+SELECT ((row_number() over())) AS seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
+FROM data ORDER BY path_id, path_seq;
+
+
+PREPARE q32 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost
+    FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[1, 3, 11],
+        directed:=FALSE
+    );
+
+SELECT set_eq('q31','q32', '6: union of dijkstra is the same AS pgr_dijkstraVia');
+
+-- Equvalences between signatures
+------------------------------
+----------------------------------------------------------------------------------------
+PREPARE q41 AS
+WITH
+union_data AS (
+    (SELECT 1 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+            array[1], array[3]))
+    UNION
+    (SELECT 2 AS path_id, * FROM pgr_dijkstra(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+            array[3], array[11] ))),
+data AS (SELECT * FROM union_data ORDER BY path_id, path_seq)
+
+SELECT ((row_number() over())) AS seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
+FROM data ORDER BY path_id, path_seq;
+
+
+PREPARE q42 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost
+    FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[1, 3, 11]
+    );
+
+PREPARE q43 AS
+SELECT seq, path_id, path_seq, start_vid, end_vid, node,
+CASE WHEN edge = -2 THEN -1 ELSE edge END,
+    cost, agg_cost
+    FROM pgr_dijkstraVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[1, 3, 11],
+        directed:=TRUE
+    );
+
+SELECT set_eq('q41','q42', '7: union of dijkstra is the same AS pgr_dijkstraVia');
+SELECT set_eq('q42','q43', '8: with directed:=TRUE is the same AS no flag');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/dijkstraVia-types-check.sql b/src/dijkstra/test/pgtap/dijkstraVia-types-check.sql
new file mode 100644
index 0000000..92f5c31
--- /dev/null
+++ b/src/dijkstra/test/pgtap/dijkstraVia-types-check.sql
@@ -0,0 +1,249 @@
+
+\i setup.sql
+
+SET client_min_messages TO WARNING;
+
+SELECT plan(33);
+
+SELECT can(ARRAY['pgr_dijkstravia']);
+
+--V2.2+
+SELECT has_function('pgr_dijkstravia', ARRAY['text','anyarray','boolean','boolean','boolean']);
+SELECT function_returns('pgr_dijkstravia', ARRAY['text','anyarray','boolean','boolean','boolean'],'setof record');
+
+PREPARE v21q30 AS
+SELECT pg_typeof(seq)::text AS t1, pg_typeof(path_id)::text AS path_id, pg_typeof(path_seq)::text AS t2,
+    pg_typeof(start_vid)::text AS t3, pg_typeof(end_vid)::text AS t4,
+    pg_typeof(node)::text AS t5, pg_typeof(edge)::text AS t6,
+    pg_typeof(cost)::text AS t7, pg_typeof(agg_cost)::TEXT AS t8,
+    pg_typeof(route_agg_cost)::TEXT AS t9
+    FROM ( 
+        SELECT * FROM pgr_dijkstravia(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+            ARRAY[2,3,11]) ) AS a
+    limit 1
+;
+PREPARE v21q31 AS
+SELECT  'integer'::text AS t1,'integer'::text AS path_id, 'integer'::text AS t2,
+    'bigint'::text AS t3, 'bigint'::text AS t4,
+    'bigint'::text AS t5, 'bigint'::text AS t6,
+    'double precision'::text AS t7, 'double precision'::text AS t8,
+    'double precision'::text AS t9;
+
+-- testing
+SELECT set_eq('v21q30', 'v21q31','many to many: Expected returning, columns names & types');
+
+
+-- CHECKING WORKS WITH & WITOUT REVERSE COST
+
+PREPARE v20q1 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v20q3 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT, reverse_cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+
+SELECT lives_ok('v20q1','with reverse cost 1');
+SELECT lives_ok('v20q3','with reverse cost 3');
+
+PREPARE v20q5 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+
+PREPARE v20q6 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+
+
+SELECT lives_ok('v20q5','without reverse cost 1');
+SELECT lives_ok('v20q6','without reverse cost 2');
+
+-- V2.0
+-- CHECKING INNER QUERY
+-- ANY-INTEGER, ANY-INTEGER, ANY-INTEGER, ANY-NUMERIC, [ANY-NUMERIC]
+
+/* TEST USES THE EDGES_INPUT FOR 5 PARAMETERS */
+
+--id ANY-INTEGER
+PREPARE v200id1 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::SMALLINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200id2 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200id3 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::FLOAT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200id4 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::REAL, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200id5 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::TEXT, source::INTEGER, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+
+SELECT lives_ok('v200id1',
+    'lives because id is SMALLINT');
+SELECT lives_ok('v200id2',
+    'lives because id is BIGINT');
+SELECT throws_ok('v200id3',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is REAL');
+SELECT throws_ok('v200id4',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is FLOAT');
+SELECT throws_ok('v200id5',
+    'XX000','Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'throws because id is TEXT');
+
+--source is only integer
+PREPARE v200s1 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::SMALLINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200s2 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200s3 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::REAL, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200s4 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::FLOAT, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200s5 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::TEXT, target::INTEGER, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+
+SELECT lives_ok('v200s1',
+    'lives because source is SMALLINT');
+SELECT lives_ok('v200s2',
+    'lives because source is BIGINT');
+SELECT throws_ok('v200s3',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because source is REAL');
+SELECT throws_ok('v200s4',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because source is FLOAT');
+SELECT throws_ok('v200s5',
+    'XX000','Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'throws because id is TEXT');
+
+
+--target is only integer
+PREPARE v200t1 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::SMALLINT, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200t2 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200t3 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::FLOAT, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200t4 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::REAL, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200t5 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::TEXT, cost::FLOAT FROM edge_table',
+    ARRAY[2,3,11]);
+
+SELECT lives_ok('v200t1',
+    'lives because target is SMALLINT');
+SELECT lives_ok('v200t2',
+    'lives because target is BIGINT');
+SELECT throws_ok('v200t3',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is REAL');
+SELECT throws_ok('v200t4',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is FLOAT');
+SELECT throws_ok('v200t5',
+    'XX000','Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'throws because target is TEXT');
+
+-- cost
+PREPARE v200c1 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::SMALLINT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200c2 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200c3 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::BIGINT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200c4 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::REAL FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200c5 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::TEXT FROM edge_table',
+    ARRAY[2,3,11]);
+
+SELECT lives_ok('v200c1',
+    'lives because cost is SMALLINT');
+SELECT lives_ok('v200c2',
+    'lives because cost is INTEGER');
+SELECT lives_ok('v200c3',
+    'lives because cost is BIGINT');
+SELECT lives_ok('v200c4',
+    'lives because cost is REAL');
+SELECT throws_ok('v200c5',
+    'XX000','Unexpected Column ''cost'' type. Expected ANY-NUMERICAL',
+    'throws because cost is TEXT');
+
+-- reverse_cost
+PREPARE v200r1 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200r2 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::INTEGER FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200r3 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::BIGINT FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200r4 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::REAL FROM edge_table',
+    ARRAY[2,3,11]);
+PREPARE v200r5 AS
+SELECT * FROM pgr_dijkstravia(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost::TEXT FROM edge_table',
+    ARRAY[2,3,11]);
+
+SELECT lives_ok('v200r1',
+    'lives because reverse_cost is SMALLINT');
+SELECT lives_ok('v200r2',
+    'lives because reverse_cost is INTEGER');
+SELECT lives_ok('v200r3',
+    'lives because reverse_cost is BIGINT');
+SELECT lives_ok('v200r4',
+    'lives because reverse_cost is REAL');
+SELECT throws_ok('v200r5',
+    'XX000','Unexpected Column ''reverse_cost'' type. Expected ANY-NUMERICAL',
+    'throws because reverse_cost is TEXT');
+
+    SELECT finish();
+    ROLLBACK;
diff --git a/src/dijkstra/test/pgtap/issue-353.test.sql b/src/dijkstra/test/pgtap/issue-353.test.sql
new file mode 100644
index 0000000..0ceaf51
--- /dev/null
+++ b/src/dijkstra/test/pgtap/issue-353.test.sql
@@ -0,0 +1,31 @@
+\i setup.sql
+
+SELECT plan(3);
+
+PREPARE q1 AS
+SELECT * FROM pgr_dijkstra( 'select id, source, target, cost from edge_table',
+    array[2,7], array[5,6]);
+
+PREPARE q2 AS
+SELECT * FROM pgr_dijkstra( 'select id, source, target, cost from edge_table', 
+    array[2,7], array[17,18]);
+
+Prepare q3 AS
+(SELECT * FROM pgr_dijkstra( 'select id, source, target, cost from edge_table',
+        array[2,7], array[5,6]))
+UNION
+(SELECT * FROM pgr_dijkstra( 'select id, source, target, cost from edge_table', 
+        array[2,7], array[17,18]));
+
+PREPARE q4 AS
+SELECT * FROM pgr_dijkstra( 'select id, source, target, cost from edge_table', 
+    array[2,7], array[5,6,17,18]);
+
+SELECT is_empty( 'q2', '1');
+SELECT set_eq( 'q1', 'q3', '2');
+SELECT set_eq( 'q1', 'q4', '3');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/dijkstra/test/pgtap/oneToOne_equiv_manyToMany.test.sql b/src/dijkstra/test/pgtap/oneToOne_equiv_manyToMany.test.sql
new file mode 100644
index 0000000..1e8c8b8
--- /dev/null
+++ b/src/dijkstra/test/pgtap/oneToOne_equiv_manyToMany.test.sql
@@ -0,0 +1,55 @@
+
+\i setup.sql
+
+SELECT plan(1);
+
+
+create or REPLACE FUNCTION foo(cant INTEGER default 18 )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+sql_OneToOne TEXT;
+sql_Many TEXT;
+BEGIN
+
+    sql_OneToOne := '';
+    sql_Many := '';
+    FOR i IN 1.. cant LOOP
+        IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF;
+            sql_Many := sql_Many || i ; 
+    END LOOP;
+
+    FOR i IN 1.. cant LOOP
+        FOR j IN 1..cant LOOP
+
+            IF NOT (i = 1 AND j = 1) THEN
+                sql_OneToOne := sql_OneToOne ||' UNION ALL'; 
+            END IF;
+            sql_OneToOne := sql_OneToOne || 
+            '( SELECT seq, ' || i || 'as start_vid, ' || j || 'as end_vid, node, edge, cost, agg_cost  FROM pgr_dijkstra(
+                    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'', '
+                    || i || ', ' || j ||
+                    ') )';
+        END LOOP;
+    END LOOP;
+    sql_Many := 
+    ' SELECT path_seq,  start_vid,  end_vid, node, edge, cost, agg_cost FROM pgr_dijkstra(
+        ''SELECT id, source, target, cost, reverse_cost FROM edge_table'', '
+        || ' ARRAY[' || sql_Many  ||'], ARRAY[' || sql_Many ||
+        '] ) ';
+
+    sql_OneToOne := 'select * from ( ' || sql_OneToOne ||') AS a';
+
+    RETURN query SELECT set_eq( sql_OneToOne, sql_Many);
+    RETURN;
+END
+$BODY$
+language plpgsql;
+
+select * from foo();
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/oneToOne_equiv_manyToOne.test.sql b/src/dijkstra/test/pgtap/oneToOne_equiv_manyToOne.test.sql
new file mode 100644
index 0000000..a5fd055
--- /dev/null
+++ b/src/dijkstra/test/pgtap/oneToOne_equiv_manyToOne.test.sql
@@ -0,0 +1,54 @@
+
+\i setup.sql
+
+SELECT plan(18);
+
+
+create or REPLACE FUNCTION foo(cant INTEGER default 18 )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+sql_OneToOne TEXT;
+sql_Many TEXT;
+BEGIN
+
+    FOR i IN 1.. cant LOOP
+        sql_OneToOne := '';
+        sql_Many := '';
+        FOR j IN 1..cant LOOP
+
+            IF j > 1 THEN
+                sql_OneToOne := sql_OneToOne
+                ||' UNION ALL'; 
+                sql_Many := sql_Many ||', '; 
+    END IF;
+    sql_OneToOne := sql_OneToOne || 
+    '( SELECT seq, ' || j || 'as start_vid, ' || i || 'as end_vid, node, edge, cost, agg_cost  FROM pgr_dijkstra(
+            ''SELECT id, source, target, cost, reverse_cost FROM edge_table'', '
+            || j || ', ' || i ||
+            ') )';
+    sql_Many := sql_Many || j ; 
+END LOOP;
+sql_Many := 
+' SELECT path_seq, start_vid, ' || i || ' as end_vid, node, edge, cost, agg_cost FROM pgr_dijkstra(
+    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'', '
+    ' ARRAY[' || sql_Many || '], ' || i ||
+    ' ) ';
+
+sql_OneToOne := 'select * from ( ' || sql_OneToOne ||') AS a';
+
+RETURN query SELECT set_eq( sql_OneToOne, sql_Many);
+
+END LOOP;
+RETURN;
+END
+$BODY$
+language plpgsql;
+
+select * from foo();
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/oneToOne_equiv_oneToMany.test.sql b/src/dijkstra/test/pgtap/oneToOne_equiv_oneToMany.test.sql
new file mode 100644
index 0000000..9bd98b6
--- /dev/null
+++ b/src/dijkstra/test/pgtap/oneToOne_equiv_oneToMany.test.sql
@@ -0,0 +1,55 @@
+\i setup.sql
+
+SELECT plan(36);
+
+
+create or REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+sql_OneToOne TEXT;
+sql_OneToMany TEXT;
+BEGIN
+
+    sql_OneToMany := '';
+    FOR i IN 1.. cant LOOP
+        sql_OneToOne := '';
+        sql_OneToMany := '';
+        FOR j IN 1..cant LOOP
+
+            IF j > 1 THEN
+                sql_OneToOne := sql_OneToOne
+                ||' UNION ALL'; 
+                sql_OneToMany := sql_OneToMany ||', '; 
+    END IF;
+    sql_OneToOne := sql_OneToOne || 
+    '( SELECT seq, ' || i || 'as start_vid, ' || j || 'as end_vid, node, edge, cost, agg_cost  FROM pgr_dijkstra(
+            ''SELECT id, source, target, cost, reverse_cost FROM edge_table'', '
+            || i || ', ' || j ||
+            ', ' || flag || ' ) )';
+    sql_OneToMany := sql_OneToMany || j ; 
+END LOOP;
+sql_OneToMany := 
+' SELECT path_seq, ' || i || ' as start_vid,  end_vid, node, edge, cost, agg_cost FROM pgr_dijkstra(
+    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'', '
+    || i || ', ARRAY[' || sql_OneToMany ||
+    '], ' || flag || ' ) ';
+
+sql_OneToOne := 'select * from ( ' || sql_OneToOne ||') AS a';
+
+RETURN query SELECT set_eq( sql_OneToOne, sql_OneToMany);
+
+END LOOP;
+RETURN;
+END
+$BODY$
+language plpgsql;
+
+select * from foo(18, true);
+select * from foo(18, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/v2-equi-v3-directed-N-reverse.test.sql b/src/dijkstra/test/pgtap/v2-equi-v3-directed-N-reverse.test.sql
new file mode 100644
index 0000000..38a3bc6
--- /dev/null
+++ b/src/dijkstra/test/pgtap/v2-equi-v3-directed-N-reverse.test.sql
@@ -0,0 +1,111 @@
+
+\i setup.sql
+SET client_min_messages=WARNING;
+
+SELECT plan(11);
+
+-- all this queries are equivalent (give the same results)
+PREPARE q00 AS
+SELECT  id2 FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, true, false);
+
+PREPARE q0 AS
+SELECT  id1 FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, true, false);
+
+PREPARE q1 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, true, false);
+
+PREPARE q2 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost 
+    FROM edge_table ORDER BY id', 
+    7, 11, true);
+
+
+PREPARE q3 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT  id, source, target, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost 
+    FROM edge_table ORDER BY id', 
+    7, 11);
+
+PREPARE q4 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        7, 11);
+
+
+PREPARE q5 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost,
+        -1 as reverse_cost
+        FROM edge_table ORDER BY id', 
+        7, 11);
+
+PREPARE q6 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        ARRAY[7], 11);
+
+PREPARE q7 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        7, ARRAY[11]);
+
+PREPARE q8 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        ARRAY[7], ARRAY[11]);
+
+PREPARE q9 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    cost
+    FROM edge_table ORDER BY id',
+    7, 11, true, false);
+
+
+
+    SELECT set_eq( 'q0', ARRAY[7, 8, 5, 6, 11], '1');
+    SELECT set_eq( 'q00', ARRAY[6, 7, 8, 11, -1], '2');
+    SELECT set_eq( 'q1', 'q2', '3');
+    SELECT set_eq( 'q1', 'q3', '4');
+    SELECT set_eq( 'q1', 'q4', '5');
+    SELECT set_eq( 'q1', 'q5', '6');
+    SELECT set_eq( 'q1', 'q6', '7');
+    SELECT set_eq( 'q1', 'q7', '8');
+    SELECT set_eq( 'q1', 'q8', '9');
+    SELECT set_eq( 'q1', 'q9', '10');
+
+PREPARE q50 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::BIGINT, target::BIGINT,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, true, false);
+
+SELECT throws_ok('q50',
+    'XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '11');
+
+    -- Finish the tests and clean up.
+    SELECT * FROM finish();
+    ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/v2-equi-v3-directed-W-reverse.test.sql b/src/dijkstra/test/pgtap/v2-equi-v3-directed-W-reverse.test.sql
new file mode 100644
index 0000000..af881e5
--- /dev/null
+++ b/src/dijkstra/test/pgtap/v2-equi-v3-directed-W-reverse.test.sql
@@ -0,0 +1,118 @@
+
+\i setup.sql
+SET client_min_messages = WARNING;
+
+SELECT plan(11);
+
+-- all this queries are equivalent (give the same results)
+PREPARE q00 AS
+SELECT  id2 FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, true, true);
+
+PREPARE q0 AS
+SELECT  id1 FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, true, true);
+
+PREPARE q1 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, true, true);
+
+PREPARE q2 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT  id, source, target, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost, 
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost 
+    FROM edge_table ORDER BY id', 
+    11, 5, true);
+
+
+PREPARE q3 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT  id, source, target, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost, 
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost 
+    FROM edge_table ORDER BY id', 
+    11, 5);
+
+PREPARE q4 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, 
+        cost, 
+        reverse_cost 
+        FROM edge_table ORDER BY id', 
+        11, 5);
+
+
+PREPARE q5 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        11, 5);
+
+PREPARE q6 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        ARRAY[11], 5);
+
+PREPARE q7 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        11, ARRAY[5]);
+
+PREPARE q8 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        ARRAY[11], ARRAY[5]);
+
+PREPARE q9 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    cost, reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, true, true);
+
+
+
+    SELECT set_eq( 'q0', ARRAY[11, 12, 9, 6, 5], '1');
+    SELECT set_eq( 'q00', ARRAY[13, 15, 9, 8, -1], '2');
+    SELECT set_eq( 'q1', 'q2', '3');
+    SELECT set_eq( 'q1', 'q3', '4');
+    SELECT set_eq( 'q1', 'q4', '5');
+    SELECT set_eq( 'q1', 'q5', '6');
+    SELECT set_eq( 'q1', 'q6', '7');
+    SELECT set_eq( 'q1', 'q7', '8');
+    SELECT set_eq( 'q1', 'q8', '9');
+    SELECT set_eq( 'q1', 'q9', '10');
+
+PREPARE q50 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::BIGINT, source::BIGINT, target::BIGINT,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, true, true);
+
+SELECT throws_ok('q50',
+    'XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '11');
+
+    -- Finish the tests and clean up.
+    SELECT * FROM finish();
+    ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/v2-equi-v3-undirected-N-reverse.test.sql b/src/dijkstra/test/pgtap/v2-equi-v3-undirected-N-reverse.test.sql
new file mode 100644
index 0000000..1884039
--- /dev/null
+++ b/src/dijkstra/test/pgtap/v2-equi-v3-undirected-N-reverse.test.sql
@@ -0,0 +1,111 @@
+\i setup.sql
+SET client_min_messages = WARNING;
+
+
+SELECT plan(11);
+
+-- all this queries are equivalent (give the same results)
+PREPARE q00 AS
+SELECT  id2 FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, false, false);
+
+PREPARE q0 AS
+SELECT  id1 FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, false, false);
+
+PREPARE q1 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, false, false);
+
+PREPARE q2 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT  id, source, target, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost 
+    FROM edge_table ORDER BY id', 
+    7, 11, false);
+
+
+PREPARE q3 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT id, source, target, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost 
+    FROM edge_table ORDER BY id', 
+    7, 11, false);
+
+PREPARE q4 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        7, 11, false);
+
+
+PREPARE q5 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost,
+        -1 as reverse_cost
+        FROM edge_table ORDER BY id', 
+        7, 11, false);
+
+PREPARE q6 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        ARRAY[7], 11, false);
+
+PREPARE q7 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        7, ARRAY[11], false);
+
+PREPARE q8 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, cost 
+        FROM edge_table ORDER BY id', 
+        ARRAY[7], ARRAY[11], false);
+
+PREPARE q9 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER,
+    cost
+    FROM edge_table ORDER BY id',
+    7, 11, false, false);
+
+
+
+    SELECT set_eq( 'q0', ARRAY[7, 8, 5, 10, 11], '1');
+    SELECT set_eq( 'q00', ARRAY[6, 7, 10, 12, -1], '2');
+    SELECT set_eq( 'q1', 'q2', '3');
+    SELECT set_eq( 'q1', 'q3', '4');
+    SELECT set_eq( 'q1', 'q4', '5');
+    SELECT set_eq( 'q1', 'q5', '6');
+    SELECT set_eq( 'q1', 'q6', '7');
+    SELECT set_eq( 'q1', 'q7', '8');
+    SELECT set_eq( 'q1', 'q8', '9');
+    SELECT set_eq( 'q1', 'q9', '10');
+
+PREPARE q50 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT  id::INTEGER, source::BIGINT, target::BIGINT,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost
+    FROM edge_table ORDER BY id',
+    7, 11, false, false);
+
+SELECT throws_ok('q50',
+    'XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '11');
+
+    -- Finish the tests and clean up.
+    SELECT * FROM finish();
+    ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/v2-equi-v3-undirected-W-reverse.test.sql b/src/dijkstra/test/pgtap/v2-equi-v3-undirected-W-reverse.test.sql
new file mode 100644
index 0000000..73110fc
--- /dev/null
+++ b/src/dijkstra/test/pgtap/v2-equi-v3-undirected-W-reverse.test.sql
@@ -0,0 +1,109 @@
+\i setup.sql
+SET client_min_messages = WARNING;
+
+
+SELECT plan(10);
+
+-- all this queries are equivalent (give the same results)
+PREPARE q00 AS
+SELECT  id2 FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, false, true);
+
+PREPARE q0 AS
+SELECT  id1 FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, false, true);
+
+PREPARE q1 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, false, true);
+
+PREPARE q2 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT id, source, target, 
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost, 
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost 
+    FROM edge_table ORDER BY id', 
+    11, 5, false);
+
+
+PREPARE q4 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT id, source, target, 
+        cost, 
+        reverse_cost 
+        FROM edge_table ORDER BY id', 
+        11, 5, false);
+
+
+PREPARE q5 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        11, 5, false);
+
+PREPARE q6 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        ARRAY[11], 5, false);
+
+PREPARE q7 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        11, ARRAY[5], false);
+
+PREPARE q8 AS
+SELECT seq - 1, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+        'SELECT * 
+        FROM edge_table ORDER BY id', 
+        ARRAY[11], ARRAY[5], false);
+
+PREPARE q9 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER,
+    cost, reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, false, true);
+
+
+
+SELECT set_eq( 'q0', ARRAY[11, 6, 5], '1');
+SELECT set_eq( 'q00', ARRAY[11, 8, -1], '2');
+SELECT set_eq( 'q1', 'q2', '3');
+SELECT set_eq( 'q1', 'q4', '4');
+SELECT set_eq( 'q1', 'q5', '5');
+SELECT set_eq( 'q1', 'q6', '6');
+SELECT set_eq( 'q1', 'q7', '7');
+SELECT set_eq( 'q1', 'q8', '8');
+SELECT set_eq( 'q1', 'q9', '9');
+
+PREPARE q50 AS
+SELECT seq, id1, id2, cost FROM pgr_dijkstra(
+    'SELECT id AS id, source::BIGINT, target::BIGINT,
+    CASE WHEN cost<=0 THEN 999 ELSE cost END AS cost,
+    CASE WHEN reverse_cost<=0 THEN 999 ELSE reverse_cost END AS reverse_cost
+    FROM edge_table ORDER BY id',
+    11, 5, false, true);
+
+SELECT throws_ok('q50',
+    'XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '10');
+
+    -- Finish the tests and clean up.
+    SELECT * FROM finish();
+    ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/zero_one_edge_-1_rev.test.sql b/src/dijkstra/test/pgtap/zero_one_edge_-1_rev.test.sql
new file mode 100644
index 0000000..b2f5b62
--- /dev/null
+++ b/src/dijkstra/test/pgtap/zero_one_edge_-1_rev.test.sql
@@ -0,0 +1,233 @@
+\i setup.sql
+
+     SELECT plan(79);
+
+-- 0 edges tests
+
+SELECT is_empty(' SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id>18 ','1');
+
+-- directed graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '', 5, 6)', '2');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '',array[5], 6)','3');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '',array[5], array[6])', '4');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '', 5, array[6])', '5');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '', 5, 6, false)', '6');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '',array[5], 6, false)', '7');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '',array[5], array[6], false)', '8');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id>18 '', 5, array[6], false)', '9');
+
+
+-- 1 edges tests
+
+-- edge doesnt have start_vid = 5 but has end_vid = 6
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 9',
+'SELECT 9::BIGINT, 6::BIGINT, 9::BIGINT, true, true',
+'10: Edge does not have start_vid = 5 but has end_vid = 6');
+
+-- directed graph
+
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '', 5, 6)', '11');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '',array[5], 6)', '12');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '',array[5], array[6])', '13');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '', 5, array[6])', '14');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '', 5, 6, false)', '15');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '',array[5], 6, false)', '16');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '',array[5], array[6], false)', '17');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 9 '', 5, array[6], false)', '18');
+
+-- edge doesnt have end_vid = 6 but has start_vid = 5
+SELECT results_eq(
+'SELECT id, source, target, cost > 0, reverse_cost > 0 from edge_table where id = 4',
+'SELECT 4::BIGINT, 2::BIGINT, 5::BIGINT, true, true',
+'19: Edge doesnt have end_vid = 6 but has start_vid = 5');
+
+
+-- directed graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '', 5, 6)', '20');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '',array[5], 6)', '21');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '',array[5], array[6])', '22');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '', 5, array[6])', '23');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '', 5, 6, false)', '24');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '',array[5], 6, false)', '25');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '',array[5], array[6], false)', '26');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 4 '', 5, array[6], false)', '27');
+
+-- edge has start_vid 6 and end_vid 5
+
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0 from edge_table where id = 8',
+'SELECT 8::BIGINT, 5::BIGINT, 6::BIGINT, true, true',
+' 28: Edge has start_vid 6 and end_vid 5');
+
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '', 5, 6)', '29');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '',array[5], 6)', '30');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '',array[5], array[6])', '31');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '', 5, array[6])', '32');
+
+-- undirected graph
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '', 5, 6, false)', '33');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '',array[5], 6, false)', '34');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '',array[5], array[6], false)', '35');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 8 '', 5, array[6], false)', '36');
+
+
+-- edge has only vid = 6 but really only one edge is inserted the first one
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 5',
+'SELECT 5::BIGINT, 3::BIGINT, 6::BIGINT, true, false',
+'37: has only vid = 6 but really only one edge is inserted the first one');
+
+
+-- directed graph
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 5, 6)', '38');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[5], 6)', '39');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[5], array[6])', '40');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 5, array[6])', '41');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 6, 5)', '42');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[6], 5)', '43');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[6], array[5])', '44');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 6, array[5])', '45');
+
+-- undirected graph
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 5, 6, false)', '46');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[5], 6, false)', '47');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[5], array[6], false)', '48');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 5, array[6], false)', '49');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 6, 5, false)', '50');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[6], 5, false)', '51');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[6], array[5], false)', '52');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 6, array[5], false)', '53');
+
+
+-- only answer is from 4 to 3
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 3',
+'SELECT 3::BIGINT, 3::BIGINT, 4::BIGINT, false, true',
+'54: only answer is from 4 to 3');
+
+-- directed graph THIS doesnt get an answer
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 3, 4)', '55');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[3], 4)', '56');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[3], array[4])', '57');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 3, array[4])', '58');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 4, 3)', '59');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[4], 3)', '60');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[4], array[3])', '61');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 4, array[3])', '62');
+
+-- undirected graph allways gets an answer
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 3, 4, false)', '63');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[3], 4, false)', '64');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[3], array[4], false)', '65');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 3, array[4], false)', '66');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 4, 3, false)', '67');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[4], 3, false)', '68');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '',array[4], array[3], false)', '69');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 3 '', 4, array[3], false)', '70');
+
+-- The edge doesnt have any of them
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 3',
+'SELECT 3::BIGINT, 3::BIGINT, 4::BIGINT, false, true',
+'71: The edge doesnt have any of them');
+
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 5, 6)', '72');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[5], 6)', '73');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[5], array[6])', '74');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 5, array[6])', '75');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 6, 5, false)', '76');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[6], 5, false)', '77');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '',array[6], array[5], false)', '78');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, -1 AS reverse_cost  from edge_table where id = 5 '', 6, array[5], false)', '79');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/zero_one_edge_has_rev.test.sql b/src/dijkstra/test/pgtap/zero_one_edge_has_rev.test.sql
new file mode 100644
index 0000000..b53c28a
--- /dev/null
+++ b/src/dijkstra/test/pgtap/zero_one_edge_has_rev.test.sql
@@ -0,0 +1,233 @@
+\i setup.sql
+
+     SELECT plan(79);
+
+-- 0 edges tests
+
+SELECT is_empty(' SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id>18 ','1');
+
+-- directed graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '', 5, 6)', '2');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '',array[5], 6)','3');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '',array[5], array[6])', '4');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '', 5, array[6])', '5');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '', 5, 6, false)', '6');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '',array[5], 6, false)', '7');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '',array[5], array[6], false)', '8');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id>18 '', 5, array[6], false)', '9');
+
+
+-- 1 edges tests
+
+-- edge doesnt have start_vid = 5 but has end_vid = 6
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 9',
+'SELECT 9::BIGINT, 6::BIGINT, 9::BIGINT, true, true',
+'10: Edge does not have start_vid = 5 but has end_vid = 6');
+
+-- directed graph
+
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '', 5, 6)', '11');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '',array[5], 6)', '12');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '',array[5], array[6])', '13');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '', 5, array[6])', '14');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '', 5, 6, false)', '15');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '',array[5], 6, false)', '16');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '',array[5], array[6], false)', '17');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 9 '', 5, array[6], false)', '18');
+
+-- edge doesnt have end_vid = 6 but has start_vid = 5
+SELECT results_eq(
+'SELECT id, source, target, cost > 0, reverse_cost > 0 from edge_table where id = 4',
+'SELECT 4::BIGINT, 2::BIGINT, 5::BIGINT, true, true',
+'19: Edge doesnt have end_vid = 6 but has start_vid = 5');
+
+
+-- directed graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '', 5, 6)', '20');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '',array[5], 6)', '21');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '',array[5], array[6])', '22');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '', 5, array[6])', '23');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '', 5, 6, false)', '24');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '',array[5], 6, false)', '25');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '',array[5], array[6], false)', '26');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 4 '', 5, array[6], false)', '27');
+
+-- edge has start_vid 6 and end_vid 5
+
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0 from edge_table where id = 8',
+'SELECT 8::BIGINT, 5::BIGINT, 6::BIGINT, true, true',
+' 28: Edge has start_vid 6 and end_vid 5');
+
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '', 5, 6)', '29');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '',array[5], 6)', '30');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '',array[5], array[6])', '31');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '', 5, array[6])', '32');
+
+-- undirected graph
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '', 5, 6, false)', '33');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '',array[5], 6, false)', '34');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '',array[5], array[6], false)', '35');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 8 '', 5, array[6], false)', '36');
+
+
+-- edge has only vid = 6 but really only one edge is inserted the first one
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 5',
+'SELECT 5::BIGINT, 3::BIGINT, 6::BIGINT, true, false',
+'37: has only vid = 6 but really only one edge is inserted the first one');
+
+
+-- directed graph
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 5, 6)', '38');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[5], 6)', '39');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[5], array[6])', '40');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 5, array[6])', '41');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 6, 5)', '42');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[6], 5)', '43');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[6], array[5])', '44');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 6, array[5])', '45');
+
+-- undirected graph
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 5, 6, false)', '46');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[5], 6, false)', '47');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[5], array[6], false)', '48');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 5, array[6], false)', '49');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 6, 5, false)', '50');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[6], 5, false)', '51');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[6], array[5], false)', '52');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 6, array[5], false)', '53');
+
+
+-- only answer is from 4 to 3
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 3',
+'SELECT 3::BIGINT, 3::BIGINT, 4::BIGINT, false, true',
+'54: only answer is from 4 to 3');
+
+-- directed graph THIS doesnt get an answer
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 3, 4)', '55');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[3], 4)', '56');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[3], array[4])', '57');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 3, array[4])', '58');
+
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 4, 3)', '59');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[4], 3)', '60');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[4], array[3])', '61');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 4, array[3])', '62');
+
+-- undirected graph allways gets an answer
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 3, 4, false)', '63');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[3], 4, false)', '64');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[3], array[4], false)', '65');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 3, array[4], false)', '66');
+
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 4, 3, false)', '67');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[4], 3, false)', '68');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '',array[4], array[3], false)', '69');
+SELECT isnt_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 3 '', 4, array[3], false)', '70');
+
+-- The edge doesnt have any of them
+SELECT results_eq('
+SELECT id, source, target, cost > 0, reverse_cost > 0  from edge_table where id = 3',
+'SELECT 3::BIGINT, 3::BIGINT, 4::BIGINT, false, true',
+'71: The edge doesnt have any of them');
+
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 5, 6)', '72');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[5], 6)', '73');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[5], array[6])', '74');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 5, array[6])', '75');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 6, 5, false)', '76');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[6], 5, false)', '77');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '',array[6], array[5], false)', '78');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost, reverse_cost  from edge_table where id = 5 '', 6, array[5], false)', '79');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/pgtap/zero_one_edge_no_rev.test.sql b/src/dijkstra/test/pgtap/zero_one_edge_no_rev.test.sql
new file mode 100644
index 0000000..0259d3c
--- /dev/null
+++ b/src/dijkstra/test/pgtap/zero_one_edge_no_rev.test.sql
@@ -0,0 +1,233 @@
+\i setup.sql
+
+     SELECT plan(79);
+
+-- 0 edges tests
+
+SELECT is_empty(' SELECT id, source, target, cost > 0  from edge_table where id > 18 ','1');
+
+-- directed graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '', 5, 6)', '2');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '',array[5], 6)','3');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '',array[5], array[6])', '4');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '', 5, array[6])', '5');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '', 5, 6, false)', '6');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '',array[5], 6, false)', '7');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '',array[5], array[6], false)', '8');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id > 18 '', 5, array[6], false)', '9');
+
+
+-- 1 edges tests
+
+-- edge doesnt have start_vid = 5 but has end_vid = 6
+SELECT results_eq('
+SELECT id, source, target, cost > 0  from edge_table where id = 9',
+'SELECT 9::BIGINT, 6::BIGINT, 9::BIGINT, true',
+'10: Edge does not have start_vid = 5 but has end_vid = 6');
+
+-- directed graph
+
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '', 5, 6)', '11');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '',array[5], 6)', '12');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '',array[5], array[6])', '13');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '', 5, array[6])', '14');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '', 5, 6, false)', '15');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '',array[5], 6, false)', '16');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '',array[5], array[6], false)', '17');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 9 '', 5, array[6], false)', '18');
+
+-- edge doesnt have end_vid = 6 but has start_vid = 5
+SELECT results_eq(
+'SELECT id, source, target, cost > 0 from edge_table where id = 4',
+'SELECT 4::BIGINT, 2::BIGINT, 5::BIGINT, true',
+'19: Edge doesnt have end_vid = 6 but has start_vid = 5');
+
+
+-- directed graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '', 5, 6)', '20');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '',array[5], 6)', '21');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '',array[5], array[6])', '22');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '', 5, array[6])', '23');
+
+-- undirected graph
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '', 5, 6, false)', '24');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '',array[5], 6, false)', '25');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '',array[5], array[6], false)', '26');
+SELECT is_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 4 '', 5, array[6], false)', '27');
+
+-- edge has start_vid 6 and end_vid 5
+
+SELECT results_eq('
+SELECT id, source, target, cost > 0 from edge_table where id = 8',
+'SELECT 8::BIGINT, 5::BIGINT, 6::BIGINT, true',
+' 28: Edge has start_vid 6 and end_vid 5');
+
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '', 5, 6)', '29');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '',array[5], 6)', '30');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '',array[5], array[6])', '31');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '', 5, array[6])', '32');
+
+-- undirected graph
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '', 5, 6, false)', '33');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '',array[5], 6, false)', '34');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '',array[5], array[6], false)', '35');
+SELECT isnt_empty('
+SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 8 '', 5, array[6], false)', '36');
+
+
+-- edge has only vid = 6 but really only one edge is inserted the first one
+SELECT results_eq('
+SELECT id, source, target, cost > 0  from edge_table where id = 5',
+'SELECT 5::BIGINT, 3::BIGINT, 6::BIGINT, true',
+'37: has only vid = 6 but really only one edge is inserted the first one');
+
+
+-- directed graph
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 5, 6)', '38');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[5], 6)', '39');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[5], array[6])', '40');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 5, array[6])', '41');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 6, 5)', '42');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[6], 5)', '43');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[6], array[5])', '44');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 6, array[5])', '45');
+
+-- undirected graph
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 5, 6, false)', '46');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[5], 6, false)', '47');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[5], array[6], false)', '48');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 5, array[6], false)', '49');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 6, 5, false)', '50');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[6], 5, false)', '51');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[6], array[5], false)', '52');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 6, array[5], false)', '53');
+
+
+-- only answer never has answer becuase cost < 0
+SELECT results_eq('
+SELECT id, source, target, cost > 0  from edge_table where id = 3',
+'SELECT 3::BIGINT, 3::BIGINT, 4::BIGINT, false',
+'54: only answer is from 4 to 3');
+
+-- directed graph doesnt get an answer
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 3, 4)', '55');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[3], 4)', '56');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[3], array[4])', '57');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 3, array[4])', '58');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 4, 3)', '59');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[4], 3)', '60');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[4], array[3])', '61');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 4, array[3])', '62');
+
+-- undirected graph allways gets an answer
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 3, 4, false)', '63');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[3], 4, false)', '64');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[3], array[4], false)', '65');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 3, array[4], false)', '66');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 4, 3, false)', '67');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[4], 3, false)', '68');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '',array[4], array[3], false)', '69');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 3 '', 4, array[3], false)', '70');
+
+-- The edge doesnt have any of them
+SELECT results_eq('
+SELECT id, source, target, cost > 0  from edge_table where id = 3',
+'SELECT 3::BIGINT, 3::BIGINT, 4::BIGINT, false',
+'71: The edge doesnt have any of them');
+
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 5, 6)', '72');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[5], 6)', '73');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[5], array[6])', '74');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 5, array[6])', '75');
+
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 6, 5, false)', '76');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[6], 5, false)', '77');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '',array[6], array[5], false)', '78');
+SELECT is_empty('
+    SELECT * from pgr_dijkstra(''SELECT id, source, target, cost  from edge_table where id = 5 '', 6, array[5], false)', '79');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/dijkstra/test/sampledata.data b/src/dijkstra/test/sampledata.data
deleted file mode 100644
index db6f2cb..0000000
--- a/src/dijkstra/test/sampledata.data
+++ /dev/null
@@ -1,59 +0,0 @@
-
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              SAMPLE DATA                
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-drop table if exists edge_table;
-
-CREATE TABLE edge_table (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-select pgr_createTopology('edge_table',0.001);
-
-drop table if exists vertex_table;
-CREATE TABLE vertex_table (
-    id serial,
-    x double precision,
-    y double precision
-);
-
-INSERT INTO vertex_table VALUES
-        (1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
-        (8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
diff --git a/src/dijkstra/test/test.conf b/src/dijkstra/test/test.conf
index 8f2c321..84ddc0f 100644
--- a/src/dijkstra/test/test.conf
+++ b/src/dijkstra/test/test.conf
@@ -3,25 +3,21 @@
 %main::tests = (
     'any' => {
         'comment' => 'Dijkstra test for any versions.',
-        'data' => ['dijkstra.data', 'sampledata.data'],
+        'data' => [ ],
         'tests' => [qw(
-zero_one_edge_has_rev
-zero_one_edge_no_rev
-zero_one_edge_-1_rev
-1_to_many
-many_to_1
-many_to_many
-dijkstra-v2 
-dijkstra-v3 
-dijkstra-undi-00 
-dijkstra-undi-01 
-dijkstra-dir-00 
-dijkstra-dir-01 
-issue-353
-)],
-        'nottesting' => [qw(
-)]
-        },
+
+            dijkstra-v2
+            doc-pgr_dijkstra
+            doc-pgr_dijkstraVia
+            doc-pgr_dijkstraCost
+            many_to_1
+            )],
+        'documentation' => [qw(
+            doc-pgr_dijkstra
+            doc-pgr_dijkstraVia
+            doc-pgr_dijkstraCost
+            )]
+    },
 
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/dijkstra/test/zero_one_edge_-1_rev.result b/src/dijkstra/test/zero_one_edge_-1_rev.result
deleted file mode 100644
index dcad1f7..0000000
--- a/src/dijkstra/test/zero_one_edge_-1_rev.result
+++ /dev/null
@@ -1,20 +0,0 @@
--- 0 edges tests
--- directed graph
--- undirected graph
--- 1 edges tests
--- edge doesnt have source
-4|2|5|1|-1
--- directed graph
--- undirected graph
--- edge doesnt have target
-3|3|4|-1|-1
--- directed graph
--- undirected graph
--- edge has both
-3|3|4|-1|-1
--- directed graph
--- undirected graph
--- edge has both
-2|2|3|-1|-1
--- directed graph
--- undirected graph
diff --git a/src/dijkstra/test/zero_one_edge_-1_rev.test.sql b/src/dijkstra/test/zero_one_edge_-1_rev.test.sql
deleted file mode 100644
index 0cc09c2..0000000
--- a/src/dijkstra/test/zero_one_edge_-1_rev.test.sql
+++ /dev/null
@@ -1,80 +0,0 @@
-
-\qecho -- 0 edges tests
-
-select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id>18 ',3, array[2], false);
-
-
-\qecho -- 1 edges tests
-
-\qecho -- edge doesnt have source
-select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 4 ',3, array[2], false);
-
-\qecho -- edge doesnt have target
-select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3 ',3, array[2], false);
-
-\qecho -- edge has both
-select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',3, array[2], false);
-
-\qecho -- edge has both
-select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',2, 3);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[2], 3);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[2], array[3]);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',2, array[3]);
-
-\qecho -- undirected graph
-
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',2, 3, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[2], 3, false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',array[2], array[3], false);
-select * from pgr_dijkstra('select id, source, target, cost, -1 as reverse_cost  from edge_table where id = 2 ',2, array[3], false);
diff --git a/src/dijkstra/test/zero_one_edge_has_rev.result b/src/dijkstra/test/zero_one_edge_has_rev.result
deleted file mode 100644
index 9a58e94..0000000
--- a/src/dijkstra/test/zero_one_edge_has_rev.result
+++ /dev/null
@@ -1,44 +0,0 @@
--- 0 edges tests
--- directed graph
--- undirected graph
--- 1 edges tests
--- edge doesnt have source
-4|2|5|1|1
--- directed graph
--- undirected graph
--- edge doesnt have target
-3|3|4|-1|1
--- directed graph
--- undirected graph
--- edge has both
-3|3|4|-1|1
--- directed graph
-1|1|3|2|1|0
-2|2|2|-1|0|1
-1|1|3|3|2|1|0
-2|2|3|2|-1|0|1
-1|1|3|2|3|2|1|0
-2|2|3|2|2|-1|0|1
-1|1|2|3|2|1|0
-2|2|2|2|-1|0|1
--- undirected graph
-1|1|3|2|1|0
-2|2|2|-1|0|1
-1|1|3|3|2|1|0
-2|2|3|2|-1|0|1
-1|1|3|2|3|2|1|0
-2|2|3|2|2|-1|0|1
-1|1|2|3|2|1|0
-2|2|2|2|-1|0|1
--- edge has both
-3|3|4|-1|1
--- directed graph
--- undirected graph
-1|1|2|2|1|0
-2|2|3|-1|0|1
-1|1|2|2|2|1|0
-2|2|2|3|-1|0|1
-1|1|2|3|2|2|1|0
-2|2|2|3|3|-1|0|1
-1|1|3|2|2|1|0
-2|2|3|3|-1|0|1
diff --git a/src/dijkstra/test/zero_one_edge_has_rev.test.sql b/src/dijkstra/test/zero_one_edge_has_rev.test.sql
deleted file mode 100644
index 73076c4..0000000
--- a/src/dijkstra/test/zero_one_edge_has_rev.test.sql
+++ /dev/null
@@ -1,80 +0,0 @@
-
-\qecho -- 0 edges tests
-
-select id, source, target, cost, reverse_cost  from edge_table where id>18;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id>18 ',3, array[2], false);
-
-
-\qecho -- 1 edges tests
-
-\qecho -- edge doesnt have source
-select id, source, target, cost, reverse_cost  from edge_table where id = 4;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 4 ',3, array[2], false);
-
-\qecho -- edge doesnt have target
-select id, source, target, cost, reverse_cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 3 ',3, array[2], false);
-
-\qecho -- edge has both
-select id, source, target, cost, reverse_cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',3, array[2], false);
-
-\qecho -- edge has both
-select id, source, target, cost, reverse_cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',2, 3);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[2], 3);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[2], array[3]);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',2, array[3]);
-
-\qecho -- undirected graph
-
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',2, 3, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[2], 3, false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',array[2], array[3], false);
-select * from pgr_dijkstra('select id, source, target, cost, reverse_cost  from edge_table where id = 2 ',2, array[3], false);
diff --git a/src/dijkstra/test/zero_one_edge_no_rev.result b/src/dijkstra/test/zero_one_edge_no_rev.result
deleted file mode 100644
index 31a2aa6..0000000
--- a/src/dijkstra/test/zero_one_edge_no_rev.result
+++ /dev/null
@@ -1,20 +0,0 @@
--- 0 edges tests
--- directed graph
--- undirected graph
--- 1 edges tests
--- edge doesnt have source
-4|2|5|1
--- directed graph
--- undirected graph
--- edge doesnt have target
-3|3|4|-1
--- directed graph
--- undirected graph
--- edge has both
-3|3|4|-1
--- directed graph
--- undirected graph
--- edge has both
-2|2|3|-1
--- directed graph
--- undirected graph
diff --git a/src/dijkstra/test/zero_one_edge_no_rev.test.sql b/src/dijkstra/test/zero_one_edge_no_rev.test.sql
deleted file mode 100644
index 6c758eb..0000000
--- a/src/dijkstra/test/zero_one_edge_no_rev.test.sql
+++ /dev/null
@@ -1,80 +0,0 @@
-
-\qecho -- 0 edges tests
-
-select id, source, target, cost  from edge_table where id>18;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id>18 ',3, array[2], false);
-
-
-\qecho -- 1 edges tests
-
-\qecho -- edge doesnt have source
-select id, source, target, cost  from edge_table where id = 4;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 4 ',3, array[2], false);
-
-\qecho -- edge doesnt have target
-select id, source, target, cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 3 ',3, array[2], false);
-
-\qecho -- edge has both
-select id, source, target, cost  from edge_table where id = 3;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',3, 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[3], 2);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[3], array[2]);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',3, array[2]);
-
-\qecho -- undirected graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',3, 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[3], 2, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[3], array[2], false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',3, array[2], false);
-
-\qecho -- edge has both
-select id, source, target, cost  from edge_table where id = 2;
-
-\qecho -- directed graph
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',2, 3);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[2], 3);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[2], array[3]);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',2, array[3]);
-
-\qecho -- undirected graph
-
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',2, 3, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[2], 3, false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',array[2], array[3], false);
-select * from pgr_dijkstra('select id, source, target, cost  from edge_table where id = 2 ',2, array[3], false);
diff --git a/src/dijkstra/tester/boost_wrapper.cpp b/src/dijkstra/tester/boost_wrapper.cpp
index 3eddbef..22ee8bf 100644
--- a/src/dijkstra/tester/boost_wrapper.cpp
+++ b/src/dijkstra/tester/boost_wrapper.cpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 /*
  * Shortest path algorithm for PostgreSQL
  *
diff --git a/src/dijkstra/tester/dijkstra.h b/src/dijkstra/tester/dijkstra.h
index ed79dc5..ca9854f 100644
--- a/src/dijkstra/tester/dijkstra.h
+++ b/src/dijkstra/tester/dijkstra.h
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 /*
  * Shortest path algorithm for PostgreSQL
  *
diff --git a/src/dijkstra/tester/testit.c b/src/dijkstra/tester/testit.c
index 201118a..05142f4 100644
--- a/src/dijkstra/tester/testit.c
+++ b/src/dijkstra/tester/testit.c
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #include <stdlib.h>
 #include <stdio.h>
 #include <limits.h>
diff --git a/src/driving_distance/doc/dd_alphashape.rst b/src/driving_distance/doc/dd_alphashape.rst
deleted file mode 100644
index c4c5d04..0000000
--- a/src/driving_distance/doc/dd_alphashape.rst
+++ /dev/null
@@ -1,125 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_alphashape:
-
-pgr_alphaShape
-===============================================================================
-
-.. index:: 
-	single: pgr_alphashape(text,float8)
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_alphaShape`` — Core function for alpha shape computation.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-Returns a table with (x, y) rows that describe the vertices of an alpha shape.
-
-.. code-block:: sql
-
-	table() pgr_alphaShape(text sql [, float8 alpha]);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: ``text`` a SQL query, which should return a set of rows with the following columns:
-
-    .. code-block:: sql
-
-        SELECT id, x, y FROM vertex_table
-
-    :id: ``int4`` identifier of the vertex
-    :x: ``float8`` x-coordinate
-    :y: ``float8`` y-coordinate
-
-:alpha: (optional) ``float8`` alpha value. If specified alpha value equals 0 (default), then optimal alpha value is used.
-    For more information, see `CGAL - 2D Alpha Shapes <http://doc.cgal.org/latest/Alpha_shapes_2/group__PkgAlphaShape2.html>`_.
-
-Returns a vertex record for each row:
-
-:x: x-coordinate
-:y: y-coordinate
-
-If a result includes multiple outer/inner rings, return those with separator row (x=NULL and y=NULL).
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-* Added alpha argument with default 0 (use optimal value) in version 2.1.0
-* Supported to return multiple outer/inner ring coordinates with separator row (x=NULL and y=NULL) in version 2.1.0
-
-Examples
--------------------------------------------------------------------------------
-In the alpha shape code we have no way to control the order of the points so the actual output you might get could be similar but different. The simple query is followed by a more complex one that constructs a polygon and computes the areas of it. This should be the same as the result on your system. We leave the details of the complex query to the reader as an exercise if they wish to decompose it into understandable pieces or to just copy and paste it into a SQL window to run.
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table');
-
-     x | y 
-    ---+---
-     2 | 4
-     0 | 2
-     2 | 0
-     4 | 1
-     4 | 2
-     4 | 3
-    (6 rows)
-
-    SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
-    FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
-    (SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
-    FROM pgr_alphaShape('SELECT id, x, y FROM vertex_table')
-    ) AS a) AS foo;
-
-     st_area
-    ---------
-       10.00
-    (1 row)
-
-
-    SELECT * FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr');
-      x  |  y  
-    -----+-----
-       2 |   4
-     0.5 | 3.5
-       0 |   2
-       2 |   0
-       4 |   1
-       4 |   2
-       4 |   3
-     3.5 |   4
-    (8 rows)
-
-    SELECT round(ST_Area(ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline))))::numeric, 2) AS st_area
-    FROM (SELECT ST_MakeLine(points ORDER BY id) AS openline FROM
-    (SELECT ST_MakePoint(x, y) AS points, row_number() over() AS id
-    FROM pgr_alphaShape('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y FROM edge_table_vertices_pgr')
-    ) AS a) AS foo;
-
-     st_area
-    ---------
-       11.75
-    (1 row)
-
- 
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`pgr_driving_distance` - Driving Distance
-* :ref:`pgr_points_as_polygon` - Polygon around set of points
diff --git a/src/driving_distance/doc/dd_driving_distance_v2.rst b/src/driving_distance/doc/dd_driving_distance_v2.rst
deleted file mode 100644
index 7c71a6c..0000000
--- a/src/driving_distance/doc/dd_driving_distance_v2.rst
+++ /dev/null
@@ -1,125 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_driving_distance_v2:
-
-pgr_drivingDistance (V2.0)
-===============================================================================
-
-.. index:: 
-	single: drivingDistance(text,integer,double precision,boolean,boolean) -- deprecated
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_drivingDistance`` - Returns the driving distance from a start node.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-This function computes a Dijkstra shortest path solution them extracts the cost to get to each node in the network from the starting node. Using these nodes and costs it is possible to compute constant drive time polygons. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a list of accessible points.
-
-.. code-block:: sql
-
-	pgr_costResult[] pgr_drivingDistance(text sql, integer source, double precision distance,
-                                      boolean directed, boolean has_rcost);
-
-.. warning:: This signature is being deprecated on version 2.1, Please use it
-             without the ``has_rcost`` flag instead:
-
-             ``pgr_drivingDistance(sql, start_v, distance, directed)``
-
-             See :ref:`pgr_driving_distance_v3`
-
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT id, source, target, cost [,reverse_cost] FROM edge_table
-
-
-	:id: ``int4`` identifier of the edge
-	:source: ``int4`` identifier of the source vertex
-	:target: ``int4`` identifier of the target vertex
-	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:distance: ``float8`` value in edge cost units (not in projection units - they might be different).
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   node ID
-:id2:   edge ID (this is probably not a useful item)
-:cost:  cost to get to this node ID
-
-.. warning::
-
-	You must reconnect to the database after ``CREATE EXTENSION pgrouting``. Otherwise the function will return ``Error computing path: std::bad_alloc``.
-
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-	SELECT seq, id1 AS node, cost 
-		FROM pgr_drivingDistance(
-			'SELECT id, source, target, cost FROM edge_table',
-			7, 1.5, false, false
-		);
-
-	 seq | node | cost 
-	-----+------+------
-	   0 |    7 |    0
-	   1 |    8 |    1
-	(2 rows)
-
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-	SELECT seq, id1 AS node, cost 
-		FROM pgr_drivingDistance(
-			'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-			7, 1.5, true, true
-		);
-
-	 seq | node | cost 
-	-----+------+------
-	   0 |    7 |    0
-	   1 |    8 |    1
-	(5 rows)
-
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`pgr_alphashape` - Alpha shape computation
-* :ref:`pgr_points_as_polygon` - Polygon around set of points
diff --git a/src/driving_distance/doc/dd_driving_distance_v3.rst b/src/driving_distance/doc/dd_driving_distance_v3.rst
deleted file mode 100644
index 78b4dd1..0000000
--- a/src/driving_distance/doc/dd_driving_distance_v3.rst
+++ /dev/null
@@ -1,475 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_driving_distance_v3:
-
-pgr_drivingDistance
-===============================================================================
-
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_drivingDistance`` - Returns the driving distance from a start node.
-
-
-.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
-   :target: http://www.boost.org/libs/graph
-
-   Boost Graph Inside
-
-Synopsis
--------------------------------------------------------------------------------
-
-Using Dijkstra algorithm, extracts all the nodes that have costs less than or equal to the value ``distance``.
-The edges extracted will conform the corresponding spanning tree.
-
-.. index::
-	single: drivingDistance(edges_sql, start_vid, distance)
-
-.. rubric:: The minimal signature:
-
-.. code-block:: sql
-
-   pgr_drivingDistance(sql text, start_v bigint, distance float8)
-     RETURNS SET OF (seq, node, edge, cost, agg_cost)
-
-
-.. index::
-	single: drivingDistance(edges_sql, start_vid, distance, directed)
-
-.. rubric:: Driving Distance from a single starting point:
-
-.. code-block:: sql
-
-   pgr_drivingDistance(sql text, start_vid bigint, distance float8, directed boolean)
-     RETURNS SET OF (seq, node, edge, cost, agg_cost)
-
-
-.. index::
-	single: drivingDistance(edges_sql, start_vids, distance, directed, equiCost)
-
-.. rubric:: Driving Distance from a multiple starting points:
-
-.. code-block:: sql
-
-   pgr_drivingDistance(sql text, start_vids anyarray, distance float8,
-         directed boolean default true,
-         equicost boolean default false)
-     RETURNS SET OF (seq, start_vid, node, edge, cost, agg_cost)
-
-Description of the SQL query
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-        .. code-block:: sql
-
-                SELECT id, source, target, cost [,reverse_cost] FROM edge_table
-
-
-        :id: ``ANY-INTEGER`` identifier of the edge.
-        :source: ``ANY-INTEGER`` identifier of the source vertex of the edge.
-        :target: ``ANY-INTEGER`` identifier of the target vertex of the edge.
-        :cost: ``ANY-NUMERICAL`` value of the edge traversal cost. A negative cost will prevent the edge (``source``, ``target``) from being inserted in the graph.
-        :reverse_cost: ``ANY-NUMERICAL`` (optional) the value for the reverse traversal of the edge. A negative cost will prevent the edge (``target``, ``source``) from being inserted in the graph.
-
-Where:
-
-:ANY-INTEGER: smallint, int, bigint
-:ANY-NUMERICAL: smallint, int, bigint, real, float
-
-Description of the parameters of the signatures
--------------------------------------------------------------------------------
-
-:sql: SQL query as decribed above.
-:start_v: ``BIGINT`` id of the starting vertex.
-:start_v: ``array[ANY-INTEGER]`` array of id of starting vertices.
-:distance: ``FLOAT`` Upper limit for the inclusion of the node in the result.
-:directed: ``boolean`` (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
-:equicost: ``boolean`` (optional). When ``true`` the node will only appear in the closest ``start_v`` list.  Default is ``false`` which resembles several calls using the single starting point signatures. Tie brakes are arbitrarely.
-
-
-Description of the return values
--------------------------------------------------------------------------------
-
-Returns set of ``(seq [, start_v], node, edge, cost, agg_cost)``
-
-:seq: ``INT`` row sequence.
-:start_v: ``BIGINT`` id of the starting vertex. Used when multiple starting vetrices are in the query.
-:node: ``BIGINT`` id of the node within the limits from ``start_v``.
-:edge: ``BIGINT`` id of the edge used to arrive to ``node``. ``0`` when the ``node`` is the ``start_v``.
-:cost: ``FLOAT`` cost to traverse ``edge``.
-:agg_cost:  ``FLOAT`` total cost from ``start_v`` to ``node``.
-
-
-
-Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
---------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig1`
-
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        2, 3
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    1 |    1 |    1 |        1
-       2 |    2 |   -1 |    0 |        0
-       3 |    5 |    4 |    1 |        1
-       4 |    6 |    8 |    1 |        2
-       5 |   11 |   12 |    1 |        3
-       6 |   10 |   10 |    1 |        2
-       7 |   13 |   14 |    1 |        3
-       8 |    9 |    9 |    1 |        3
-       9 |    7 |    6 |    1 |        3
-      10 |    8 |    7 |    1 |        2
-    (10 rows)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        13, 3
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    2 |    4 |    1 |        3
-       2 |    5 |   10 |    1 |        2
-       3 |    6 |    8 |    1 |        3
-       4 |   11 |   12 |    1 |        2
-       5 |   10 |   14 |    1 |        1
-       6 |   12 |   13 |    1 |        3
-       7 |   13 |   -1 |    0 |        0
-       8 |    8 |    7 |    1 |        3
-    (8 rows)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    1 |    1 |    1 |        1
-       2 |      2 |    2 |   -1 |    0 |        0
-       3 |      2 |    5 |    4 |    1 |        1
-       4 |      2 |    6 |    8 |    1 |        2
-       5 |      2 |   11 |   12 |    1 |        3
-       6 |      2 |   10 |   10 |    1 |        2
-       7 |      2 |   13 |   14 |    1 |        3
-       8 |      2 |    9 |    9 |    1 |        3
-       9 |      2 |    7 |    6 |    1 |        3
-      10 |      2 |    8 |    7 |    1 |        2
-      11 |     13 |    2 |    4 |    1 |        3
-      12 |     13 |    5 |   10 |    1 |        2
-      13 |     13 |    6 |    8 |    1 |        3
-      14 |     13 |   11 |   12 |    1 |        2
-      15 |     13 |   10 |   14 |    1 |        1
-      16 |     13 |   12 |   13 |    1 |        3
-      17 |     13 |   13 |   -1 |    0 |        0
-      18 |     13 |    8 |    7 |    1 |        3
-    (18 rows)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3, equicost:=true
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    1 |    1 |    1 |        1
-       2 |      2 |    2 |   -1 |    0 |        0
-       3 |      2 |    5 |    4 |    1 |        1
-       4 |      2 |    6 |    8 |    1 |        2
-       5 |      2 |    7 |    6 |    1 |        3
-       6 |      2 |    8 |    7 |    1 |        2
-       7 |      2 |    9 |    9 |    1 |        3
-       8 |      2 |   10 |   10 |    1 |        2
-       9 |      2 |   11 |   12 |    1 |        3
-      10 |     13 |   13 |   -1 |    0 |        0
-      11 |     13 |   12 |   13 |    1 |        3
-    (11 rows)
-
-
-
-Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig2`
-
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        2, 3, false
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    1 |    1 |    1 |        1
-       2 |    2 |   -1 |    0 |        0
-       3 |    3 |    2 |    1 |        1
-       4 |    4 |    3 |    1 |        2
-       5 |    5 |    4 |    1 |        1
-       6 |    6 |    8 |    1 |        2
-       7 |   11 |   12 |    1 |        3
-       8 |   10 |   10 |    1 |        2
-       9 |   13 |   14 |    1 |        3
-      10 |    9 |   16 |    1 |        3
-      11 |    7 |    6 |    1 |        3
-      12 |    8 |    7 |    1 |        2
-    (12 rows)
-    
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        13, 3, false
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    2 |    4 |    1 |        3
-       2 |    5 |   10 |    1 |        2
-       3 |    6 |   11 |    1 |        3
-       4 |   11 |   12 |    1 |        2
-       5 |   10 |   14 |    1 |        1
-       6 |   12 |   13 |    1 |        3
-       7 |   13 |   -1 |    0 |        0
-       8 |    8 |    7 |    1 |        3
-    (8 rows)
-    
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3, false
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    1 |    1 |    1 |        1
-       2 |      2 |    2 |   -1 |    0 |        0
-       3 |      2 |    3 |    2 |    1 |        1
-       4 |      2 |    4 |    3 |    1 |        2
-       5 |      2 |    5 |    4 |    1 |        1
-       6 |      2 |    6 |    8 |    1 |        2
-       7 |      2 |   11 |   12 |    1 |        3
-       8 |      2 |   10 |   10 |    1 |        2
-       9 |      2 |   13 |   14 |    1 |        3
-      10 |      2 |    9 |   16 |    1 |        3
-      11 |      2 |    7 |    6 |    1 |        3
-      12 |      2 |    8 |    7 |    1 |        2
-      13 |     13 |    2 |    4 |    1 |        3
-      14 |     13 |    5 |   10 |    1 |        2
-      15 |     13 |    6 |   11 |    1 |        3
-      16 |     13 |   11 |   12 |    1 |        2
-      17 |     13 |   10 |   14 |    1 |        1
-      18 |     13 |   12 |   13 |    1 |        3
-      19 |     13 |   13 |   -1 |    0 |        0
-      20 |     13 |    8 |    7 |    1 |        3
-    (20 rows)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3, false, equicost:=true
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    1 |    1 |    1 |        1
-       2 |      2 |    2 |   -1 |    0 |        0
-       3 |      2 |    3 |    2 |    1 |        1
-       4 |      2 |    4 |    3 |    1 |        2
-       5 |      2 |    5 |    4 |    1 |        1
-       6 |      2 |    6 |    8 |    1 |        2
-       7 |      2 |    7 |    6 |    1 |        3
-       8 |      2 |    8 |    7 |    1 |        2
-       9 |      2 |    9 |   16 |    1 |        3
-      10 |      2 |   10 |   10 |    1 |        2
-      11 |      2 |   11 |   12 |    1 |        3
-      12 |     13 |   13 |   -1 |    0 |        0
-      13 |     13 |   12 |   13 |    1 |        3
-    (13 rows)
-
-
-
-
-Examples for queries marked as ``directed`` with ``cost`` column
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig3`
-
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        2, 3
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    2 |   -1 |    0 |        0
-       2 |    5 |    4 |    1 |        1
-       3 |    6 |    8 |    1 |        2
-       4 |   11 |   11 |    1 |        3
-       5 |   10 |   10 |    1 |        2
-       6 |   13 |   14 |    1 |        3
-       7 |    9 |    9 |    1 |        3
-    (7 rows)
-    
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        13, 3
-      );
-     seq | node | edge | cost | agg_cost
-    -----+------+------+------+----------
-       1 |   13 |   -1 |    0 |        0
-    (1 row)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    2 |   -1 |    0 |        0
-       2 |      2 |    5 |    4 |    1 |        1
-       3 |      2 |    6 |    8 |    1 |        2
-       4 |      2 |   11 |   11 |    1 |        3
-       5 |      2 |   10 |   10 |    1 |        2
-       6 |      2 |   13 |   14 |    1 |        3
-       7 |      2 |    9 |    9 |    1 |        3
-       8 |     13 |   13 |   -1 |    0 |        0
-    (8 rows)
-    
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3, equicost:=true
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    2 |   -1 |    0 |        0
-       2 |      2 |    5 |    4 |    1 |        1
-       3 |      2 |    6 |    8 |    1 |        2
-       4 |      2 |    9 |    9 |    1 |        3
-       5 |      2 |   10 |   10 |    1 |        2
-       6 |      2 |   11 |   11 |    1 |        3
-       7 |     13 |   13 |   -1 |    0 |        0
-    (7 rows)
-    
-
-
-Examples for queries marked as ``undirected`` with ``cost`` column
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig4`
-
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        2, 3, false
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    1 |    1 |    1 |        1
-       2 |    2 |   -1 |    0 |        0
-       3 |    3 |    5 |    1 |        3
-       4 |    5 |    4 |    1 |        1
-       5 |    6 |    8 |    1 |        2
-       6 |   11 |   12 |    1 |        3
-       7 |   10 |   10 |    1 |        2
-       8 |   13 |   14 |    1 |        3
-       9 |    9 |    9 |    1 |        3
-      10 |    7 |    6 |    1 |        3
-      11 |    8 |    7 |    1 |        2
-    (11 rows)
-    
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        13, 3, false
-      );
-     seq | node | edge | cost | agg_cost 
-    -----+------+------+------+----------
-       1 |    2 |    4 |    1 |        3
-       2 |    5 |   10 |    1 |        2
-       3 |    6 |   11 |    1 |        3
-       4 |   11 |   12 |    1 |        2
-       5 |   10 |   14 |    1 |        1
-       6 |   12 |   13 |    1 |        3
-       7 |   13 |   -1 |    0 |        0
-       8 |    8 |    7 |    1 |        3
-    (8 rows)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3, false
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    1 |    1 |    1 |        1
-       2 |      2 |    2 |   -1 |    0 |        0
-       3 |      2 |    3 |    5 |    1 |        3
-       4 |      2 |    5 |    4 |    1 |        1
-       5 |      2 |    6 |    8 |    1 |        2
-       6 |      2 |   11 |   12 |    1 |        3
-       7 |      2 |   10 |   10 |    1 |        2
-       8 |      2 |   13 |   14 |    1 |        3
-       9 |      2 |    9 |    9 |    1 |        3
-      10 |      2 |    7 |    6 |    1 |        3
-      11 |      2 |    8 |    7 |    1 |        2
-      12 |     13 |    2 |    4 |    1 |        3
-      13 |     13 |    5 |   10 |    1 |        2
-      14 |     13 |    6 |   11 |    1 |        3
-      15 |     13 |   11 |   12 |    1 |        2
-      16 |     13 |   10 |   14 |    1 |        1
-      17 |     13 |   12 |   13 |    1 |        3
-      18 |     13 |   13 |   -1 |    0 |        0
-      19 |     13 |    8 |    7 |    1 |        3
-    (19 rows)
-
-    SELECT * FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3, false, equicost:=true
-      );
-     seq | from_v | node | edge | cost | agg_cost 
-    -----+--------+------+------+------+----------
-       1 |      2 |    1 |    1 |    1 |        1
-       2 |      2 |    2 |   -1 |    0 |        0
-       3 |      2 |    3 |    5 |    1 |        3
-       4 |      2 |    5 |    4 |    1 |        1
-       5 |      2 |    6 |    8 |    1 |        2
-       6 |      2 |    7 |    6 |    1 |        3
-       7 |      2 |    8 |    7 |    1 |        2
-       8 |      2 |    9 |    9 |    1 |        3
-       9 |      2 |   10 |   10 |    1 |        2
-      10 |      2 |   11 |   12 |    1 |        3
-      11 |     13 |   13 |   -1 |    0 |        0
-      12 |     13 |   12 |   13 |    1 |        3
-    (12 rows)
-
-
-
-The queries use the :ref:`sampledata` network.
-
-
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-* Added functionality in version 2.1
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`pgr_alphashape` - Alpha shape computation
-* :ref:`pgr_points_as_polygon` - Polygon around set of points
-
-.. rubric:: Indices and tables
-
-* :ref:`genindex`
-* :ref:`search`
-
diff --git a/src/driving_distance/doc/dd_points_as_polygon.rst b/src/driving_distance/doc/dd_points_as_polygon.rst
deleted file mode 100644
index e363efc..0000000
--- a/src/driving_distance/doc/dd_points_as_polygon.rst
+++ /dev/null
@@ -1,103 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_points_as_polygon:
-
-pgr_pointsAsPolygon
-===============================================================================
-
-.. index:: 
-    single: pgr_pointsAsPolygon(text,float8)
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_pointsAsPolygon`` — Draws an alpha shape around given set of points.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-Returns the alpha shape as (multi)polygon geometry.
-
-.. code-block:: sql
-
-    geometry pgr_pointsAsPolygon(text sql [, float8 alpha]);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: ``text`` a SQL query, which should return a set of rows with the following columns:
-
-    .. code-block:: sql
-
-        SELECT id, x, y FROM vertex_result;
-
-    :id: ``int4`` identifier of the vertex
-    :x: ``float8`` x-coordinate
-    :y: ``float8`` y-coordinate
-
-:alpha: (optional) ``float8`` alpha value. If specified alpha value equals 0 (default), then optimal alpha value is used.
-    For more information, see `CGAL - 2D Alpha Shapes <http://doc.cgal.org/latest/Alpha_shapes_2/group__PkgAlphaShape2.html>`_.
-
-Returns a (multi)polygon geometry (with holes).
-
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-* Added alpha argument with default 0 (use optimal value) in version 2.1.0
-* Supported to return a (multi)polygon geometry (with holes) in version 2.1.0
-
-
-Examples
--------------------------------------------------------------------------------
-In the following query there is no way to control which point in the polygon is the first in the list, so you may get similar but different results than the following which are also correct. Each of the pgr_pointsAsPolygon queries below is followed by one the compute the area of the polygon. This area should remain constant regardles of the order of the points making up the polygon.
-
-.. code-block:: sql
-
-    SELECT ST_AsText(pgr_pointsAsPolygon('SELECT id, x, y FROM vertex_table'));
-
-                   st_astext                
-    ----------------------------------------
-     POLYGON((2 4,4 3,4 2,4 1,2 0,0 2,2 4))
-    (1 row)
-
-    SELECT round(ST_Area(pgr_pointsAsPolygon('SELECT id, x, y FROM vertex_table'))::numeric, 2) AS st_area;
-
-     st_area
-    ---------
-       10.00
-    (1 row)
-
-    
-    SELECT ST_AsText(pgr_pointsAsPolygon('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y
-                                          FROM edge_table_vertices_pgr'));
-                        st_astext                         
-    ----------------------------------------------------------
-     POLYGON((2 4,3.5 4,4 3,4 2,4 1,2 0,0 2,0.5 3.5,2 4))
-    (1 row)
-
-    SELECT round(ST_Area(pgr_pointsAsPolygon('SELECT id::integer, ST_X(the_geom)::float AS x, ST_Y(the_geom)::float AS y
-         FROM edge_table_vertices_pgr'))::numeric, 2) AS st_area;
-
-     st_area
-    ---------
-       11.75
-
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`pgr_driving_distance` - Driving Distance
-* :ref:`pgr_alphashape` - Alpha shape computation
diff --git a/src/driving_distance/doc/doc-pgr_drivingDistance.queries b/src/driving_distance/doc/doc-pgr_drivingDistance.queries
new file mode 100644
index 0000000..a429c0d
--- /dev/null
+++ b/src/driving_distance/doc/doc-pgr_drivingDistance.queries
@@ -0,0 +1,337 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+
+
+
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        2, 3
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |    2 |   -1 |    0 |        0
+   2 |    1 |    1 |    1 |        1
+   3 |    5 |    4 |    1 |        1
+   4 |    6 |    8 |    1 |        2
+   5 |    8 |    7 |    1 |        2
+   6 |   10 |   10 |    1 |        2
+   7 |    7 |    6 |    1 |        3
+   8 |    9 |    9 |    1 |        3
+   9 |   11 |   12 |    1 |        3
+  10 |   13 |   14 |    1 |        3
+(10 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        13, 3
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   13 |   -1 |    0 |        0
+   2 |   10 |   14 |    1 |        1
+   3 |    5 |   10 |    1 |        2
+   4 |   11 |   12 |    1 |        2
+   5 |    2 |    4 |    1 |        3
+   6 |    6 |    8 |    1 |        3
+   7 |    8 |    7 |    1 |        3
+   8 |   12 |   13 |    1 |        3
+(8 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    1 |    1 |    1 |        1
+   3 |      2 |    5 |    4 |    1 |        1
+   4 |      2 |    6 |    8 |    1 |        2
+   5 |      2 |    8 |    7 |    1 |        2
+   6 |      2 |   10 |   10 |    1 |        2
+   7 |      2 |    7 |    6 |    1 |        3
+   8 |      2 |    9 |    9 |    1 |        3
+   9 |      2 |   11 |   12 |    1 |        3
+  10 |      2 |   13 |   14 |    1 |        3
+  11 |     13 |   13 |   -1 |    0 |        0
+  12 |     13 |   10 |   14 |    1 |        1
+  13 |     13 |    5 |   10 |    1 |        2
+  14 |     13 |   11 |   12 |    1 |        2
+  15 |     13 |    2 |    4 |    1 |        3
+  16 |     13 |    6 |    8 |    1 |        3
+  17 |     13 |    8 |    7 |    1 |        3
+  18 |     13 |   12 |   13 |    1 |        3
+(18 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3, equicost:=true
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    1 |    1 |    1 |        1
+   3 |      2 |    5 |    4 |    1 |        1
+   4 |      2 |    6 |    8 |    1 |        2
+   5 |      2 |    8 |    7 |    1 |        2
+   6 |      2 |    7 |    6 |    1 |        3
+   7 |      2 |    9 |    9 |    1 |        3
+   8 |     13 |   13 |   -1 |    0 |        0
+   9 |     13 |   10 |   14 |    1 |        1
+  10 |     13 |   11 |   12 |    1 |        2
+  11 |     13 |   12 |   13 |    1 |        3
+(11 rows)
+
+--q2
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        2, 3, false
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |    2 |   -1 |    0 |        0
+   2 |    1 |    1 |    1 |        1
+   3 |    3 |    2 |    1 |        1
+   4 |    5 |    4 |    1 |        1
+   5 |    4 |    3 |    1 |        2
+   6 |    6 |    8 |    1 |        2
+   7 |    8 |    7 |    1 |        2
+   8 |   10 |   10 |    1 |        2
+   9 |    7 |    6 |    1 |        3
+  10 |    9 |   16 |    1 |        3
+  11 |   11 |   12 |    1 |        3
+  12 |   13 |   14 |    1 |        3
+(12 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        13, 3, false
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   13 |   -1 |    0 |        0
+   2 |   10 |   14 |    1 |        1
+   3 |    5 |   10 |    1 |        2
+   4 |   11 |   12 |    1 |        2
+   5 |    2 |    4 |    1 |        3
+   6 |    6 |    8 |    1 |        3
+   7 |    8 |    7 |    1 |        3
+   8 |   12 |   13 |    1 |        3
+(8 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3, false
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    1 |    1 |    1 |        1
+   3 |      2 |    3 |    2 |    1 |        1
+   4 |      2 |    5 |    4 |    1 |        1
+   5 |      2 |    4 |    3 |    1 |        2
+   6 |      2 |    6 |    8 |    1 |        2
+   7 |      2 |    8 |    7 |    1 |        2
+   8 |      2 |   10 |   10 |    1 |        2
+   9 |      2 |    7 |    6 |    1 |        3
+  10 |      2 |    9 |   16 |    1 |        3
+  11 |      2 |   11 |   12 |    1 |        3
+  12 |      2 |   13 |   14 |    1 |        3
+  13 |     13 |   13 |   -1 |    0 |        0
+  14 |     13 |   10 |   14 |    1 |        1
+  15 |     13 |    5 |   10 |    1 |        2
+  16 |     13 |   11 |   12 |    1 |        2
+  17 |     13 |    2 |    4 |    1 |        3
+  18 |     13 |    6 |    8 |    1 |        3
+  19 |     13 |    8 |    7 |    1 |        3
+  20 |     13 |   12 |   13 |    1 |        3
+(20 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3, false, equicost:=true
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    1 |    1 |    1 |        1
+   3 |      2 |    3 |    2 |    1 |        1
+   4 |      2 |    5 |    4 |    1 |        1
+   5 |      2 |    4 |    3 |    1 |        2
+   6 |      2 |    6 |    8 |    1 |        2
+   7 |      2 |    8 |    7 |    1 |        2
+   8 |      2 |    7 |    6 |    1 |        3
+   9 |      2 |    9 |   16 |    1 |        3
+  10 |     13 |   13 |   -1 |    0 |        0
+  11 |     13 |   10 |   14 |    1 |        1
+  12 |     13 |   11 |   12 |    1 |        2
+  13 |     13 |   12 |   13 |    1 |        3
+(13 rows)
+
+--q3
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        2, 3
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |    2 |   -1 |    0 |        0
+   2 |    5 |    4 |    1 |        1
+   3 |    6 |    8 |    1 |        2
+   4 |   10 |   10 |    1 |        2
+   5 |    9 |    9 |    1 |        3
+   6 |   11 |   11 |    1 |        3
+   7 |   13 |   14 |    1 |        3
+(7 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        13, 3
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   13 |   -1 |    0 |        0
+(1 row)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    5 |    4 |    1 |        1
+   3 |      2 |    6 |    8 |    1 |        2
+   4 |      2 |   10 |   10 |    1 |        2
+   5 |      2 |    9 |    9 |    1 |        3
+   6 |      2 |   11 |   11 |    1 |        3
+   7 |      2 |   13 |   14 |    1 |        3
+   8 |     13 |   13 |   -1 |    0 |        0
+(8 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3, equicost:=true
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    5 |    4 |    1 |        1
+   3 |      2 |    6 |    8 |    1 |        2
+   4 |      2 |   10 |   10 |    1 |        2
+   5 |      2 |    9 |    9 |    1 |        3
+   6 |      2 |   11 |   11 |    1 |        3
+   7 |     13 |   13 |   -1 |    0 |        0
+(7 rows)
+
+--q4
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        2, 3, false
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |    2 |   -1 |    0 |        0
+   2 |    1 |    1 |    1 |        1
+   3 |    5 |    4 |    1 |        1
+   4 |    6 |    8 |    1 |        2
+   5 |    8 |    7 |    1 |        2
+   6 |   10 |   10 |    1 |        2
+   7 |    3 |    5 |    1 |        3
+   8 |    7 |    6 |    1 |        3
+   9 |    9 |    9 |    1 |        3
+  10 |   11 |   12 |    1 |        3
+  11 |   13 |   14 |    1 |        3
+(11 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        13, 3, false
+      );
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   13 |   -1 |    0 |        0
+   2 |   10 |   14 |    1 |        1
+   3 |    5 |   10 |    1 |        2
+   4 |   11 |   12 |    1 |        2
+   5 |    2 |    4 |    1 |        3
+   6 |    6 |    8 |    1 |        3
+   7 |    8 |    7 |    1 |        3
+   8 |   12 |   13 |    1 |        3
+(8 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3, false
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    1 |    1 |    1 |        1
+   3 |      2 |    5 |    4 |    1 |        1
+   4 |      2 |    6 |    8 |    1 |        2
+   5 |      2 |    8 |    7 |    1 |        2
+   6 |      2 |   10 |   10 |    1 |        2
+   7 |      2 |    3 |    5 |    1 |        3
+   8 |      2 |    7 |    6 |    1 |        3
+   9 |      2 |    9 |    9 |    1 |        3
+  10 |      2 |   11 |   12 |    1 |        3
+  11 |      2 |   13 |   14 |    1 |        3
+  12 |     13 |   13 |   -1 |    0 |        0
+  13 |     13 |   10 |   14 |    1 |        1
+  14 |     13 |    5 |   10 |    1 |        2
+  15 |     13 |   11 |   12 |    1 |        2
+  16 |     13 |    2 |    4 |    1 |        3
+  17 |     13 |    6 |    8 |    1 |        3
+  18 |     13 |    8 |    7 |    1 |        3
+  19 |     13 |   12 |   13 |    1 |        3
+(19 rows)
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3, false, equicost:=true
+      );
+ seq | from_v | node | edge | cost | agg_cost 
+-----+--------+------+------+------+----------
+   1 |      2 |    2 |   -1 |    0 |        0
+   2 |      2 |    1 |    1 |    1 |        1
+   3 |      2 |    5 |    4 |    1 |        1
+   4 |      2 |    6 |    8 |    1 |        2
+   5 |      2 |    8 |    7 |    1 |        2
+   6 |      2 |    3 |    5 |    1 |        3
+   7 |      2 |    7 |    6 |    1 |        3
+   8 |      2 |    9 |    9 |    1 |        3
+   9 |     13 |   13 |   -1 |    0 |        0
+  10 |     13 |   10 |   14 |    1 |        1
+  11 |     13 |   11 |   12 |    1 |        2
+  12 |     13 |   12 |   13 |    1 |        3
+(12 rows)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/driving_distance/doc/doc-pgr_drivingdistance-v2.queries b/src/driving_distance/doc/doc-pgr_drivingdistance-v2.queries
new file mode 100644
index 0000000..668d59a
--- /dev/null
+++ b/src/driving_distance/doc/doc-pgr_drivingdistance-v2.queries
@@ -0,0 +1,28 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_drivingDistance(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+    7, 1.5, false, false
+) ;
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   7 |  -1 |    0
+   1 |   8 |   6 |    1
+(2 rows)
+
+SELECT * FROM pgr_drivingDistance(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    7, 1.5, true, true
+) ;
+NOTICE:  Deprecated function
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   7 |  -1 |    0
+   1 |   8 |   6 |    1
+(2 rows)
+
+--q2
+ROLLBACK;
+ROLLBACK
diff --git a/src/driving_distance/doc/drivingDistance.rst b/src/driving_distance/doc/drivingDistance.rst
new file mode 100644
index 0000000..9aa783a
--- /dev/null
+++ b/src/driving_distance/doc/drivingDistance.rst
@@ -0,0 +1,36 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+
+.. _drivingDistance:
+
+Driving Distance
+===============================================================================
+
+
+
+  - :ref:`pgr_drivingDistance<pgr_drivingDistance>` - Driving Distance
+
+
+.. _pgr_driving_distance_post:
+
+Driving Distance post-processing
+===============================================================================
+
+  -  :ref:`pgr_alphaShape` - Alpha shape computation
+  -  :ref:`pgr_points_as_polygon` - Polygon around set of points
+
+
+.. toctree::
+   :hidden:
+
+   ./pgr_drivingDistance.rst
+   ./../../alpha_shape/doc/pgr_alphaShape.rst
+   ./../../alpha_shape/doc/pgr_pointsAsPolygon.rst
+
diff --git a/src/driving_distance/doc/index.rst b/src/driving_distance/doc/index.rst
deleted file mode 100644
index b3c3184..0000000
--- a/src/driving_distance/doc/index.rst
+++ /dev/null
@@ -1,44 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_driving_distance:
-
-Driving Distance
-===============================================================================
-
-
-Version 2.0 (deprecated)
-------------------------
-
-  - :ref:`pgr_driving_distance<pgr_driving_distance_v2>` - Driving Distance
-
-
-Version 2.1
-------------------
-
-  - :ref:`pgr_driving_distance<pgr_driving_distance_v3>` - Driving Distance
-
-
-.. _pgr_driving_distance_post:
-
-Driving Distance post-processing
-===============================================================================
-
-  -  :ref:`pgr_alphaShape` - Alpha shape computation
-  -  :ref:`pgr_points_as_polygon` - Polygon around set of points
-
-
-.. toctree::
-	:hidden:
-
-	./dd_driving_distance_v2.rst
-	./dd_driving_distance_v3.rst
-	./dd_alphashape.rst
-	./dd_points_as_polygon.rst
-
diff --git a/src/driving_distance/doc/pgr_drivingDistance.rst b/src/driving_distance/doc/pgr_drivingDistance.rst
new file mode 100644
index 0000000..8d4439e
--- /dev/null
+++ b/src/driving_distance/doc/pgr_drivingDistance.rst
@@ -0,0 +1,170 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_drivingDistance:
+
+pgr_drivingDistance
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_drivingDistance`` - Returns the driving distance from a start node.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Using Dijkstra algorithm, extracts all the nodes that have costs less than or equal to the value ``distance``.
+The edges extracted will conform the corresponding spanning tree.
+
+.. index::
+	single: drivingDistance(edges_sql, start_vid, distance)
+
+.. rubric:: The minimal signature:
+
+.. code-block:: sql
+
+   pgr_drivingDistance(sql text, start_v bigint, distance float8)
+     RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+.. index::
+	single: drivingDistance(edges_sql, start_vid, distance, directed)
+
+.. rubric:: Driving Distance from a single starting point:
+
+.. code-block:: sql
+
+   pgr_drivingDistance(sql text, start_vid bigint, distance float8, directed boolean)
+     RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+.. index::
+	single: drivingDistance(edges_sql, start_vids, distance, directed, equiCost)
+
+.. rubric:: Driving Distance from a multiple starting points:
+
+.. code-block:: sql
+
+   pgr_drivingDistance(sql text, start_vids anyarray, distance float8,
+         directed boolean default true,
+         equicost boolean default false)
+     RETURNS SET OF (seq, start_vid, node, edge, cost, agg_cost)
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+        .. code-block:: sql
+
+                SELECT id, source, target, cost [,reverse_cost] FROM edge_table
+
+
+        :id: ``ANY-INTEGER`` identifier of the edge.
+        :source: ``ANY-INTEGER`` identifier of the source vertex of the edge.
+        :target: ``ANY-INTEGER`` identifier of the target vertex of the edge.
+        :cost: ``ANY-NUMERICAL`` value of the edge traversal cost. A negative cost will prevent the edge (``source``, ``target``) from being inserted in the graph.
+        :reverse_cost: ``ANY-NUMERICAL`` (optional) the value for the reverse traversal of the edge. A negative cost will prevent the edge (``target``, ``source``) from being inserted in the graph.
+
+Where:
+
+:ANY-INTEGER: smallint, int, bigint
+:ANY-NUMERICAL: smallint, int, bigint, real, float
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+:sql: SQL query as decribed above.
+:start_v: ``BIGINT`` id of the starting vertex.
+:start_v: ``array[ANY-INTEGER]`` array of id of starting vertices.
+:distance: ``FLOAT`` Upper limit for the inclusion of the node in the result.
+:directed: ``boolean`` (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+:equicost: ``boolean`` (optional). When ``true`` the node will only appear in the closest ``start_v`` list.  Default is ``false`` which resembles several calls using the single starting point signatures. Tie brakes are arbitrarely.
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq [, start_v], node, edge, cost, agg_cost)``
+
+:seq: ``INT`` row sequence.
+:start_v: ``BIGINT`` id of the starting vertex. Used when multiple starting vetrices are in the query.
+:node: ``BIGINT`` id of the node within the limits from ``start_v``.
+:edge: ``BIGINT`` id of the edge used to arrive to ``node``. ``0`` when the ``node`` is the ``start_v``.
+:cost: ``FLOAT`` cost to traverse ``edge``.
+:agg_cost:  ``FLOAT`` total cost from ``start_v`` to ``node``.
+
+
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+--------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+.. literalinclude:: doc-pgr_drivingDistance.queries
+   :start-after: --q1
+   :end-before: --q2
+
+Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig2`
+
+
+.. literalinclude:: doc-pgr_drivingDistance.queries
+   :start-after: --q2
+   :end-before: --q3
+
+Examples for queries marked as ``directed`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig3`
+
+.. literalinclude:: doc-pgr_drivingDistance.queries
+   :start-after: --q3
+   :end-before: --q4
+
+
+
+Examples for queries marked as ``undirected`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig4`
+
+.. literalinclude:: doc-pgr_drivingDistance.queries
+   :start-after: --q4
+   :end-before: --q5
+
+The queries use the :ref:`sampledata` network.
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+* Added functionality in version 2.1
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_alphashape` - Alpha shape computation
+* :ref:`pgr_points_as_polygon` - Polygon around set of points
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/driving_distance/doc/pgr_drivingDistance_v2.rst b/src/driving_distance/doc/pgr_drivingDistance_v2.rst
new file mode 100644
index 0000000..df50505
--- /dev/null
+++ b/src/driving_distance/doc/pgr_drivingDistance_v2.rst
@@ -0,0 +1,99 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_driving_distance_v2:
+
+pgr_drivingDistance (V2.0)
+===============================================================================
+
+.. index:: 
+	single: drivingDistance(text,integer,double precision,boolean,boolean) -- deprecated
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_drivingDistance`` - Returns the driving distance from a start node.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+This function computes a Dijkstra shortest path solution them extracts the cost to get to each node in the network from the starting node. Using these nodes and costs it is possible to compute constant drive time polygons. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a list of accessible points.
+
+.. code-block:: sql
+
+	pgr_costResult[] pgr_drivingDistance(text sql, integer source, double precision distance,
+                                      boolean directed, boolean has_rcost);
+
+.. warning:: This signature is being deprecated on version 2.1, Please use it
+             without the ``has_rcost`` flag instead:
+
+             ``pgr_drivingDistance(sql, start_v, distance, directed)``
+
+             See :ref:`pgr_drivingDistance`
+
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT id, source, target, cost [,reverse_cost] FROM edge_table
+
+
+	:id: ``int4`` identifier of the edge
+	:source: ``int4`` identifier of the source vertex
+	:target: ``int4`` identifier of the target vertex
+	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:distance: ``float8`` value in edge cost units (not in projection units - they might be different).
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   node ID
+:id2:   edge ID (this is probably not a useful item)
+:cost:  cost to get to this node ID
+
+.. warning::
+
+	You must reconnect to the database after ``CREATE EXTENSION pgrouting``. Otherwise the function will return ``Error computing path: std::bad_alloc``.
+
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+* With ``reverse_cost``
+
+.. literalinclude:: doc-pgr_drivingdistance-v2.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_alphashape` - Alpha shape computation
+* :ref:`pgr_points_as_polygon` - Polygon around set of points
diff --git a/src/driving_distance/sql/CMakeLists.txt b/src/driving_distance/sql/CMakeLists.txt
index cce2f97..7f05fe3 100644
--- a/src/driving_distance/sql/CMakeLists.txt
+++ b/src/driving_distance/sql/CMakeLists.txt
@@ -1,5 +1,6 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/withPoints_dd.sql
     ${CMAKE_CURRENT_SOURCE_DIR}/routing_dd.sql)
 
 # set in parent scope
diff --git a/src/driving_distance/sql/routing_dd.sql b/src/driving_distance/sql/routing_dd.sql
index 4d2bafc..bae8e47 100644
--- a/src/driving_distance/sql/routing_dd.sql
+++ b/src/driving_distance/sql/routing_dd.sql
@@ -1,63 +1,68 @@
---
--- Copyright (c) 2005 Sylvain Pasche,
---               2006-2007 Anton A. Patrushev, Orkney, Inc.
---
--- This program is free software; you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
---
+/*PGR-GNU*****************************************************************
 
------------------------------------------------------------------------
--- Core function for driving distance.
--- The sql should return edge and vertex ids.
------------------------------------------------------------------------
-/*
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, source_id integer, distance float8, directed boolean, has_reverse_cost boolean)
-    RETURNS SETOF pgr_costResultBig
-    AS '$libdir/librouting_dd', 'driving_distance'
-    LANGUAGE c IMMUTABLE STRICT;
-*/
-CREATE OR REPLACE FUNCTION _pgr_drivingDistance(sql text, start_v bigint, distance float8, directed boolean, has_rcost boolean,
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+CREATE OR REPLACE FUNCTION _pgr_drivingDistance(edges_sql text, start_vid bigint, distance float8, directed BOOLEAN, 
        OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
-     '$libdir/librouting-2.1', 'driving_distance'
- LANGUAGE c IMMUTABLE STRICT;
+     '$libdir/${PGROUTING_LIBRARY_NAME}', 'driving_distance'
+ LANGUAGE c VOLATILE STRICT;
 
-CREATE OR REPLACE FUNCTION _pgr_drivingDistance(sql text, start_v anyarray, distance float8, directed boolean, equicost boolean, has_rcost boolean,
+CREATE OR REPLACE FUNCTION _pgr_drivingDistance(edges_sql text, start_vids anyarray, distance float8, directed BOOLEAN, equicost BOOLEAN, 
        OUT seq integer, OUT start_v bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
-     '$libdir/librouting-2.1', 'driving_many_to_dist'
- LANGUAGE c IMMUTABLE STRICT;
+     '$libdir/${PGROUTING_LIBRARY_NAME}', 'driving_many_to_dist'
+ LANGUAGE c VOLATILE STRICT;
 
 
 -- OLD SIGNATURE
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, source bigint, distance float8, directed boolean, has_rcost boolean)
+CREATE OR REPLACE FUNCTION pgr_drivingDistance(edges_sql text, source bigint, distance float8, directed BOOLEAN, has_rcost BOOLEAN)
   RETURNS SETOF pgr_costresult AS
   $BODY$
   DECLARE
-  has_reverse boolean;
+  has_reverse BOOLEAN;
+  sql TEXT;
   BEGIN
-      -- old signature, things are int and float8 only
-      has_reverse =_pgr_parameter_check('driving', sql, false);
-
-      if (has_reverse != has_rcost) then
-         if (has_reverse) then --raise NOTICE 'has_rcost set to false but reverse_cost column found, Ignoring';
-         else raise EXCEPTION 'has_rcost set to true but reverse_cost not found';
-         end if;
-      end if;
-
-      return query SELECT seq-1 as seq, node::integer as id1, edge::integer as id2, agg_cost as cost
-                FROM _pgr_drivingDistance(sql, source, distance, directed, has_rcost);
+      RAISE NOTICE 'Deprecated function';
+
+      has_reverse =_pgr_parameter_check('dijkstra', edges_sql, FALSE);
+
+      sql = edges_sql;
+      IF (has_reverse != has_rcost) THEN
+         IF (has_reverse) THEN 
+             -- the user says it doesn't have reverse cost but its false
+             -- removing from query
+             RAISE NOTICE 'Contradiction found: has_rcost set to false but reverse_cost column found';
+             sql = 'SELECT id, source, target, cost, -1 as reverse_cost FROM (' || edges_sql || ') __q ';
+         ELSE
+             -- the user says it has reverse cost but its false
+             -- cant do anything
+             RAISE EXCEPTION 'has_rcost set to true but reverse_cost not found';
+         END IF;
+      END IF;
+
+      RETURN query SELECT seq - 1 AS seq, node::integer AS id1, edge::integer AS id2, agg_cost AS cost
+                FROM _pgr_drivingDistance(sql, source, distance, directed);
   END
   $BODY$
   LANGUAGE plpgsql VOLATILE
@@ -65,49 +70,31 @@ CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, source bigint, distance
   ROWS 1000;
 
 
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, start_v bigint, distance float8,
-       OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
-  RETURNS SETOF RECORD AS
-  $BODY$
-  DECLARE
-  has_rcost boolean;
-  BEGIN
-      has_rcost =_pgr_parameter_check('driving', sql, true);
-      return query SELECT *
-                FROM _pgr_drivingDistance(sql, start_v, distance, true, has_rcost);
-  END
-  $BODY$
-  LANGUAGE plpgsql VOLATILE
-  COST 100
-  ROWS 1000;
-
 
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, start_v bigint, distance float8, directed boolean,
+CREATE OR REPLACE FUNCTION pgr_drivingDistance(edges_sql text, start_v bigint, distance float8, directed BOOLEAN DEFAULT TRUE,
        OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
   $BODY$
   DECLARE
-  has_rcost boolean;
   BEGIN
-      has_rcost =_pgr_parameter_check('driving', sql, true);
-      return query SELECT *
-                FROM _pgr_drivingDistance(sql, start_v, distance, directed, has_rcost);
+      RETURN query
+          SELECT * FROM _pgr_drivingDistance(edges_sql, start_v, distance, directed);
   END
   $BODY$
   LANGUAGE plpgsql VOLATILE
   COST 100
   ROWS 1000;
 
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, start_v anyarray, distance float8, directed boolean default true, equicost boolean default false,
+
+-- the multi starting point
+CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, start_v anyarray, distance float8, directed BOOLEAN DEFAULT TRUE, equicost BOOLEAN DEFAULT FALSE,
        OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
   $BODY$
   DECLARE
-  has_rcost boolean;
   BEGIN
-      has_rcost =_pgr_parameter_check('driving', sql, true);
-      return query SELECT *
-                FROM _pgr_drivingDistance(sql, start_v, distance, directed, equicost, has_rcost);
+      RETURN query
+           SELECT * FROM _pgr_drivingDistance(sql, start_v, distance, directed, equicost);
   END
   $BODY$
   LANGUAGE plpgsql VOLATILE
@@ -115,7 +102,7 @@ CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, start_v anyarray, dista
   ROWS 1000;
 
 
-
+/*
 
 -----------------------------------------------------------------------
 -- Core function for alpha shape computation.
@@ -124,7 +111,7 @@ CREATE OR REPLACE FUNCTION pgr_drivingDistance(sql text, start_v anyarray, dista
 -----------------------------------------------------------------------
 CREATE OR REPLACE FUNCTION pgr_alphashape(sql text, alpha float8 DEFAULT 0, OUT x float8, OUT y float8)
     RETURNS SETOF record
-    AS '$libdir/librouting-2.1', 'alphashape'
+    AS '$libdir/librouting-2.2', 'alphashape'
     LANGUAGE c IMMUTABLE STRICT;
 
 ----------------------------------------------------------
@@ -149,7 +136,7 @@ CREATE OR REPLACE FUNCTION pgr_pointsAsPolygon(query varchar, alpha float8 DEFAU
 		geoms := array[]::geometry[];
 		i := 1;
 
-		FOR vertex_result IN EXECUTE 'SELECT x, y FROM pgr_alphashape('''|| query || ''', ' || alpha || ')' 
+		FOR vertex_result IN EXECUTE 'SELECT x, y FROM pgr_alphashape($1,$2) ' USING query, alpha
 		LOOP
 			x[i] = vertex_result.x;
 			y[i] = vertex_result.y;
@@ -187,4 +174,5 @@ CREATE OR REPLACE FUNCTION pgr_pointsAsPolygon(query varchar, alpha float8 DEFAU
 	END;
 	$$
 	LANGUAGE 'plpgsql' VOLATILE STRICT;
+    */
 
diff --git a/src/driving_distance/sql/routing_dd_legacy.sql b/src/driving_distance/sql/routing_dd_legacy.sql
deleted file mode 100644
index b8ab3c7..0000000
--- a/src/driving_distance/sql/routing_dd_legacy.sql
+++ /dev/null
@@ -1,116 +0,0 @@
------------------------------------------------------------------------
--- Calculates the driving distance.
---
--- A delta-sized bounding box around the start is used for data clipping.
---
--- table_name        the table name to work on
--- x                 start x
--- x                 start y
--- distance          the max. cost
--- delta             delta for data clipping
--- cost              cost
--- reverse_cost      reverse_cost
--- directed          is graph directed
--- has_reverse_cost  use reverse_cost column
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(
-    table_name varchar, 
-    x double precision, 
-    y double precision,
-    distance double precision,
-    delta double precision,
-    cost varchar,
-    reverse_cost varchar,
-    directed boolean,
-    has_reverse_cost boolean)
-RETURNS SETOF pgr_geomResult AS
-$$
-DECLARE
-    q text;
-    srid integer;
-    r record;
-    geom pgr_geomResult;
-BEGIN
-     
-    EXECUTE 'SELECT srid FROM geometry_columns WHERE f_table_name = ''' ||
-        table_name || '''' INTO r;
-    srid := r.srid;
-     
-    -- RAISE NOTICE 'SRID: %', srid;
-
-    q := 'SELECT * FROM pgr_pointsAsPolygon(''SELECT a.id1::integer AS id, b.x1::double precision AS x, b.y1::double precision AS y FROM pgr_drivingDistance(''''''''SELECT gid AS id,source::integer,target::integer, ' || cost || '::double precision AS cost, ' || reverse_cost || '::double precision as reverse_cost FROM ' || table_name || ' WHERE ST_SetSRID(''''''''''''''''BOX3D(' || x-delta || ' ' || y-delta || ', ' || x+delta || ' ' || y+delta || ')''''''''''''''''::BOX3D, ' || srid || ') [...]
-
-    -- RAISE NOTICE 'Query: %', q;
-     
-     EXECUTE q INTO r;
-     geom.seq  := r.seq;
-     geom.id1  := r.id1;
-     geom.id2  := r.id2;
-     geom.geom := r.geom;
-     RETURN NEXT geom;
-     
-     RETURN;
-
-END;
-$$
-
-LANGUAGE 'plpgsql' VOLATILE STRICT;
-
-
-
------------------------------------------------------------------------
--- Calculates the driving distance.
---
--- A delta-sized bounding box around the start is used for data clipping.
---
--- This function differs from the pgr_drivingDistance in that the signature
--- is now similar to the shortest path delta functions and the delta is
--- passed as argument.
---
--- If you're accustomed to the shortest path delta functions, you probably
--- want to use this as the preferred way to get the driving distance.
---
--- table_name        the table name to work on
--- source_id         start id
--- distance          the max. cost
--- delta             delta for data clipping
--- directed          is graph directed
--- has_reverse_cost  use reverse_cost column
------------------------------------------------------------------------
-CREATE OR REPLACE FUNCTION pgr_drivingDistance(
-    table_name varchar,
-    source_id integer,
-	distance double precision,
-    delta float8,
-    directed boolean,
-    has_reverse_cost boolean)
-RETURNS SETOF pgr_geomResult AS
-$$
-DECLARE
-    q text;
-    srid integer;
-    r record;
-    geom pgr_geomResult;
-    source_x float8;
-    source_y float8;
-BEGIN
-
-    EXECUTE 'select ST_X(PGR_StartPoint(the_geom)) as source_x from ' ||
-            pgr_quote_ident(table_name) || ' where source = ' ||
-            source_id || ' limit 1' INTO r;
-    source_x := r.source_x;
-
-
-    EXECUTE 'select ST_Y(PGR_StartPoint(the_geom)) as source_y from ' ||
-            pgr_quote_ident(table_name) || ' where source = ' ||
-            source_id || ' limit 1' INTO r;
-    source_y := r.source_y;
-
-    RETURN QUERY select * from pgr_drivingDistance(table_name,
-        source_x, source_y, distance, delta, directed, has_reverse_cost);
-
-END;
-$$
-
-LANGUAGE 'plpgsql' VOLATILE STRICT;
-
diff --git a/src/driving_distance/sql/withPoints_dd.sql b/src/driving_distance/sql/withPoints_dd.sql
new file mode 100644
index 0000000..ae6ce7e
--- /dev/null
+++ b/src/driving_distance/sql/withPoints_dd.sql
@@ -0,0 +1,64 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_dd.sql
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+CREATE OR REPLACE FUNCTION pgr_withPointsDD(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pid BIGINT,
+    distance FLOAT,
+
+    directed BOOLEAN DEFAULT TRUE,
+    driving_side CHAR DEFAULT 'b', 
+    details BOOLEAN DEFAULT FALSE, 
+
+    OUT seq INTEGER,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+  RETURNS SETOF RECORD AS
+     '$libdir/${PGROUTING_LIBRARY_NAME}', 'withPoints_dd'
+ LANGUAGE c VOLATILE STRICT;
+
+CREATE OR REPLACE FUNCTION pgr_withPointsDD(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pid ANYARRAY,
+    distance FLOAT,
+
+    directed BOOLEAN DEFAULT TRUE,
+    driving_side CHAR DEFAULT 'b', 
+    details BOOLEAN DEFAULT FALSE, 
+    equicost BOOLEAN DEFAULT FALSE, 
+
+    OUT seq INTEGER,
+    OUT start_vid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+  RETURNS SETOF RECORD AS
+     '$libdir/${PGROUTING_LIBRARY_NAME}', 'many_withPointsDD'
+ LANGUAGE c VOLATILE STRICT;
diff --git a/src/driving_distance/src/CMakeLists.txt b/src/driving_distance/src/CMakeLists.txt
index 5292f1a..f22ac9d 100644
--- a/src/driving_distance/src/CMakeLists.txt
+++ b/src/driving_distance/src/CMakeLists.txt
@@ -1,10 +1,10 @@
 ADD_LIBRARY(driving_distance OBJECT
-    alpha.c
-    alpha_drivedist.cpp
-
-    boost_interface_drivedist.cpp
-
     drivedist.c
     many_to_dist_driving_distance.c
+    boost_interface_drivedist.cpp
+
+    withPoints_dd.c
+    many_to_dist_withPointsDD.c
+    withPoints_dd_driver.cpp
  )
 
diff --git a/src/driving_distance/src/alpha.c b/src/driving_distance/src/alpha.c
deleted file mode 100644
index 0d18ee0..0000000
--- a/src/driving_distance/src/alpha.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Alpha-Shapes for PostgreSQL
- *
- * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-
-#include "alpha.h"
-
-#include "fmgr.h"
-
-
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-/*
- * Define this to have profiling enabled
- */
-//#define PROFILE
-
-#ifdef PROFILE
-#include <sys/time.h>
-
-/*! \def MAX_NODES
-  \brief Maximal number of nodes in the path (to avoid infinite loops)
-*/
-#define MAX_NODES 1000000
-
-struct timeval prof_alpha, prof_store, prof_extract, prof_total;
-long proftime[5];
-long profipts1, profipts2, profopts;
-#define profstart(x) do { gettimeofday(&x, NULL); } while (0);
-#define profstop(n, x) do { struct timeval _profstop;   \
-        long _proftime;                         \
-        gettimeofday(&_profstop, NULL);                         \
-        _proftime = ( _profstop.tv_sec*1000000+_profstop.tv_usec) -     \
-                ( x.tv_sec*1000000+x.tv_usec); \
-        elog(NOTICE, \
-                "PRF(%s) %lu (%f ms)", \
-                (n), \
-             _proftime, _proftime / 1000.0);    \
-        } while (0);
-
-#else
-
-#define profstart(x) do { } while (0);
-#define profstop(n, x) do { } while (0);
-
-
-#endif // PROFILE
-
-
-Datum alphashape(PG_FUNCTION_ARGS);
-
-#undef DEBUG
-//#define DEBUG 1
-
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-    
-// The number of tuples to fetch from the SPI cursor at each iteration
-#define TUPLIMIT 1000
-
-static char *
-text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-    
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
-
-static int
-finish(int code, int ret)
-{
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH )
-  {
-    elog(ERROR,"couldn't disconnect from SPI");
-    return -1 ;
-  }
-  return ret;
-}
-		  
-
-typedef struct vertex_columns 
-{
-  int id;
-  int x;
-  int y;
-
-} vertex_columns_t;
-
-
-
-static int
-fetch_vertices_columns(SPITupleTable *tuptable, 
-                       vertex_columns_t *vertex_columns)
-{
-  vertex_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
-  vertex_columns->x = SPI_fnumber(SPI_tuptable->tupdesc, "x");
-  vertex_columns->y = SPI_fnumber(SPI_tuptable->tupdesc, "y");
-
-  if (vertex_columns->id == SPI_ERROR_NOATTRIBUTE ||
-      vertex_columns->x == SPI_ERROR_NOATTRIBUTE ||
-      vertex_columns->y == SPI_ERROR_NOATTRIBUTE) 
-    {
-      elog(ERROR, "Error, query must return columns "
-           "'id', 'x' and 'y'");
-      return -1;
-    }
-
-  if (SPI_gettypeid(SPI_tuptable->tupdesc, vertex_columns->id) != INT4OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, vertex_columns->x) != FLOAT8OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, vertex_columns->y) != FLOAT8OID) 
-    {
-      elog(ERROR, 
-           "Error, column 'id' must be of type int4, 'x' and 'y' must be of type float8");
-      return -1;
-    }
-   
-  return 0;
-}
-
-static void
-fetch_vertex(HeapTuple *tuple, TupleDesc *tupdesc, 
-             vertex_columns_t *vertex_columns, vertex_t *target_vertex)
-{
-  Datum binval;
-  bool isnull;
-
-  binval = SPI_getbinval(*tuple, *tupdesc, vertex_columns->x, &isnull);
-  if (isnull)
-    elog(ERROR, "x contains a null value");
-  target_vertex->x = DatumGetFloat8(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, vertex_columns->y, &isnull);
-  if (isnull)
-    elog(ERROR, "y contains a null value");
-  target_vertex->y = DatumGetFloat8(binval);
-}
-
-static int compute_alpha_shape(char* sql, float8 alpha, vertex_t **res, int *res_count)
-{
-
-  int SPIcode;
-  void *SPIplan;
-  Portal SPIportal;
-  bool moredata = TRUE;
-  int ntuples;
-  vertex_t *vertices = NULL;
-  int total_tuples = 0;
-  vertex_columns_t vertex_columns = {.id= -1, .x= -1, .y= -1};
-  char *err_msg;
-  int ret = -1;
-
-  DBG("start alpha_shape\n");
-        
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT)
-    {
-      elog(ERROR, "alpha_shape: couldn't open a connection to SPI");
-      return -1;
-    }
-
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL)
-    {
-      elog(ERROR, "alpha_shape: couldn't create query plan via SPI");
-      return -1;
-    }
-
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) 
-    {
-      elog(ERROR, "alpha_shape: SPI_cursor_open('%s') returns NULL", sql);
-      return -1;
-    }
-
-  while (moredata == TRUE)
-    {
-      SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-      if (vertex_columns.id == -1) 
-        {
-          if (fetch_vertices_columns(SPI_tuptable, &vertex_columns) == -1)
-	    return finish(SPIcode, ret);
-        }
-
-      ntuples = SPI_processed;
-      total_tuples += ntuples;
-      if (!vertices)
-        vertices = palloc(total_tuples * sizeof(vertex_t));
-      else
-        vertices = repalloc(vertices, total_tuples * sizeof(vertex_t));
-
-      if (vertices == NULL) 
-        {
-          elog(ERROR, "Out of memory");
-          return finish(SPIcode, ret);
-        }
-
-      if (ntuples > 0) 
-        {
-          int t;
-          SPITupleTable *tuptable = SPI_tuptable;
-          TupleDesc tupdesc = SPI_tuptable->tupdesc;
-                
-          for (t = 0; t < ntuples; t++) 
-            {
-              HeapTuple tuple = tuptable->vals[t];
-              fetch_vertex(&tuple, &tupdesc, &vertex_columns, 
-                           &vertices[total_tuples - ntuples + t]);
-            }
-          SPI_freetuptable(tuptable);
-        } 
-      else 
-        {
-          moredata = FALSE;
-        }
-    }
-
-
-  // if (total_tuples < 2) //this was the buggy code of the pgrouting project.
-  // TODO: report this as a bug to the pgrouting project
-  // the CGAL alpha-shape function crashes if called with less than three points!!!
-
-  if (total_tuples == 0) {
-  	  elog(ERROR, "Distance is too short. no vertex for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");
-  }
-  if (total_tuples == 1) {
-	  elog(ERROR, "Distance is too short. only 1 vertex for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");
-  }
-  if (total_tuples == 2) {
-	  elog(ERROR, "Distance is too short. only 2 vertices for alpha shape calculation. alpha shape calculation needs at least 3 vertices.");
-  }
-  if (total_tuples < 3)
-  {
-    // elog(ERROR, "Distance is too short ....");
-    return finish(SPIcode, ret);
-  }
-
-  DBG("Calling CGAL alpha-shape\n");
-        
-  profstop("extract", prof_extract);
-  profstart(prof_alpha);
-
-  ret = alpha_shape(vertices, total_tuples, alpha, res, res_count, &err_msg);
-
-  profstop("alpha", prof_alpha);
-  profstart(prof_store);
-
-  if (ret < 0)
-    {
-      //elog(ERROR, "Error computing shape: %s", err_msg);
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), errmsg("Error computing shape: %s", err_msg)));
-    } 
-  
-  return finish(SPIcode, ret);    
-}
-
-PG_FUNCTION_INFO_V1(alphashape);
-
-Datum alphashape(PG_FUNCTION_ARGS)
-{
-  FuncCallContext      *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  vertex_t     *res = 0;
-                    
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL())
-    {
-      MemoryContext   oldcontext;
-      int res_count;
-                            
-      // XXX profiling messages are not thread safe
-      profstart(prof_total);
-      profstart(prof_extract);
-                                            
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-                                                                    
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-      compute_alpha_shape(text2char(PG_GETARG_TEXT_P(0)), 
-                                PG_GETARG_FLOAT8(1), &res, &res_count);
-
-      /* total number of tuples to be returned */
-      DBG("Conting tuples number\n");
-      funcctx->max_calls = res_count;
-      funcctx->user_fctx = res;
-
-      DBG("Total count %i", res_count);
-
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
-        ereport(ERROR,
-            (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-            errmsg("function returning record called in context "
-                   "that cannot accept type record")));
-
-      funcctx->tuple_desc = BlessTupleDesc(tuple_desc);
-
-      MemoryContextSwitchTo(oldcontext);
-    }
-
-  /* stuff done on every call of the function */
-  DBG("Strange stuff doing\n");
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  res = (vertex_t*) funcctx->user_fctx;
-
-  DBG("Trying to allocate some memory\n");
-
-  if (call_cntr < max_calls)    /* do when there is more left to send */
-    {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-      double x;
-      double y;
-
-      /* This will work for some compilers. If it crashes with segfault, try to change the following block with this one    
-
-      values = palloc(3 * sizeof(Datum));
-      nulls = palloc(3 * sizeof(char));
-
-      values[0] = call_cntr;
-      nulls[0] = ' ';
-      values[1] = Float8GetDatum(res[call_cntr].x);
-      nulls[1] = ' ';
-      values[2] = Float8GetDatum(res[call_cntr].y);
-      nulls[2] = ' ';
-      */
-    
-      values = palloc(2 * sizeof(Datum));
-      nulls = palloc(2 * sizeof(char));
-
-      x = res[call_cntr].x;
-      y = res[call_cntr].y;
-      if (x == DBL_MAX && y == DBL_MAX)
-      {
-        values[0] = 0;
-        values[1] = 0;
-        nulls[0] = 'n';
-        nulls[1] = 'n';
-      }
-      else
-      {
-        values[0] = Float8GetDatum(x);
-        values[1] = Float8GetDatum(y);
-        nulls[0] = ' ';
-        nulls[1] = ' ';
-      }
-	
-      DBG("Heap making\n");
-
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      DBG("Datum making\n");
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      DBG("Trying to free some memory\n");
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-    }
-  else    /* do when there is no more left */
-    {
-      if (res) free(res);
-      profstop("store", prof_store);
-      profstop("total", prof_total);
-#ifdef PROFILE
-      elog(NOTICE, "_________");
-#endif
-      SRF_RETURN_DONE(funcctx);
-    }
-}
diff --git a/src/driving_distance/src/alpha.h b/src/driving_distance/src/alpha.h
deleted file mode 100644
index 3ee9c8e..0000000
--- a/src/driving_distance/src/alpha.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Alpha-Shapes for PostgreSQL
- *
- * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
- 
-#define _ALPHA_H
-
-#ifdef __MINGW64__
-#define ELOG_H
-#endif
-#include "postgres.h"
-#include "../../common/src/pgr_types.h"
-
-typedef struct vertex
-{
-  float8 x;
-  float8 y;
-} vertex_t;
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-                                                                     
-  int alpha_shape(vertex_t *vertices, unsigned int count, double alpha,
-                  vertex_t **res, int *res_count, char **err_msg);
-
-#ifdef __cplusplus
-}
-#endif
-
-                                        
diff --git a/src/driving_distance/src/alpha_drivedist.cpp b/src/driving_distance/src/alpha_drivedist.cpp
deleted file mode 100644
index 5167ac3..0000000
--- a/src/driving_distance/src/alpha_drivedist.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Alpha-Shapes for PostgreSQL
- *
- * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * As a special exception, you have permission to link this program
- * with the CGAL library and distribute executables, as long as you
- * follow the requirements of the GNU GPL in regard to all of the
- * software in the executable aside from CGAL.
- *
- */
-
-
-/***********************************************************************
-Takes a list of points and returns a list of segments 
-corresponding to the Alpha shape.
-************************************************************************/
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-#ifdef __MINGW64__
-namespace boost {
-  void tss_cleanup_implemented() { }
-}
-#endif
-#include <CGAL/Simple_cartesian.h>
-#include <CGAL/Filtered_kernel.h>
-#include <CGAL/algorithm.h>
-
-#include <vector>
-#include <list>
-#include <cmath>
-
-#include "alpha.h"
-
-#include <CGAL/Polygon_2.h>
-#include <CGAL/Delaunay_triangulation_2.h>
-#include <CGAL/Triangulation_2.h>
-#include <CGAL/Triangulation_hierarchy_vertex_base_2.h>
-#include <CGAL/Triangulation_hierarchy_2.h>
-#include <CGAL/Triangulation_face_base_2.h>
-#include <CGAL/Triangulation_euclidean_traits_2.h>
-#include <CGAL/Alpha_shape_2.h>
-#include <CGAL/Alpha_shape_face_base_2.h>
-#include <CGAL/Alpha_shape_vertex_base_2.h>
-
-
-typedef double coord_type;
-
-typedef CGAL::Simple_cartesian<coord_type>  SC;
-typedef CGAL::Filtered_kernel<SC> K;
-typedef K::Point_2  Point;
-typedef K::Segment_2  Segment;
-typedef K::Vector_2 Vector;
-typedef CGAL::Polygon_2<K> Polygon_2;
-
-typedef CGAL::Alpha_shape_vertex_base_2<K> Avb;
-typedef CGAL::Triangulation_hierarchy_vertex_base_2<Avb> Av;
-
-typedef CGAL::Triangulation_face_base_2<K> Tf;
-typedef CGAL::Alpha_shape_face_base_2<K,Tf> Af;
-
-typedef CGAL::Triangulation_default_data_structure_2<K,Av,Af> Tds;
-typedef CGAL::Delaunay_triangulation_2<K,Tds> Dt;
-typedef CGAL::Triangulation_hierarchy_2<Dt> Ht;
-typedef CGAL::Alpha_shape_2<Ht> Alpha_shape_2;
-
-typedef Alpha_shape_2::Face_circulator  Face_circulator;
-typedef Alpha_shape_2::Vertex_circulator  Vertex_circulator;
-
-typedef Alpha_shape_2::Alpha_iterator Alpha_iterator;
-typedef Alpha_shape_2::Alpha_shape_edges_iterator Alpha_shape_edges_iterator;
-
-//---------------------------------------------------------------------
-
-double get_angle(Point p, Point q, Point r)
-{
-  double m_pi(3.14159265358979323846);
-  Vector v1(q, p);
-  Vector v2(q, r);
-  double cross = v1.x() * v2.y() - v1.y() * v2.x();
-  double dot = v1.x() * v2.x() + v1.y() * v2.y();
-  double angle = atan2(cross, dot);
-  if (angle < 0.0) {
-    angle += 2 * m_pi;
-  }
-  return angle;
-}
-
-size_t prev_size = 0;
-void find_next_edge(Segment s, std::vector<Segment>& segments, 
-                    std::set<int>& unusedIndexes, std::vector<Polygon_2>& rings)
-{
-  if(unusedIndexes.empty()
-    || prev_size == unusedIndexes.size())
-  {
-    return;
-  }
-  
-  prev_size = unusedIndexes.size();
-  
-  Point start = s.source();
-  Point end = s.target();
-  rings.back().push_back(end);
-  
-  std::vector<int> nextIndexes;
-  for(unsigned int i = 0;i < segments.size(); i++)
-  {
-    if (unusedIndexes.find(i) != unusedIndexes.end())
-    {
-      Point source = segments.at(i).source();
-      if(source == end)
-      {
-        nextIndexes.push_back(i);
-      }
-    }
-  }
-  if (nextIndexes.size() == 1)
-  {
-    int i = nextIndexes.at(0);
-    unusedIndexes.erase(i);
-    find_next_edge(segments.at(i), segments, unusedIndexes, rings);
-  }
-  else if (nextIndexes.size() > 1)
-  {
-    std::vector< std::pair<double, int> > nextAngles;
-    for (unsigned int i = 0; i < nextIndexes.size(); i++)
-    {
-      int j = nextIndexes.at(i);
-      Point target = segments.at(j).target();
-      double angle = get_angle(start, end, target);
-      nextAngles.push_back(std::pair<double, int>(angle, j));
-    }
-    std::sort(nextAngles.begin(), nextAngles.end());
-    int i = nextAngles.begin()->second;
-    unusedIndexes.erase(i);
-    find_next_edge(segments.at(i), segments, unusedIndexes, rings);
-  }
-  
-  if (!unusedIndexes.empty())
-  {
-    for (unsigned int i = 0; i < segments.size(); i++)
-    {
-      if (unusedIndexes.find(i) != unusedIndexes.end())
-      {
-        Polygon_2 ring;
-        ring.push_back(segments.at(i).source());
-        rings.push_back(ring);
-        unusedIndexes.erase(i);
-        find_next_edge(segments.at(i), segments, unusedIndexes, rings);
-      }
-    }
-  }
-}
-
-template <class OutputIterator>
-void
-alpha_edges( const Alpha_shape_2&  A,
-             OutputIterator out)
-{ 
-
-  for(Alpha_shape_edges_iterator it =  A.alpha_shape_edges_begin();
-      it != A.alpha_shape_edges_end();
-      ++it){
-    *out++ = A.segment(*it);
-  }
-}
-
-
-int alpha_shape(vertex_t *vertices, unsigned int count, double alpha,
-                vertex_t **res, int *res_count, char **err_msg)
-{
-  std::list<Point> points;
-
-  //std::copy(begin(vertices), end(vertices), std::back_inserter(points)); 
-  
-  for (std::size_t j = 0; j < count; ++j)
-  {
-    Point p(vertices[j].x, vertices[j].y);
-    points.push_back(p);
-  }
-  
-
-  Alpha_shape_2 A(points.begin(), points.end(),
-                  coord_type(10000),
-                  Alpha_shape_2::REGULARIZED);
-  
-  std::vector<Segment> segments;
-//  std::vector<Segment> result;
-
-//  Alpha_shape_2::Alpha_shape_vertices_iterator vit;
-//  Alpha_shape_2::Vertex_handle vertex;
-//  Alpha_shape_2::Alpha_shape_edges_iterator eit;
-//  Alpha_shape_2::Edge edge;
-//  Alpha_shape_2::Face_iterator fit;
-//  Alpha_shape_2::Face_handle face;
-  
-  if (alpha <= 0.0)
-  {
-    alpha = *A.find_optimal_alpha(1);
-  }
-  A.set_alpha(alpha);
-
-  alpha_edges( A, std::back_inserter(segments));
-
-//  Segment s = segments.at(0);
-//  find_next_edge(s, segments, result);
-  if (segments.empty())
-  {
-    *res = NULL;
-    *res_count = 0;
-  }
-  else
-  {
-    std::set<int> unusedIndexes;
-    for (unsigned int i = 0; i < segments.size(); i++)
-    {
-      unusedIndexes.insert(i);
-    }
-    
-    std::vector<Polygon_2> rings;
-    Polygon_2 ring;
-    ring.push_back(segments.at(0).source());
-    rings.push_back(ring);
-    unusedIndexes.erase(0);
-    find_next_edge(segments.at(0), segments, unusedIndexes, rings);
-
-    int result_count = 0;
-    for (unsigned int i = 0; i < rings.size(); i++)
-    {
-      Polygon_2 ring = rings.at(i);
-      result_count += ring.size();
-    }
-    result_count += rings.size() - 1;
-    *res = (vertex_t *) malloc(sizeof(vertex_t) * result_count);
-    *res_count = result_count;
-
-    int idx = 0;
-    for (unsigned int i = 0; i < rings.size(); i++)
-    {
-      if (i > 0)
-      {
-        (*res)[idx].x = DBL_MAX;
-        (*res)[idx].y = DBL_MAX;
-        idx++;
-      }
-      Polygon_2 ring = rings.at(i);
-      for(unsigned int j = 0; j < ring.size(); j++)
-      {
-        Point point = ring.vertex(j);
-        (*res)[idx].x = point.x();
-        (*res)[idx].y = point.y();
-        idx++;
-      }
-    }
-  }
-
-  return EXIT_SUCCESS;
-}
diff --git a/src/driving_distance/src/boost_interface_drivedist.cpp b/src/driving_distance/src/boost_interface_drivedist.cpp
index 54397d6..61cbac1 100644
--- a/src/driving_distance/src/boost_interface_drivedist.cpp
+++ b/src/driving_distance/src/boost_interface_drivedist.cpp
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: boost_interface_drivedist.cpp
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,110 +20,79 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+ ********************************************************************PGR-GNU*/
 
 #ifdef __MINGW32__
 #include <winsock2.h>
 #include <windows.h>
 #endif
 
-
-#include "./../../dijkstra/src/pgr_dijkstra.hpp"
-
 #include "unistd.h"
 #include <sstream>
 #include <deque>
 #include <vector>
 
+#include "../../common/src/memory_func.hpp"
+#include "./../../dijkstra/src/pgr_dijkstra.hpp"
 #include "./boost_interface_drivedist.h"
 
 extern "C" {
-#include "postgres.h"
 #include "./../../common/src/pgr_types.h"
-#include "./../../common/src/postgres_connection.h"
 }
 
 
 
-
-
-
-int  do_pgr_driving_many_to_dist(pgr_edge_t  *data_edges, int64_t total_tuples,
-                       int64_t  *start_vertex, int s_len,
-                       float8 distance,
-                       bool directedFlag,
-                       bool equiCostFlag,
-                       pgr_path_element3_t **ret_path, int *path_count,
-                       char ** err_msg) {
+void
+do_pgr_driving_many_to_dist(
+        pgr_edge_t  *data_edges, size_t total_tuples,
+        int64_t  *start_vertex, size_t s_len,
+        float8 distance,
+        bool directedFlag,
+        bool equiCostFlag,
+        General_path_element_t **ret_path, size_t *path_count,
+        char ** err_msg) {
     try {
-        // in c code this should this must have been checked:
-        //  1) end_vertex is in the data_edges
-
-        #if 0  // set to 1 if needed
-        std::ostringstream log;
-        #endif
-
         graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-        const int initial_size = 1;
+        const auto initial_size = total_tuples;
 
         std::deque< Path >paths;
-        typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::undirectedS,
-            boost_vertex_t, boost_edge_t > UndirectedGraph;
-        typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::bidirectionalS,
-            boost_vertex_t, boost_edge_t > DirectedGraph;
-
-        Pgr_dijkstra < DirectedGraph > digraph(gType, initial_size);
-        Pgr_dijkstra < UndirectedGraph > undigraph(gType, initial_size);
-
-        std::vector< int64_t > start_vertices(start_vertex, start_vertex + s_len);
+        std::set< int64_t > s_start_vertices(start_vertex, start_vertex + s_len);
+        std::vector< int64_t > start_vertices(s_start_vertices.begin(), s_start_vertices.end());
 
         if (directedFlag) {
-            digraph.initialize_graph(data_edges, total_tuples);
-            digraph.dijkstra_dd(paths, start_vertices, distance);
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(data_edges, total_tuples);
+            pgr_drivingDistance(digraph, paths, start_vertices, distance, equiCostFlag);
         } else {
-            undigraph.initialize_graph(data_edges, total_tuples);
-            undigraph.dijkstra_dd(paths, start_vertices, distance);
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(data_edges, total_tuples);
+            pgr_drivingDistance(undigraph, paths, start_vertices, distance, equiCostFlag);
         }
 
+        size_t count(count_tuples(paths));
 
-        if (equiCostFlag == false) {
-            int count(count_tuples(paths));
-            if (count == 0) {
-              *err_msg = strdup("NOTICE: No return values was found");
-              *ret_path = noPathFound3(-1, path_count, (*ret_path));
-              return 0;
-            }
-            *ret_path = pgr_get_memory3(count, (*ret_path));
-            int trueCount(collapse_paths(ret_path, paths));
-            *path_count = trueCount;
-            // assert (count == trueCount);
 
-        } else {
-            Path path = equi_cost(paths);
-            size_t count(path.size());
-            if (count == 0) {
-              *err_msg = strdup("NOTICE: No return values was found");
-              *ret_path = noPathFound3(-1, path_count, (*ret_path));
-              return 0;
-            }
-            int trueCount = 0;
-            *ret_path = pgr_get_memory3(count, (*ret_path));
-            path.dpPrint(ret_path, trueCount);
-            *path_count = trueCount;
-            // assert (count == trueCount);
+        if (count == 0) {
+            *err_msg = strdup("NOTICE: No return values was found");
+            *ret_path = noResult(path_count, (*ret_path));
+            return;
         }
+        *ret_path = get_memory(count, (*ret_path));
+        auto trueCount(collapse_paths(ret_path, paths));
+        *path_count = trueCount;
+
 
-      #if 1
+#ifndef DEBUG
         *err_msg = strdup("OK");
-        #else
+#else
         *err_msg = strdup(log.str().c_str());
-        #endif
-        return EXIT_SUCCESS;
+#endif
+        return;
+
     } catch ( ... ) {
-     *err_msg = strdup("Caught unknown expection!");
-     return -1;
+        *err_msg = strdup("Caught unknown expection!");
+        *ret_path = noResult(path_count, (*ret_path));
+        return;
     }
 }
 
@@ -130,78 +102,73 @@ int  do_pgr_driving_many_to_dist(pgr_edge_t  *data_edges, int64_t total_tuples,
 
 
 
-int  do_pgr_driving_distance(pgr_edge_t  *data_edges, int64_t total_tuples,
-                       int64_t  start_vertex, float8 distance,
-                       bool directedFlag,
-                       pgr_path_element3_t **ret_path, int *path_count,
-                       char ** err_msg) {
+void
+do_pgr_driving_distance(
+        pgr_edge_t  *data_edges, size_t total_edges,
+        int64_t     start_vertex,
+        float8      distance,
+        bool        directedFlag,
+        General_path_element_t **ret_path, size_t *path_count,
+        char                   **err_msg) {
+    std::ostringstream log;
     try {
+        // if it already has values there will be a leak
+        // call with pointing to NULL
+        *ret_path = NULL;
+
+        log << "NOTICE: Started processing pgr_drivingDistance for 1 start_vid\n";
         // in c code this should have been checked:
         //  1) start_vertex is in the data_edges  DONE
-        //  2) end_vertex is in the data_edges    DONE
-        //  3) start and end_vertex are different DONE
-        std::ostringstream log;
 
         graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-        const int initial_size = 1;
+        const auto initial_size = total_edges;
 
-        Path paths;
-        typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::undirectedS,
-            boost_vertex_t, boost_edge_t > UndirectedGraph;
-        typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::bidirectionalS,
-            boost_vertex_t, boost_edge_t > DirectedGraph;
+        Path path;
 
-        Pgr_dijkstra < DirectedGraph > digraph(gType, initial_size);
-        Pgr_dijkstra < UndirectedGraph > undigraph(gType, initial_size);
 
         if (directedFlag) {
-            digraph.initialize_graph(data_edges, total_tuples);
-            digraph.dijkstra_dd(paths, start_vertex, distance);
+            log << "NOTICE: Processing Directed graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(data_edges, total_edges);
+            pgr_drivingDistance(digraph, path, start_vertex, distance);
         } else {
-            undigraph.initialize_graph(data_edges, total_tuples);
-            undigraph.dijkstra_dd(paths, start_vertex, distance);
+            log << "NOTICE: Processing Undirected graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(data_edges, total_edges);
+            pgr_drivingDistance(undigraph, path, start_vertex, distance);
         }
 
-        if (paths.path.size() == 0) {
-            *err_msg = strdup(
-                "NOTICE: No driving distance node found");
-            *ret_path = noPathFound3(-1, path_count, (*ret_path));
-            return 0;
+        log << "Returning number of tuples" << path.size() << "\n";
+        if (path.empty()) {
+            log << "NOTICE: it shoud have at least the one for it self";
+            *err_msg = strdup(log.str().c_str());
+            *ret_path = noResult(path_count, (*ret_path));
+            return;
         }
 
         log << "NOTICE: Calculating the number of tuples \n";
-        int count = paths.path.size();
+        auto count = path.size();
 
         log << "NOTICE Count: " << count << " tuples\n";
 
-        // get the space required to store all the paths
-        *ret_path = NULL;
-        *ret_path = pgr_get_memory3(count, (*ret_path));
+        *ret_path = get_memory(count, (*ret_path));
 
-        int sequence = 0;
-        paths.ddPrint(ret_path, sequence, 0);
+        size_t sequence = 0;
+        path.get_pg_dd_path(ret_path, sequence);
         *path_count = count;
 
-        #if 1
+#ifndef DEBUG
         *err_msg = strdup("OK");
-        #else
+#else
         *err_msg = strdup(log.str().c_str());
-        #endif
+#endif
 
-        return EXIT_SUCCESS;
+        return;
     } catch ( ... ) {
-     *err_msg = strdup("Caught unknown expection!");
-     return -1;
+        log << "NOTICE: unknown exception cought";
+        *err_msg = strdup(log.str().c_str());
+        *ret_path = noResult(path_count, (*ret_path));
+        return;
     }
 }
 
-#if 0
-// move around this lines to force a return with an empty path and the log msg
-// cool for debugging
-*err_msg = strdup(log.str().c_str());
-(*path_count) = 1;
-*path = noPathFound(start_vertex);
-return -1;
-#endif
diff --git a/src/driving_distance/src/boost_interface_drivedist.h b/src/driving_distance/src/boost_interface_drivedist.h
index 39adb88..8bf563e 100644
--- a/src/driving_distance/src/boost_interface_drivedist.h
+++ b/src/driving_distance/src/boost_interface_drivedist.h
@@ -1,10 +1,11 @@
-/*PGR
-
-file: KSPDriver.h
+/*PGR-GNU*****************************************************************
+File: boost_interface_drivedist.h
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -19,7 +20,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 #ifndef SRC_DRIVING_DISTANCE_SRC_BOOST_INTERFACE_DRIVEDIST_H_
 #define SRC_DRIVING_DISTANCE_SRC_BOOST_INTERFACE_DRIVEDIST_H_
@@ -30,19 +31,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 extern "C" {
 #endif
 
-int  do_pgr_driving_many_to_dist(pgr_edge_t  * edges, int64_t total_tuples,
-                      int64_t  *start_vertex, int s_len,
-                      float8 distance,
-                      bool directed,
-                      bool equicost,
-                      pgr_path_element3_t **ret_path, int *path_count,
-                      char ** err_msg);
-
-int  do_pgr_driving_distance(pgr_edge_t  * edges, int64_t total_tuples,
-                      int64_t  start_vertex, float8 distance,
-                      bool directed,
-                      pgr_path_element3_t **ret_path, int *path_count,
-                      char ** err_msg);
+    void do_pgr_driving_many_to_dist(
+            pgr_edge_t  * edges, size_t total_tuples,
+            int64_t  *start_vertex, size_t s_len,
+            float8 distance,
+            bool directed,
+            bool equicost,
+            General_path_element_t **ret_path, size_t *path_count,
+            char ** err_msg);
+
+    void do_pgr_driving_distance(
+            pgr_edge_t  * edges, size_t total_tuples,
+            int64_t  start_vertex, double distance,
+            bool directed,
+            General_path_element_t **ret_path, size_t *path_count,
+            char ** err_msg);
 
 #ifdef __cplusplus
 }
diff --git a/src/driving_distance/src/drivedist.c b/src/driving_distance/src/drivedist.c
index 383790f..207a0d0 100644
--- a/src/driving_distance/src/drivedist.c
+++ b/src/driving_distance/src/drivedist.c
@@ -1,24 +1,26 @@
-/*
- * Shortest path algorithm for PostgreSQL
- *
- * Copyright (c) 2005 Sylvain Pasche
- *               2015 Celia Virginia Vergara Castillo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+/*PGR-GNU*****************************************************************
+File: drivedist.c 
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail:vicky_Vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 #include "postgres.h"
 #include "executor/spi.h"
@@ -28,68 +30,67 @@
 #include "access/htup_details.h"
 #endif
 
+//#define DEBUG
+
 #include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
 #include "./../../common/src/pgr_types.h"
 #include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
 #include "./boost_interface_drivedist.h"
 
+PG_FUNCTION_INFO_V1(driving_distance);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+driving_distance(PG_FUNCTION_ARGS); 
+
+static
+void compute_driving_distance(
+     char* sql,
+     int64_t start_vertex,
+     float8 distance,
+     bool directed,
+     General_path_element_t **path, size_t *path_count) {
+  pgr_SPI_connect();
 
-static int compute_driving_distance(char* sql, int64_t start_vertex,
-                                 float8 distance, bool directed,
-                                 bool has_rcost,
-                                 pgr_path_element3_t **path, int *path_count) {
-  int SPIcode;
   pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
+  size_t total_edges = 0;
 
 
   char *err_msg = (char *)"";
-  int ret = -1;
 
   PGR_DBG("Load data");
 
-  SPIcode = pgr_get_data(sql, &edges, &total_tuples, has_rcost,
-               start_vertex, start_vertex);
+  pgr_get_data_5_columns(sql, &edges, &total_edges);
 
-  if (SPIcode == -1) {
-    PGR_DBG("Error getting data\n");
-    return SPIcode;
+  if (total_edges == 0) {
+    PGR_DBG("No edges found");
+    *path = NULL;
+    (*path_count) = 0;
+    pgr_SPI_finish();
+    return;
   }
+  PGR_DBG("total edges read %ld\n", total_edges);
 
-  PGR_DBG("Total %ld tuples in query:", total_tuples);
-
-  ret = do_pgr_driving_distance(edges, total_tuples,
+  clock_t start_t = clock();
+  do_pgr_driving_distance(edges, total_edges,
                         start_vertex, distance,
-                        directed,
+                        directed, 
                         path, path_count, &err_msg);
+  time_msg(" processing Driving Distance one start", start_t, clock());
 
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-        errmsg("Error computing path: %s", err_msg)));
-  }
 
-  PGR_DBG("total tuples found %i\n", *path_count);
-  PGR_DBG("Exist Status = %i\n", ret);
+  PGR_DBG("total tuples found %ld\n", *path_count);
   PGR_DBG("Returned message = %s\n", err_msg);
 
-
-
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-      errmsg("Error computing path: %s", err_msg)));
-    }
-
   pfree(edges);
-  return pgr_finish(SPIcode, ret);
+  pgr_SPI_finish();
 }
 
-#ifndef _MSC_VER
-Datum driving_distance(PG_FUNCTION_ARGS);
-#else  // _MSC_VER
-PGDLLEXPORT Datum driving_distance(PG_FUNCTION_ARGS);
-#endif  // _MSC_VER
-
-PG_FUNCTION_INFO_V1(driving_distance);
 
 #ifndef _MSC_VER
 Datum
@@ -98,15 +99,15 @@ PGDLLEXPORT Datum
 #endif
 driving_distance(PG_FUNCTION_ARGS) {
   FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
+  uint32_t             call_cntr;
+  uint32_t             max_calls;
   TupleDesc            tuple_desc;
-  pgr_path_element3_t  *ret_path = 0;
+  General_path_element_t  *ret_path = 0;
 
   /* stuff done only on the first call of the function */
   if (SRF_IS_FIRSTCALL()) {
       MemoryContext   oldcontext;
-      int path_count = 0;
+      size_t path_count = 0;
 
       /* create a function context for cross-call persistence */
       funcctx = SRF_FIRSTCALL_INIT();
@@ -114,17 +115,21 @@ driving_distance(PG_FUNCTION_ARGS) {
       /* switch to memory context appropriate for multiple function calls */
       oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
 
-
-      compute_driving_distance(pgr_text2char(
-                                  PG_GETARG_TEXT_P(0)),       // sql
-                                  PG_GETARG_INT64(1),         // source_id
-                                  PG_GETARG_FLOAT8(2),        // distance
-                                  PG_GETARG_BOOL(3),          // directed
-                                  PG_GETARG_BOOL(4),          // has_rcost
+      /*************************************************************************************************************
+                                        QUERY
+       CREATE OR REPLACE FUNCTION _pgr_drivingDistance(edges_sql text, start_vid bigint, distance float8, directed BOOLEAN,
+       OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
+      *************************************************************************************************************/
+      PGR_DBG("Sub query  %s\n", pgr_text2char(PG_GETARG_TEXT_P(0)));
+
+      compute_driving_distance(pgr_text2char(PG_GETARG_TEXT_P(0)),       // edges_sql
+                               PG_GETARG_INT64(1),         // start_vid
+                               PG_GETARG_FLOAT8(2),        // distance
+                               PG_GETARG_BOOL(3),          // directed
                                   &ret_path, &path_count);
 
       /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
+      funcctx->max_calls = (uint32_t)path_count;
       funcctx->user_fctx = ret_path;
 
       if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
@@ -144,7 +149,7 @@ driving_distance(PG_FUNCTION_ARGS) {
   call_cntr = funcctx->call_cntr;
   max_calls = funcctx->max_calls;
   tuple_desc = funcctx->tuple_desc;
-  ret_path = (pgr_path_element3_t*) funcctx->user_fctx;
+  ret_path = (General_path_element_t*) funcctx->user_fctx;
 
   /* do when there is more left to send */
   if (call_cntr < max_calls) {
@@ -156,16 +161,18 @@ driving_distance(PG_FUNCTION_ARGS) {
       values = palloc(5 * sizeof(Datum));
       nulls = palloc(5 * sizeof(char));
 
-      values[0] = Int32GetDatum(ret_path[call_cntr].seq + 1);
+      // TODO version 3.0 change to 
+      // values[0] = Int64GetDatum(ret_path[call_cntr].seq + 1);
       nulls[0] = ' ';
-      values[1] = Int64GetDatum(ret_path[call_cntr].vertex);
       nulls[1] = ' ';
-      values[2] = Int64GetDatum(ret_path[call_cntr].edge);
       nulls[2] = ' ';
-      values[3] = Float8GetDatum(ret_path[call_cntr].cost);
       nulls[3] = ' ';
-      values[4] = Float8GetDatum(ret_path[call_cntr].tot_cost);
       nulls[4] = ' ';
+      values[0] = Int32GetDatum(ret_path[call_cntr].seq + 1);
+      values[1] = Int64GetDatum(ret_path[call_cntr].node);
+      values[2] = Int64GetDatum(ret_path[call_cntr].edge);
+      values[3] = Float8GetDatum(ret_path[call_cntr].cost);
+      values[4] = Float8GetDatum(ret_path[call_cntr].agg_cost);
 
       tuple = heap_formtuple(tuple_desc, values, nulls);
 
diff --git a/src/driving_distance/src/many_to_dist_driving_distance.c b/src/driving_distance/src/many_to_dist_driving_distance.c
index 9cfe810..a099a8e 100644
--- a/src/driving_distance/src/many_to_dist_driving_distance.c
+++ b/src/driving_distance/src/many_to_dist_driving_distance.c
@@ -1,23 +1,27 @@
-/*pgRouting
- *
- * File: many_to_1_dijkstra.c
- * Copyright (c) 2015 Celia Virginia Vergara Castillo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+/*PGR-GNU*****************************************************************
+File: many_to_dist_driving_distance.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_Vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ ********************************************************************PGR-GNU*/
+
 // #define DEBUG
 #include "postgres.h"
 #include "executor/spi.h"
@@ -29,52 +33,53 @@
 #endif
 
 #include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
 #include "./../../common/src/pgr_types.h"
 #include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
 #include "./boost_interface_drivedist.h"
 
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-
-static int driving_many_to_dist_driver(
-          char* sql, int64_t *start_vertex, int num,
-          float8 distance,
-          bool directed, bool equicost, bool has_rcost,
-          pgr_path_element3_t **path, int *path_count) {
-  int SPIcode;
-  pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
 
 
-  char *err_msg = (char *)"";
-  int ret = -1;
+static 
+void driving_many_to_dist_driver(
+        char* sql,
+        int64_t *start_vertex, size_t num,
+        float8 distance,
+        bool directed,
+        bool equicost, 
+        General_path_element_t **path, size_t *path_count) {
+    pgr_SPI_connect();
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
 
 
-  SPIcode = pgr_get_data(sql, &edges, &total_tuples, has_rcost, -1, -1);
+    char *err_msg = (char *)"";
 
-  if (SPIcode == -1) {
-    return SPIcode;
-  }
 
-  ret = do_pgr_driving_many_to_dist(edges, total_tuples,
-                        start_vertex, num, distance,
-                        directed, equicost,
-                        path, path_count, &err_msg);
+    pgr_get_data_5_columns(sql, &edges, &total_tuples);
 
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-        errmsg("Error computing path: %s", err_msg)));
-  }
-
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-      errmsg("Error computing path: %s", err_msg)));
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*path_count) = 0;
+        *path = NULL;
+        return;
     }
 
-  pfree(edges);
-  return pgr_finish(SPIcode, ret);
+    clock_t start_t = clock();
+    do_pgr_driving_many_to_dist(
+            edges, total_tuples,
+            start_vertex, num,
+            distance,
+            directed,
+            equicost,
+            path, path_count, &err_msg);
+    time_msg(" processing DrivingDistance many starts", start_t, clock());
+
+    pfree(edges);
+    pgr_SPI_finish(); 
 }
 
 
@@ -92,100 +97,99 @@ Datum
 PGDLLEXPORT Datum
 #endif
 driving_many_to_dist(PG_FUNCTION_ARGS) {
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  pgr_path_element3_t  *ret_path = 0;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-      int64_t* sourcesArr;
-      int num;
-
-      sourcesArr = (int64_t*) pgr_get_bigIntArray(&num, PG_GETARG_ARRAYTYPE_P(1));
-      PGR_DBG("sourcesArr size %d ", num);
-
-      PGR_DBG("Calling driving_many_to_dist_driver");
-      driving_many_to_dist_driver(
-               pgr_text2char(PG_GETARG_TEXT_P(0)),  // sql
-               sourcesArr, num,                     // array of sources
-               PG_GETARG_FLOAT8(2),                 // distance
-               PG_GETARG_BOOL(3),                   // directed
-               PG_GETARG_BOOL(4),                   // equicost
-               PG_GETARG_BOOL(5),                   // has_rcost
-               &ret_path, &path_count);
-
-      free(sourcesArr);
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = ret_path;
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+    FuncCallContext     *funcctx;
+    uint32_t                  call_cntr;
+    uint32_t                  max_calls;
+    TupleDesc            tuple_desc;
+    General_path_element_t  *ret_path = 0;
+
+    /* stuff done only on the first call of the function */
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        size_t path_count = 0;
+
+        /* create a function context for cross-call persistence */
+        funcctx = SRF_FIRSTCALL_INIT();
+
+        /* switch to memory context appropriate for multiple function calls */
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+        int64_t* sourcesArr;
+        size_t num;
+
+        sourcesArr = (int64_t*) pgr_get_bigIntArray(&num, PG_GETARG_ARRAYTYPE_P(1));
+        PGR_DBG("sourcesArr size %d ", num);
+
+        PGR_DBG("Calling driving_many_to_dist_driver");
+        driving_many_to_dist_driver(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),  // sql
+                sourcesArr, num,                     // array of sources
+                PG_GETARG_FLOAT8(2),                 // distance
+                PG_GETARG_BOOL(3),                   // directed
+                PG_GETARG_BOOL(4),                   // equicost
+                &ret_path, &path_count);
+
+        free(sourcesArr);
+
+        /* total number of tuples to be returned */
+        funcctx->max_calls = (uint32_t) path_count;
+        funcctx->user_fctx = ret_path;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
             ereport(ERROR,
                     (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                      errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-      funcctx->tuple_desc = tuple_desc;
-
-      MemoryContextSwitchTo(oldcontext);
-  }
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  ret_path = (pgr_path_element3_t*) funcctx->user_fctx;
-
-  /* do when there is more left to send */
-  if (call_cntr < max_calls) {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(6 * sizeof(Datum));
-      nulls = palloc(6 * sizeof(char));
-      // id, start_v, node, edge, cost, tot_cost
-      values[0] = Int32GetDatum(call_cntr + 1);
-      nulls[0] = ' ';
-      values[1] = Int64GetDatum(ret_path[call_cntr].from);
-      nulls[1] = ' ';
-      values[2] = Int64GetDatum(ret_path[call_cntr].vertex);
-      nulls[2] = ' ';
-      values[3] = Int64GetDatum(ret_path[call_cntr].edge);
-      nulls[3] = ' ';
-      values[4] = Float8GetDatum(ret_path[call_cntr].cost);
-      nulls[4] = ' ';
-      values[5] = Float8GetDatum(ret_path[call_cntr].tot_cost);
-      nulls[5] = ' ';
-
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-  } else {
-      /* do when there is no more left */
-      if (ret_path) free(ret_path);
-      SRF_RETURN_DONE(funcctx);
-  }
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    /* stuff done on every call of the function */
+    funcctx = SRF_PERCALL_SETUP();
+
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    ret_path = (General_path_element_t*) funcctx->user_fctx;
+
+    /* do when there is more left to send */
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum *values;
+        char* nulls;
+
+        values = palloc(6 * sizeof(Datum));
+        nulls = palloc(6 * sizeof(char));
+        // id, start_v, node, edge, cost, tot_cost
+        nulls[0] = ' ';
+        nulls[1] = ' ';
+        nulls[2] = ' ';
+        nulls[3] = ' ';
+        nulls[4] = ' ';
+        nulls[5] = ' ';
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int64GetDatum(ret_path[call_cntr].start_id);
+        values[2] = Int64GetDatum(ret_path[call_cntr].node);
+        values[3] = Int64GetDatum(ret_path[call_cntr].edge);
+        values[4] = Float8GetDatum(ret_path[call_cntr].cost);
+        values[5] = Float8GetDatum(ret_path[call_cntr].agg_cost);
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+
+        /* make the tuple into a datum */
+        result = HeapTupleGetDatum(tuple);
+
+        /* clean up (this is not really necessary) */
+        pfree(values);
+        pfree(nulls);
+
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        /* do when there is no more left */
+        if (ret_path) free(ret_path);
+        SRF_RETURN_DONE(funcctx);
+    }
 }
 
diff --git a/src/driving_distance/src/many_to_dist_withPointsDD.c b/src/driving_distance/src/many_to_dist_withPointsDD.c
new file mode 100644
index 0000000..afb8a16
--- /dev/null
+++ b/src/driving_distance/src/many_to_dist_withPointsDD.c
@@ -0,0 +1,270 @@
+/*PGR-GNU*****************************************************************
+File: many_to_dist_driving_distance.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_Vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+// #define DEBUG
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./../../common/src/points_input.h"
+#include "./../../withPoints/src/get_new_queries.h"
+#include "./withPoints_dd_driver.h"
+
+
+PG_FUNCTION_INFO_V1(many_withPointsDD);
+#ifndef _MSC_VER
+Datum 
+#else  
+PGDLLEXPORT Datum 
+#endif
+many_withPointsDD(PG_FUNCTION_ARGS);
+
+static 
+void process(
+        char* edges_sql,
+        char* points_sql,
+        int64_t *start_pids_arr, size_t size_arr,
+        double distance,
+
+        bool directed,
+        char *driving_side,
+        bool details,
+        bool equicost, 
+
+        General_path_element_t **result_tuples,
+        size_t *result_count  ){
+
+    driving_side[0] = tolower(driving_side[0]);
+    PGR_DBG("driving side:%c",driving_side[0]);
+    if (! ((driving_side[0] == 'r')
+                || (driving_side[0] == 'l'))) {
+        driving_side[0] = 'b';
+    }
+
+
+    pgr_SPI_connect();
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+    get_new_queries(
+            edges_sql, points_sql,
+            &edges_of_points_query,
+            &edges_no_points_query);
+
+
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    PGR_DBG("freeing allocated memory not used anymore");
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ((total_edges + total_edges_of_points) == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    PGR_DBG("Starting processing");
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int errcode = do_pgr_many_withPointsDD(
+            edges,              total_edges,
+            points,             total_points,
+            edges_of_points,    total_edges_of_points,
+            start_pids_arr,     size_arr,
+            distance,
+
+            directed,
+            driving_side[0],
+            details,
+            equicost, 
+
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPointsDD many starts", start_t, clock());
+
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    if (!err_msg) free(err_msg);
+
+    pfree(edges);
+    pfree(edges_of_points);
+    pfree(points);
+
+    pgr_SPI_finish();
+
+    if (errcode) {
+        pgr_send_error(errcode);
+    }
+}
+
+
+
+#ifndef _MSC_VER
+Datum
+#else  
+PGDLLEXPORT Datum
+#endif
+many_withPointsDD(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t                  call_cntr;
+    uint32_t                  max_calls;
+    TupleDesc               tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPointsDD(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pids anyarray,
+        // distance FLOAT,
+        //
+        // directed BOOLEAN -- DEFAULT true,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT false,
+        // equicost BOOLEAN -- DEFAULT false,
+
+        int64_t *sourcesArr;
+        size_t num;
+
+        sourcesArr = (int64_t*) pgr_get_bigIntArray(&num, PG_GETARG_ARRAYTYPE_P(2));
+        PGR_DBG("sourcesArr size %d ", num);
+
+        PGR_DBG("Calling driving_many_to_dist_driver");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),  // edges_sql
+                pgr_text2char(PG_GETARG_TEXT_P(1)),  // points_sql
+                sourcesArr, num,                     // start_pids array
+                PG_GETARG_FLOAT8(3),                 // distance
+
+                PG_GETARG_BOOL(4),                   // directed
+                pgr_text2char(PG_GETARG_TEXT_P(5)),  // driving side
+                PG_GETARG_BOOL(6),                   // details
+                PG_GETARG_BOOL(7),                   // equicost
+                &result_tuples, &result_count);
+
+        free(sourcesArr);
+
+        /* total number of tuples to be returned */
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    /* stuff done on every call of the function */
+    funcctx = SRF_PERCALL_SETUP();
+
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    /* do when there is more left to send */
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum *values;
+        char* nulls;
+
+        values = palloc(6 * sizeof(Datum));
+        nulls = palloc(6 * sizeof(char));
+        // id, start_v, node, edge, cost, tot_cost
+        nulls[0] = ' ';
+        nulls[1] = ' ';
+        nulls[2] = ' ';
+        nulls[3] = ' ';
+        nulls[4] = ' ';
+        nulls[5] = ' ';
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int64GetDatum(result_tuples[call_cntr].start_id);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[4] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+
+        /* make the tuple into a datum */
+        result = HeapTupleGetDatum(tuple);
+
+        /* clean up (this is not really necessary) */
+        pfree(values);
+        pfree(nulls);
+
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        /* do when there is no more left */
+        if (result_tuples) free(result_tuples);
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/driving_distance/src/withPoints_dd.c b/src/driving_distance/src/withPoints_dd.c
new file mode 100644
index 0000000..57454f1
--- /dev/null
+++ b/src/driving_distance/src/withPoints_dd.c
@@ -0,0 +1,271 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_dd.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+
+#include "fmgr.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/points_input.h"
+#include "./../../withPoints/src/get_new_queries.h"
+#include "./withPoints_dd_driver.h"
+// #define DEBUG
+#include "./../../common/src/debug_macro.h"
+
+PG_FUNCTION_INFO_V1(withPoints_dd);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+withPoints_dd(PG_FUNCTION_ARGS);
+
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process(
+        char* edges_sql,
+        char* points_sql,
+        int64_t start_pid,
+        double distance,
+
+        bool directed,
+        char *driving_side,
+        bool details,
+
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+
+    driving_side[0] = tolower(driving_side[0]);
+    PGR_DBG("driving side:%c",driving_side[0]);
+    if (! ((driving_side[0] == 'r')
+                || (driving_side[0] == 'l'))) {
+        driving_side[0] = 'b'; 
+    }
+
+    pgr_SPI_connect();
+
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+    get_new_queries(
+            edges_sql, points_sql,
+            &edges_of_points_query,
+            &edges_no_points_query);
+
+
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    PGR_DBG("freeing allocated memory not used anymore");
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ((total_edges + total_edges_of_points) == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    PGR_DBG("Starting processing");
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int errcode = do_pgr_withPointsDD(
+            edges,              total_edges,
+            points,             total_points,
+            edges_of_points,    total_edges_of_points,
+            start_pid,
+            distance,
+
+            driving_side[0],
+            details,
+            directed,
+
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPointsDD one start", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    if (!err_msg) free(err_msg);
+
+    pfree(edges);
+    pfree(edges_of_points);
+    pfree(points);
+
+    pgr_SPI_finish();
+
+    if (errcode) {
+        pgr_send_error(errcode);
+    }
+
+}
+
+/*                                                                             */
+/*******************************************************************************/
+
+
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+withPoints_dd(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPoint(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pid BIGINT,
+        // distance FLOAT,
+        //
+        // directed BOOLEAN -- DEFAULT true,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT false,
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                pgr_text2char(PG_GETARG_TEXT_P(1)),
+                PG_GETARG_INT64(2),
+                PG_GETARG_FLOAT8(3),
+
+                PG_GETARG_BOOL(4),
+                pgr_text2char(PG_GETARG_TEXT_P(5)),
+                PG_GETARG_BOOL(6),
+                &result_tuples,
+                &result_count);
+
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t) result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // OUT seq BIGINT,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT)
+
+
+        values = palloc(5 * sizeof(Datum));
+        nulls = palloc(5 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 6; ++i) {
+            nulls[i] = ' ';
+        }
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[3] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[4] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/driving_distance/src/withPoints_dd_driver.cpp b/src/driving_distance/src/withPoints_dd_driver.cpp
new file mode 100644
index 0000000..50060c6
--- /dev/null
+++ b/src/driving_distance/src/withPoints_dd_driver.cpp
@@ -0,0 +1,323 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include <cassert>
+#include "./../../dijkstra/src/pgr_dijkstra.hpp"
+#include "./../../withPoints/src/pgr_withPoints.hpp"
+#include "./withPoints_dd_driver.h"
+
+// #define DEBUG
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+#include "./../../common/src/memory_func.hpp"
+
+
+/*******************************************************************************/
+// CREATE OR REPLACE FUNCTION pgr_withPointsDD(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pids anyarray,
+// distance FLOAT,
+//
+// driving_side CHAR -- DEFAULT 'b',
+// details BOOLEAN -- DEFAULT false,
+// directed BOOLEAN -- DEFAULT true,
+// equicost BOOLEAN -- DEFAULT false,
+
+
+int
+do_pgr_many_withPointsDD(
+        pgr_edge_t      *edges,             size_t total_edges,
+        Point_on_edge_t *points_p,          size_t total_points,
+        pgr_edge_t      *edges_of_points,   size_t total_edges_of_points,
+
+        int64_t  *start_pids_arr,    size_t s_len,
+        float8 distance,
+
+        bool directed,
+        char driving_side,
+        bool details,
+        bool equiCost,
+
+        General_path_element_t **return_tuples, size_t *return_count,
+        char ** err_msg) {
+    std::ostringstream log;
+    try {
+        /*
+         * This is the original state
+         */
+        if (*err_msg) free(err_msg);
+        if (*return_tuples) free(return_tuples);
+        (*return_count) = 0;
+
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+
+        /*
+         * checking here is easier than on the C code
+         */
+        int errcode = check_points(points, log);
+        if (errcode) {
+            return errcode;
+        }
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges,
+                log);
+
+        std::set< int64_t > s_start_vids(start_pids_arr, start_pids_arr + s_len);
+        std::vector< int64_t > start_vids(s_start_vids.begin(), s_start_vids.end());
+#if 0
+        std::set< int64_t > start_vids;
+
+        for (const auto start_pid : start_pids) {
+            for (const auto point : points) {
+                if (point.pid == start_pid) {
+                    start_vids.insert(point.vertex_id);
+                    break;
+                }
+            }
+        }
+#endif
+
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const size_t initial_size = total_edges;
+
+        std::deque< Path >paths;
+
+        if (directed) {
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            pgr_drivingDistance(digraph, paths, start_vids, distance, equiCost);
+        } else {
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            pgr_drivingDistance(undigraph, paths, start_vids, distance, equiCost);
+        }
+
+        for (auto &path : paths) {
+            log << path;
+
+            if (!details) {
+                eliminate_details_dd(path);
+            }
+            log << path;
+            std::sort(path.begin(), path.end(),
+                    [](const Path_t &l, const  Path_t &r)
+                    {return l.node < r.node;});
+            std::stable_sort(path.begin(), path.end(),
+                    [](const Path_t &l, const  Path_t &r)
+                    {return l.agg_cost < r.agg_cost;});
+            log << path;
+        }
+
+        size_t count(count_tuples(paths));
+
+
+        if (count == 0) {
+            *err_msg = strdup("NOTICE: No return values was found");
+            return 0;
+        }
+        *return_tuples = get_memory(count, (*return_tuples));
+        *return_count = collapse_paths(return_tuples, paths);
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+
+    } catch ( ... ) {
+        *err_msg = strdup("Caught unknown expection!");
+        return 1000;
+    }
+
+}
+
+
+// CREATE OR REPLACE FUNCTION pgr_withPointsDD(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pid BIGINT,
+// end_pid BIGINT,
+//
+// driving_side CHAR -- DEFAULT 'b',
+// details BOOLEAN -- DEFAULT false,
+// directed BOOLEAN -- DEFAULT true,
+// equicost BOOLEAN -- DEFAULT false,
+
+int
+do_pgr_withPointsDD(
+        pgr_edge_t  *edges, size_t total_edges,
+        Point_on_edge_t  *points_p, size_t total_points,
+        pgr_edge_t  *edges_of_points, size_t total_edges_of_points,
+
+        int64_t start_vid,
+        float8      distance,
+
+        char driving_side,
+        bool details,
+        bool directed,
+
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+        /*
+         * This is the original state
+         */
+        if (*err_msg) free(err_msg);
+        if (*return_tuples) free(return_tuples);
+        (*return_count) = 0;
+
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+
+        /*
+         * checking here is easier than on the C code
+         */
+        int errcode = check_points(points, log);
+        if (errcode) {
+            return errcode;
+        }
+
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges,
+                log);
+
+#if 0
+        int64_t start_vid = 0;
+        for (const auto point : points) {
+            if (point.pid == start_pid) {
+                start_vid = point.vertex_id;
+            }
+        }
+#endif
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const size_t initial_size = total_edges;
+
+        Path path;
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            pgr_drivingDistance(digraph, path, start_vid, distance);
+        } else {
+            log << "Working with undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            pgr_drivingDistance(undigraph, path, start_vid, distance);
+        }
+
+
+#if 0
+        path.print_path(log);
+        adjust_pids(points, path);
+        path.print_path(log);
+#endif
+
+        if (!details) {
+            eliminate_details_dd(path);
+        }
+        std::sort(path.begin(), path.end(),
+                [](const Path_t &l, const  Path_t &r)
+                {return l.node < r.node;});
+        std::stable_sort(path.begin(), path.end(),
+                [](const Path_t &l, const  Path_t &r)
+                {return l.agg_cost < r.agg_cost;});
+
+
+        auto count(path.size());
+
+        if (count == 0) {
+            return 0;
+        }
+
+
+        *return_tuples = NULL;
+        *return_tuples = get_memory(count, (*return_tuples));
+
+        size_t sequence = 0;
+        path.get_pg_dd_path(return_tuples, sequence);
+
+        if (count != sequence) {
+            return 2;
+        }
+        (*return_count) = sequence;
+
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+    }
+    return 1000;
+}
diff --git a/src/driving_distance/src/withPoints_dd_driver.h b/src/driving_distance/src/withPoints_dd_driver.h
new file mode 100644
index 0000000..00a9060
--- /dev/null
+++ b/src/driving_distance/src/withPoints_dd_driver.h
@@ -0,0 +1,80 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+    int do_pgr_many_withPointsDD(
+            pgr_edge_t      *edges,             size_t total_edges,
+            Point_on_edge_t *points_p,          size_t total_points,
+            pgr_edge_t      *edges_of_points,   size_t total_edges_of_points,
+
+            int64_t  *start_pids_arr,    size_t s_len,
+            float8 distance,
+
+            bool directed,
+            char driving_side,
+            bool details,
+            bool equiCost,
+
+            General_path_element_t **return_tuples, size_t *return_count,
+            char ** err_msg);
+
+
+    //  CREATE OR REPLACE FUNCTION pgr_withPointKsp(
+    //  edges_sql TEXT,
+    //  points_sql TEXT,
+    //  start_pid BIGINT,
+    //  end_pid BIGINT,
+    //  directed BOOLEAN DEFAULT true,
+    int do_pgr_withPointsDD(
+            pgr_edge_t  *edges,             size_t total_edges,
+            Point_on_edge_t  *points,       size_t total_points,
+            pgr_edge_t  *edges_of_points,   size_t total_edges_of_points,
+
+            int64_t start_pid,
+            double  distance,
+
+            char driving_side,
+            bool details,
+            bool directed,
+
+            General_path_element_t **return_tuples,
+            size_t *return_count,
+            char ** err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/driving_distance/test/doc-pgr_drivingDistance.result b/src/driving_distance/test/doc-pgr_drivingDistance.result
new file mode 100644
index 0000000..50cef61
--- /dev/null
+++ b/src/driving_distance/test/doc-pgr_drivingDistance.result
@@ -0,0 +1,178 @@
+--q1
+1|2|-1|0|0
+2|1|1|1|1
+3|5|4|1|1
+4|6|8|1|2
+5|8|7|1|2
+6|10|10|1|2
+7|7|6|1|3
+8|9|9|1|3
+9|11|12|1|3
+10|13|14|1|3
+1|13|-1|0|0
+2|10|14|1|1
+3|5|10|1|2
+4|11|12|1|2
+5|2|4|1|3
+6|6|8|1|3
+7|8|7|1|3
+8|12|13|1|3
+1|2|2|-1|0|0
+2|2|1|1|1|1
+3|2|5|4|1|1
+4|2|6|8|1|2
+5|2|8|7|1|2
+6|2|10|10|1|2
+7|2|7|6|1|3
+8|2|9|9|1|3
+9|2|11|12|1|3
+10|2|13|14|1|3
+11|13|13|-1|0|0
+12|13|10|14|1|1
+13|13|5|10|1|2
+14|13|11|12|1|2
+15|13|2|4|1|3
+16|13|6|8|1|3
+17|13|8|7|1|3
+18|13|12|13|1|3
+1|2|2|-1|0|0
+2|2|1|1|1|1
+3|2|5|4|1|1
+4|2|6|8|1|2
+5|2|8|7|1|2
+6|2|7|6|1|3
+7|2|9|9|1|3
+8|13|13|-1|0|0
+9|13|10|14|1|1
+10|13|11|12|1|2
+11|13|12|13|1|3
+--q2
+1|2|-1|0|0
+2|1|1|1|1
+3|3|2|1|1
+4|5|4|1|1
+5|4|3|1|2
+6|6|8|1|2
+7|8|7|1|2
+8|10|10|1|2
+9|7|6|1|3
+10|9|16|1|3
+11|11|12|1|3
+12|13|14|1|3
+1|13|-1|0|0
+2|10|14|1|1
+3|5|10|1|2
+4|11|12|1|2
+5|2|4|1|3
+6|6|8|1|3
+7|8|7|1|3
+8|12|13|1|3
+1|2|2|-1|0|0
+2|2|1|1|1|1
+3|2|3|2|1|1
+4|2|5|4|1|1
+5|2|4|3|1|2
+6|2|6|8|1|2
+7|2|8|7|1|2
+8|2|10|10|1|2
+9|2|7|6|1|3
+10|2|9|16|1|3
+11|2|11|12|1|3
+12|2|13|14|1|3
+13|13|13|-1|0|0
+14|13|10|14|1|1
+15|13|5|10|1|2
+16|13|11|12|1|2
+17|13|2|4|1|3
+18|13|6|8|1|3
+19|13|8|7|1|3
+20|13|12|13|1|3
+1|2|2|-1|0|0
+2|2|1|1|1|1
+3|2|3|2|1|1
+4|2|5|4|1|1
+5|2|4|3|1|2
+6|2|6|8|1|2
+7|2|8|7|1|2
+8|2|7|6|1|3
+9|2|9|16|1|3
+10|13|13|-1|0|0
+11|13|10|14|1|1
+12|13|11|12|1|2
+13|13|12|13|1|3
+--q3
+1|2|-1|0|0
+2|5|4|1|1
+3|6|8|1|2
+4|10|10|1|2
+5|9|9|1|3
+6|11|11|1|3
+7|13|14|1|3
+1|13|-1|0|0
+1|2|2|-1|0|0
+2|2|5|4|1|1
+3|2|6|8|1|2
+4|2|10|10|1|2
+5|2|9|9|1|3
+6|2|11|11|1|3
+7|2|13|14|1|3
+8|13|13|-1|0|0
+1|2|2|-1|0|0
+2|2|5|4|1|1
+3|2|6|8|1|2
+4|2|10|10|1|2
+5|2|9|9|1|3
+6|2|11|11|1|3
+7|13|13|-1|0|0
+--q4
+1|2|-1|0|0
+2|1|1|1|1
+3|5|4|1|1
+4|6|8|1|2
+5|8|7|1|2
+6|10|10|1|2
+7|3|5|1|3
+8|7|6|1|3
+9|9|9|1|3
+10|11|12|1|3
+11|13|14|1|3
+1|13|-1|0|0
+2|10|14|1|1
+3|5|10|1|2
+4|11|12|1|2
+5|2|4|1|3
+6|6|8|1|3
+7|8|7|1|3
+8|12|13|1|3
+1|2|2|-1|0|0
+2|2|1|1|1|1
+3|2|5|4|1|1
+4|2|6|8|1|2
+5|2|8|7|1|2
+6|2|10|10|1|2
+7|2|3|5|1|3
+8|2|7|6|1|3
+9|2|9|9|1|3
+10|2|11|12|1|3
+11|2|13|14|1|3
+12|13|13|-1|0|0
+13|13|10|14|1|1
+14|13|5|10|1|2
+15|13|11|12|1|2
+16|13|2|4|1|3
+17|13|6|8|1|3
+18|13|8|7|1|3
+19|13|12|13|1|3
+1|2|2|-1|0|0
+2|2|1|1|1|1
+3|2|5|4|1|1
+4|2|6|8|1|2
+5|2|8|7|1|2
+6|2|3|5|1|3
+7|2|7|6|1|3
+8|2|9|9|1|3
+9|13|13|-1|0|0
+10|13|10|14|1|1
+11|13|11|12|1|2
+12|13|12|13|1|3
+--q5
diff --git a/src/driving_distance/test/doc-pgr_drivingDistance.test.sql b/src/driving_distance/test/doc-pgr_drivingDistance.test.sql
new file mode 100644
index 0000000..8587e97
--- /dev/null
+++ b/src/driving_distance/test/doc-pgr_drivingDistance.test.sql
@@ -0,0 +1,118 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_drivingDistance  V3
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+BEGIN;
+
+\echo --q1
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        2, 3
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        13, 3
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3, equicost:=true
+      );
+\echo --q2
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        2, 3, false
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        13, 3, false
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3, false
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+        array[2,13], 3, false, equicost:=true
+      );
+
+\echo --q3
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        2, 3
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        13, 3
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3, equicost:=true
+      );
+
+\echo --q4
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        2, 3, false
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        13, 3, false
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3, false
+      );
+
+SELECT * FROM pgr_drivingDistance(
+        'SELECT id, source, target, cost FROM edge_table',
+        array[2,13], 3, false, equicost:=true
+      );
+
+\echo --q5
+
+ROLLBACK;
diff --git a/src/driving_distance/test/doc-pgr_drivingdistance-v2.result b/src/driving_distance/test/doc-pgr_drivingdistance-v2.result
new file mode 100644
index 0000000..7221d5a
--- /dev/null
+++ b/src/driving_distance/test/doc-pgr_drivingdistance-v2.result
@@ -0,0 +1,8 @@
+--q1
+NOTICE:  Deprecated function
+0|7|-1|0
+1|8|6|1
+NOTICE:  Deprecated function
+0|7|-1|0
+1|8|6|1
+--q2
diff --git a/src/driving_distance/test/doc-pgr_drivingdistance-v2.test.sql b/src/driving_distance/test/doc-pgr_drivingdistance-v2.test.sql
new file mode 100644
index 0000000..6bddfe3
--- /dev/null
+++ b/src/driving_distance/test/doc-pgr_drivingdistance-v2.test.sql
@@ -0,0 +1,18 @@
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_drivingDistance
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+BEGIN;
+\echo --q1
+SELECT * FROM pgr_drivingDistance(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+    7, 1.5, false, false
+) ;
+
+SELECT * FROM pgr_drivingDistance(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table',
+    7, 1.5, true, true
+) ;
+\echo --q2
+ROLLBACK;
diff --git a/src/driving_distance/test/drivingdistance-any-00.data b/src/driving_distance/test/drivingdistance-any-00.data
deleted file mode 100644
index 45e6633..0000000
--- a/src/driving_distance/test/drivingdistance-any-00.data
+++ /dev/null
@@ -1,34 +0,0 @@
--- create 50x50 grid of overlapping lines horizontal and vertical
-
-create table ddunnoded (
-  id serial not null primary key
-);
-select addgeometrycolumn('ddunnoded', 'the_geom', ST_SRID('POINT(0 0)'::geometry), 'LINESTRING', 2);
-insert into ddunnoded (the_geom)
-select st_astext(st_makeline(st_makepoint(0,s1), st_makepoint(51,s1))) from (select generate_series(1,50) as s1) as foo
-union all
-select st_astext(st_makeline(st_makepoint(s1,0), st_makepoint(s1,51))) from (select generate_series(1,50) as s1) as foo;
-
--- node the grid so we can use it
-select pgr_nodenetwork('ddunnoded',0.000001);
-
--- copy the noded table into a table we can use for a graph
--- and add the required columns
-create table ddnoded2 (
-  gid serial not null primary key,
-  id integer,
-  source integer,
-  target integer,
-  cost float8
-);
-select addgeometrycolumn('ddnoded2', 'the_geom', ST_SRID('POINT(0 0)'::geometry), 'LINESTRING', 2);
-
-insert into ddnoded2 (id, cost, the_geom)
-select a.id, 1.0::float8 as cost, a.the_geom
-  from ddunnoded_noded a order by id, sub_id;
-
--- now create a topology
-select pgr_createtopology('ddnoded2', 0.000001, id:='gid');
-
--- Total query runtime: 8080 ms.
-
diff --git a/src/driving_distance/test/drivingdistance-any-00.result b/src/driving_distance/test/drivingdistance-any-00.result
index f42a346..74465da 100644
--- a/src/driving_distance/test/drivingdistance-any-00.result
+++ b/src/driving_distance/test/drivingdistance-any-00.result
@@ -1,44 +1,575 @@
-0|1
-1|4
-2|8
-3|12
-4|16
-5|20
-6|24
-7|28
-8|32
-9|36
-10|40
-0|1
-1|4
-2|8
-3|12
-4|16
-5|20
-6|24
-7|28
-8|32
-9|36
-10|40
-0|1
-1|2
-2|3
-3|4
-4|5
-5|6
-6|7
-7|8
-8|9
-9|10
-10|11
-0|1
-1|2
-2|3
-3|4
-4|5
-5|6
-6|7
-7|8
-8|9
-9|10
-10|11
+NOTICE:  Deprecated function
+0|1274|-1|0.00
+1|1222|3799|1.00
+2|1273|1249|1.00
+3|1275|1250|1.00
+4|1326|3800|1.00
+5|1170|3798|2.00
+6|1221|3748|2.00
+7|1223|3850|2.00
+8|1272|1248|2.00
+9|1276|1251|2.00
+10|1325|3749|2.00
+11|1327|1301|2.00
+12|1378|3801|2.00
+13|1118|3797|3.00
+14|1169|1147|3.00
+15|1171|3849|3.00
+16|1220|3697|3.00
+17|1224|1200|3.00
+18|1271|1247|3.00
+19|1277|1252|3.00
+20|1324|1299|3.00
+21|1328|1302|3.00
+22|1377|3750|3.00
+23|1379|3852|3.00
+24|1430|3802|3.00
+25|1066|3796|4.00
+26|1117|1096|4.00
+27|1119|3848|4.00
+28|1168|3696|4.00
+29|1172|1149|4.00
+30|1219|1196|4.00
+31|1225|1201|4.00
+32|1270|1246|4.00
+33|1278|1253|4.00
+34|1323|3647|4.00
+35|1329|1303|4.00
+36|1376|1350|4.00
+37|1380|1353|4.00
+38|1429|3751|4.00
+39|1431|3853|4.00
+40|1482|3803|4.00
+41|1014|3795|5.00
+42|1065|1045|5.00
+43|1067|1046|5.00
+44|1116|3695|5.00
+45|1120|1098|5.00
+46|1167|1145|5.00
+47|1173|3951|5.00
+48|1218|1195|5.00
+49|1226|4003|5.00
+50|1269|1245|5.00
+51|1279|1254|5.00
+52|1322|1297|5.00
+53|1330|4004|5.00
+54|1375|3648|5.00
+55|1381|1354|5.00
+56|1428|1401|5.00
+57|1432|1404|5.00
+58|1481|1453|5.00
+59|1483|1454|5.00
+60|1534|3804|5.00
+61|962|3794|6.00
+62|1013|3744|6.00
+63|1015|3846|6.00
+64|1064|1044|6.00
+65|1068|1047|6.00
+66|1115|1094|6.00
+67|1121|1099|6.00
+68|1166|3594|6.00
+69|1174|1151|6.00
+70|1217|1194|6.00
+71|1227|4054|6.00
+72|1268|1244|6.00
+73|1280|1255|6.00
+74|1321|1296|6.00
+75|1331|1305|6.00
+76|1374|1348|6.00
+77|1382|4005|6.00
+78|1427|3649|6.00
+79|1433|1405|6.00
+80|1480|3701|6.00
+81|1484|3905|6.00
+82|1533|1504|6.00
+83|1535|1505|6.00
+84|1586|3805|6.00
+85|910|3793|7.00
+86|961|3743|7.00
+87|963|3845|7.00
+88|1012|993|7.00
+89|1016|996|7.00
+90|1063|3643|7.00
+91|1069|3949|7.00
+92|1114|1093|7.00
+93|1122|1100|7.00
+94|1165|1143|7.00
+95|1175|1152|7.00
+96|1216|3493|7.00
+97|1228|1204|7.00
+98|1267|1243|7.00
+99|1281|1256|7.00
+100|1320|1295|7.00
+101|1332|1306|7.00
+102|1373|1347|7.00
+103|1383|4056|7.00
+104|1426|3598|7.00
+105|1434|4006|7.00
+106|1479|3650|7.00
+107|1485|1456|7.00
+108|1532|1503|7.00
+109|1536|1506|7.00
+110|1585|3754|7.00
+111|1587|3856|7.00
+112|1638|3806|7.00
+113|858|3792|8.00
+114|909|3742|8.00
+115|911|3844|8.00
+116|960|3692|8.00
+117|964|945|8.00
+118|1011|992|8.00
+119|1017|997|8.00
+120|1062|1042|8.00
+121|1070|1049|8.00
+122|1113|1092|8.00
+123|1123|4052|8.00
+124|1164|3492|8.00
+125|1176|1153|8.00
+126|1215|1192|8.00
+127|1229|4156|8.00
+128|1266|1242|8.00
+129|1282|1257|8.00
+130|1319|1294|8.00
+131|1333|1307|8.00
+132|1372|1346|8.00
+133|1384|4107|8.00
+134|1425|3547|8.00
+135|1435|4057|8.00
+136|1478|3599|8.00
+137|1486|4007|8.00
+138|1531|1502|8.00
+139|1537|1507|8.00
+140|1584|1554|8.00
+141|1588|1557|8.00
+142|1637|1606|8.00
+143|1639|1607|8.00
+144|1690|3807|8.00
+145|806|3791|9.00
+146|857|3741|9.00
+147|859|3843|9.00
+148|908|3691|9.00
+149|912|3895|9.00
+150|959|941|9.00
+151|965|946|9.00
+152|1010|991|9.00
+153|1018|998|9.00
+154|1061|1041|9.00
+155|1071|1050|9.00
+156|1112|1091|9.00
+157|1124|4103|9.00
+158|1163|1141|9.00
+159|1177|1154|9.00
+160|1214|1191|9.00
+161|1230|4207|9.00
+162|1265|1241|9.00
+163|1283|1258|9.00
+164|1318|1293|9.00
+165|1334|1308|9.00
+166|1371|1345|9.00
+167|1385|1358|9.00
+168|1424|1397|9.00
+169|1436|4108|9.00
+170|1477|3548|9.00
+171|1487|1458|9.00
+172|1530|1501|9.00
+173|1538|1508|9.00
+174|1583|3652|9.00
+175|1589|1558|9.00
+176|1636|3704|9.00
+177|1640|3908|9.00
+178|1689|1657|9.00
+179|1691|1658|9.00
+180|1742|3808|9.00
+181|754|3790|10.00
+182|805|3740|10.00
+183|807|3842|10.00
+184|856|3690|10.00
+185|860|3894|10.00
+186|907|890|10.00
+187|913|895|10.00
+188|958|3590|10.00
+189|966|947|10.00
+190|1009|990|10.00
+191|1019|999|10.00
+192|1060|1040|10.00
+193|1072|4102|10.00
+194|1111|1090|10.00
+195|1125|1103|10.00
+196|1162|3390|10.00
+197|1178|1155|10.00
+198|1213|3340|10.00
+199|1231|4258|10.00
+200|1264|1240|10.00
+201|1284|1259|10.00
+202|1317|3341|10.00
+203|1335|4259|10.00
+204|1370|1344|10.00
+205|1386|4209|10.00
+206|1423|1396|10.00
+207|1437|1409|10.00
+208|1476|1448|10.00
+209|1488|4109|10.00
+210|1529|1500|10.00
+211|1539|1509|10.00
+212|1582|3601|10.00
+213|1590|4009|10.00
+214|1635|1604|10.00
+215|1641|1609|10.00
+216|1688|3705|10.00
+217|1692|3909|10.00
+218|1741|1708|10.00
+219|1743|1709|10.00
+220|1794|3809|10.00
+1|1274|-1|0.00|0.00
+2|1222|3799|1.00|1.00
+3|1273|1249|1.00|1.00
+4|1275|1250|1.00|1.00
+5|1326|3800|1.00|1.00
+6|1170|3798|1.00|2.00
+7|1221|3748|1.00|2.00
+8|1223|3850|1.00|2.00
+9|1272|1248|1.00|2.00
+10|1276|1251|1.00|2.00
+11|1325|3749|1.00|2.00
+12|1327|1301|1.00|2.00
+13|1378|3801|1.00|2.00
+14|1118|3797|1.00|3.00
+15|1169|1147|1.00|3.00
+16|1171|3849|1.00|3.00
+17|1220|3697|1.00|3.00
+18|1224|1200|1.00|3.00
+19|1271|1247|1.00|3.00
+20|1277|1252|1.00|3.00
+21|1324|1299|1.00|3.00
+22|1328|1302|1.00|3.00
+23|1377|3750|1.00|3.00
+24|1379|3852|1.00|3.00
+25|1430|3802|1.00|3.00
+26|1066|3796|1.00|4.00
+27|1117|1096|1.00|4.00
+28|1119|3848|1.00|4.00
+29|1168|3696|1.00|4.00
+30|1172|1149|1.00|4.00
+31|1219|1196|1.00|4.00
+32|1225|1201|1.00|4.00
+33|1270|1246|1.00|4.00
+34|1278|1253|1.00|4.00
+35|1323|3647|1.00|4.00
+36|1329|1303|1.00|4.00
+37|1376|1350|1.00|4.00
+38|1380|1353|1.00|4.00
+39|1429|3751|1.00|4.00
+40|1431|3853|1.00|4.00
+41|1482|3803|1.00|4.00
+42|1014|3795|1.00|5.00
+43|1065|1045|1.00|5.00
+44|1067|1046|1.00|5.00
+45|1116|3695|1.00|5.00
+46|1120|1098|1.00|5.00
+47|1167|1145|1.00|5.00
+48|1173|3951|1.00|5.00
+49|1218|1195|1.00|5.00
+50|1226|4003|1.00|5.00
+51|1269|1245|1.00|5.00
+52|1279|1254|1.00|5.00
+53|1322|1297|1.00|5.00
+54|1330|4004|1.00|5.00
+55|1375|3648|1.00|5.00
+56|1381|1354|1.00|5.00
+57|1428|1401|1.00|5.00
+58|1432|1404|1.00|5.00
+59|1481|1453|1.00|5.00
+60|1483|1454|1.00|5.00
+61|1534|3804|1.00|5.00
+62|962|3794|1.00|6.00
+63|1013|3744|1.00|6.00
+64|1015|3846|1.00|6.00
+65|1064|1044|1.00|6.00
+66|1068|1047|1.00|6.00
+67|1115|1094|1.00|6.00
+68|1121|1099|1.00|6.00
+69|1166|3594|1.00|6.00
+70|1174|1151|1.00|6.00
+71|1217|1194|1.00|6.00
+72|1227|4054|1.00|6.00
+73|1268|1244|1.00|6.00
+74|1280|1255|1.00|6.00
+75|1321|1296|1.00|6.00
+76|1331|1305|1.00|6.00
+77|1374|1348|1.00|6.00
+78|1382|4005|1.00|6.00
+79|1427|3649|1.00|6.00
+80|1433|1405|1.00|6.00
+81|1480|3701|1.00|6.00
+82|1484|3905|1.00|6.00
+83|1533|1504|1.00|6.00
+84|1535|1505|1.00|6.00
+85|1586|3805|1.00|6.00
+86|910|3793|1.00|7.00
+87|961|3743|1.00|7.00
+88|963|3845|1.00|7.00
+89|1012|993|1.00|7.00
+90|1016|996|1.00|7.00
+91|1063|3643|1.00|7.00
+92|1069|3949|1.00|7.00
+93|1114|1093|1.00|7.00
+94|1122|1100|1.00|7.00
+95|1165|1143|1.00|7.00
+96|1175|1152|1.00|7.00
+97|1216|3493|1.00|7.00
+98|1228|1204|1.00|7.00
+99|1267|1243|1.00|7.00
+100|1281|1256|1.00|7.00
+101|1320|1295|1.00|7.00
+102|1332|1306|1.00|7.00
+103|1373|1347|1.00|7.00
+104|1383|4056|1.00|7.00
+105|1426|3598|1.00|7.00
+106|1434|4006|1.00|7.00
+107|1479|3650|1.00|7.00
+108|1485|1456|1.00|7.00
+109|1532|1503|1.00|7.00
+110|1536|1506|1.00|7.00
+111|1585|3754|1.00|7.00
+112|1587|3856|1.00|7.00
+113|1638|3806|1.00|7.00
+114|858|3792|1.00|8.00
+115|909|3742|1.00|8.00
+116|911|3844|1.00|8.00
+117|960|3692|1.00|8.00
+118|964|945|1.00|8.00
+119|1011|992|1.00|8.00
+120|1017|997|1.00|8.00
+121|1062|1042|1.00|8.00
+122|1070|1049|1.00|8.00
+123|1113|1092|1.00|8.00
+124|1123|4052|1.00|8.00
+125|1164|3492|1.00|8.00
+126|1176|1153|1.00|8.00
+127|1215|1192|1.00|8.00
+128|1229|4156|1.00|8.00
+129|1266|1242|1.00|8.00
+130|1282|1257|1.00|8.00
+131|1319|1294|1.00|8.00
+132|1333|1307|1.00|8.00
+133|1372|1346|1.00|8.00
+134|1384|4107|1.00|8.00
+135|1425|3547|1.00|8.00
+136|1435|4057|1.00|8.00
+137|1478|3599|1.00|8.00
+138|1486|4007|1.00|8.00
+139|1531|1502|1.00|8.00
+140|1537|1507|1.00|8.00
+141|1584|1554|1.00|8.00
+142|1588|1557|1.00|8.00
+143|1637|1606|1.00|8.00
+144|1639|1607|1.00|8.00
+145|1690|3807|1.00|8.00
+146|806|3791|1.00|9.00
+147|857|3741|1.00|9.00
+148|859|3843|1.00|9.00
+149|908|3691|1.00|9.00
+150|912|3895|1.00|9.00
+151|959|941|1.00|9.00
+152|965|946|1.00|9.00
+153|1010|991|1.00|9.00
+154|1018|998|1.00|9.00
+155|1061|1041|1.00|9.00
+156|1071|1050|1.00|9.00
+157|1112|1091|1.00|9.00
+158|1124|4103|1.00|9.00
+159|1163|1141|1.00|9.00
+160|1177|1154|1.00|9.00
+161|1214|1191|1.00|9.00
+162|1230|4207|1.00|9.00
+163|1265|1241|1.00|9.00
+164|1283|1258|1.00|9.00
+165|1318|1293|1.00|9.00
+166|1334|1308|1.00|9.00
+167|1371|1345|1.00|9.00
+168|1385|1358|1.00|9.00
+169|1424|1397|1.00|9.00
+170|1436|4108|1.00|9.00
+171|1477|3548|1.00|9.00
+172|1487|1458|1.00|9.00
+173|1530|1501|1.00|9.00
+174|1538|1508|1.00|9.00
+175|1583|3652|1.00|9.00
+176|1589|1558|1.00|9.00
+177|1636|3704|1.00|9.00
+178|1640|3908|1.00|9.00
+179|1689|1657|1.00|9.00
+180|1691|1658|1.00|9.00
+181|1742|3808|1.00|9.00
+182|754|3790|1.00|10.00
+183|805|3740|1.00|10.00
+184|807|3842|1.00|10.00
+185|856|3690|1.00|10.00
+186|860|3894|1.00|10.00
+187|907|890|1.00|10.00
+188|913|895|1.00|10.00
+189|958|3590|1.00|10.00
+190|966|947|1.00|10.00
+191|1009|990|1.00|10.00
+192|1019|999|1.00|10.00
+193|1060|1040|1.00|10.00
+194|1072|4102|1.00|10.00
+195|1111|1090|1.00|10.00
+196|1125|1103|1.00|10.00
+197|1162|3390|1.00|10.00
+198|1178|1155|1.00|10.00
+199|1213|3340|1.00|10.00
+200|1231|4258|1.00|10.00
+201|1264|1240|1.00|10.00
+202|1284|1259|1.00|10.00
+203|1317|3341|1.00|10.00
+204|1335|4259|1.00|10.00
+205|1370|1344|1.00|10.00
+206|1386|4209|1.00|10.00
+207|1423|1396|1.00|10.00
+208|1437|1409|1.00|10.00
+209|1476|1448|1.00|10.00
+210|1488|4109|1.00|10.00
+211|1529|1500|1.00|10.00
+212|1539|1509|1.00|10.00
+213|1582|3601|1.00|10.00
+214|1590|4009|1.00|10.00
+215|1635|1604|1.00|10.00
+216|1641|1609|1.00|10.00
+217|1688|3705|1.00|10.00
+218|1692|3909|1.00|10.00
+219|1741|1708|1.00|10.00
+220|1743|1709|1.00|10.00
+221|1794|3809|1.00|10.00
+1|1274|-1|0.00|0.00
+2|1275|1250|1.00|1.00
+3|1326|3800|1.00|1.00
+4|1276|1251|1.00|2.00
+5|1327|3851|1.00|2.00
+6|1378|3801|1.00|2.00
+7|1277|1252|1.00|3.00
+8|1328|1302|1.00|3.00
+9|1379|3852|1.00|3.00
+10|1430|3802|1.00|3.00
+11|1278|1253|1.00|4.00
+12|1329|3953|1.00|4.00
+13|1380|1353|1.00|4.00
+14|1431|1403|1.00|4.00
+15|1482|3803|1.00|4.00
+16|1279|1254|1.00|5.00
+17|1330|4004|1.00|5.00
+18|1381|1354|1.00|5.00
+19|1432|3904|1.00|5.00
+20|1483|1454|1.00|5.00
+21|1534|3804|1.00|5.00
+22|1280|1255|1.00|6.00
+23|1331|4055|1.00|6.00
+24|1382|4005|1.00|6.00
+25|1433|1405|1.00|6.00
+26|1484|1455|1.00|6.00
+27|1535|3855|1.00|6.00
+28|1586|3805|1.00|6.00
+29|1281|1256|1.00|7.00
+30|1332|4106|1.00|7.00
+31|1383|4056|1.00|7.00
+32|1434|1406|1.00|7.00
+33|1485|1456|1.00|7.00
+34|1536|1506|1.00|7.00
+35|1587|1556|1.00|7.00
+36|1638|3806|1.00|7.00
+37|1282|1257|1.00|8.00
+38|1333|4157|1.00|8.00
+39|1384|4107|1.00|8.00
+40|1435|1407|1.00|8.00
+41|1486|4007|1.00|8.00
+42|1537|1507|1.00|8.00
+43|1588|1557|1.00|8.00
+44|1639|1607|1.00|8.00
+45|1690|3807|1.00|8.00
+46|1283|1258|1.00|9.00
+47|1334|4208|1.00|9.00
+48|1385|1358|1.00|9.00
+49|1436|4108|1.00|9.00
+50|1487|1458|1.00|9.00
+51|1538|4008|1.00|9.00
+52|1589|1558|1.00|9.00
+53|1640|1608|1.00|9.00
+54|1691|3858|1.00|9.00
+55|1742|3808|1.00|9.00
+56|1284|1259|1.00|10.00
+57|1335|4259|1.00|10.00
+58|1386|4209|1.00|10.00
+59|1437|1409|1.00|10.00
+60|1488|4109|1.00|10.00
+61|1539|1509|1.00|10.00
+62|1590|1559|1.00|10.00
+63|1641|3959|1.00|10.00
+64|1692|1659|1.00|10.00
+65|1743|3859|1.00|10.00
+66|1794|3809|1.00|10.00
+1|1274|-1|0.00|0.00
+2|1275|1250|1.00|1.00
+3|1326|3800|1.00|1.00
+4|1276|1251|1.00|2.00
+5|1327|3851|1.00|2.00
+6|1378|3801|1.00|2.00
+7|1277|1252|1.00|3.00
+8|1328|1302|1.00|3.00
+9|1379|3852|1.00|3.00
+10|1430|3802|1.00|3.00
+11|1278|1253|1.00|4.00
+12|1329|3953|1.00|4.00
+13|1380|1353|1.00|4.00
+14|1431|1403|1.00|4.00
+15|1482|3803|1.00|4.00
+16|1279|1254|1.00|5.00
+17|1330|4004|1.00|5.00
+18|1381|1354|1.00|5.00
+19|1432|3904|1.00|5.00
+20|1483|1454|1.00|5.00
+21|1534|3804|1.00|5.00
+22|1280|1255|1.00|6.00
+23|1331|4055|1.00|6.00
+24|1382|4005|1.00|6.00
+25|1433|1405|1.00|6.00
+26|1484|1455|1.00|6.00
+27|1535|3855|1.00|6.00
+28|1586|3805|1.00|6.00
+29|1281|1256|1.00|7.00
+30|1332|4106|1.00|7.00
+31|1383|4056|1.00|7.00
+32|1434|1406|1.00|7.00
+33|1485|1456|1.00|7.00
+34|1536|1506|1.00|7.00
+35|1587|1556|1.00|7.00
+36|1638|3806|1.00|7.00
+37|1282|1257|1.00|8.00
+38|1333|4157|1.00|8.00
+39|1384|4107|1.00|8.00
+40|1435|1407|1.00|8.00
+41|1486|4007|1.00|8.00
+42|1537|1507|1.00|8.00
+43|1588|1557|1.00|8.00
+44|1639|1607|1.00|8.00
+45|1690|3807|1.00|8.00
+46|1283|1258|1.00|9.00
+47|1334|4208|1.00|9.00
+48|1385|1358|1.00|9.00
+49|1436|4108|1.00|9.00
+50|1487|1458|1.00|9.00
+51|1538|4008|1.00|9.00
+52|1589|1558|1.00|9.00
+53|1640|1608|1.00|9.00
+54|1691|3858|1.00|9.00
+55|1742|3808|1.00|9.00
+56|1284|1259|1.00|10.00
+57|1335|4259|1.00|10.00
+58|1386|4209|1.00|10.00
+59|1437|1409|1.00|10.00
+60|1488|4109|1.00|10.00
+61|1539|1509|1.00|10.00
+62|1590|1559|1.00|10.00
+63|1641|3959|1.00|10.00
+64|1692|1659|1.00|10.00
+65|1743|3859|1.00|10.00
+66|1794|3809|1.00|10.00
diff --git a/src/driving_distance/test/drivingdistance-any-00.test.sql b/src/driving_distance/test/drivingdistance-any-00.test.sql
index b7af8c1..f1e3387 100644
--- a/src/driving_distance/test/drivingdistance-any-00.test.sql
+++ b/src/driving_distance/test/drivingdistance-any-00.test.sql
@@ -1,22 +1,67 @@
 -- each ring will increas by 4 because it is on a square grid
 -- to find the start node number
 -- select *, st_distance(st_makepoint(25,25), the_geom) from vertices_tmp where st_dwithin(st_makepoint(25,25), the_geom, 1.0) order by st_distance(st_makepoint(25,25), the_geom) limit 1;
+BEGIN;
 
+    -- create 50x50 grid of overlapping lines horizontal and vertical
 
---this are equivalent
-select cost, count(*) from (
-    select * from pgr_drivingdistance('select id, source, target, 1.0::float8 as cost from ddnoded2', 1274, 10, false, false)
-) as foo group by cost order by cost asc;
+    DO $$
+    DECLARE debuglevel TEXT;
+    BEGIN
 
-select agg_cost, count(*) from (
-    select * from pgr_drivingdistance('select id, source, target, 1 as cost from ddnoded2', 1274, 10, false)
-) as foo group by agg_cost order by agg_cost asc;
+        EXECUTE 'show client_min_messages' into debuglevel;
 
---- this ones are equivalent
-select agg_cost, count(*) from (
-    select * from pgr_drivingdistance('select id, source, target, 1 as cost from ddnoded2', 1274, 10, true)
-) as foo group by agg_cost order by agg_cost asc;
+        SET client_min_messages TO WARNING;
 
-select agg_cost, count(*) from (
-    select * from pgr_drivingdistance('select id, source, target, 1 as cost from ddnoded2', 1274, 10)
-) as foo group by agg_cost order by agg_cost asc;
+        create table ddunnoded (
+            id serial not null primary key
+        );
+
+        PERFORM  addgeometrycolumn('ddunnoded', 'the_geom', ST_SRID('POINT(0 0)'::geometry), 'LINESTRING', 2);
+
+        INSERT into ddunnoded (the_geom)
+        select st_astext(st_makeline(st_makepoint(0,s1), st_makepoint(51,s1))) from (select generate_series(1,50) as s1) as foo
+        union all
+        select st_astext(st_makeline(st_makepoint(s1,0), st_makepoint(s1,51))) from (select generate_series(1,50) as s1) as foo;
+
+        -- node the grid so we can use it
+        PERFORM pgr_nodenetwork('ddunnoded',0.000001);
+
+        -- copy the noded table into a table we can use for a graph
+        -- and add the required columns
+
+
+        create table ddnoded2 (
+            gid serial not null primary key,
+            id integer,
+            source integer,
+            target integer,
+            cost float8
+        );
+
+        PERFORM addgeometrycolumn('ddnoded2', 'the_geom', ST_SRID('POINT(0 0)'::geometry), 'LINESTRING', 2);
+
+        insert into ddnoded2 (id, cost, the_geom)
+        select a.id, 1.0::float8 as cost, a.the_geom
+        from ddunnoded_noded a order by id, sub_id;
+
+        -- now create a topology
+        PERFORM pgr_createtopology('ddnoded2', 0.000001, id:='gid');
+
+        -- Total query runtime: 8080 ms.
+
+
+        execute 'set client_min_messages  to '|| debuglevel;
+    END $$;
+
+    --this are equivalent
+    select seq, id1, id2, round(cost::numeric, 2) from pgr_drivingdistance('select id, source, target, 1.0::float8 as cost from ddnoded2', 1274, 10, false, false);
+    select seq, node, edge, round(cost::numeric, 2), round(agg_cost::numeric,2) from pgr_drivingdistance('select id, source, target, 1.0::float8 as cost from ddnoded2', 1274, 10, false);
+
+
+    --- this ones are equivalent
+    select seq, node, edge, round(cost::numeric, 2), round(agg_cost::numeric,2) from pgr_drivingdistance('select id, source, target, 1.0::float8 as cost from ddnoded2', 1274, 10, true);
+    select seq, node, edge, round(cost::numeric, 2), round(agg_cost::numeric,2) from pgr_drivingdistance('select id, source, target, 1.0::float8 as cost from ddnoded2', 1274, 10);
+
+
+    ROLLBACK;
diff --git a/src/driving_distance/test/drivingdistance-doc-v2.result b/src/driving_distance/test/drivingdistance-doc-v2.result
deleted file mode 100644
index 78030bc..0000000
--- a/src/driving_distance/test/drivingdistance-doc-v2.result
+++ /dev/null
@@ -1,4 +0,0 @@
-7|0
-8|1
-7|0
-8|1
diff --git a/src/driving_distance/test/drivingdistance-doc-v2.test.sql b/src/driving_distance/test/drivingdistance-doc-v2.test.sql
deleted file mode 100644
index c3e1b34..0000000
--- a/src/driving_distance/test/drivingdistance-doc-v2.test.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_drivingDistance
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-SELECT id1 AS node, cost
-        FROM pgr_drivingDistance(
-                'SELECT id, source, target, cost FROM edge_table',
-                7, 1.5, false, false
-        ) ;
-
-SELECT id1 AS node, cost
-        FROM pgr_drivingDistance(
-                'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-                7, 1.5, true, true
-        ) ;
diff --git a/src/driving_distance/test/drivingdistance-doc-v3.result b/src/driving_distance/test/drivingdistance-doc-v3.result
deleted file mode 100644
index e2821ba..0000000
--- a/src/driving_distance/test/drivingdistance-doc-v3.result
+++ /dev/null
@@ -1,173 +0,0 @@
-1|1|1|1|1
-1|2|-1|0|0
-1|5|4|1|1
-1|6|8|1|2
-1|7|6|1|3
-1|8|7|1|2
-1|9|9|1|3
-1|10|10|1|2
-1|11|12|1|3
-1|13|14|1|3
-2|2|4|1|3
-2|5|10|1|2
-2|6|8|1|3
-2|8|7|1|3
-2|10|14|1|1
-2|11|12|1|2
-2|12|13|1|3
-2|13|-1|0|0
-3|1|1|1|1
-3|2|-1|0|0
-3|5|4|1|1
-3|6|8|1|2
-3|7|6|1|3
-3|8|7|1|2
-3|9|9|1|3
-3|10|10|1|2
-3|11|12|1|3
-3|13|14|1|3
-3|2|4|1|3
-3|5|10|1|2
-3|6|8|1|3
-3|8|7|1|3
-3|10|14|1|1
-3|11|12|1|2
-3|12|13|1|3
-3|13|-1|0|0
-4|1|1|1|1
-4|2|-1|0|0
-4|5|4|1|1
-4|6|8|1|2
-4|7|6|1|3
-4|8|7|1|2
-4|9|9|1|3
-4|10|10|1|2
-4|11|12|1|3
-4|12|13|1|3
-4|13|-1|0|0
-5|1|1|1|1
-5|2|-1|0|0
-5|3|2|1|1
-5|4|3|1|2
-5|5|4|1|1
-5|6|8|1|2
-5|7|6|1|3
-5|8|7|1|2
-5|9|16|1|3
-5|10|10|1|2
-5|11|12|1|3
-5|13|14|1|3
-6|2|1|3
-6|5|1|2
-6|6|1|3
-6|8|1|3
-6|10|1|1
-6|11|1|2
-6|12|1|3
-6|13|0|0
-7|2|1|1|1
-7|2|2|0|0
-7|2|3|1|1
-7|2|4|1|2
-7|2|5|1|1
-7|2|6|1|2
-7|2|7|1|3
-7|2|8|1|2
-7|2|9|1|3
-7|2|10|1|2
-7|2|11|1|3
-7|2|13|1|3
-7|13|2|1|3
-7|13|5|1|2
-7|13|6|1|3
-7|13|8|1|3
-7|13|10|1|1
-7|13|11|1|2
-7|13|12|1|3
-7|13|13|0|0
-8|2|1|1|1|1
-8|2|2|-1|0|0
-8|2|3|2|1|1
-8|2|4|3|1|2
-8|2|5|4|1|1
-8|2|6|8|1|2
-8|2|7|6|1|3
-8|2|8|7|1|2
-8|2|9|16|1|3
-8|2|10|10|1|2
-8|2|11|12|1|3
-8|13|12|13|1|3
-8|13|13|-1|0|0
-9|2|-1|0|0
-9|5|4|1|1
-9|6|8|1|2
-9|9|9|1|3
-9|10|10|1|2
-9|11|11|1|3
-9|13|14|1|3
-10|13|-1|0|0
-11|2|2|-1|0|0
-11|2|5|4|1|1
-11|2|6|8|1|2
-11|2|9|9|1|3
-11|2|10|10|1|2
-11|2|11|11|1|3
-11|2|13|14|1|3
-11|13|13|-1|0|0
-12|2|2|-1|0|0
-12|2|5|4|1|1
-12|2|6|8|1|2
-12|2|9|9|1|3
-12|2|10|10|1|2
-12|2|11|11|1|3
-12|13|13|-1|0|0
-13|1|1|1|1
-13|2|-1|0|0
-13|3|5|1|3
-13|5|4|1|1
-13|6|8|1|2
-13|7|6|1|3
-13|8|7|1|2
-13|9|9|1|3
-13|10|10|1|2
-13|11|12|1|3
-13|13|14|1|3
-14|2|1|3
-14|5|1|2
-14|6|1|3
-14|8|1|3
-14|10|1|1
-14|11|1|2
-14|12|1|3
-14|13|0|0
-15|2|1|1|1
-15|2|2|0|0
-15|2|3|1|3
-15|2|5|1|1
-15|2|6|1|2
-15|2|7|1|3
-15|2|8|1|2
-15|2|9|1|3
-15|2|10|1|2
-15|2|11|1|3
-15|2|13|1|3
-15|13|2|1|3
-15|13|5|1|2
-15|13|6|1|3
-15|13|8|1|3
-15|13|10|1|1
-15|13|11|1|2
-15|13|12|1|3
-15|13|13|0|0
-16|2|1|1|1|1
-16|2|2|-1|0|0
-16|2|3|5|1|3
-16|2|5|4|1|1
-16|2|6|8|1|2
-16|2|7|6|1|3
-16|2|8|7|1|2
-16|2|9|9|1|3
-16|2|10|10|1|2
-16|2|11|12|1|3
-16|13|12|13|1|3
-16|13|13|-1|0|0
diff --git a/src/driving_distance/test/drivingdistance-doc-v3.test.sql b/src/driving_distance/test/drivingdistance-doc-v3.test.sql
deleted file mode 100644
index c592643..0000000
--- a/src/driving_distance/test/drivingdistance-doc-v3.test.sql
+++ /dev/null
@@ -1,91 +0,0 @@
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              PGR_drivingDistance  V3
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-
-
-SELECT 1, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        2, 3
-      ) order by node;
-
-SELECT 2, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        13, 3
-      ) order by node;
-
-SELECT 3, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3
-      ) order by from_v, node;
-
-SELECT 4, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3, equicost:=true
-      ) order by from_v, node;
---------------------------------------------------------------
-SELECT 5, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        2, 3, false
-      ) order by node;
-
-SELECT 6, node, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        13, 3, false
-      ) order by node;
-
-SELECT 7, from_v, node, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3, false
-      ) order by from_v, node;
-
-SELECT 8, from_v, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-        array[2,13], 3, false, equicost:=true
-      ) order by from_v, node;
-
----------------------------------------------------------------
-
-SELECT 9, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        2, 3
-      ) order by node;
-
-SELECT 10, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        13, 3
-      ) order by node;
-
-SELECT 11, from_v, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3
-      ) order by from_v, node;
-
-SELECT 12, from_v, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3, equicost:=true
-      ) order by from_v, node;
---------------------------------------------------------------
-SELECT 13, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        2, 3, false
-      ) order by node;
-
-SELECT 14, node, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        13, 3, false
-      ) order by node;
-
-SELECT 15, from_v, node, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3, false
-      ) order by from_v, node;
-
-SELECT 16, from_v, node, edge, cost, agg_cost FROM pgr_drivingDistance(
-        'SELECT id, source, target, cost FROM edge_table',
-        array[2,13], 3, false, equicost:=true
-      ) order by from_v, node;
-
----------------------------------------------------------------
-
diff --git a/src/driving_distance/test/pgtap/issue-519.sql b/src/driving_distance/test/pgtap/issue-519.sql
new file mode 100644
index 0000000..2cb5283
--- /dev/null
+++ b/src/driving_distance/test/pgtap/issue-519.sql
@@ -0,0 +1,30 @@
+\i setup.sql
+
+SELECT plan(3);
+
+PREPARE q1 AS
+SELECT 1 AS from_v, node, edge, cost, agg_cost FROM pgr_drivingDistance( 'select id, source, target, cost from edge_table',
+    1, 3.5);
+
+PREPARE q2 AS
+SELECT 5 AS from_v, node, edge, cost, agg_cost  FROM pgr_drivingDistance( 'select id, source, target, cost from edge_table',
+    5, 3.5);
+
+PREPARE q3 AS
+SELECT 25 AS from_v, node, edge, cost, agg_cost  FROM pgr_drivingDistance( 'select id, source, target, cost from edge_table',
+    25, 3.5);
+
+Prepare q4 AS
+SELECT from_v, node, edge, cost, agg_cost FROM pgr_drivingDistance( 'select id, source, target, cost from edge_table',
+    ARRAY[1, 5, 25], 3.5);
+
+
+
+SELECT bag_has( 'q4', 'q1', '1: DD from [1, 5, 25] should have results of DD from 1');
+SELECT bag_has( 'q4', 'q2', '2: DD from [1, 5, 25] should have results of DD from 5');
+SELECT bag_has( 'q4', 'q3', '3: DD from [1, 5, 25] should have results of DD from 25');
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/driving_distance/test/sampledata.data b/src/driving_distance/test/sampledata.data
deleted file mode 100644
index db6f2cb..0000000
--- a/src/driving_distance/test/sampledata.data
+++ /dev/null
@@ -1,59 +0,0 @@
-
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
---              SAMPLE DATA                
-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
-drop table if exists edge_table;
-
-CREATE TABLE edge_table (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-select pgr_createTopology('edge_table',0.001);
-
-drop table if exists vertex_table;
-CREATE TABLE vertex_table (
-    id serial,
-    x double precision,
-    y double precision
-);
-
-INSERT INTO vertex_table VALUES
-        (1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
-        (8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
diff --git a/src/driving_distance/test/test.conf b/src/driving_distance/test/test.conf
index 870ee1d..a633183 100644
--- a/src/driving_distance/test/test.conf
+++ b/src/driving_distance/test/test.conf
@@ -3,13 +3,17 @@
 %main::tests = (
     'any' => {
         'comment' => 'Driving Distance test for any versions.',
-        'data' => ['drivingdistance-any-00.data','sampledata.data'],
+        'data' => [],
         'tests' => [qw(
-drivingdistance-any-00
-drivingdistance-doc-v2
-drivingdistance-doc-v3
-)]
-        },
+            drivingdistance-any-00
+            doc-pgr_drivingDistance
+            doc-pgr_drivingdistance-v2
+            )],
+        'documentation' => [qw(
+            doc-pgr_drivingDistance
+            doc-pgr_drivingdistance-v2
+            )]
+    },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
 #    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
diff --git a/src/index.rst b/src/index.rst
deleted file mode 100644
index 7997061..0000000
--- a/src/index.rst
+++ /dev/null
@@ -1,42 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _routing_functions:
-
-Routing Functions
-------------------
-
-  -  :ref:`pgr_apspJohnson <pgr_apsp_johnson>`- All Pairs Shortest Path, Johnson’s Algorithm
-  -  :ref:`pgr_apspWarshall<pgr_apsp_warshall>` - All Pairs Shortest Path, Floyd-Warshall Algorithm
-  -  :ref:`pgr_astar<pgr_astar>` - Shortest Path A*
-  -  :ref:`pgr_bdAstar<bd_astar>` - Bi-directional A* Shortest Path
-  -  :ref:`pgr_bdDijkstra<bd_dijkstra>` - Bi-directional Dijkstra Shortest Path
-  -  :ref:`pgr_dijkstra<pgr_dijkstra>` - Shortest Path Dijkstra
-  -  :ref:`pgr_drivingDistance<pgr_driving_distance>` - Driving distamce
-  -  :ref:`pgr_kDijkstra<pgr_kdijkstra>` - Mutliple destination Shortest Path Dijkstra
-  -  :ref:`pgr_ksp<pgr_ksp>` - K-Shortest Path
-  -  :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
-  -  :ref:`pgr_trsp<trsp>` - Turn Restriction Shortest Path (TRSP)
-
-.. toctree::
-	:hidden: 
-
-	apsp_johnson/doc/index
-	apsp_warshall/doc/index
-	astar/doc/index
-	bd_astar/doc/index
-	bd_dijkstra/doc/index
-	dijkstra/doc/index
-	driving_distance/doc/index
-	kdijkstra/doc/index
-	ksp/doc/index
-	tsp/doc/index
-	trsp/doc/index
-
-
diff --git a/src/kdijkstra/doc/doc-kdijkstra.queries b/src/kdijkstra/doc/doc-kdijkstra.queries
new file mode 100644
index 0000000..7f20492
--- /dev/null
+++ b/src/kdijkstra/doc/doc-kdijkstra.queries
@@ -0,0 +1,50 @@
+BEGIN;
+BEGIN
+-- q1
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+    10, array[4,12], false, false);
+NOTICE:  Deprecated function. Use pgr_dijkstraCost instead.
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |  10 |   4 |    4
+   1 |  10 |  12 |    2
+(2 rows)
+
+-- q2
+SELECT * FROM pgr_kdijkstraPath(
+      'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+      10, array[4,12], false, false);
+NOTICE:  Deprecated function: Use pgr_dijkstra instead.
+ seq | id1 | id2 | id3 | cost 
+-----+-----+-----+-----+------
+   0 |   4 |  10 |  12 |    1
+   1 |   4 |  11 |  13 |    1
+   2 |   4 |  12 |  15 |    1
+   3 |   4 |   9 |  16 |    1
+   4 |   4 |   4 |  -1 |    0
+   5 |  12 |  10 |  12 |    1
+   6 |  12 |  11 |  13 |    1
+   7 |  12 |  12 |  -1 |    0
+(8 rows)
+
+-- q3
+SELECT id1 AS path, st_AStext(st_linemerge(st_union(b.the_geom))) AS the_geom
+  FROM pgr_kdijkstraPath(
+                  'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+                  10, array[4,12], false, false
+            ) a,
+            edge_table b
+WHERE a.id3=b.id
+GROUP by id1
+ORDER by id1;
+NOTICE:  Deprecated function: Use pgr_dijkstra instead.
+ path |            the_geom             
+------+---------------------------------
+    4 | LINESTRING(2 3,3 3,4 3,4 2,4 1)
+   12 | LINESTRING(2 3,3 3,4 3)
+(2 rows)
+
+-- q4
+ROLLBACK;
+ROLLBACK
diff --git a/src/kdijkstra/doc/index.rst b/src/kdijkstra/doc/index.rst
deleted file mode 100644
index 5084032..0000000
--- a/src/kdijkstra/doc/index.rst
+++ /dev/null
@@ -1,155 +0,0 @@
-..
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_kdijkstra:
-
-pgr_kDijkstra - Mutliple destination Shortest Path Dijkstra
-===============================================================================
-
-.. index::
-    single: pgr_kDijkstraCost(text,integer,integer[],boolean,boolean)
-    single: pgr_kDijkstraPath(text,integer,integer[],boolean,boolean)
-
-Name
--------------------------------------------------------------------------------
-
-* ``pgr_kdijkstraCost`` - Returns the costs for K shortest paths using Dijkstra algorithm.
-* ``pgr_kdijkstraPath`` - Returns the paths for K shortest paths using Dijkstra algorithm.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-These functions allow you to have a single start node and multiple destination nodes and will compute the routes to all the destinations from the source node. Returns a set of :ref:`pgr_costResult <type_cost_result>` or :ref:`pgr_costResult3 <type_cost_result3>`. ``pgr_kdijkstraCost`` returns one record for each destination node and the cost is the total code of the route to that node. ``pgr_kdijkstraPath`` returns one record for every edge in that path from source to destination and the [...]
-
-.. code-block:: sql
-
-    pgr_costResult[] pgr_kdijkstraCost(text sql, integer source,
-                     integer[] targets, boolean directed, boolean has_rcost);
-
-    pgr_costResult3[] pgr_kdijkstraPath(text sql, integer source,
-                      integer[] targets, boolean directed, boolean has_rcost);
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-    .. code-block:: sql
-
-        SELECT id, source, target, cost [,reverse_cost] FROM edge_table
-
-
-    :id: ``int4`` identifier of the edge
-    :source: ``int4`` identifier of the source vertex
-    :target: ``int4`` identifier of the target vertex
-    :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-    :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:targets: ``int4[]`` an array of ids of the end points
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-
-``pgr_kdijkstraCost`` returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   path vertex source id (this will always be source start point in the query).
-:id2:   path vertex target id
-:cost:  cost to traverse the path from ``id1`` to ``id2``. Cost will be -1.0 if there is no path to that target vertex id.
-
-
-``pgr_kdijkstraPath`` returns set of :ref:`type_cost_result3`:
-
-:seq:   row sequence
-:id1:   path target id (identifies the target path).
-:id2:   path edge source node id
-:id3:   path edge id (``-1`` for the last row)
-:cost:  cost to traverse this edge or -1.0 if there is no path to this target
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Returning a ``cost`` result
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS source, id2 AS target, cost FROM pgr_kdijkstraCost(
-        'SELECT id, source, target, cost FROM edge_table',
-        10, array[4,12], false, false
-    );
-
-     seq | source | target | cost 
-    -----+--------+--------+------
-       0 |     10 |      4 |    4
-       1 |     10 |     12 |    2
-
-
-.. code-block:: sql
-
-    SELECT seq, id1 AS path, id2 AS node, id3 AS edge, cost
-      FROM pgr_kdijkstraPath(
-          'SELECT id, source, target, cost FROM edge_table',
-          10, array[4,12], false, false
-    );
-
-     seq | path | node | edge | cost
-    -----+------+------+------+------
-       0 |    4 |   10 |   12 |    1
-       1 |    4 |   11 |   13 |    1
-       2 |    4 |   12 |   15 |    1
-       3 |    4 |    9 |   16 |    1
-       4 |    4 |    4 |   -1 |    0
-       5 |   12 |   10 |   12 |    1
-       6 |   12 |   11 |   13 |    1
-       7 |   12 |   12 |   -1 |    0
-    (8 rows)
-
-* Returning a ``path`` result
-
-.. code-block:: sql
-
-    SELECT id1 as path, st_astext(st_linemerge(st_union(b.the_geom))) as the_geom
-      FROM pgr_kdijkstraPath(
-                      'SELECT id, source, target, cost FROM edge_table',
-                      10, array[4,12], false, false
-                ) a,
-                edge_table b
-    WHERE a.id3=b.id
-    GROUP by id1
-    ORDER by id1;
-
-    path |            the_geom
-    ------+---------------------------------
-        4 | LINESTRING(2 3,3 3,4 3,4 2,4 1)
-       12 | LINESTRING(2 3,3 3,4 3)
-    (2 rows)
-
-
-There is no assurance that the result above will be ordered in the direction
-of flow of the route, ie: it might be reversed. You will need to check if
-``st_startPoint()`` of the route is the same as the start node location and
-if it is not then call ``st_reverse()`` to reverse the direction of the route.
-This behavior is a function of PostGIS functions ``st_linemerge()`` and 
-``st_union()`` and not pgRouting.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
diff --git a/src/kdijkstra/doc/pgr_kDijkstra.rst b/src/kdijkstra/doc/pgr_kDijkstra.rst
new file mode 100644
index 0000000..66163fb
--- /dev/null
+++ b/src/kdijkstra/doc/pgr_kDijkstra.rst
@@ -0,0 +1,127 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+
+.. _pgr_kdijkstra:
+
+pgr_kDijkstra - Mutliple destination Shortest Path Dijkstra
+===============================================================================
+
+.. index::
+    single: pgr_kDijkstraCost(text,integer,integer[],boolean,boolean) -- deprecated 
+    single: pgr_kDijkstraPath(text,integer,integer[],boolean,boolean) -- deprecated
+
+Name
+-------------------------------------------------------------------------------
+
+* ``pgr_kdijkstraCost`` - Returns the costs for K shortest paths using Dijkstra algorithm.
+
+.. warning:: This functions is deprecated in 2.2.
+    Use :ref:`pgr_dijkstraCost` instead.
+
+* ``pgr_kdijkstraPath`` - Returns the paths for K shortest paths using Dijkstra algorithm.
+
+.. warning:: This function is deprecated in 2.2.
+    Use :ref:`pgr_dijkstra` instead.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+These functions allow you to have a single start node and multiple destination nodes and will compute the routes to all the destinations from the source node. Returns a set of :ref:`pgr_costResult <type_cost_result>` or :ref:`pgr_costResult3 <type_cost_result3>`. ``pgr_kdijkstraCost`` returns one record for each destination node and the cost is the total code of the route to that node. ``pgr_kdijkstraPath`` returns one record for every edge in that path from source to destination and the [...]
+
+.. code-block:: sql
+
+    pgr_costResult[] pgr_kdijkstraCost(text sql, integer source,
+                     integer[] targets, boolean directed, boolean has_rcost);
+
+    pgr_costResult3[] pgr_kdijkstraPath(text sql, integer source,
+                      integer[] targets, boolean directed, boolean has_rcost);
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+    .. code-block:: sql
+
+        SELECT id, source, target, cost [,reverse_cost] FROM edge_table
+
+
+    :id: ``int4`` identifier of the edge
+    :source: ``int4`` identifier of the source vertex
+    :target: ``int4`` identifier of the target vertex
+    :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+    :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:targets: ``int4[]`` an array of ids of the end points
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+
+``pgr_kdijkstraCost`` returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   path vertex source id (this will always be source start point in the query).
+:id2:   path vertex target id
+:cost:  cost to traverse the path from ``id1`` to ``id2``. Cost will be -1.0 if there is no path to that target vertex id.
+
+
+``pgr_kdijkstraPath`` returns set of :ref:`type_cost_result3`:
+
+:seq:   row sequence
+:id1:   path target id (identifies the target path).
+:id2:   path edge source node id
+:id3:   path edge id (``-1`` for the last row)
+:cost:  cost to traverse this edge or -1.0 if there is no path to this target
+
+
+.. rubric:: History
+
+* Deprecated in version 2.0.0
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Returning a ``cost`` result
+
+
+.. literalinclude:: doc-kdijkstra.queries
+   :start-after: -- q1
+   :end-before: -- q2
+
+
+.. literalinclude:: doc-kdijkstra.queries
+   :start-after: -- q2
+   :end-before: -- q3
+
+
+* Returning a ``path`` result
+
+.. literalinclude:: doc-kdijkstra.queries
+   :start-after: -- q3
+   :end-before: -- q4
+
+There is no assurance that the result above will be ordered in the direction
+of flow of the route, ie: it might be reversed. You will need to check if
+``st_startPoint()`` of the route is the same as the start node location and
+if it is not then call ``st_reverse()`` to reverse the direction of the route.
+This behavior is a function of PostGIS functions ``st_linemerge()`` and 
+``st_union()`` and not pgRouting.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
diff --git a/src/kdijkstra/sql/CMakeLists.txt b/src/kdijkstra/sql/CMakeLists.txt
index 287c108..933cd12 100644
--- a/src/kdijkstra/sql/CMakeLists.txt
+++ b/src/kdijkstra/sql/CMakeLists.txt
@@ -1,6 +1,6 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/kdijkstra.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/kdijkstra-V2.2.sql
 )
 
 # set in parent scope
diff --git a/src/kdijkstra/sql/kdijkstra-V2.2.sql b/src/kdijkstra/sql/kdijkstra-V2.2.sql
new file mode 100644
index 0000000..953d9bb
--- /dev/null
+++ b/src/kdijkstra/sql/kdijkstra-V2.2.sql
@@ -0,0 +1,195 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; IF not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+CREATE OR REPLACE FUNCTION pgr_kdijkstraPath(
+    sql text,
+    source INTEGER,
+    targets INTEGER ARRAY,
+    directed BOOLEAN,
+    has_rcost BOOLEAN)
+    RETURNS SETOF pgr_costResult3 AS
+    $BODY$
+    DECLARE
+    has_reverse BOOLEAN;
+    new_sql TEXT;
+    result pgr_costResult3;
+    tmp pgr_costResult3;
+    sseq INTEGER;
+    i INTEGER;
+    BEGIN
+        RAISE NOTICE 'Deprecated function: Use pgr_dijkstra instead.';
+        has_reverse =_pgr_parameter_check('dijkstra', sql, false);
+        new_sql = sql;
+        IF (array_ndims(targets) != 1) THEN
+            raise EXCEPTION 'Error, reverse_cost is used, but query did''t return ''reverse_cost'' column'
+            USING ERRCODE = 'XX000';
+        END IF;
+
+        IF (has_reverse != has_rcost) THEN
+            IF (has_reverse) THEN
+                new_sql = 'SELECT id, source, target, cost FROM (' || sql || ') a';
+            ELSE
+                raise EXCEPTION 'Error, reverse_cost is used, but query did''t return ''reverse_cost'' column'
+                USING ERRCODE = 'XX000';
+            END IF;
+        END IF;
+        SELECT ARRAY(SELECT DISTINCT UNNEST(targets) ORDER BY 1) INTO targets;
+
+        sseq = 0; i = 1;
+        FOR result IN 
+            SELECT seq, a.end_vid::INTEGER AS id1, a.node::INTEGER AS i2, a.edge::INTEGER AS id3, cost
+            FROM pgr_dijkstra(new_sql, source, targets, directed) a ORDER BY a.end_vid, seq LOOP
+            WHILE (result.id1 != targets[i]) LOOP
+                tmp.seq = sseq;
+                tmp.id1 = targets[i];
+                IF (targets[i] = source) THEN
+                    tmp.id2 = source;
+                    tmp.cost =0;
+                ELSE
+                    tmp.id2 = 0;
+                    tmp.cost = -1;
+                END IF;
+                tmp.id3 = -1;
+                RETURN next tmp;
+                i = i + 1;
+                sseq = sseq + 1;
+            END LOOP;
+        IF (result.id1 = targets[i] AND result.id3 != -1) THEN
+            result.seq = sseq;
+            RETURN next result;
+            sseq = sseq + 1;
+            CONTINUE;
+        END IF;
+        IF (result.id1 = targets[i] AND result.id3 = -1) THEN
+            result.seq = sseq;
+            RETURN next result;
+            i = i + 1;
+            sseq = sseq + 1;
+            CONTINUE;
+        END IF;
+    END LOOP;
+    WHILE (i <= array_length(targets,1)) LOOP
+        tmp.seq = sseq;
+        tmp.id1 = targets[i];
+        IF (targets[i] = source) THEN
+            tmp.id2 = source;
+            tmp.cost = 0;
+        ELSE
+            tmp.id2 = 0;
+            tmp.cost = -1;
+        END IF;
+        tmp.id3 = -1;
+        RETURN next tmp;
+        i = i + 1;
+        sseq = sseq + 1;
+    END LOOP;
+
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+CREATE OR REPLACE FUNCTION pgr_kdijkstracost(
+    sql text,
+    source INTEGER,
+    targets INTEGER array,
+    directed BOOLEAN,
+    has_rcost BOOLEAN)
+RETURNS SETOF pgr_costResult AS
+$BODY$
+DECLARE
+has_reverse BOOLEAN;
+new_sql TEXT;
+result pgr_costResult;
+tmp pgr_costResult;
+sseq INTEGER;
+i INTEGER;
+BEGIN
+    RAISE NOTICE 'Deprecated function. Use pgr_dijkstraCost instead.';
+    has_reverse =_pgr_parameter_check('dijkstra', sql, false);
+    new_sql = sql;
+    IF (array_ndims(targets) != 1) THEN
+        raise EXCEPTION 'Error, reverse_cost is used, but query did''t return ''reverse_cost'' column'
+        USING ERRCODE = 'XX000';
+    END IF;
+
+
+    IF (has_reverse != has_rcost) THEN
+        IF (has_reverse) THEN
+            new_sql = 'SELECT id, source, target, cost FROM (' || sql || ') a';
+        ELSE
+            RAISE EXCEPTION 'Error, reverse_cost is used, but query did''t return ''reverse_cost'' column'
+            USING ERRCODE = 'XX000';
+        END IF;
+    END IF;
+
+    SELECT ARRAY(SELECT DISTINCT UNNEST(targets) ORDER BY 1) INTO targets;
+
+    sseq = 0; i = 1;
+    FOR result IN 
+        SELECT ((row_number() over()) -1)::INTEGER, a.start_vid::INTEGER, a.end_vid::INTEGER, agg_cost
+        FROM pgr_dijkstraCost(new_sql, source, targets, directed) a ORDER BY end_vid LOOP
+        WHILE (result.id2 != targets[i]) LOOP
+            tmp.seq = sseq;
+            tmp.id1 = source;
+            tmp.id2 = targets[i];
+            IF (targets[i] = source) THEN
+                tmp.cost = 0;
+            ELSE
+                tmp.cost = -1;
+            END IF;
+            RETURN next tmp;
+            i = i + 1;
+            sseq = sseq + 1;
+        END LOOP;
+        IF (result.id2 = targets[i]) THEN
+            result.seq = sseq;
+            RETURN next result;
+            i = i + 1;
+            sseq = sseq + 1;
+        END IF;
+    END LOOP;
+    WHILE (i <= array_length(targets,1)) LOOP
+        tmp.seq = sseq;
+        tmp.id1 = source;
+        tmp.id2 = targets[i];
+        IF (targets[i] = source) THEN
+            tmp.cost = 0;
+        ELSE
+            tmp.cost = -1;
+        END IF;
+        RETURN next tmp;
+        i = i + 1;
+        sseq = sseq + 1;
+    END LOOP;
+
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
diff --git a/src/kdijkstra/sql/kdijkstra.sql b/src/kdijkstra/sql/kdijkstra.sql
deleted file mode 100644
index 303ea93..0000000
--- a/src/kdijkstra/sql/kdijkstra.sql
+++ /dev/null
@@ -1,55 +0,0 @@
------------------------------------------------------------------------
--- Core function for one_to_many_dijkstra_shortest_path computation
------------------------------------------------------------------------
---
---
-
-/*CREATE TYPE dist_result AS (vertex_id_source integer, edge_id_source integer, vertex_id_target integer, edge_id_target integer, cost float8);
-CREATE TYPE concatpath_result AS (vertex_id_source integer, edge_id_source integer, vertex_id_target integer, edge_id_target integer, cost float8, the_way text);
-
-CREATE OR REPLACE FUNCTION KDijkstra_dist_sp(
-	    sql text,
-		source_vid integer, 
-        target_vid integer array, 
-        directed boolean, 
-        has_reverse_cost boolean)
-        RETURNS SETOF dist_result
-        AS '$libdir/librouting', 'onetomany_dijkstra_dist'
-        LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OR REPLACE FUNCTION KDijkstra_ways_sp(
-	    sql text,
-		source_vid integer, 
-        target_vid integer array, 
-        directed boolean, 
-        has_reverse_cost boolean)
-        RETURNS SETOF concatpath_result
-        AS '$libdir/librouting', 'onetomany_dijkstra_path'
-        LANGUAGE C IMMUTABLE STRICT;
-*/
-
-CREATE OR REPLACE FUNCTION pgr_kdijkstracost(
-    sql text,
-    source_vid integer,
-    target_vid integer array,
-    directed boolean,
-    has_reverse_cost boolean)
-    RETURNS SETOF pgr_costResult
-    AS '$libdir/librouting-2.1', 'onetomany_dijkstra_dist'
-    LANGUAGE C STABLE STRICT;
-
-CREATE OR REPLACE FUNCTION pgr_kdijkstrapath(
-    sql text,
-    source_vid integer,
-    target_vid integer array,
-    directed boolean,
-    has_reverse_cost boolean)
-    RETURNS SETOF pgr_costResult3
-    AS '$libdir/librouting-2.1', 'onetomany_dijkstra_path'
-    LANGUAGE C STABLE STRICT;
-
-CREATE OR REPLACE FUNCTION pgr_vidsToDMatrix(sql text,
-    vids integer[], dir bool, has_rcost bool, want_symmetric bool)
-    RETURNS float8[]
-    AS '$libdir/librouting-2.1', 'manytomany_dijkstra_dmatrix'
-    LANGUAGE C STABLE STRICT;
diff --git a/src/kdijkstra/src/CMakeLists.txt b/src/kdijkstra/src/CMakeLists.txt
index 702fa34..c3f928d 100644
--- a/src/kdijkstra/src/CMakeLists.txt
+++ b/src/kdijkstra/src/CMakeLists.txt
@@ -1 +1,3 @@
-ADD_LIBRARY(kdijkstra OBJECT k_targets_boost_wrapper.cpp  k_targets_sp.c  k_targets_sp.h)
+ADD_LIBRARY(kdijkstra OBJECT 
+    k_targets_boost_wrapper.cpp  
+    k_targets_sp.c)
diff --git a/src/kdijkstra/src/k_targets_boost_wrapper.cpp b/src/kdijkstra/src/k_targets_boost_wrapper.cpp
index 02e965b..33f7ebc 100644
--- a/src/kdijkstra/src/k_targets_boost_wrapper.cpp
+++ b/src/kdijkstra/src/k_targets_boost_wrapper.cpp
@@ -1,23 +1,27 @@
-/*
+/*PGR-GNU*****************************************************************
+
  * Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2005 Sylvain Pasche
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 #ifdef __MINGW32__
 #include <winsock2.h>
@@ -33,25 +37,11 @@
 #include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/dijkstra_shortest_paths.hpp>
 
-#include "k_targets_sp.h"
+#include "k_targets_boost_wrapper.h"
 
 using namespace std;
 using namespace boost;
 
-/*
-//    FIXME: use this to avoid heap allocation ?
-
-void* operator new(size_t size)
-{
-return palloc(size);
-}
-
-void operator delete(void *p)
-{
-    pfree(p);
-}
-
-*/
 
 // Maximal number of nodes in the path (to avoid infinite loops)
 #define MAX_NODES 100000000
@@ -87,11 +77,7 @@ graph_add_edge(G &graph, E &e, int id, int source, int target, float8 cost)
 int onetomany_dijkstra_boostdist(edge_t *edges, unsigned int count,
         int start_vertex, int *end_vertices, int nb_targets,
         bool directed, bool has_reverse_cost,
-#ifdef PGR_MERGE
         pgr_cost_t **dists,
-#else
-        dist_fromto_t **dists,
-#endif
         char **err_msg)
 {
   try {    
@@ -146,7 +132,7 @@ int onetomany_dijkstra_boostdist(edge_t *edges, unsigned int count,
         return -1;
     }
 
-    vertex_descriptor _target[nb_targets];
+    std::vector < vertex_descriptor > _target(nb_targets);
     for (int i = 0; i < nb_targets; i++)
     {
         _target[i] = vertex(end_vertices[i], graph);
@@ -166,13 +152,14 @@ int onetomany_dijkstra_boostdist(edge_t *edges, unsigned int count,
                 weight_map(get(&Vertex::cost, graph))
                 .distance_map(&distances[0]));
 
-    std::vector< std::vector<int> > path_vect(nb_targets);
+    std::vector< std::vector<uint64_t> > path_vect(nb_targets);
 
     int max;
 
     int index_of_last_path_vertex = 0;
-    int sum_path_sizes = 0, i = 0, j = 0;
-    bool no_path[nb_targets];
+    size_t sum_path_sizes = 0;
+    int i = 0, j = 0;
+    std::vector < bool > no_path(nb_targets);
     for (i = 0; i < nb_targets; i++)
     {
         no_path[i] = false;
@@ -203,35 +190,24 @@ int onetomany_dijkstra_boostdist(edge_t *edges, unsigned int count,
         sum_path_sizes += path_vect[i].size();
     }
 
-#ifdef PGR_MERGE
     *dists = (pgr_cost_t *) malloc(sizeof(pgr_cost_t) * nb_targets + 1);
     if (! *dists) {
         *err_msg = (char *) "Error: out of memory";
         return -1;
     }
-#else
-    *dists = (dist_fromto_t *) malloc(sizeof(dist_fromto_t) * nb_targets + 1);
-#endif
 
     for (int numTarget = 0; numTarget < nb_targets; numTarget++)
     {
 
-#ifdef PGR_MERGE
         (*dists)[numTarget].seq = numTarget;
-        (*dists)[numTarget].id1 = path_vect[numTarget].at(path_vect[numTarget].size() -1);
-        (*dists)[numTarget].id2 = path_vect[numTarget].at(0);
-#else
-        (*dists)[numTarget].vertex_id_source = path_vect[numTarget].at(path_vect[numTarget].size() -1);
-        (*dists)[numTarget].vertex_id_target = path_vect[numTarget].at(0);
-        (*dists)[numTarget].edge_id_source = -1;
-        (*dists)[numTarget].edge_id_target = -1;
-#endif
+        (*dists)[numTarget].id1 = static_cast<int>(path_vect[numTarget].at(path_vect[numTarget].size() -1));
+        (*dists)[numTarget].id2 = static_cast<int>(path_vect[numTarget].at(0));
         (*dists)[numTarget].cost = 0.0;
         if (no_path[numTarget]){
             (*dists)[numTarget].cost = -1.0;
         }
         else {
-            for(i = path_vect[numTarget].size() - 1, j = index_of_last_path_vertex; i >= 0; i--, j++)
+            for(i = static_cast<int>(path_vect[numTarget].size()) - 1, j = index_of_last_path_vertex; i >= 0; i--, j++)
             {
                 graph_traits < graph_t >::vertex_descriptor v_src;
                 graph_traits < graph_t >::vertex_descriptor v_targ;
@@ -251,17 +227,10 @@ int onetomany_dijkstra_boostdist(edge_t *edges, unsigned int count,
                     targ = target(e, graph);
 
                     if (targ == v_targ) {
-#ifndef PGR_MERGE
-                        if ((*dists)[numTarget].edge_id_source < 0)
-                            (*dists)[numTarget].edge_id_source = graph[*out_i].id;
-#endif
                         (*dists)[numTarget].cost += graph[*out_i].cost;
                         break;
                     }
                 }
-#ifndef PGR_MERGE
-                (*dists)[numTarget].edge_id_target = graph[*out_i].id;
-#endif
 
             }
             index_of_last_path_vertex = j;
@@ -278,275 +247,4 @@ int onetomany_dijkstra_boostdist(edge_t *edges, unsigned int count,
       *err_msg = (char *) "Unknown exception caught!";
       return -1;
   }
-};
-
-template <class T>
-string toString( T argument){
-    string r;
-    stringstream s;
-    s << argument;
-    r = s.str();
-    return r;
-};
-
-int 
-onetomany_dijkstra_boostpath(edge_t *edges, unsigned int count,
-        int start_vertex, int *end_vertices, int nb_targets,
-        bool directed, bool has_reverse_cost,
-#ifdef PGR_MERGE
-        pgr_cost3_t **pathdists,
-        int *path_count,
-#else
-        path_fromto_t **pathdists,
-#endif
-        char **err_msg )
-{
-try {
-
-    // FIXME: use a template for the directedS parameters
-    typedef adjacency_list < listS, vecS, directedS, no_property, Vertex> graph_t;
-    typedef graph_traits < graph_t >::vertex_descriptor vertex_descriptor;
-    typedef graph_traits < graph_t >::edge_descriptor edge_descriptor;
-    // typedef std::pair<int, int> Edge;
-
-    // FIXME: compute this value
-    const unsigned int num_nodes = ((directed && has_reverse_cost ? 2 : 1) * count) + 100;
-
-    graph_t graph(num_nodes);
-
-    //property_map<graph_t, edge_weight_t>::type weightmap = get(edge_weight, graph);
-
-    for (std::size_t j = 0; j < count; ++j)
-    {
-        edge_descriptor e;
-        graph_add_edge<graph_t, edge_descriptor>(graph, e,
-                   edges[j].id, edges[j].source,
-                   edges[j].target, edges[j].cost);
-
-        if (!directed || (directed && has_reverse_cost))
-        {
-          float8 cost;
-
-          if (has_reverse_cost)
-          {
-              cost = edges[j].reverse_cost;
-          }
-          else
-          {
-              cost = edges[j].cost;
-          }
-
-          graph_add_edge<graph_t, edge_descriptor>(graph, e,
-                 edges[j].id,
-                 edges[j].target,
-                 edges[j].source,
-                 cost);
-          }
-    }
-
-    std::vector<vertex_descriptor> predecessors(num_vertices(graph));
-
-    vertex_descriptor _source = vertex(start_vertex, graph);
-
-    if ((long)_source < 0) 
-    {
-        *err_msg = (char *) "Starting vertex not found";
-        return -1;
-    }
-
-    vertex_descriptor _target[nb_targets];
-    for (int i = 0; i < nb_targets; i++)
-    {
-        _target[i] = vertex(end_vertices[i], graph);
-
-
-        if ((long)_target[i] < 0)
-        {
-            *err_msg = (char *) "Ending vertex not found";
-            return -1;
-        }
-    }        
-
-    std::vector<float8> distances(num_vertices(graph));
-    // calling Boost function
-
-    dijkstra_shortest_paths(graph, _source,
-                predecessor_map(&predecessors[0]).
-                weight_map(get(&Vertex::cost, graph))
-                .distance_map(&distances[0]));
-
-    std::vector< std::vector<int> > path_vect(nb_targets);
-
-    int max = MAX_NODES;
-    int index_of_last_path_vertex = 0;
-    int sum_path_sizes = 0, i = 0, j = 0;
-    bool no_path[nb_targets];
-
-    for (i = 0; i < nb_targets; i++)
-    {
-        no_path[i] = false;
-        max = MAX_NODES;
-        path_vect[i].push_back(_target[i]);
-
-        while (_target[i] != _source && !no_path[i]) 
-        {
-            if (_target[i] == predecessors[_target[i]]) 
-            {
-                //No path found
-                path_vect[i].clear();
-                path_vect[i].push_back(end_vertices[i]);
-                path_vect[i].push_back(start_vertex);
-                no_path[i] = true;
-                break;
-            }
-            _target[i] = predecessors[_target[i]];
-            path_vect[i].push_back(_target[i]);
-
-            if (!max--) 
-            {
-                *err_msg = (char *) "Exceeded MAX_NODES";
-                return -1;
-            }
-        }
-        sum_path_sizes += path_vect[i].size();
-    }
-#ifdef PGR_MERGE
-    *pathdists = (pgr_cost3_t *) malloc(sizeof(pgr_cost3_t) * sum_path_sizes + nb_targets + 1);
-    if (! *pathdists) {
-        *err_msg = (char *) "Error: out of memory";
-        return -1;
-    }
-
-    int seq = 0;
-    for (int numTarget = 0; numTarget < nb_targets; numTarget++) {
-        int id1 = path_vect[numTarget].at(0);
-
-        if (no_path[numTarget]) {
-            (*pathdists)[seq].seq = seq;
-            (*pathdists)[seq].id1 = id1;
-            (*pathdists)[seq].id2 = -1;
-            (*pathdists)[seq].id3 = -1;
-            (*pathdists)[seq].cost = -1.0;
-            seq++;
-            continue;
-        }
-
-        for(i = path_vect[numTarget].size() - 1, j = index_of_last_path_vertex; i >= 0; i--, j++) {
-            graph_traits < graph_t >::vertex_descriptor v_src;
-            graph_traits < graph_t >::vertex_descriptor v_targ;
-            graph_traits < graph_t >::edge_descriptor e;
-            graph_traits < graph_t >::out_edge_iterator out_i, out_end;
-
-            v_src = path_vect[numTarget].at(i);
-
-            if (i == 0) {
-                (*pathdists)[seq].seq = seq;
-                (*pathdists)[seq].id1 = id1;
-                (*pathdists)[seq].id2 = v_src;
-                (*pathdists)[seq].id3 = -1;
-                (*pathdists)[seq].cost = 0.0;
-                seq++;
-                continue;
-            }
-
-            v_targ = path_vect[numTarget].at(i - 1);
-
-            for (tie(out_i, out_end) = out_edges(v_src, graph); out_i != out_end; ++out_i) {
-                graph_traits < graph_t >::vertex_descriptor src, targ;
-                e = *out_i;
-                src = source(e, graph);
-                targ = target(e, graph);
-
-                if (targ == v_targ) {
-                    (*pathdists)[seq].seq = seq;
-                    (*pathdists)[seq].id1 = id1;
-                    (*pathdists)[seq].id2 = src;
-                    (*pathdists)[seq].id3 = graph[*out_i].id; 
-                    (*pathdists)[seq].cost = graph[*out_i].cost;
-                    seq++;
-                    break;
-                }
-            }
-        }
-        index_of_last_path_vertex = j;
-    }
-
-    *path_count = seq;
-
-#else
-
-    *pathdists = (path_fromto_t *) malloc(sizeof(path_fromto_t) * nb_targets + 1);
-
-    std::string edgeIDLists [nb_targets];
-    for (int numTarget = 0; numTarget < nb_targets; numTarget++)
-    {
-
-        (*pathdists)[numTarget].vertex_id_source = path_vect[numTarget].at(path_vect[numTarget].size() -1);
-        (*pathdists)[numTarget].vertex_id_target = path_vect[numTarget].at(0);
-        (*pathdists)[numTarget].edge_id_source = -1;
-        (*pathdists)[numTarget].edge_id_target = -1;
-        (*pathdists)[numTarget].cost = 0;
-        edgeIDLists[numTarget] = "";
-
-        if (no_path[numTarget]){
-
-            (*pathdists)[numTarget].cost = -1;
-            edgeIDLists[numTarget] = "NOT FOUND";
-        }
-        else {
-            for(i = path_vect[numTarget].size() - 1, j = index_of_last_path_vertex; i >= 0; i--, j++)
-            {
-                graph_traits < graph_t >::vertex_descriptor v_src;
-                graph_traits < graph_t >::vertex_descriptor v_targ;
-                graph_traits < graph_t >::edge_descriptor e;
-                graph_traits < graph_t >::out_edge_iterator out_i, out_end;
-
-                if (i == 0) 
-                {
-                    continue;
-                }
-
-                v_src = path_vect[numTarget].at(i);
-                v_targ = path_vect[numTarget].at(i - 1);
-
-                for (tie(out_i, out_end) = out_edges(v_src, graph); out_i != out_end; ++out_i)
-                {
-
-                    graph_traits < graph_t >::vertex_descriptor v, targ;
-                    e = *out_i;
-                    v = source(e, graph);
-                    targ = target(e, graph);
-
-                    if (targ == v_targ)
-                    {
-                        if ((*pathdists)[numTarget].edge_id_source < 0)
-                            (*pathdists)[numTarget].edge_id_source = graph[*out_i].id;
-                        else
-                            edgeIDLists[numTarget] += ", ";
-                        edgeIDLists[numTarget] += toString(graph[*out_i].id);
-                        (*pathdists)[numTarget].cost += graph[*out_i].cost;
-                        break;
-                    }
-                }
-                (*pathdists)[numTarget].edge_id_target = graph[*out_i].id;
-            }
-        }
-        (*pathdists)[numTarget].the_way = (char*)malloc(sizeof(char) * edgeIDLists[numTarget].size() + 1);
-
-        strcpy((*pathdists)[numTarget].the_way, edgeIDLists[numTarget].c_str());
-        index_of_last_path_vertex = j;
-    }
-#endif
-
-    return EXIT_SUCCESS;
-  }
-  catch(std::exception& e) {
-      *err_msg = (char *) e.what();
-      return -1;
-  }
-  catch (...) {
-      *err_msg = (char *) "Unknown exception caught!";
-      return -1;
-  }
 }
-
diff --git a/src/kdijkstra/src/k_targets_boost_wrapper.h b/src/kdijkstra/src/k_targets_boost_wrapper.h
new file mode 100644
index 0000000..8fdcdc6
--- /dev/null
+++ b/src/kdijkstra/src/k_targets_boost_wrapper.h
@@ -0,0 +1,98 @@
+/*PGR-GNU*****************************************************************
+
+ * Bi Directional Shortest path algorithm for PostgreSQL
+ *
+ * Copyright (c) 2005 Sylvain Pasche
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef _TOMANYSP_H
+#define _TOMANYSP_H
+
+//#include "MyWrapper.h"
+
+#include "postgres.h"
+// #include "../../common/src/pgr_types.h"
+
+typedef struct {
+    int id;
+    int source;
+    int target;
+    double cost;
+    double reverse_cost;
+} edge_t;
+
+
+typedef struct
+{
+    int seq;
+    int id1;
+    int id2;
+    float8 cost;
+} pgr_cost_t;
+
+typedef struct
+{
+    int seq;
+    int id1;
+    int id2;
+    int id3;
+    float8 cost;
+} pgr_cost3_t;
+
+
+typedef struct 
+{
+    int vertex_id_source;
+    int edge_id_source;
+    int vertex_id_target;
+    int edge_id_target;
+    float8 cost;
+} dist_fromto_t;
+
+
+typedef struct 
+{
+    int vertex_id_source;
+    int edge_id_source;
+    int vertex_id_target;
+    int edge_id_target;
+    float8 cost;
+    char* the_way;
+} path_fromto_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+    int onetomany_dijkstra_boostdist(
+            edge_t *edges, unsigned int count, int start_vertex,
+            int *end_vertices, int nb_targets,
+            bool directed, bool has_reverse_cost,
+            pgr_cost_t **dists,
+            char **err_msg );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _TOMANYSP_H
diff --git a/src/kdijkstra/src/k_targets_sp.c b/src/kdijkstra/src/k_targets_sp.c
index c4405a0..c7916ff 100644
--- a/src/kdijkstra/src/k_targets_sp.c
+++ b/src/kdijkstra/src/k_targets_sp.c
@@ -1,24 +1,29 @@
-/*
+/*PGR-GNU*****************************************************************
+
  * Shortest path algorithm for PostgreSQL
  *
  * Copyright (c) 2005 Sylvain Pasche
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+********************************************************************PGR-GNU*/
+
+#include "../../common/src/pgr_types.h"
 #include "postgres.h"
 #include "executor/spi.h"
 #include "funcapi.h"
@@ -31,20 +36,15 @@
 
 #include "fmgr.h"
 
-#include "k_targets_sp.h"
+#include "k_targets_boost_wrapper.h"
 
-Datum onetomany_dijkstra_dist(PG_FUNCTION_ARGS);
-Datum onetomany_dijkstra_path(PG_FUNCTION_ARGS);
+Datum manytomany_dijkstra_dmatrix(PG_FUNCTION_ARGS);
 
 #undef DEBUG
 //#define DEBUG 1
+#include "../../common/src/debug_macro.h"
+#include "../../common/src/postgres_connection.h"
 
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
 
 // The number of tuples to fetch from the SPI cursor at each iteration
 #define TUPLIMIT 1000
@@ -67,29 +67,6 @@ typedef struct edge_columns
 
 
 
-#if 0
-static text * charl2text(char *in, int len)
-{
-      text     *out = (text *) palloc(len + VARHDRSZ);
-      memcpy(VARDATA(out), in, len);
-      SET_VARSIZE(out, VARHDRSZ + len);
-      return out;
-}
-
-static text * char2text(char *in)
-{
-      return charl2text(in, strlen(in));
-}
-#endif
-
-static char * text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
-
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
 
 #define DTYPE int
 
@@ -135,11 +112,11 @@ static DTYPE *get_pgarray(int *num, ArrayType *input)
     deconstruct_array(input, i_eltype, i_typlen, i_typbyval, i_typalign,
 &i_data, &nulls, &n);
 
-    DBG("get_pgarray: ndims=%d, n=%d", ndims, n);
+    PGR_DBG("get_pgarray: ndims=%d, n=%d", ndims, n);
 
 #ifdef DEBUG
     for (i=0; i<ndims; i++) {
-        DBG("   dims[%d]=%d, lbs[%d]=%d", i, dims[i], i, lbs[i]);
+        PGR_DBG("   dims[%d]=%d, lbs[%d]=%d", i, dims[i], i, lbs[i]);
     }
 #endif
 
@@ -169,7 +146,7 @@ static DTYPE *get_pgarray(int *num, ArrayType *input)
                     break;
             }
         }
-        DBG("    data[%d]=%.4f", i, data[i]);
+        PGR_DBG("    data[%d]=%.4f", i, data[i]);
     }
 
     pfree(nulls);
@@ -181,20 +158,6 @@ static DTYPE *get_pgarray(int *num, ArrayType *input)
 }
 
 
-static int
-finish(int code, int ret)
-{  
-  DBG("In finish, trying to disconnect from spi %d",ret);
-
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH )
-  {
-    elog(ERROR,"couldn't disconnect from SPI");
-    return -1 ;
-  }            
-  return ret;
-}
-
 /*
  * This function fetches the edge columns from the SPITupleTable.
  * 
@@ -223,7 +186,7 @@ static int fetch_edge_columns(SPITupleTable *tuptable, edge_columns_t *edge_colu
         return -1;
     }
 
-    DBG("columns: id %i source %i target %i cost %i", 
+    PGR_DBG("columns: id %i source %i target %i cost %i", 
         edge_columns->id, edge_columns->source, 
         edge_columns->target, edge_columns->cost);
 
@@ -246,7 +209,7 @@ static int fetch_edge_columns(SPITupleTable *tuptable, edge_columns_t *edge_colu
             return -1;
         }
 
-        DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
+        PGR_DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
     }
 
     return 0;
@@ -288,715 +251,11 @@ static void fetch_edge(HeapTuple *tuple, TupleDesc *tupdesc, edge_columns_t *edg
 }
 
 
-static int tomanysp_dijkstra_dist(char* sql, int start_vertex, 
-         int *end_vertices, int nb_targets, bool directed, 
-         bool has_reverse_cost, 
-#ifdef PGR_MERGE
-         pgr_cost_t **dists,
-#else
-         dist_fromto_t **dists,
-#endif
-         int *path_count) 
-{
-
-    int SPIcode;
-    void *SPIplan;
-    Portal SPIportal;
-    bool moredata = TRUE;
-    int ntuples;
-    edge_t *edges = NULL;
-    int total_tuples = 0;
-    edge_columns_t edge_columns = {.id= -1, .source= -1, .target= -1, 
-                                   .cost= -1, .reverse_cost= -1};
-    int v_max_id=0;
-    int v_min_id=INT_MAX;
-
-    int sumFoundTargets = 0, numTarget;
-
-    int s_count = 0;
-    int t_count[nb_targets];
-    for (numTarget = 0; numTarget < nb_targets; numTarget++)
-        t_count[numTarget] = 0;
-
-    char *err_msg;
-    int ret = -1;
-    register int z;
-    int zcnt = 0;
-
-
-    DBG("start shortest_path\n");
-
-    SPIcode = SPI_connect();
-    if (SPIcode  != SPI_OK_CONNECT) {
-        elog(ERROR, "shortest_path: couldn't open a connection to SPI");
-        return -1;
-    }
-
-    SPIplan = SPI_prepare(sql, 0, NULL);
-    if (SPIplan  == NULL) {
-        elog(ERROR, "shortest_path: couldn't create query plan via SPI");
-        return -1;
-    }
-
-    if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-        elog(ERROR, "shortest_path: SPI_cursor_open('%s') returns NULL", sql);
-        return -1;
-    }
-
-    DBG("Maybe there is moredata...\n");
-
-    while (moredata == TRUE) {
-        SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-        if (edge_columns.id == -1) {
-            if (fetch_edge_columns(SPI_tuptable, &edge_columns, 
-                                 has_reverse_cost) == -1)
-            return finish(SPIcode, ret);
-        }
-
-        ntuples = SPI_processed;
-        total_tuples += ntuples;
-        if (!edges)
-            edges = palloc(total_tuples * sizeof(edge_t));
-        else
-            edges = repalloc(edges, total_tuples * sizeof(edge_t));
-
-        if (edges == NULL) {
-            elog(ERROR, "Out of memory");
-            return finish(SPIcode, ret);      
-        }
-
-        if (ntuples > 0) {
-            int t;
-            SPITupleTable *tuptable = SPI_tuptable;
-            TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-            for (t = 0; t < ntuples; t++) 
-            {
-                HeapTuple tuple = tuptable->vals[t];
-                fetch_edge(&tuple, &tupdesc, &edge_columns, 
-                         &edges[total_tuples - ntuples + t]);
-            }
-            SPI_freetuptable(tuptable);
-        } 
-        else {
-            moredata = FALSE;
-        }
-    }
-
-    //defining min and max vertex id
-
-    DBG("Total %i tuples", total_tuples);
-
-    for(z=0; z<total_tuples; z++) {
-        if(edges[z].source<v_min_id)
-            v_min_id=edges[z].source;
-
-        if(edges[z].source>v_max_id)
-            v_max_id=edges[z].source;
-
-        if(edges[z].target<v_min_id)
-            v_min_id=edges[z].target;
-
-        if(edges[z].target>v_max_id)
-            v_max_id=edges[z].target;      
-
-        // DBG("%i <-> %i", v_min_id, v_max_id);
-
-    }
-
-    //::::::::::::::::::::::::::::::::::::  
-    //:: reducing vertex id (renumbering)
-    //::::::::::::::::::::::::::::::::::::
-
-
-    for (numTarget = 0; numTarget < nb_targets; numTarget ++) {
-        t_count[numTarget] = 0;
-    }
-
-    for(z=0; z<total_tuples; z++) {
-        //check if edges[] contains source and target
-        if(edges[z].source == start_vertex || edges[z].target == start_vertex)
-            ++s_count;
-        for (numTarget = 0; numTarget < nb_targets; numTarget++) {
-            if (edges[z].source == end_vertices[numTarget] ||
-                    edges[z].target == end_vertices[numTarget]) {
-                ++t_count[numTarget];
-                ++sumFoundTargets;    
-            }
-        }
-        edges[z].source-=v_min_id;
-        edges[z].target-=v_min_id;
-        //  DBG("%i - %i", edges[z].source, edges[z].target);      
-    }
-
-    DBG("Total %i tuples", total_tuples);
-
-    if(s_count == 0) {
-        elog(ERROR, "Start vertex was not found.");
-        return -1;
-    }
-
-    for (numTarget = 0; numTarget < nb_targets; numTarget++) {
-        if(t_count[numTarget] == 0) zcnt++;
-        DBG("t_count[%d] = %d", end_vertices[numTarget], t_count[numTarget]);
-    }
-    if (zcnt > 0) {
-        elog(ERROR, "One of the target vertices was not found or several targets are the same.");
-    }
-
-    if(sumFoundTargets == 0 ) {
-        elog(ERROR, "None of the target vertices has been found; aborting!");
-        return -1;
-    }
-
-    DBG("Calling boost_dijkstra\n");
-
-    start_vertex -= v_min_id;
-    for (numTarget = 0; numTarget < nb_targets; numTarget++) {
-        end_vertices[numTarget] -= v_min_id;
-    }
-
-    ret = onetomany_dijkstra_boostdist(edges, total_tuples, start_vertex,
-                end_vertices, nb_targets, directed, has_reverse_cost,
-                dists, &err_msg);
-
-    DBG("ret = %i\n", ret);
-
-    if (ret < 0) {
-        //elog(ERROR, "Error computing path: %s", err_msg);
-        ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), 
-            errmsg("Error computing path: %s", err_msg)));
-    } 
-
-    //::::::::::::::::::::::::::::::::
-    //:: restoring original vertex id
-    //::::::::::::::::::::::::::::::::
-    for(z=0; z<nb_targets; z++) {
-#ifdef PGR_MERGE
-        (*dists)[z].id1 += v_min_id;
-        (*dists)[z].id2 += v_min_id;
-#else
-        (*dists)[z].vertex_id_source += v_min_id;
-        (*dists)[z].vertex_id_target += v_min_id;
-#endif
-    }
-
-    *path_count = nb_targets;
-
-    return finish(SPIcode, ret);
-}
-
-/*
-CREATE OR REPLACE FUNCTION pgr_kdijkstracost(
-    sql text,
-    source_vid integer,
-    target_vid integer array,
-    directed boolean,
-    has_reverse_cost boolean)
-RETURNS SETOF pgr_costResult
-AS '$libdir/librouting', 'onetomany_dijkstra_dist'
-LANGUAGE C IMMUTABLE STRICT;
-*/
-
-
-PG_FUNCTION_INFO_V1(onetomany_dijkstra_dist);
-
-Datum onetomany_dijkstra_dist(PG_FUNCTION_ARGS)
-{
-
-    FuncCallContext     *funcctx;
-    int                  call_cntr;
-    int                  max_calls;
-    TupleDesc            tuple_desc;
-#ifdef PGR_MERGE
-    pgr_cost_t          *dist;
-#else
-    dist_fromto_t       *dist;
-#endif
-
-    char * sql = text2char(PG_GETARG_TEXT_P(0));
-    int source_ID = PG_GETARG_INT32(1);
-    int i;
-
-    // HeapTuple    tuple;
-    // Datum        result;
-    // Datum *values;
-    // char* nulls;    
-
-    /* stuff done only on the first call of the function */
-    if (SRF_IS_FIRSTCALL()) {
-        MemoryContext   oldcontext;
-        int path_count = 0;
-        int ret;
-        int num;
-        int *myTargets;
-
-        DBG("source_ID = %d ", source_ID);   
-
-        /* create a function context for cross-call persistence */
-        funcctx = SRF_FIRSTCALL_INIT();
-
-        /* switch to memory context appropriate for multiple function calls */
-        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-        myTargets = get_pgarray(&num, PG_GETARG_ARRAYTYPE_P(2));
-
-        DBG("There are %d targets : \n", num);
-        for (i = 0; i < num; i++)
-            DBG("%d => %d\t", i+1, myTargets[i]);
-
-        ret = tomanysp_dijkstra_dist(sql, source_ID, myTargets,
-                num, PG_GETARG_BOOL(3), PG_GETARG_BOOL(4),
-                &dist, &path_count);
-
-        pfree(myTargets);
-        if (ret) {
-            elog(ERROR, "Error computing paths!");
-        }
-
-        DBG("max_calls: %d", path_count);
-        funcctx->max_calls = path_count;
-        funcctx->user_fctx = dist;
-
-        DBG("tuple_desc");
-#ifdef PGR_MERGE
-        funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("pgr_costresult"));
-#else
-        funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("dist_result"));
-#endif
-
-        MemoryContextSwitchTo(oldcontext);
-    }
-
-    /* stuff done on every call of the function */
-    funcctx = SRF_PERCALL_SETUP();
-
-    call_cntr = funcctx->call_cntr;
-    max_calls = funcctx->max_calls;
-    tuple_desc = funcctx->tuple_desc;
-#ifdef PGR_MERGE
-    dist = (pgr_cost_t *) funcctx->user_fctx;
-#else
-    dist = (dist_fromto_t *) funcctx->user_fctx;
-#endif
-
-    /* do when there is more left to send */
-    if (call_cntr < max_calls) {
-        HeapTuple    tuple;
-        Datum        result;
-        Datum       *values;
-        char        *nulls;
-
-        DBG("INIT values && nulls");
-#ifdef PGR_MERGE
-        values = palloc(4 * sizeof(Datum));
-        nulls = palloc(4 * sizeof(char));
-
-        values[0] = Int32GetDatum(dist[call_cntr].seq);
-        nulls[0] = ' ';
-        values[1] = Int32GetDatum(dist[call_cntr].id1);
-        nulls[1] = ' ';
-        values[2] = Int32GetDatum(dist[call_cntr].id2);
-        nulls[2] = ' ';
-        values[3] = Float8GetDatum(dist[call_cntr].cost);
-        nulls[3] = ' ';
-#else
-        values = palloc(5 * sizeof(Datum));
-        nulls = palloc(5 * sizeof(char));
-
-        values[0] = Int32GetDatum(dist[call_cntr].vertex_id_source);
-        nulls[0] = ' ';
-        values[1] = Int32GetDatum(dist[call_cntr].edge_id_source);
-        nulls[1] = ' ';
-        values[2] = Int32GetDatum(dist[call_cntr].vertex_id_target);
-        nulls[2] = ' ';
-        values[3] = Int32GetDatum(dist[call_cntr].edge_id_target);
-        nulls[4] = ' ';
-        values[4] = Float8GetDatum(dist[call_cntr].cost);
-        nulls[4] = ' ';
-#endif
-
-        DBG("Create the tuple");
-        tuple = heap_formtuple(tuple_desc, values, nulls);
-
-        /* make the tuple into a datum */
-
-        DBG("HeapTupleGetDatum");
-        result = HeapTupleGetDatum(tuple);
-
-        /* clean up (this is not really necessary) */
-
-        DBG("pfree");
-        pfree(values);
-        pfree(nulls);
-
-        DBG("return next");
-        SRF_RETURN_NEXT(funcctx, result);
-    }
-
-    DBG("freeing dist");
-    free(dist);
-
-    SRF_RETURN_DONE(funcctx);
-}
-
-static int tomanysp_dijkstra_ways(char* sql, int start_vertex, 
-                int *end_vertices, int nb_targets, bool directed, 
-                bool has_reverse_cost, 
-#ifdef PGR_MERGE
-                pgr_cost3_t **distpaths,
-#else
-                path_fromto_t **distpaths,
-#endif
-                int *path_count) 
-{
-    int SPIcode;
-    void *SPIplan;
-    Portal SPIportal;
-    bool moredata = TRUE;
-    int ntuples;
-    edge_t *edges = NULL;
-    int total_tuples = 0;
-    edge_columns_t edge_columns = {.id= -1, .source= -1, .target= -1, 
-                                   .cost= -1, .reverse_cost= -1};
-    int v_max_id=0;
-    int v_min_id=INT_MAX;
-
-    int sumFoundTargets = 0, numTarget;
-
-    int s_count = 0;
-    int t_count[nb_targets];
-
-    int pcount = 0;
-
-    char *err_msg;
-    int ret = -1;
-    register int z;
-
-    for (numTarget = 0; numTarget < nb_targets; numTarget++)
-        t_count[numTarget] = 0;
-
-    SPIcode = SPI_connect();
-    if (SPIcode  != SPI_OK_CONNECT) {
-        elog(ERROR, "shortest_path: couldn't open a connection to SPI");
-        return -1;
-    }
-
-    SPIplan = SPI_prepare(sql, 0, NULL);
-    if (SPIplan  == NULL) {
-        elog(ERROR, "shortest_path: couldn't create query plan via SPI");
-        return -1;
-    }
-
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-      elog(ERROR, "shortest_path: SPI_cursor_open('%s') returns NULL", sql);
-      return -1;
-    }
-
-    DBG("Maybe there is moredata...\n");
-
-    while (moredata == TRUE) {
-        SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-        if (edge_columns.id == -1) {
-            if (fetch_edge_columns(SPI_tuptable, &edge_columns, 
-                                 has_reverse_cost) == -1)
-            return finish(SPIcode, ret);
-        }
-
-        ntuples = SPI_processed;
-        total_tuples += ntuples;
-        if (!edges)
-            edges = palloc(total_tuples * sizeof(edge_t));
-        else
-            edges = repalloc(edges, total_tuples * sizeof(edge_t));
-
-        if (edges == NULL) {
-            elog(ERROR, "Out of memory");
-            return finish(SPIcode, ret);      
-        }
-
-        if (ntuples > 0) {
-            int t;
-            SPITupleTable *tuptable = SPI_tuptable;
-            TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-            for (t = 0; t < ntuples; t++) {
-                HeapTuple tuple = tuptable->vals[t];
-                fetch_edge(&tuple, &tupdesc, &edge_columns, 
-                         &edges[total_tuples - ntuples + t]);
-            }
-            SPI_freetuptable(tuptable);
-        } 
-        else {
-            moredata = FALSE;
-        }
-    }
-
-    //defining min and max vertex id
-
-    DBG("Total %i tuples", total_tuples);
-
-    for(z=0; z<total_tuples; z++) {
-        if(edges[z].source<v_min_id)
-            v_min_id=edges[z].source;
-
-        if(edges[z].source>v_max_id)
-            v_max_id=edges[z].source;
-
-        if(edges[z].target<v_min_id)
-            v_min_id=edges[z].target;
-
-        if(edges[z].target>v_max_id)
-            v_max_id=edges[z].target;      
-
-        //DBG("%i <-> %i", v_min_id, v_max_id);                    
-    }
-
-    //::::::::::::::::::::::::::::::::::::  
-    //:: reducing vertex id (renumbering)
-    //::::::::::::::::::::::::::::::::::::
-
-
-    for (numTarget = 0; numTarget < nb_targets; numTarget ++){
-        t_count[numTarget] = 0;
-    }
-
-    for(z=0; z<total_tuples; z++) {
-        //check if edges[] contains source and target
-        if(edges[z].source == start_vertex || edges[z].target == start_vertex)
-            ++s_count;
-        for (numTarget = 0; numTarget < nb_targets; numTarget++) {
-            if(edges[z].source == end_vertices[numTarget] || edges[z].target == end_vertices[numTarget]) {
-                ++t_count[numTarget];
-                ++sumFoundTargets;    
-            }
-        }
-        edges[z].source-=v_min_id;
-        edges[z].target-=v_min_id;
-        //DBG("%i - %i", edges[z].source, edges[z].target);      
-    }
-
-    DBG("Total %i tuples", total_tuples);
-
-    if(s_count == 0) {
-        elog(ERROR, "Start vertex was not found.");
-        return -1;
-    }
-
-    for (numTarget = 0; numTarget < nb_targets; numTarget++)
-        if(t_count[numTarget] == 0) {
-            elog(ERROR, "One of the target vertices was not found or several targets are the same.");
-        }
-
-    if(sumFoundTargets == 0 ) {
-        elog(ERROR, "None of the target vertices has been found; aborting!");
-        return -1;
-    }
-
-    DBG("modifying vertices' idz..\n");
-
-    start_vertex -= v_min_id;
-    for (numTarget = 0; numTarget < nb_targets; numTarget++) {
-        end_vertices[numTarget] -= v_min_id;
-    }
-
-    DBG("Calling boost_dijkstra\n");
-
-
-    ret = onetomany_dijkstra_boostpath (edges, total_tuples, start_vertex,
-            end_vertices, nb_targets, 
-            directed, has_reverse_cost,
-            distpaths,
-#ifdef PGR_MERGE
-            &pcount,
-#endif
-            &err_msg);
-
-    DBG("ret = %i\n", ret);
-
-    if (ret < 0) {
-        ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), 
-            errmsg("Error computing path: %s", err_msg)));
-    }
-
-    //::::::::::::::::::::::::::::::::
-    //:: restoring original vertex id
-    //::::::::::::::::::::::::::::::::
-
-#ifdef PGR_MERGE
-    for(z=0; z<pcount; z++) {
-        (*distpaths)[z].id1 += v_min_id;
-        (*distpaths)[z].id2 += v_min_id;
-    }
-
-    *path_count = pcount;
-#else
-    for(z=0; z<nb_targets; z++) {
-        (*distpaths)[z].vertex_id_source += v_min_id;
-        (*distpaths)[z].vertex_id_target += v_min_id;
-
-        DBG("(*distpaths)[z].cost = %f)", (*distpaths)[z].cost);
-    }
-#endif
-
-    DBG("*path_count = %i\n", *path_count);
-
-    return finish(SPIcode, ret);
-}
-
-/**/
-
-PG_FUNCTION_INFO_V1(onetomany_dijkstra_path);
-
-Datum
-onetomany_dijkstra_path(PG_FUNCTION_ARGS)
-{
-
-    FuncCallContext     *funcctx;
-    int                  call_cntr;
-    int                  max_calls;
-    TupleDesc            tuple_desc;
-
-#ifdef PGR_MERGE
-    pgr_cost3_t          *path_res;
-#else
-    path_fromto_t       *path_res;
-#endif
-
-    char * sql = text2char(PG_GETARG_TEXT_P(0));
-    int source_ID = PG_GETARG_INT32(1);
-    int *myTargets = (int *)PG_GETARG_POINTER(2);
-    int i;
-
-    // HeapTuple    tuple;
-    // Datum        result;
-    // Datum *values;
-    // char* nulls;    
-
-    /* stuff done only on the first call of the function */
-    if (SRF_IS_FIRSTCALL()) {
-        MemoryContext   oldcontext;
-        int path_count = 0;
-        int ret;
-
-
-        DBG("source_ID = %d \n", source_ID);   
-        DBG("There may be %d targets : \n", myTargets[4]);
-        for (i = 0; i < myTargets[4]; i++)
-            DBG("%d => %d\t", i+1, myTargets[6+i]);
-
-        /* create a function context for cross-call persistence */
-        funcctx = SRF_FIRSTCALL_INIT();
-
-        /* switch to memory context appropriate for multiple function calls */
-        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-        ret = tomanysp_dijkstra_ways(sql, source_ID, &(myTargets[6]),
-                myTargets[4], PG_GETARG_BOOL(3),
-                PG_GETARG_BOOL(4), &path_res, &path_count);
-
-        if (ret) {
-            elog(ERROR, "Error computing paths!");
-        }
-
-        /*  Building the whole linestrings in the_way */
-        DBG("max_calls: %d", path_count);
-        funcctx->max_calls = path_count;
-        funcctx->user_fctx = path_res;
-
-        DBG("tuple_desc");
-#ifdef PGR_MERGE
-        funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("pgr_costresult3"));
-#else
-        funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("concatpath_result"));
-#endif
-
-        MemoryContextSwitchTo(oldcontext);
-
-    }
-
-    /* stuff done on every call of the function */
-    funcctx = SRF_PERCALL_SETUP();
-
-    call_cntr = funcctx->call_cntr;
-    max_calls = funcctx->max_calls;
-    tuple_desc = funcctx->tuple_desc;
-#ifdef PGR_MERGE
-    path_res = (pgr_cost3_t *) funcctx->user_fctx;
-#else
-    path_res = (path_fromto_t *) funcctx->user_fctx;
-#endif
-
-    /* do when there is more left to send */
-    if (call_cntr < max_calls) {
-        HeapTuple    tuple;
-        Datum        result;
-        Datum       *values;
-        char        *nulls;
-
-        DBG("INIT values && nulls");
-#ifdef PGR_MERGE
-        values = palloc(5 * sizeof(Datum));
-        nulls = palloc(5 * sizeof(char));
-
-        values[0] = Int32GetDatum(path_res[call_cntr].seq);
-        nulls[0] = ' ';
-        values[1] = Int32GetDatum(path_res[call_cntr].id1);
-        nulls[1] = ' ';
-        values[2] = Int32GetDatum(path_res[call_cntr].id2);
-        nulls[2] = ' ';
-        values[3] = Int32GetDatum(path_res[call_cntr].id3);
-        nulls[3] = ' ';
-        values[4] = Float8GetDatum(path_res[call_cntr].cost);
-        nulls[4] = ' ';
-#else
-        values = palloc(6 * sizeof(Datum));
-        nulls = palloc(6 * sizeof(char));
-
-        values[0] = Int32GetDatum(path_res[call_cntr].vertex_id_source);
-        nulls[0] = ' ';
-        values[1] = Int32GetDatum(path_res[call_cntr].edge_id_source);
-        nulls[1] = ' ';
-        values[2] = Int32GetDatum(path_res[call_cntr].vertex_id_target);
-        nulls[2] = ' ';
-        values[3] = Int32GetDatum(path_res[call_cntr].edge_id_target);
-        nulls[3] = ' ';
-        values[4] = Float8GetDatum(path_res[call_cntr].cost);
-        nulls[4] = ' ';
-        values[5] = PointerGetDatum(char2text(path_res[call_cntr].the_way));
-        nulls[5] = ' ';
-#endif
-
-        DBG("Create the tuple");
-        tuple = heap_formtuple(tuple_desc, values, nulls);
-
-        /* make the tuple into a datum */
-        DBG("HeapTupleGetDatum");
-        result = HeapTupleGetDatum(tuple);
-
-        /* clean up (this is not really necessary) */
-        DBG("pfree");
-        pfree(values);
-        pfree(nulls);
-
-        DBG("return next");
-        SRF_RETURN_NEXT(funcctx, result);
-    }
-
-    DBG("freeing path_res");
-    free(path_res);
-
-    DBG("return done");
-    SRF_RETURN_DONE(funcctx);    
-}
-
 
 static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
         bool has_reverse_cost, bool symmetric, float8 *dm)
 {
-    int SPIcode;
+    // int SPIcode;
     void *SPIplan;
     Portal SPIportal;
     bool moredata = TRUE;
@@ -1023,41 +282,26 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
 
     pgr_cost_t *dists;
 
-    DBG("start many2many_dijkstra_dm");
-
-    SPIcode = SPI_connect();
-    if (SPIcode != SPI_OK_CONNECT) {
-        elog(ERROR, "many2many_dijkstra_dm: couldn't open an SPI connection");
-        return -1;
-    }
+    PGR_DBG("start many2many_dijkstra_dm");
 
-    DBG("Calling SPI_prepare");
-    SPIplan = SPI_prepare(sql, 0, NULL);
-    if (SPIplan == NULL) {
-        elog(ERROR, "many2many_dijkstra_dm: SPI_prepare failed for (%s)", sql);
-        return -1;
-    }
+    pgr_SPI_connect();
+    SPIplan = pgr_SPI_prepare(sql);
+    SPIportal = pgr_SPI_cursor_open(SPIplan);
 
-    DBG("Calling SPI_cursor_open");
-    SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true);
-    if (SPIportal == NULL) {
-        elog(ERROR, "many2many_dijkstra_dm: SPI_cursor_open(%s) failed!", sql);
-        return -1;
-    }
-
-    DBG("Starting while loop to collect edges ...");
+    PGR_DBG("Starting while loop to collect edges ...");
 
     while (moredata == TRUE) {
-        DBG("Calling SPI_cursor_fetch");
+        PGR_DBG("Calling SPI_cursor_fetch");
         SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
 
         if (fetch_edge_columns(SPI_tuptable, &edge_columns,
                 has_reverse_cost) == -1) {
-            return finish(SPIcode, ret);
+            pgr_SPI_finish();
+            return -1;
         }
 
         ntuples = SPI_processed;
-        DBG("ntuples=%d", ntuples);
+        PGR_DBG("ntuples=%d", ntuples);
         if (ntuples > 0) {
             SPITupleTable *tuptable = SPI_tuptable;
             TupleDesc tupdesc = SPI_tuptable->tupdesc;
@@ -1072,7 +316,8 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
 
             if (edges == NULL) {
                 elog(ERROR, "Out of memory!");
-                return finish(SPIcode, ret);
+                pgr_SPI_finish();
+                return -1;
             }
 
             for (t=0; t < ntuples; t++) {
@@ -1086,7 +331,7 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
             moredata = FALSE;
         }
     }
-    DBG("Total %d edges!", total_tuples);
+    PGR_DBG("Total %d edges!", total_tuples);
 
     // find min and max vertex ids
 
@@ -1096,7 +341,7 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
         if (edges[i].target < v_min_id) v_min_id = edges[i].target;
         if (edges[i].target > v_max_id) v_max_id = edges[i].target;
     }
-    DBG("v_min_id: %d, v_max_id: %d", v_min_id, v_max_id);
+    PGR_DBG("v_min_id: %d, v_max_id: %d", v_min_id, v_max_id);
 
     // renumber vertices
 
@@ -1112,7 +357,7 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
 
     for (j=0; j< num; j++) {
         if (v_count[j] == 0) zcnt++;
-        DBG("vids[%d]: %d, cnt: %d", j, vids[j], v_count[j]);
+        PGR_DBG("vids[%d]: %d, cnt: %d", j, vids[j], v_count[j]);
         vvids[j] = vids[j] - v_min_id;
     }
 
@@ -1121,10 +366,10 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
         return -1;
     }
 
-    DBG("Starting loop to build dmatrix!");
+    PGR_DBG("Starting loop to build dmatrix!");
 
     for (j=0; j<num; j++) {
-        DBG("Calling onetomany_dijkstra_boostdist j=%d", j);
+        PGR_DBG("Calling onetomany_dijkstra_boostdist j=%d", j);
 
         ret = onetomany_dijkstra_boostdist(edges, total_tuples, vvids[j],
                 vvids, num, directed, has_reverse_cost, &dists, &err_msg);
@@ -1142,7 +387,7 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
         dists = NULL;
     }
     
-    DBG("Making the matrix symmertic if requested!");
+    PGR_DBG("Making the matrix symmertic if requested!");
 
     // if symmetric requsted, then average cells to make it symmetric
 
@@ -1162,9 +407,10 @@ static int many2many_dijkstra_dm(char *sql, int *vids, int num, bool directed,
         }
     }
 
-    DBG("Leaving many2many_dijkstra_dm");
+    PGR_DBG("Leaving many2many_dijkstra_dm");
 
-    return finish(SPIcode, ret);
+    pgr_SPI_finish();
+    return 0;
 }
 
 /*
@@ -1197,7 +443,7 @@ Datum manytomany_dijkstra_dmatrix(PG_FUNCTION_ARGS)
     int     dims[2];
     int     lbs[2] = {1, 1};;
 
-    char   *sql = text2char(PG_GETARG_TEXT_P(0));
+    char   *sql = pgr_text2char(PG_GETARG_TEXT_P(0));
     int    *vids = get_pgarray(&num, PG_GETARG_ARRAYTYPE_P(1));
 
     dm = (float8 *)palloc(num * num * sizeof(float8));
diff --git a/src/kdijkstra/src/k_targets_sp.h b/src/kdijkstra/src/k_targets_sp.h
deleted file mode 100644
index 757094a..0000000
--- a/src/kdijkstra/src/k_targets_sp.h
+++ /dev/null
@@ -1,121 +0,0 @@
- /*
- * Bi Directional Shortest path algorithm for PostgreSQL
- *
- * Copyright (c) 2005 Sylvain Pasche
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-#ifndef _TOMANYSP_H
-#define _TOMANYSP_H
-
-//#include "MyWrapper.h"
-
-#include "postgres.h"
-
-typedef struct edge
-{
-    int id;
-    int source;
-    int target;
-    float8 cost;
-    float8 reverse_cost;
-} edge_t;
-
-
-typedef struct 
-{
-    int vertex_id;
-    int edge_id;
-    float8 cost;
-} path_element_t;
-
-#define PGR_MERGE
-#ifdef PGR_MERGE
-typedef struct
-{
-    int seq;
-    int id1;
-    int id2;
-    float8 cost;
-} pgr_cost_t;
-
-typedef struct
-{
-    int seq;
-    int id1;
-    int id2;
-    int id3;
-    float8 cost;
-} pgr_cost3_t;
-#endif
-
-typedef struct 
-{
-	int vertex_id_source;
-	int edge_id_source;
-	int vertex_id_target;
-	int edge_id_target;
-	float8 cost;
-} dist_fromto_t;
-
-
-typedef struct 
-{
-	int vertex_id_source;
-	int edge_id_source;
-	int vertex_id_target;
-	int edge_id_target;
-	float8 cost;
-	char* the_way;
-} path_fromto_t;
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-int onetomany_dijkstra_boostdist(
-        edge_t *edges, unsigned int count, int start_vertex,
-        int *end_vertices, int nb_targets,
-	    bool directed, bool has_reverse_cost,
-#ifdef PGR_MERGE
-	    pgr_cost_t **dists,
-#else
-	    dist_fromto_t **dists,
-#endif
-        char **err_msg );
-    
-  
-#ifdef __cplusplus
-extern "C"
-#endif
-
-int onetomany_dijkstra_boostpath(
-        edge_t *edges, unsigned int count, int start_vertex,
-        int *end_vertices, int nb_targets,
-	    bool directed, bool has_reverse_cost,
-#ifdef PGR_MERGE
-	    pgr_cost3_t **dists,
-        int *path_count,
-#else
-	    path_fromto_t **pathdists,
-#endif
-        char **err_msg );
-
-#endif
-
-
-
-
diff --git a/src/kdijkstra/test/doc-kdijkstra.result b/src/kdijkstra/test/doc-kdijkstra.result
new file mode 100644
index 0000000..2f98464
--- /dev/null
+++ b/src/kdijkstra/test/doc-kdijkstra.result
@@ -0,0 +1,19 @@
+-- q1
+NOTICE:  Deprecated function. Use pgr_dijkstraCost instead.
+0|10|4|4
+1|10|12|2
+-- q2
+NOTICE:  Deprecated function: Use pgr_dijkstra instead.
+0|4|10|12|1
+1|4|11|13|1
+2|4|12|15|1
+3|4|9|16|1
+4|4|4|-1|0
+5|12|10|12|1
+6|12|11|13|1
+7|12|12|-1|0
+-- q3
+NOTICE:  Deprecated function: Use pgr_dijkstra instead.
+4|LINESTRING(2 3,3 3,4 3,4 2,4 1)
+12|LINESTRING(2 3,3 3,4 3)
+-- q4
diff --git a/src/kdijkstra/test/doc-kdijkstra.test.sql b/src/kdijkstra/test/doc-kdijkstra.test.sql
new file mode 100644
index 0000000..a76aad0
--- /dev/null
+++ b/src/kdijkstra/test/doc-kdijkstra.test.sql
@@ -0,0 +1,26 @@
+BEGIN;
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              PGR_kdijkstraPath
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+\echo -- q1
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+    10, array[4,12], false, false);
+\echo -- q2
+SELECT * FROM pgr_kdijkstraPath(
+      'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+      10, array[4,12], false, false);
+\echo -- q3
+SELECT id1 AS path, st_AStext(st_linemerge(st_union(b.the_geom))) AS the_geom
+  FROM pgr_kdijkstraPath(
+                  'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+                  10, array[4,12], false, false
+            ) a,
+            edge_table b
+WHERE a.id3=b.id
+GROUP by id1
+ORDER by id1;
+\echo -- q4
+ROLLBACK;
diff --git a/src/kdijkstra/test/kdijkstra-any-00.data b/src/kdijkstra/test/kdijkstra-any-00.data
deleted file mode 100644
index 95a8d68..0000000
--- a/src/kdijkstra/test/kdijkstra-any-00.data
+++ /dev/null
@@ -1,24 +0,0 @@
-drop table if exists kdgrid cascade;
-create table kdgrid (
-  gid serial not null primary key,
-  source integer,
-  target integer,
-  cost float8
-);
-
-insert into kdgrid (source, target, cost)
-select source, target, cost from
-(
-  (with i as (select generate_series(0,24,1) as n),
-        j as (select generate_series(1,24,1) as n)
-   select (i.n*24 + i.n + j.n) as source, (i.n*24 + i.n + j.n + 1) as target, 1.0::float8 as cost,
-          j.n as x1, i.n as y1, j.n+1 as x2, i.n as y2
-     from i, j)
-   union all
-  (with u as (select generate_series(0,24,1) as n),
-     v as (select generate_series(1,25,1) as n)
-  select (u.n*24 + u.n + v.n) as source, (u.n*24 + u.n + v.n + 25) as target, 1.0::float8 as cost,
-         v.n as x1, u.n as y1, v.n as x2, u.n+25 as y2
-    from u, v where u.n < 24)
-) as foo;
-
diff --git a/src/kdijkstra/test/kdijkstra-any-01.data b/src/kdijkstra/test/kdijkstra-any-01.data
deleted file mode 100644
index 7e6e628..0000000
--- a/src/kdijkstra/test/kdijkstra-any-01.data
+++ /dev/null
@@ -1,73 +0,0 @@
-BEGIN;
-
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET escape_string_warning = off;
-
-SET search_path = public, pg_catalog;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: edges5; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS edges5 CASCADE;
-
-CREATE TABLE edges5 (
-    eid integer NOT NULL,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    to_cost double precision,
-    rule text,
-    the_geom geometry,
-    CONSTRAINT enforce_dims_the_geom CHECK ((st_ndims(the_geom) = 2)),
-    CONSTRAINT enforce_geotype_the_geom CHECK (((geometrytype(the_geom) = 'LINESTRING'::text) OR (the_geom IS NULL)))
---    , CONSTRAINT enforce_srid_the_geom CHECK ((st_srid(the_geom) = (0)))
-);
-
-
---
--- Data for Name: edges5; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY edges5 (eid, dir, source, target, cost, reverse_cost, x1, y1, x2, y2, to_cost, rule, the_geom) FROM stdin WITH NULL '__NULL__';
-1	B	1	2	1	1	2	0	2	1	__NULL__	__NULL__	010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2	TF	2	3	-1	1	2	1	3	1	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3	TF	3	4	-1	1	3	1	4	1	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4	B	2	7	1	1	2	1	2	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5	FT	3	8	1	-1	3	1	3	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6	B	5	6	1	1	0	2	1	2	__NULL__	__NULL__	01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7	B	6	7	1	1	1	2	2	2	__NULL__	__NULL__	010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8	B	7	8	1	1	2	2	3	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9	B	8	9	1	1	3	2	4	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10	B	7	10	1	1	2	2	2	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11	FT	8	11	1	-1	3	2	3	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12	FT	10	11	1	-1	2	3	3	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13	FT	11	12	1	-1	3	3	4	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14	B	10	13	1	1	2	3	2	4	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15	B	9	12	1	1	4	2	4	3	__NULL__	__NULL__	0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16	B	4	9	1	1	4	1	4	2	__NULL__	__NULL__	0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-\.
-
-
---
--- Name: edges5_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY edges5
-    ADD CONSTRAINT edges5_pkey PRIMARY KEY (eid);
-
-
-COMMIT;
diff --git a/src/kdijkstra/test/kdijkstra-any-01.result b/src/kdijkstra/test/kdijkstra-any-01.result
deleted file mode 100644
index c128e28..0000000
--- a/src/kdijkstra/test/kdijkstra-any-01.result
+++ /dev/null
@@ -1,4 +0,0 @@
-0|288|1|23
-1|288|25|23
-2|288|601|25
-3|288|625|25
diff --git a/src/kdijkstra/test/kdijkstra-any-01.test.sql b/src/kdijkstra/test/kdijkstra-any-01.test.sql
deleted file mode 100644
index 3a69d73..0000000
--- a/src/kdijkstra/test/kdijkstra-any-01.test.sql
+++ /dev/null
@@ -1 +0,0 @@
-select * from pgr_kdijkstracost('select gid as id, source, target, cost from kdgrid', 288, array[1,25,601,625], false, false);
diff --git a/src/kdijkstra/test/kdijkstra-any-02.result b/src/kdijkstra/test/kdijkstra-any-02.result
deleted file mode 100644
index 627d034..0000000
--- a/src/kdijkstra/test/kdijkstra-any-02.result
+++ /dev/null
@@ -1,100 +0,0 @@
-0|1|288|863|1
-1|1|263|838|1
-2|1|238|813|1
-3|1|213|788|1
-4|1|188|180|1
-5|1|187|762|1
-6|1|162|155|1
-7|1|161|154|1
-8|1|160|153|1
-9|1|159|734|1
-10|1|134|128|1
-11|1|133|708|1
-12|1|108|103|1
-13|1|107|102|1
-14|1|106|101|1
-15|1|105|680|1
-16|1|80|76|1
-17|1|79|75|1
-18|1|78|74|1
-19|1|77|652|1
-20|1|52|49|1
-21|1|51|626|1
-22|1|26|601|1
-23|1|1|-1|0
-24|25|288|277|1
-25|25|289|278|1
-26|25|290|279|1
-27|25|291|280|1
-28|25|292|281|1
-29|25|293|282|1
-30|25|294|283|1
-31|25|295|284|1
-32|25|296|285|1
-33|25|297|286|1
-34|25|298|873|1
-35|25|273|263|1
-36|25|274|849|1
-37|25|249|824|1
-38|25|224|799|1
-39|25|199|774|1
-40|25|174|749|1
-41|25|149|724|1
-42|25|124|699|1
-43|25|99|674|1
-44|25|74|649|1
-45|25|49|624|1
-46|25|24|24|1
-47|25|25|-1|0
-48|601|288|276|1
-49|601|287|275|1
-50|601|286|274|1
-51|601|285|273|1
-52|601|284|272|1
-53|601|283|271|1
-54|601|282|270|1
-55|601|281|269|1
-56|601|280|268|1
-57|601|279|879|1
-58|601|304|291|1
-59|601|303|903|1
-60|601|328|928|1
-61|601|353|953|1
-62|601|378|978|1
-63|601|403|386|1
-64|601|402|1002|1
-65|601|427|1027|1
-66|601|452|1052|1
-67|601|477|1077|1
-68|601|502|1102|1
-69|601|527|1127|1
-70|601|552|1152|1
-71|601|577|553|1
-72|601|576|1176|1
-73|601|601|-1|0
-74|625|288|277|1
-75|625|289|278|1
-76|625|290|279|1
-77|625|291|280|1
-78|625|292|892|1
-79|625|317|305|1
-80|625|318|306|1
-81|625|319|919|1
-82|625|344|944|1
-83|625|369|969|1
-84|625|394|994|1
-85|625|419|1019|1
-86|625|444|1044|1
-87|625|469|1069|1
-88|625|494|1094|1
-89|625|519|499|1
-90|625|520|1120|1
-91|625|545|524|1
-92|625|546|1146|1
-93|625|571|1171|1
-94|625|596|573|1
-95|625|597|574|1
-96|625|598|575|1
-97|625|599|576|1
-98|625|600|1200|1
-99|625|625|-1|0
diff --git a/src/kdijkstra/test/kdijkstra-any-02.test.sql b/src/kdijkstra/test/kdijkstra-any-02.test.sql
deleted file mode 100644
index 4ca0bfc..0000000
--- a/src/kdijkstra/test/kdijkstra-any-02.test.sql
+++ /dev/null
@@ -1 +0,0 @@
-select * from pgr_kdijkstrapath('select gid as id, source, target, cost from kdgrid', 288, array[1,25,601,625], false, false);
diff --git a/src/kdijkstra/test/kdijkstra-any-03.result b/src/kdijkstra/test/kdijkstra-any-03.result
deleted file mode 100644
index 86bf7c0..0000000
--- a/src/kdijkstra/test/kdijkstra-any-03.result
+++ /dev/null
@@ -1,100 +0,0 @@
-0|1|288|863|1
-1|1|263|838|1
-2|1|238|813|1
-3|1|213|788|1
-4|1|188|180|1
-5|1|187|762|1
-6|1|162|155|1
-7|1|161|154|1
-8|1|160|153|1
-9|1|159|734|1
-10|1|134|128|1
-11|1|133|708|1
-12|1|108|103|1
-13|1|107|102|1
-14|1|106|101|1
-15|1|105|680|1
-16|1|80|76|1
-17|1|79|75|1
-18|1|78|74|1
-19|1|77|73|1
-20|1|76|651|1
-21|1|51|626|1
-22|1|26|601|1
-23|1|1|-1|0
-24|25|288|277|1
-25|25|289|864|1
-26|25|264|254|1
-27|25|265|255|1
-28|25|266|841|1
-29|25|241|232|1
-30|25|242|233|1
-31|25|243|234|1
-32|25|244|235|1
-33|25|245|236|1
-34|25|246|821|1
-35|25|221|796|1
-36|25|196|771|1
-37|25|171|746|1
-38|25|146|141|1
-39|25|147|722|1
-40|25|122|697|1
-41|25|97|672|1
-42|25|72|647|1
-43|25|47|46|1
-44|25|48|623|1
-45|25|23|23|1
-46|25|24|24|1
-47|25|25|-1|0
-48|601|288|888|1
-49|601|313|913|1
-50|601|338|938|1
-51|601|363|963|1
-52|601|388|988|1
-53|601|413|396|1
-54|601|412|395|1
-55|601|411|394|1
-56|601|410|393|1
-57|601|409|392|1
-58|601|408|1008|1
-59|601|433|415|1
-60|601|432|414|1
-61|601|431|1031|1
-62|601|456|437|1
-63|601|455|436|1
-64|601|454|1054|1
-65|601|479|1079|1
-66|601|504|1104|1
-67|601|529|1129|1
-68|601|554|531|1
-69|601|553|1153|1
-70|601|578|554|1
-71|601|577|553|1
-72|601|576|1176|1
-73|601|601|-1|0
-74|625|288|277|1
-75|625|289|278|1
-76|625|290|279|1
-77|625|291|280|1
-78|625|292|892|1
-79|625|317|305|1
-80|625|318|306|1
-81|625|319|919|1
-82|625|344|944|1
-83|625|369|969|1
-84|625|394|994|1
-85|625|419|1019|1
-86|625|444|1044|1
-87|625|469|1069|1
-88|625|494|1094|1
-89|625|519|1119|1
-90|625|544|523|1
-91|625|545|524|1
-92|625|546|1146|1
-93|625|571|549|1
-94|625|572|550|1
-95|625|573|1173|1
-96|625|598|575|1
-97|625|599|576|1
-98|625|600|1200|1
-99|625|625|-1|0
diff --git a/src/kdijkstra/test/kdijkstra-any-03.test.sql b/src/kdijkstra/test/kdijkstra-any-03.test.sql
deleted file mode 100644
index 5d89a84..0000000
--- a/src/kdijkstra/test/kdijkstra-any-03.test.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-update kdgrid set cost=-1.0 where  source=2 and target=3;
-update kdgrid set cost=-1.0 where  source=12 and target=13;
-update kdgrid set cost=-1.0 where  source=22 and target=23;
-update kdgrid set cost=-1.0 where  source=32 and target=33;
-update kdgrid set cost=-1.0 where  source=42 and target=43;
-select * from pgr_kdijkstrapath('select gid as id, source, target, cost from kdgrid', 288, array[1,25,601,625], false, false);
diff --git a/src/kdijkstra/test/pgtap/compare-kdijstraCost-dijkstraCost.test.sql b/src/kdijkstra/test/pgtap/compare-kdijstraCost-dijkstraCost.test.sql
new file mode 100644
index 0000000..f5b51ca
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/compare-kdijstraCost-dijkstraCost.test.sql
@@ -0,0 +1,77 @@
+
+/*
+This test is for the equivalence of 
+pgr_ kdijstraCost with pgr_dijkstraCost one to many
+with
+one to many dijkstra
+*/
+
+\i setup.sql
+SET client_min_messages = WARNING;
+
+SELECT plan(102);
+
+
+create or REPLACE FUNCTION foo(cant INTEGER, directed BOOLEAN)
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+sql_kdc TEXT;
+sql_dc TEXT;
+arrayData TEXT;
+msg TEXT;
+count integer;
+gtype TEXT;
+inner_sql TEXT;
+BEGIN
+    sql_kdc := '';
+    sql_dc := '';
+    count := 1;
+    arrayData := 'ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]';
+    IF (directed) THEN gtype := ': Directed';
+    ELSE gtype := ': Undirected';
+    END IF;
+
+    FOR i IN 1.. cant LOOP
+        inner_sql := 'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table';
+        sql_kdc := 'SELECT id1, id2, cost from pgr_kdijkstraCost(' || quote_literal(inner_sql) || ', '
+            || i || ', ' || arrayData || ', ' ||  directed || ', ' || TRUE || ')';
+
+        sql_dc := 'SELECT start_vid::INTEGER, end_vid::INTEGER, agg_cost from pgr_dijkstraCost(' || quote_literal(inner_sql) || ', '
+            || i || ', ' || arrayData || ', ' ||  directed || ')';
+
+        msg:= count || gtype || ': Directed with reverse cost start:' || i || ' test 1' ;
+        RETURN query SELECT set_has(sql_kdc, sql_dc, msg);
+        count := count + 1;
+
+        sql_kdc := 'SELECT id1, id2, cost from pgr_kdijkstraCost(' || quote_literal(inner_sql) || ', '
+            || i || ', ' || arrayData || ', ' ||  directed || ', ' || FALSE || ')';
+
+        inner_sql := 'select id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table';
+        sql_dc := 'SELECT start_vid::INTEGER, end_vid::INTEGER, agg_cost from pgr_dijkstraCost(' || quote_literal(inner_sql) || ', '
+            || i || ', ' || arrayData || ', ' ||  directed || ')';
+
+        msg:= count || gtype || ' with reverse cost but dont want reverse cost start: ' || i || ' test 2' ;
+        RETURN query SELECT set_has( sql_kdc, sql_dc, msg);
+        count := count + 1;
+
+        sql_kdc := 'SELECT id1, id2, cost from pgr_kdijkstraCost(' || quote_literal(inner_sql) || ', '
+            || i || ', ' || arrayData || ', ' ||  directed || ', ' || FALSE || ')';
+
+        msg:= count || gtype ||' No reverse cost start:'  || i || ' test 3' ;
+        RETURN query SELECT set_has( sql_kdc, sql_dc, msg);
+        count := count + 1;
+
+END LOOP;
+END
+$BODY$
+language plpgsql;
+
+select * from foo(17, TRUE);
+select * from foo(17, FALSE);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
+
diff --git a/src/kdijkstra/test/pgtap/compare-kdijstraPath-dijkstra.test.sql b/src/kdijkstra/test/pgtap/compare-kdijstraPath-dijkstra.test.sql
new file mode 100644
index 0000000..cc9b8a2
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/compare-kdijstraPath-dijkstra.test.sql
@@ -0,0 +1,78 @@
+
+/*
+This test is for the equivalence of 
+pgr_ kdijstraPath with pgr_dijkstra one to many
+with
+one to many dijkstra
+*/
+
+\i setup.sql
+SET client_min_messages TO WARNING;
+
+SELECT plan(102);
+
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+
+create or REPLACE FUNCTION foo(cant INTEGER, directed BOOLEAN)
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+sql_kdc TEXT;
+sql_dc TEXT;
+arrayData TEXT;
+msg TEXT;
+count integer;
+gtype TEXT;
+inner_sql TEXT;
+BEGIN
+    sql_kdc := '';
+    sql_dc := '';
+    count := 1;
+    arrayData := 'ARRAY[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]';
+    IF (directed) THEN gtype := ': Directed';
+    ELSE gtype := ': Undirected';
+END IF;
+
+FOR i IN 1.. cant LOOP
+    inner_sql := 'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table';
+    sql_kdc := 'SELECT id1, id2, id3, cost from pgr_kdijkstraPath(' || quote_literal(inner_sql) || ', '
+        || i || ', ' || arrayData || ', ' ||  directed || ', ' || TRUE || ')';
+
+    sql_dc := 'SELECT end_vid::INTEGER,node::INTEGER, edge::INTEGER, cost  from pgr_dijkstra(' || quote_literal(inner_sql) || ', '
+        || i || ', ' || arrayData || ', ' ||  directed || ')';
+
+    msg:= count || gtype || ': with reverse cost start:' || i || ' test 1' ;
+    RETURN query SELECT set_has(sql_kdc, sql_dc, msg);
+
+    sql_kdc := 'SELECT id1, id2, id3, cost from pgr_kdijkstraPath(' || quote_literal(inner_sql) || ', '
+        || i || ', ' || arrayData || ', ' ||  directed || ', ' || FALSE || ')';
+
+    inner_sql := 'select id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table';
+    sql_dc := 'SELECT end_vid::INTEGER, node::INTEGER, edge::INTEGER, cost from pgr_dijkstra(' || quote_literal(inner_sql) || ', '
+        || i || ', ' || arrayData || ', ' ||  directed || ')';
+
+    msg:= count || gtype || ' with reverse cost but dont want reverse cost start: ' || i || ' test 2' ;
+    RETURN query SELECT set_has( sql_kdc, sql_dc, msg);
+
+    sql_kdc := 'SELECT id1, id2, id3, cost from pgr_kdijkstraPath(' || quote_literal(inner_sql) || ', '
+        || i || ', ' || arrayData || ', ' ||  directed || ', ' || FALSE || ') where cost >= 0 and id1 <> ' || i;
+
+    msg:= count || gtype ||' No reverse cost start:'  || i || ' test 3' ;
+    RETURN query SELECT set_eq( sql_kdc, sql_dc, msg);
+    count := count + 1;
+END LOOP;
+END
+$BODY$
+language plpgsql;
+
+select * from foo(17, TRUE);
+select * from foo(17, FALSE);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
+
diff --git a/src/kdijkstra/test/pgtap/errors-exceptions-cost.test.sql b/src/kdijkstra/test/pgtap/errors-exceptions-cost.test.sql
new file mode 100644
index 0000000..54fbb0e
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/errors-exceptions-cost.test.sql
@@ -0,0 +1,299 @@
+
+/*
+This test is for the equivalence of 
+pgr_ kdijstra with pgr_dijkstra one to many
+with
+one to many dijkstra
+*/
+
+\i setup.sql
+SET client_min_messages = WARNING;
+
+
+SELECT plan(29);
+
+PREPARE doc1 AS
+SELECT id1, id2, cost FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+PREPARE q2 AS
+SELECT  start_vid::INTEGER, end_vid::INTEGER, agg_cost FROM pgr_dijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true);
+
+SELECT set_eq('doc1', 'q2', '1: From 2 to 3 returns the same result as pgr_dijkstraCost(one to many)');
+
+
+PREPARE q3 AS
+SELECT id1, id2, cost FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2], true, true);
+PREPARE q4 AS
+SELECT  2::INTEGER AS id1, 2::INTEGER as id2, 0::FLOAT as cost;
+SELECT set_eq('q3', 'q4','2: Gives a record when no path is found from v to v');
+
+PREPARE q5 AS
+SELECT id1, id2, cost FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2,3], true, true);
+PREPARE q6 AS
+WITH the_union AS (
+    (SELECT id1, id2, cost FROM pgr_kdijkstraCost(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+            2, ARRAY[3], true, true))
+    UNION ALL
+    (SELECT 2::INTEGER AS id1, 2::INTEGER as id2, 0::FLOAT as cost))
+SELECT id1, id2, cost FROM the_union;
+SELECT set_eq('q5', 'q6','3: It is the union');
+
+
+PREPARE q7 AS
+SELECT id1, id2, cost FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[17], true, true);
+PREPARE q8 AS
+SELECT  2::INTEGER AS id1, 17::INTEGER as id2,  -1::FLOAT as cost;
+SELECT set_eq('q7', 'q8','4: Gives a record when no path is found from u to v');
+
+
+
+
+
+
+
+PREPARE q9 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2, 18, 3], true, true);
+SELECT lives_ok('q9',
+    '5: When a target is not found there is no path, So returns -1 in cost');
+
+PREPARE q10 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2, 7, 5, 7], true, true);
+SELECT lives_ok('q10',
+    '6: repeated targets are accepted (returned once)');
+
+PREPARE q11 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[18, 19, 20], true, true);
+SELECT lives_ok('q11',
+    '7: None of the target vertices has been found; therefore no path is found So all costs must have a -1');
+
+PREPARE q12 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    18, ARRAY[2], true, true);
+SELECT lives_ok('q12',
+    '8: Start vertex does not exist in the edges: all cost must have a -1');
+
+
+
+
+
+--Throws because id is not int');
+PREPARE doc11 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc11', 'XX000');
+
+PREPARE doc12 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc12','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '10: Throws when source is not int');
+
+PREPARE doc13 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc13','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '11: Throws when target is not int');
+
+PREPARE doc14 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc14','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '12: Throws when cost is not float');
+
+PREPARE doc15 AS
+SELECT * FROM pgr_kdijkstraCost(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost::INTEGER FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc15','XX000');
+
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, 3, true, true);
+    ',
+    '42883','function pgr_kdijkstracost(unknown, integer, integer, boolean, boolean) does not exist',
+    '14: Throws because an array was not given');
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2::BIGINT, ARRAY[3], true, true);
+    ',
+    '42883','function pgr_kdijkstracost(unknown, bigint, integer[], boolean, boolean) does not exist',
+    '15: Throws because a NOT int was was given as starting vertex');
+
+-- BASED ON THE CODE'S INTENTIONS
+
+-- this code never gets executed
+-- https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L121
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3::BIGINT], true, true);
+    ',
+    '42883','function pgr_kdijkstracost(unknown, integer, bigint[], boolean, boolean) does not exist',
+    '16: Throws because the array has data that is not integer');
+
+-- Throws because its not a 1 dimension array: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L131');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[[1,2],[3,4]], true, true);
+    ', 'XX000');
+
+--   'Throws because its missing id: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+--    'Throws because its missing source: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+--    'Throws because its missing target: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+--    'Throws because its missing cost: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, target::INTEGER, source::INTEGER, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3]::BIGINT[], true, true);
+    ',
+    '42883','function pgr_kdijkstracost(unknown, integer, bigint[], boolean, boolean) does not exist',
+    '22: Throws because the arrays are of big int');
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column',
+    '23: Throws because unsalvable contradiction: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L237');
+
+SELECT lives_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, false);
+    ',
+    '24: Does not throw when salvable contradiction');
+
+
+-- TROWS because of null values
+-- https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L285');
+UPDATE edge_table SET source = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT source::INTEGER AS id, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+
+UPDATE edge_table SET source = 1, target = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+
+UPDATE edge_table SET target = 1, cost = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+
+UPDATE edge_table SET cost = 1, reverse_cost = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraCost(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+UPDATE edge_table SET reverse_cost = 1 WHERE id = 1;
+
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/kdijkstra/test/pgtap/errors-exceptions-path.test.sql b/src/kdijkstra/test/pgtap/errors-exceptions-path.test.sql
new file mode 100644
index 0000000..9a6bb64
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/errors-exceptions-path.test.sql
@@ -0,0 +1,305 @@
+
+/*
+This test is for the equivalence of 
+pgr_ kdijstraPath with pgr_dijkstra one to many
+with
+one to many dijkstra
+*/
+
+\i setup.sql
+SET client_min_messages = WARNING;
+
+
+SELECT plan(29);
+
+PREPARE doc1 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+PREPARE q2 AS
+SELECT seq-1,  end_vid::INTEGER, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true);
+
+SELECT set_eq('doc1', 'q2', 'From 2 to 3 returns the same result as pgr_dijkstra(one to many)');
+
+
+PREPARE q3 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2], true, true);
+PREPARE q4 AS
+SELECT 0::INTEGER AS seq, 2::INTEGER AS id1, 2::INTEGER as id2, -1::INTEGER as id3, 0::FLOAT as cost;
+SELECT set_eq('q3', 'q4','Gives a record when no path is found from v to v');
+
+PREPARE q5 AS
+SELECT id1,id2,id3,cost FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2,3], true, true);
+PREPARE q6 AS
+WITH the_union AS (
+    (SELECT * FROM pgr_kdijkstraPath(
+            'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+            2, ARRAY[3], true, true))
+    UNION ALL
+    (SELECT 0::INTEGER AS seq, 2::INTEGER AS id1, 2::INTEGER as id2, -1::INTEGER as id3, 0::FLOAT as cost))
+SELECT id1,id2,id3,cost FROM the_union;
+SELECT set_eq('q5', 'q6','It is the union');
+
+
+PREPARE q7 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[17], true, true);
+PREPARE q8 AS
+SELECT 0::INTEGER AS seq, 17::INTEGER AS id1, 0::INTEGER as id2, -1::INTEGER as id3, -1::FLOAT as cost;
+SELECT set_eq('q7', 'q8','Gives a record when no path is found from u to v');
+
+
+
+
+
+
+-- BASED ON THE CODE'S INTENTIONS
+
+--  Code link: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L790');
+PREPARE q9 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[2, 18, 3], true, true);
+SELECT lives_ok('q9',
+    'Not documented: When a target is not found there is no path, So returns -1 in cost');
+
+-- Code link: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L790');
+PREPARE q10 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    18, ARRAY[2, 7, 5, 7], true, true);
+SELECT lives_ok('q10',
+    'Several targets are the same: returns all values');
+
+-- Code link: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L794');
+PREPARE q11 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[18, 19, 20, 2], true, true);
+SELECT lives_ok('q11',
+    'None of the target vertices has been found; all costs must have a -1 (except for v,v)');
+
+-- Code Link: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L784');
+PREPARE q12 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    18, ARRAY[2], true, true);
+SELECT lives_ok('q12',
+    'Start vertex does not exist in the edges: all cost must have a -1');
+
+
+
+
+
+-- BASED ON THE DOCUMENTATION
+--Throws because id is not int');
+PREPARE doc11 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::BIGINT, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc11', 'XX000');
+
+PREPARE doc12 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::BIGINT, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc12','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '10: Throws when source is not int');
+
+PREPARE doc13 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::BIGINT, cost, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc13','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '11: Throws when target is not int');
+
+PREPARE doc14 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost::INTEGER, reverse_cost FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc14','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '12: Throws when cost is not float');
+
+PREPARE doc15 AS
+SELECT * FROM pgr_kdijkstraPath(
+    'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost::INTEGER FROM edge_table ORDER BY ID',
+    2, ARRAY[3], true, true);
+SELECT throws_ok('doc15','XX000');
+
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, 3, true, true);
+    ',
+    '42883','function pgr_kdijkstrapath(unknown, integer, integer, boolean, boolean) does not exist',
+    '14: Throws because an array was not given');
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2::BIGINT, ARRAY[3], true, true);
+    ',
+    '42883','function pgr_kdijkstrapath(unknown, bigint, integer[], boolean, boolean) does not exist',
+    '15: Throws because a NOT int was was given as starting vertex');
+
+-- BASED ON THE CODE'S INTENTIONS
+
+-- this code never gets executed
+-- https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L121
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3::BIGINT], true, true);
+    ',
+    '42883','function pgr_kdijkstrapath(unknown, integer, bigint[], boolean, boolean) does not exist',
+    '16: Throws because the array has data that is not integer');
+
+-- Throws because its not a 1 dimension array: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L131');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[[1,2],[3,4]], true, true);
+    ', 'XX000');
+
+--   'Throws because its missing id: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+--    'Throws because its missing source: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+--    'Throws because its missing target: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+--    'Throws because its missing cost: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L214');
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, target::INTEGER, source::INTEGER, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3]::BIGINT[], true, true);
+    ',
+    '42883','function pgr_kdijkstrapath(unknown, integer, bigint[], boolean, boolean) does not exist',
+    '22: Throws because the arrays are of big int');
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column',
+    '23: Throws because unsalvable contradiction: https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L237');
+
+SELECT lives_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, false);
+    ',
+    '24: Does not throw when salvable contradiction');
+
+
+-- TROWS because of null values
+-- https://github.com/pgRouting/pgrouting/blob/master/src/kdijkstra/src/k_targets_sp.c#L285');
+UPDATE edge_table SET source = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT source::INTEGER AS id, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+
+UPDATE edge_table SET source = 1, target = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+
+UPDATE edge_table SET target = 1, cost = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+
+
+UPDATE edge_table SET cost = 1, reverse_cost = NULL WHERE id = 1;
+
+SELECT throws_ok(
+    '
+    SELECT * FROM pgr_kdijkstraPath(
+        ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id'',
+        2, ARRAY[3], true, true);
+    ',
+    'XX000');
+
+UPDATE edge_table SET reverse_cost = 1 WHERE id = 1;
+
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/kdijkstra/test/pgtap/issue229.test.sql b/src/kdijkstra/test/pgtap/issue229.test.sql
new file mode 100644
index 0000000..18e41d6
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/issue229.test.sql
@@ -0,0 +1,22 @@
+\i setup.sql
+SET client_min_messages=WARNING;
+
+SELECT plan(1);
+
+        
+SELECT set_eq(
+'SELECT *
+FROM pgr_kdijkstraPath(
+    ''SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table'',
+    10, array[4,12], false, false)',
+
+'SELECT seq-1, end_vid::integer, node::integer, edge::integer, cost 
+FROM pgr_dijkstra(
+    ''SELECT id, source, target, cost FROM edge_table'',
+    10, array[4,12], false)'
+);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/kdijkstra/test/pgtap/issue333.test.sql b/src/kdijkstra/test/pgtap/issue333.test.sql
new file mode 100644
index 0000000..8e8a553
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/issue333.test.sql
@@ -0,0 +1,42 @@
+\i setup.sql
+SET client_min_messages= WARNING;
+
+SELECT plan(3);
+
+CREATE TABLE issue333 ( 
+    id serial,
+    source integer,
+    target integer,
+    cost double precision,
+    reverse_cost double precision
+);
+
+INSERT INTO issue333 (source, target, cost, reverse_cost) VALUES ( 1, 2, 16.72, 16.72);
+INSERT INTO issue333 (source, target, cost, reverse_cost) VALUES ( 2, 1,  3.59,  3.59);
+
+PREPARE q1 AS
+SELECT seq-1, end_vid::integer, node::INTEGER, edge::INTEGER, cost FROM pgr_dijkstra(
+    'SELECT id, source, target, cost, reverse_cost FROM issue333',
+    1, array[2], false);
+
+SELECT set_eq('q1', 
+'SELECT * FROM pgr_kDijkstraPath(
+    ''SELECT id, source, target, cost, reverse_cost FROM issue333'',
+    1, array[2], false, true)', '1');
+
+SELECT set_eq('q1', 
+'SELECT * FROM pgr_kDijkstraPath(
+    ''SELECT id, source, target, cost, reverse_cost FROM issue333'',
+    1, array[2], false, false)', '2');
+
+SELECT set_eq('q1', 
+'SELECT * FROM pgr_kDijkstraPath(
+    ''SELECT id, source, target, cost, reverse_cost FROM issue333'',
+    1, array[2], true, true)', '3');
+
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/kdijkstra/test/pgtap/kdijkstra-any-01.test.sql b/src/kdijkstra/test/pgtap/kdijkstra-any-01.test.sql
new file mode 100644
index 0000000..6e00a5a
--- /dev/null
+++ b/src/kdijkstra/test/pgtap/kdijkstra-any-01.test.sql
@@ -0,0 +1,74 @@
+\i setup.sql
+SET client_min_messages = WARNING;
+
+SELECT plan(3);
+
+
+create table kdgrid (
+    gid serial not null primary key,
+    source integer,
+    target integer,
+    cost float8
+);
+
+insert into kdgrid (source, target, cost)
+select source, target, cost from
+(
+    (with i as (select generate_series(0,24,1) as n),
+        j as (select generate_series(1,24,1) as n)
+        select (i.n*24 + i.n + j.n) as source, (i.n*24 + i.n + j.n + 1) as target, 1.0::float8 as cost,
+        j.n as x1, i.n as y1, j.n+1 as x2, i.n as y2
+        from i, j)
+    union all
+    (with u as (select generate_series(0,24,1) as n),
+        v as (select generate_series(1,25,1) as n)
+        select (u.n*24 + u.n + v.n) as source, (u.n*24 + u.n + v.n + 25) as target, 1.0::float8 as cost,
+        v.n as x1, u.n as y1, v.n as x2, u.n+25 as y2
+        from u, v where u.n < 24)
+) as foo;
+
+PREPARE q1 AS
+select id1, id2, cost from pgr_kdijkstracost('select gid as id, source, target, cost from kdgrid', 288, array[1,25,601,625], false, false);
+
+PREPARE q2 AS
+SELECT start_vid::INTEGER, end_vid::INTEGER, agg_cost
+FROM pgr_dijkstracost(
+    'select gid as id, source, target, cost from kdgrid',
+    288, array[1,25,601,625],
+    false);
+SELECT set_has('q1','q2','comparing vs pgr_dijkstracost');
+
+
+
+PREPARE q3 AS
+select id1, id2, id3, cost from pgr_kdijkstrapath('select gid as id, source, target, cost from kdgrid', 288, array[1,25,601,625], false, false);
+
+PREPARE q4 AS
+SELECT end_vid::INTEGER, node::INTEGER, edge::INTEGER, cost
+FROM pgr_dijkstra(
+    'select gid as id, source, target, cost from kdgrid',
+    288, array[1,25,601,625],
+    false);
+SELECT set_has('q3','q4','comparing vs pgr_dijkstracost');
+
+
+update kdgrid set cost=-1.0 where  source=2 and target=3;
+update kdgrid set cost=-1.0 where  source=12 and target=13;
+update kdgrid set cost=-1.0 where  source=22 and target=23;
+update kdgrid set cost=-1.0 where  source=32 and target=33;
+update kdgrid set cost=-1.0 where  source=42 and target=43;
+
+PREPARE q5 AS
+select id1, id2, id3, cost from pgr_kdijkstrapath('select gid as id, source, target, cost from kdgrid', 288, array[1,25,601,625], false, false);
+
+PREPARE q6 AS
+SELECT end_vid::INTEGER, node::INTEGER, edge::INTEGER, cost
+FROM pgr_dijkstra(
+    'select gid as id, source, target, cost from kdgrid',
+    288, array[1,25,601,625],
+    false);
+SELECT set_has('q5','q6','comparing vs pgr_dijkstracost');
+
+
+SELECT * FROM FINISH();
+ROLLBACK;
diff --git a/src/kdijkstra/test/test.conf b/src/kdijkstra/test/test.conf
index 79f6faa..ebbd3d9 100644
--- a/src/kdijkstra/test/test.conf
+++ b/src/kdijkstra/test/test.conf
@@ -3,8 +3,18 @@
 %main::tests = (
     'any' => {
         'comment' => 'KDijkstra test for any versions.',
-        'data' => [qw(kdijkstra-any-00.data kdijkstra-any-01.data)],
-        'tests' => [qw(kdijkstra-any-01 kdijkstra-any-02 kdijkstra-any-03 vidstodmatrix-any-01 vidstodmatrix-any-02)]
+        'data' => [qw(
+            )],
+
+        'tests' => [qw(
+            doc-kdijkstra
+            )],
+
+        'documentation' => [qw(
+            doc-kdijkstra
+
+            )],
+
         },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/kdijkstra/test/vidstodmatrix-any-01.result b/src/kdijkstra/test/vidstodmatrix-any-01.result
deleted file mode 100644
index e8b9888..0000000
--- a/src/kdijkstra/test/vidstodmatrix-any-01.result
+++ /dev/null
@@ -1 +0,0 @@
-{{0,4,4,4,5,5},{4,0,4,4,5,5},{4,4,0,2,3,5},{6,6,6,0,1,3},{5,5,5,3,0,2},{3,5,5,3,2,0}}
diff --git a/src/kdijkstra/test/vidstodmatrix-any-01.test.sql b/src/kdijkstra/test/vidstodmatrix-any-01.test.sql
deleted file mode 100644
index 93b4001..0000000
--- a/src/kdijkstra/test/vidstodmatrix-any-01.test.sql
+++ /dev/null
@@ -1 +0,0 @@
-select * from pgr_vidsToDMatrix('select eid as id, source, target, cost, reverse_cost from edges5', array[1,5,13,11,12,4], true, true, false);
diff --git a/src/kdijkstra/test/vidstodmatrix-any-02.result b/src/kdijkstra/test/vidstodmatrix-any-02.result
deleted file mode 100644
index a5c1108..0000000
--- a/src/kdijkstra/test/vidstodmatrix-any-02.result
+++ /dev/null
@@ -1 +0,0 @@
-{{0,4,4,5,5,4},{4,0,4,5,5,5},{4,4,0,4,4,5},{5,5,4,0,2,3},{5,5,4,2,0,2},{4,5,5,3,2,0}}
diff --git a/src/kdijkstra/test/vidstodmatrix-any-02.test.sql b/src/kdijkstra/test/vidstodmatrix-any-02.test.sql
deleted file mode 100644
index 9a26d4c..0000000
--- a/src/kdijkstra/test/vidstodmatrix-any-02.test.sql
+++ /dev/null
@@ -1 +0,0 @@
-select * from pgr_vidsToDMatrix('select eid as id, source, target, cost, reverse_cost from edges5', array[1,5,13,11,12,4], true, true, true);
diff --git a/src/ksp/doc/doc-ksp-v2.queries b/src/ksp/doc/doc-ksp-v2.queries
new file mode 100644
index 0000000..4622a62
--- /dev/null
+++ b/src/ksp/doc/doc-ksp-v2.queries
@@ -0,0 +1,45 @@
+--q1
+SELECT * FROM pgr_ksp(
+   'SELECT id, source, target, cost FROM edge_table order by id',
+   7, 12, 2, false
+ );
+NOTICE:  Deprecated function
+ seq | id1 | id2 | id3 | cost 
+-----+-----+-----+-----+------
+   0 |   0 |   7 |   6 |    1
+   1 |   0 |   8 |   7 |    1
+   2 |   0 |   5 |   8 |    1
+   3 |   0 |   6 |   9 |    1
+   4 |   0 |   9 |  15 |    1
+   5 |   0 |  12 |  -1 |    0
+   6 |   1 |   7 |   6 |    1
+   7 |   1 |   8 |   7 |    1
+   8 |   1 |   5 |   8 |    1
+   9 |   1 |   6 |  11 |    1
+  10 |   1 |  11 |  13 |    1
+  11 |   1 |  12 |  -1 |    0
+(12 rows)
+
+--q2
+SELECT * FROM pgr_ksp(
+   'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+   7, 12, 2, true
+ );
+NOTICE:  Deprecated function
+ seq | id1 | id2 | id3 | cost 
+-----+-----+-----+-----+------
+   0 |   0 |   7 |   6 |    1
+   1 |   0 |   8 |   7 |    1
+   2 |   0 |   5 |   8 |    1
+   3 |   0 |   6 |   9 |    1
+   4 |   0 |   9 |  15 |    1
+   5 |   0 |  12 |  -1 |    0
+   6 |   1 |   7 |   6 |    1
+   7 |   1 |   8 |   7 |    1
+   8 |   1 |   5 |   8 |    1
+   9 |   1 |   6 |  11 |    1
+  10 |   1 |  11 |  13 |    1
+  11 |   1 |  12 |  -1 |    0
+(12 rows)
+
+--q3
diff --git a/src/ksp/doc/doc-ksp.queries b/src/ksp/doc/doc-ksp.queries
new file mode 100644
index 0000000..89f7e8c
--- /dev/null
+++ b/src/ksp/doc/doc-ksp.queries
@@ -0,0 +1,288 @@
+--q1
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, 
+      true   
+   );
+NOTICE:  Deprecated function
+ seq | id1 | id2 | id3 | cost 
+-----+-----+-----+-----+------
+   0 |   0 |   2 |   4 |    1
+   1 |   0 |   5 |   8 |    1
+   2 |   0 |   6 |   9 |    1
+   3 |   0 |   9 |  15 |    1
+   4 |   0 |  12 |  -1 |    0
+   5 |   1 |   2 |   4 |    1
+   6 |   1 |   5 |   8 |    1
+   7 |   1 |   6 |  11 |    1
+   8 |   1 |  11 |  13 |    1
+   9 |   1 |  12 |  -1 |    0
+(10 rows)
+
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2,
+      directed:=true   
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+(10 rows)
+
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+(10 rows)
+
+--q2
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+(10 rows)
+
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, heap_paths:=true
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+  11 |       3 |        1 |    2 |    4 |    1 |        0
+  12 |       3 |        2 |    5 |   10 |    1 |        1
+  13 |       3 |        3 |   10 |   12 |    1 |        2
+  14 |       3 |        4 |   11 |   13 |    1 |        3
+  15 |       3 |        5 |   12 |   -1 |    0 |        4
+(15 rows)
+
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, true, true
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+  11 |       3 |        1 |    2 |    4 |    1 |        0
+  12 |       3 |        2 |    5 |   10 |    1 |        1
+  13 |       3 |        3 |   10 |   12 |    1 |        2
+  14 |       3 |        4 |   11 |   13 |    1 |        3
+  15 |       3 |        5 |   12 |   -1 |    0 |        4
+(15 rows)
+
+--q3
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, directed:=false
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    2 |    1 |        0
+   2 |       1 |        2 |    3 |    3 |    1 |        1
+   3 |       1 |        3 |    4 |   16 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+(10 rows)
+
+SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, false, true
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    2 |    1 |        0
+   2 |       1 |        2 |    3 |    3 |    1 |        1
+   3 |       1 |        3 |    4 |   16 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+  11 |       3 |        1 |    2 |    4 |    1 |        0
+  12 |       3 |        2 |    5 |   10 |    1 |        1
+  13 |       3 |        3 |   10 |   12 |    1 |        2
+  14 |       3 |        4 |   11 |   13 |    1 |        3
+  15 |       3 |        5 |   12 |   -1 |    0 |        4
+  16 |       4 |        1 |    2 |    4 |    1 |        0
+  17 |       4 |        2 |    5 |   10 |    1 |        1
+  18 |       4 |        3 |   10 |   12 |    1 |        2
+  19 |       4 |        4 |   11 |   11 |    1 |        3
+  20 |       4 |        5 |    6 |    9 |    1 |        4
+  21 |       4 |        6 |    9 |   15 |    1 |        5
+  22 |       4 |        7 |   12 |   -1 |    0 |        6
+(22 rows)
+
+--q4
+SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 3, 2
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+(0 rows)
+
+SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+(10 rows)
+
+SELECT   * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, heap_paths:=true
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+  11 |       3 |        1 |    2 |    4 |    1 |        0
+  12 |       3 |        2 |    5 |   10 |    1 |        1
+  13 |       3 |        3 |   10 |   12 |    1 |        2
+  14 |       3 |        4 |   11 |   13 |    1 |        3
+  15 |       3 |        5 |   12 |   -1 |    0 |        4
+(15 rows)
+
+SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, true, true
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+  11 |       3 |        1 |    2 |    4 |    1 |        0
+  12 |       3 |        2 |    5 |   10 |    1 |        1
+  13 |       3 |        3 |   10 |   12 |    1 |        2
+  14 |       3 |        4 |   11 |   13 |    1 |        3
+  15 |       3 |        5 |   12 |   -1 |    0 |        4
+(15 rows)
+
+--q5
+SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, directed:=false
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+(10 rows)
+
+SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, directed:=false, heap_paths:=true
+   );
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |    2 |    4 |    1 |        0
+   2 |       1 |        2 |    5 |    8 |    1 |        1
+   3 |       1 |        3 |    6 |    9 |    1 |        2
+   4 |       1 |        4 |    9 |   15 |    1 |        3
+   5 |       1 |        5 |   12 |   -1 |    0 |        4
+   6 |       2 |        1 |    2 |    4 |    1 |        0
+   7 |       2 |        2 |    5 |    8 |    1 |        1
+   8 |       2 |        3 |    6 |   11 |    1 |        2
+   9 |       2 |        4 |   11 |   13 |    1 |        3
+  10 |       2 |        5 |   12 |   -1 |    0 |        4
+  11 |       3 |        1 |    2 |    4 |    1 |        0
+  12 |       3 |        2 |    5 |   10 |    1 |        1
+  13 |       3 |        3 |   10 |   12 |    1 |        2
+  14 |       3 |        4 |   11 |   13 |    1 |        3
+  15 |       3 |        5 |   12 |   -1 |    0 |        4
+(15 rows)
+
+--q6
diff --git a/src/ksp/doc/index.rst b/src/ksp/doc/index.rst
deleted file mode 100644
index 6b47cff..0000000
--- a/src/ksp/doc/index.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_ksp:
-
-pgr_ksp - Multiple shortest Paths based on Dijkstra
-===============================================================================
-
-Version 2.0 (deprecated)
-------------------------
-
-  -  :ref:`pgr_ksp<pgr_ksp_v2>` - Multiple shortest Paths based on Dijkstra
-
-Version 2.1
-------------------
-
-  -  :ref:`pgr_ksp<pgr_ksp_v3>` - Multiple shortest Paths based on Dijkstra
-
-.. toctree::
-        :hidden: 
-
-        ./ksp_v2
-        ./ksp_v3
-
-
diff --git a/src/ksp/doc/ksp.rst.back b/src/ksp/doc/ksp.rst.back
new file mode 100644
index 0000000..0eec12f
--- /dev/null
+++ b/src/ksp/doc/ksp.rst.back
@@ -0,0 +1,24 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _ksp:
+
+pgr_ksp - Multiple shortest Paths based on Dijkstra
+===============================================================================
+
+
+
+  -  :ref:`pgr_ksp<pgr_ksp>` - Multiple shortest Paths based on Dijkstra
+  -  :ref:`pgr_withPointsKSP<pgr_withPointsKSP>` - Multiple shortest Paths based on Dijkstra
+
+.. toctree::
+        :hidden: 
+
+        ./pgr_ksp
+
diff --git a/src/ksp/doc/ksp_v2.rst b/src/ksp/doc/ksp_v2.rst
deleted file mode 100644
index c9303c6..0000000
--- a/src/ksp/doc/ksp_v2.rst
+++ /dev/null
@@ -1,146 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_ksp_v2:
-
-pgr_ksp (V 2.0) - K-Shortest Path
-===============================================================================
-
-.. index:: 
-  single: ksp(text,integer,integer,integer,boolean) -- deprecated
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_ksp`` — Returns the "K" shortest paths.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The K shortest path routing algorithm based on Yen's algorithm. "K" is the number of shortest paths desired. Returns a set of :ref:`pgr_costResult3 <type_cost_result3>` (seq, id1, id2, id3, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-  pgr_costResult3[] pgr_ksp(sql text, source integer, target integer,
-                           paths integer, has_rcost boolean);
-
-.. warning:: This signature is being deprecated in version 2.1, Please use it
-             without the ``has_rcost`` flag instead.
-             
-               - for undirected graph.
-                 ``pgr_ksp(sql, source, target, distance, directed:=false)``
-               - for directed graph.
-                 ``pgr_ksp(sql, source, target, distance, directed:=true)``
-
-             See :ref:`pgr_ksp_v3`
-
-
-
-Description
--------------------------------------------------------------------------------
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-  .. code-block:: sql
-
-    SELECT id, source, target, cost, [,reverse_cost] FROM edge_table
-
-
-  :id: ``int4`` identifier of the edge
-  :source: ``int4`` identifier of the source vertex
-  :target: ``int4`` identifier of the target vertex
-  :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-  :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when ``has_rcost`` the parameter is ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` id of the start point
-:target: ``int4`` id of the end point
-:paths: ``int4`` number of alternative routes
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   sequence for ording the results
-:id1:   route ID
-:id2:   node ID
-:id3:   edge ID (``0`` for the last row)
-:cost:  cost to traverse from ``id2`` using ``id3``
-
-KSP code base taken from http://code.google.com/p/k-shortest-paths/source.
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Without ``reverse_cost``
-
-.. code-block:: sql
-
-   SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-      'SELECT id, source, target, cost FROM edge_table',
-      7, 12, 2, false
-    );
-   seq | route | node | edge | cost 
-  -----+-------+------+------+------
-     0 |     0 |    7 |    6 |    1
-     1 |     0 |    8 |    7 |    1
-     2 |     0 |    5 |    8 |    1
-     3 |     0 |    6 |    9 |    1
-     4 |     0 |    9 |   15 |    1
-     5 |     0 |   12 |   -1 |    0
-     6 |     1 |    7 |    6 |    1
-     7 |     1 |    8 |    7 |    1
-     8 |     1 |    5 |    8 |    1
-     9 |     1 |    6 |   11 |    1
-    10 |     1 |   11 |   13 |    1
-    11 |     1 |   12 |   -1 |    0
-  (12 rows)
-
-
-
-* With ``reverse_cost``
-
-.. code-block:: sql
-
-   SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-      'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      7, 12, 2, true
-    );
-   seq | route | node | edge | cost 
-  -----+-------+------+------+------
-     0 |     0 |    7 |    6 |    1
-     1 |     0 |    8 |    7 |    1
-     2 |     0 |    5 |    8 |    1
-     3 |     0 |    6 |    9 |    1
-     4 |     0 |    9 |   15 |    1
-     5 |     0 |   12 |   -1 |    0
-     6 |     1 |    7 |    6 |    1
-     7 |     1 |    8 |    7 |    1
-     8 |     1 |    5 |    8 |    1
-     9 |     1 |    6 |   11 |    1
-    10 |     1 |   11 |   13 |    1
-    11 |     1 |   12 |   -1 |    0
-  (12 rows)
-
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result3`
-* http://en.wikipedia.org/wiki/K_shortest_path_routing
diff --git a/src/ksp/doc/ksp_v3.rst b/src/ksp/doc/ksp_v3.rst
deleted file mode 100644
index 27b8900..0000000
--- a/src/ksp/doc/ksp_v3.rst
+++ /dev/null
@@ -1,431 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_ksp_v3:
-
-pgr_ksp - K-Shortest Path
-===============================================================================
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_ksp`` — Returns the "K" shortest paths.
-
-
-.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
-   :target: http://www.boost.org/libs/graph
-
-   Boost Graph Inside
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The K shortest path routing algorithm based on Yen's algorithm. "K" is the number of shortest paths desired.
-
-.. index:: 
-  single: ksp(edges_sql, start_vid, end_vid, k)
-
-.. rubric:: The minimal signature:
-
-.. code-block:: sql
-
-  pgr_ksp(TEXT sql_q, BIGINT start_vid, BIGINT end_vid, INTEGER k);
-    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost) or EMPTY SET
-
-
-.. index:: 
-  single: ksp(edges_sql, start_vid, end_vid, k, directed, heap_paths)
-
-.. rubric:: The full signature:
-
-.. code-block:: sql
-
-  pgr_ksp(TEXT edges_sql, BIGINT start_vid, BIGINT end_vid, INTEGER k,
-        BOOLEAN directed:=true, BOOLEAN heap_paths:=false);
-    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost) or EMPTY SET
-
-
-Description of the SQL query
--------------------------------------------------------------------------------
-
-General description of the ``edges_sql``
-
-.. code-block:: sql
-
-    SELECT id, source, target, cost [,reverse_cost] FROM ...
-
-:sql_q: a SQL query, which returns a set of rows with the following columns:
-
-        :id: ``ANY-INTEGER`` identifier of the edge.
-        :source: ``ANY-INTEGER`` identifier of the source vertex of the edge.
-        :target: ``ANY-INTEGER`` identifier of the target vertex of the edge.
-        :cost: ``ANY-NUMERICAL`` value of the edge traversal cost. A negative cost will prevent the edge (``source``, ``target``) from being inserted in the graph.
-        :reverse_cost: ``ANY-NUMERICAL`` (optional) the value for the reverse traversal of the edge. A negative cost will prevent the edge (``target``, ``source``) from being inserted in the graph.
-
-Where:
-
-:ANY-INTEGER: smallint, int, bigint
-:ANY-NUMERICAL: smallint, int, bigint, real, float
-
-
-Description of the parameters of the signatures
--------------------------------------------------------------------------------
-
-:sql_q: ``TEXT`` SQL query as decribed above.
-:start_vid: ``BIGINT`` id of the starting vertex.
-:end_vid: ``BIGINT`` id of the ending vertex.
-:k: ``INTEGER`` The desiered number of paths.
-:directed: ``BOOLEAN`` (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
-:heap_paths: ``BOOLEAN`` (optional). When ``true`` returns all the paths stored in the process heap. Default is ``false`` which only returns ``k`` pahts. 
-
-Roughly, if the shortest path has ``N`` edges, the heap will contain about than ``N * k`` paths for small value of ``k`` and ``k > 1``.
-
-
-
-Description of the return values
--------------------------------------------------------------------------------
-
-Returns set of ``(seq, path_seq, path_id, node, edge, cost, agg_cost)``
-
-:seq: ``INT`` sequential number starting from **1**.
-:path_seq: ``INT`` relative position in the pathi of ``node`` and ``edge``. Has value **1** for the begining of a path.
-:path_id: ``BIGINT`` path identifier. The ordering of the paths For two paths i, j if i < j then agg_cost(i) <= agg_cost(j).
-:node: ``BIGINT`` id of the node in the path.
-:edge: ``BIGINT`` id of the edge used to go from ``node`` to the next node in the path sequence. ``-1`` for the last node of the route.
-:cost: ``FLOAT`` cost to traverse from ``node`` using ``edge`` to the next node in the path sequence.
-:agg_cost:  ``FLOAT`` total cost from ``start_vid`` to ``node``.
-
-
-.. warning:: During the transition to 3.0, because pgr_ksp version 2.0 doesn't have defined a directed flag nor a heap_path flag, when pgr_ksp is used with only one flag version 2.0 will be used.
-
-
-Examples to handle the one flag to choose signatures
-------------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig1`
-
-.. code-block:: sql
-
-   SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, 
-      true   -- takes the (V2.0) signature (has_rcost = true and works on directed graph)
-   );
-   seq | id1 | id2 | id3 | cost 
-  -----+-----+-----+-----+------
-     0 |   0 |   2 |   4 |    1
-     1 |   0 |   5 |   8 |    1
-     2 |   0 |   6 |   9 |    1
-     3 |   0 |   9 |  15 |    1
-     4 |   0 |  12 |  -1 |    0
-     5 |   1 |   2 |   4 |    1
-     6 |   1 |   5 |   8 |    1
-     7 |   1 |   6 |  11 |    1
-     8 |   1 |  11 |  13 |    1
-     9 |   1 |  12 |  -1 |    0
-  (10 rows)
-
-
-   SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2,
-      directed:=true   -- takes the new signature
-   );
-
-   SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       0 |        1 |    2 |    4 |    1 |        0
-       2 |       0 |        2 |    5 |    8 |    1 |        1
-       3 |       0 |        3 |    6 |    9 |    1 |        2
-       4 |       0 |        4 |    9 |   15 |    1 |        3
-       5 |       0 |        5 |   12 |   -1 |    0 |        4
-       6 |       1 |        1 |    2 |    4 |    1 |        0
-       7 |       1 |        2 |    5 |    8 |    1 |        1
-       8 |       1 |        3 |    6 |   11 |    1 |        2
-       9 |       1 |        4 |   11 |   13 |    1 |        3
-      10 |       1 |        5 |   12 |   -1 |    0 |        4
-    (10 rows)
-    
-
-
-Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
---------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig1`
-
-
-.. code-block:: sql
-
-   SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    4 |    1 |        0
-       2 |       1 |        2 |    5 |    8 |    1 |        1
-       3 |       1 |        3 |    6 |    9 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |   11 |    1 |        2
-       9 |       2 |        4 |   11 |   13 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-    (10 rows)
-
-
-  
-
-   SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, heap_paths:=true
-   );
-
-   SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, true, true
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    4 |    1 |        0
-       2 |       1 |        2 |    5 |    8 |    1 |        1
-       3 |       1 |        3 |    6 |    9 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |   11 |    1 |        2
-       9 |       2 |        4 |   11 |   13 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-      11 |       3 |        1 |    2 |    4 |    1 |        0
-      12 |       3 |        2 |    5 |   10 |    1 |        1
-      13 |       3 |        3 |   10 |   12 |    1 |        2
-      14 |       3 |        4 |   11 |   13 |    1 |        3
-      15 |       3 |        5 |   12 |   -1 |    0 |        4
-    (15 rows)
-    
-
-
-
-Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig2`
-
-
-.. code-block:: sql
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, directed:=false
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    2 |    1 |        0
-       2 |       1 |        2 |    3 |    3 |    1 |        1
-       3 |       1 |        3 |    4 |   16 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |    9 |    1 |        2
-       9 |       2 |        4 |    9 |   15 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-    (10 rows)
-
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, directed:=false, heap_paths:=true
-   );
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, false, true
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    2 |    1 |        0
-       2 |       1 |        2 |    3 |    3 |    1 |        1
-       3 |       1 |        3 |    4 |   16 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |    9 |    1 |        2
-       9 |       2 |        4 |    9 |   15 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-      11 |       3 |        1 |    2 |    4 |    1 |        0
-      12 |       3 |        2 |    5 |   10 |    1 |        1
-      13 |       3 |        3 |   10 |   12 |    1 |        2
-      14 |       3 |        4 |   11 |   13 |    1 |        3
-      15 |       3 |        5 |   12 |   -1 |    0 |        4
-      16 |       4 |        1 |    2 |    4 |    1 |        0
-      17 |       4 |        2 |    5 |   10 |    1 |        1
-      18 |       4 |        3 |   10 |   12 |    1 |        2
-      19 |       4 |        4 |   11 |   11 |    1 |        3
-      20 |       4 |        5 |    6 |    9 |    1 |        4
-      21 |       4 |        6 |    9 |   15 |    1 |        5
-      22 |       4 |        7 |   12 |   -1 |    0 |        6
-    (22 rows)
-
-
-
-Examples for queries marked as ``directed`` with ``cost`` column
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig3`
-
-
-Empty path representation
-
-.. code-block:: sql
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 3, 2
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-    (0 rows)
-
-
-.. code-block:: sql
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    4 |    1 |        0
-       2 |       1 |        2 |    5 |    8 |    1 |        1
-       3 |       1 |        3 |    6 |    9 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |   11 |    1 |        2
-       9 |       2 |        4 |   11 |   13 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-    (10 rows)
-
-
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, heap_paths:=true
-   );
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, true, true
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    4 |    1 |        0
-       2 |       1 |        2 |    5 |    8 |    1 |        1
-       3 |       1 |        3 |    6 |    9 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |   11 |    1 |        2
-       9 |       2 |        4 |   11 |   13 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-      11 |       3 |        1 |    2 |    4 |    1 |        0
-      12 |       3 |        2 |    5 |   10 |    1 |        1
-      13 |       3 |        3 |   10 |   12 |    1 |        2
-      14 |       3 |        4 |   11 |   13 |    1 |        3
-      15 |       3 |        5 |   12 |   -1 |    0 |        4
-    (15 rows)
-
-    
-
-Examples for queries marked as ``undirected`` with ``cost`` column
-----------------------------------------------------------------------------------------
-
-The examples in this section use the following :ref:`fig4`
-
-
-.. code-block:: sql
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, directed:=false
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    4 |    1 |        0
-       2 |       1 |        2 |    5 |    8 |    1 |        1
-       3 |       1 |        3 |    6 |    9 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |   11 |    1 |        2
-       9 |       2 |        4 |   11 |   13 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-    (10 rows)
-
-  
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, directed:=false, heap_paths:=true
-   );
-
-  SELECT * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, false, true
-   );
-     seq | path_id | path_seq | node | edge | cost | agg_cost 
-    -----+---------+----------+------+------+------+----------
-       1 |       1 |        1 |    2 |    4 |    1 |        0
-       2 |       1 |        2 |    5 |    8 |    1 |        1
-       3 |       1 |        3 |    6 |    9 |    1 |        2
-       4 |       1 |        4 |    9 |   15 |    1 |        3
-       5 |       1 |        5 |   12 |   -1 |    0 |        4
-       6 |       2 |        1 |    2 |    4 |    1 |        0
-       7 |       2 |        2 |    5 |    8 |    1 |        1
-       8 |       2 |        3 |    6 |   11 |    1 |        2
-       9 |       2 |        4 |   11 |   13 |    1 |        3
-      10 |       2 |        5 |   12 |   -1 |    0 |        4
-      11 |       3 |        1 |    2 |    4 |    1 |        0
-      12 |       3 |        2 |    5 |   10 |    1 |        1
-      13 |       3 |        3 |   10 |   12 |    1 |        2
-      14 |       3 |        4 |   11 |   13 |    1 |        3
-      15 |       3 |        5 |   12 |   -1 |    0 |        4
-    (15 rows)
-
-
-The queries use the :ref:`sampledata` network.
-
-
-
-.. rubric:: History
-
-* New in version 2.0.0
-* Added functionality version 2.1
-
-See Also
--------------------------------------------------------------------------------
-
-* http://en.wikipedia.org/wiki/K_shortest_path_routing
-
-.. rubric:: Indices and tables
-
-* :ref:`genindex`
-* :ref:`search`
-
diff --git a/src/ksp/doc/pgr_ksp.rst b/src/ksp/doc/pgr_ksp.rst
new file mode 100644
index 0000000..6cbdc92
--- /dev/null
+++ b/src/ksp/doc/pgr_ksp.rst
@@ -0,0 +1,178 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_ksp:
+
+pgr_ksp
+===============================================================================
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_ksp`` — Returns the "K" shortest paths.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The K shortest path routing algorithm based on Yen's algorithm. "K" is the number of shortest paths desired.
+
+.. index:: 
+  single: ksp(edges_sql, start_vid, end_vid, k)
+
+.. rubric:: The minimal signature:
+
+.. code-block:: sql
+
+  pgr_ksp(TEXT sql_q, BIGINT start_vid, BIGINT end_vid, INTEGER k);
+    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost) or EMPTY SET
+
+
+.. index:: 
+  single: ksp(edges_sql, start_vid, end_vid, k, directed, heap_paths)
+
+.. rubric:: The full signature:
+
+.. code-block:: sql
+
+  pgr_ksp(TEXT edges_sql, BIGINT start_vid, BIGINT end_vid, INTEGER k,
+        BOOLEAN directed:=true, BOOLEAN heap_paths:=false);
+    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost) or EMPTY SET
+
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+General description of the ``edges_sql``
+
+.. code-block:: sql
+
+    SELECT id, source, target, cost [,reverse_cost] FROM ...
+
+:sql_q: a SQL query, which returns a set of rows with the following columns:
+
+        :id: ``ANY-INTEGER`` identifier of the edge.
+        :source: ``ANY-INTEGER`` identifier of the source vertex of the edge.
+        :target: ``ANY-INTEGER`` identifier of the target vertex of the edge.
+        :cost: ``ANY-NUMERICAL`` value of the edge traversal cost. A negative cost will prevent the edge (``source``, ``target``) from being inserted in the graph.
+        :reverse_cost: ``ANY-NUMERICAL`` (optional) the value for the reverse traversal of the edge. A negative cost will prevent the edge (``target``, ``source``) from being inserted in the graph.
+
+Where:
+
+:ANY-INTEGER: smallint, int, bigint
+:ANY-NUMERICAL: smallint, int, bigint, real, float
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+:sql_q: ``TEXT`` SQL query as decribed above.
+:start_vid: ``BIGINT`` id of the starting vertex.
+:end_vid: ``BIGINT`` id of the ending vertex.
+:k: ``INTEGER`` The desiered number of paths.
+:directed: ``BOOLEAN`` (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+:heap_paths: ``BOOLEAN`` (optional). When ``true`` returns all the paths stored in the process heap. Default is ``false`` which only returns ``k`` pahts. 
+
+Roughly, if the shortest path has ``N`` edges, the heap will contain about than ``N * k`` paths for small value of ``k`` and ``k > 1``.
+
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq, path_seq, path_id, node, edge, cost, agg_cost)``
+
+:seq: ``INT`` sequential number starting from **1**.
+:path_seq: ``INT`` relative position in the pathi of ``node`` and ``edge``. Has value **1** for the begining of a path.
+:path_id: ``BIGINT`` path identifier. The ordering of the paths For two paths i, j if i < j then agg_cost(i) <= agg_cost(j).
+:node: ``BIGINT`` id of the node in the path.
+:edge: ``BIGINT`` id of the edge used to go from ``node`` to the next node in the path sequence. ``-1`` for the last node of the route.
+:cost: ``FLOAT`` cost to traverse from ``node`` using ``edge`` to the next node in the path sequence.
+:agg_cost:  ``FLOAT`` total cost from ``start_vid`` to ``node``.
+
+
+.. warning:: During the transition to 3.0, because pgr_ksp version 2.0 doesn't have defined a directed flag nor a heap_path flag, when pgr_ksp is used with only one flag version 2.0 will be used.
+
+
+Examples to handle the one flag to choose signatures
+------------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+.. literalinclude:: doc-ksp.queries
+    :start-after: --q1
+    :end-before: --q2
+
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+--------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+.. literalinclude:: doc-ksp.queries
+    :start-after: --q2
+    :end-before: --q3
+
+
+
+Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig2`
+
+.. literalinclude:: doc-ksp.queries
+    :start-after: --q3
+    :end-before: --q4
+
+
+Examples for queries marked as ``directed`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig3`
+
+
+.. literalinclude:: doc-ksp.queries
+    :start-after: --q4
+    :end-before: --q5
+
+
+Examples for queries marked as ``undirected`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig4`
+
+.. literalinclude:: doc-ksp.queries
+    :start-after: --q5
+    :end-before: --q6
+
+
+The queries use the :ref:`sampledata` network.
+
+
+.. rubric:: History
+
+* New in version 2.0.0
+* Added functionality version 2.1
+
+See Also
+-------------------------------------------------------------------------------
+
+* http://en.wikipedia.org/wiki/K_shortest_path_routing
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/ksp/doc/pgr_ksp_v2.rst b/src/ksp/doc/pgr_ksp_v2.rst
new file mode 100644
index 0000000..950e712
--- /dev/null
+++ b/src/ksp/doc/pgr_ksp_v2.rst
@@ -0,0 +1,107 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_ksp_v2:
+
+pgr_ksp (V 2.0) 
+===============================================================================
+
+.. index:: 
+  single: ksp(text,integer,integer,integer,boolean) -- deprecated
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_ksp`` — Returns the "K" shortest paths.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The K shortest path routing algorithm based on Yen's algorithm. "K" is the number of shortest paths desired. Returns a set of :ref:`pgr_costResult3 <type_cost_result3>` (seq, id1, id2, id3, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+  pgr_costResult3[] pgr_ksp(sql text, source integer, target integer,
+                           paths integer, has_rcost boolean);
+
+.. warning:: This signature is being deprecated in version 2.1, Please use it
+             without the ``has_rcost`` flag instead.
+             
+               - for undirected graph.
+                 ``pgr_ksp(sql, source, target, distance, directed:=false)``
+               - for directed graph.
+                 ``pgr_ksp(sql, source, target, distance, directed:=true)``
+
+             See :ref:`pgr_ksp`
+
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+  .. code-block:: sql
+
+    SELECT id, source, target, cost, [,reverse_cost] FROM edge_table
+
+
+  :id: ``int4`` identifier of the edge
+  :source: ``int4`` identifier of the source vertex
+  :target: ``int4`` identifier of the target vertex
+  :cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+  :reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when ``has_rcost`` the parameter is ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` id of the start point
+:target: ``int4`` id of the end point
+:paths: ``int4`` number of alternative routes
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   sequence for ording the results
+:id1:   route ID
+:id2:   node ID
+:id3:   edge ID (``0`` for the last row)
+:cost:  cost to traverse from ``id2`` using ``id3``
+
+KSP code base taken from http://code.google.com/p/k-shortest-paths/source.
+
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Without ``reverse_cost``
+
+.. literalinclude:: doc-ksp-v2.queries
+    :start-after: --q1
+    :end-before: --q2
+
+
+* With ``reverse_cost``
+
+.. literalinclude:: doc-ksp-v2.queries
+    :start-after: --q2
+    :end-before: --q3
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result3`
+* http://en.wikipedia.org/wiki/K_shortest_path_routing
diff --git a/src/ksp/sql/CMakeLists.txt b/src/ksp/sql/CMakeLists.txt
index 50d23db..c45978a 100644
--- a/src/ksp/sql/CMakeLists.txt
+++ b/src/ksp/sql/CMakeLists.txt
@@ -1,6 +1,7 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
     ${CMAKE_CURRENT_SOURCE_DIR}/routing_ksp.sql 
+    ${CMAKE_CURRENT_SOURCE_DIR}/withPoints_ksp.sql 
 )
         
 # set in parent scope
diff --git a/src/ksp/sql/routing_ksp.sql b/src/ksp/sql/routing_ksp.sql
index dad78a6..13a226f 100644
--- a/src/ksp/sql/routing_ksp.sql
+++ b/src/ksp/sql/routing_ksp.sql
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: routing_ksp.sql
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,60 +20,59 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 
-CREATE OR REPLACE FUNCTION _pgr_ksp(sql text, start_vid bigint, end_vid bigint, k integer, has_rcost boolean, directed boolean,
+CREATE OR REPLACE FUNCTION _pgr_ksp(edges_sql text, start_vid bigint, end_vid bigint, k integer, directed boolean, heap_paths boolean,
   OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
-    '$libdir/librouting-2.1', 'kshortest_path'
+    '$libdir/${PGROUTING_LIBRARY_NAME}', 'kshortest_path'
     LANGUAGE c STABLE STRICT;
 
-
 -- V2 the graph is directed and there are no heap paths 
-CREATE OR REPLACE FUNCTION pgr_ksp(sql text, start_vid integer, end_vid integer, k integer, has_rcost boolean)
+CREATE OR REPLACE FUNCTION pgr_ksp(edges_sql text, start_vid integer, end_vid integer, k integer, has_rcost boolean)
   RETURNS SETOF pgr_costresult3 AS
   $BODY$  
   DECLARE
   has_reverse boolean;
+  sql TEXT;
   BEGIN
-      has_reverse =_pgr_parameter_check('ksp', sql::text, false);
-
-      if (has_reverse != has_rcost) then 
-         if (has_reverse) then -- raise NOTICE 'has_reverse_cost set to false but reverse_cost column found, Ignoring';
-         else raise EXCEPTION 'has_reverse_cost set to true but reverse_cost not found';
-         end if;
-      end if;
+      RAISE NOTICE 'Deprecated function';
+      has_reverse =_pgr_parameter_check('ksp', edges_sql::text, false);
+      sql = edges_sql;
+      IF (has_reverse != has_rcost) THEN
+         IF (has_rcost) THEN
+           -- user says that it has reverse_cost but its not true
+           RAISE EXCEPTION 'has_reverse_cost set to true but reverse_cost not found';
+         ELSE  
+           -- user says that it does not have reverse_cost but it does have it
+           -- to ignore we remove reverse_cost from the query
+           sql = 'SELECT id, source, target, cost FROM (' || edges_sql || ') a';
+         END IF;
+      END IF;
 
-      return query SELECT ((row_number() over()) -1)::integer  as seq,  (path_id-1)::integer as id1, node::integer as id2, edge::integer as id3, cost 
-            FROM _pgr_ksp(sql::text, start_vid, end_vid, k, has_reverse, true) where path_id <= k;
+      RETURN query SELECT ((row_number() over()) -1)::integer  AS seq,  (path_id - 1)::integer AS id1, node::integer AS id2, edge::integer AS id3, cost 
+            FROM _pgr_ksp(sql::text, start_vid, end_vid, k, TRUE, FALSE) WHERE path_id <= k;
   END
   $BODY$
   LANGUAGE plpgsql VOLATILE
   COST 100
   ROWS 1000;
 
---V3 DEFAULTS directed:=true heap_paths:=false
-CREATE OR REPLACE FUNCTION pgr_ksp(sql text, start_vid bigint, end_vid bigint, k integer,
+
+CREATE OR REPLACE FUNCTION pgr_ksp(edges_sql text, start_vid bigint, end_vid bigint, k integer,
   directed boolean default true, heap_paths boolean default false,
+  --directed boolean, heap_paths boolean,
   OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost float, OUT agg_cost float)
   RETURNS SETOF RECORD AS
   $BODY$
   DECLARE
-  has_rcost boolean;
   BEGIN
-      has_rcost =_pgr_parameter_check('ksp', sql::text, true);
-      if heap_paths = false then
-         return query SELECT *
-                FROM _pgr_ksp(sql::text, start_vid, end_vid, k, has_rcost, directed) a where a.path_id <= k;
-      else
-         return query SELECT *
-                FROM _pgr_ksp(sql::text, start_vid, end_vid, k, has_rcost, directed);
-      end if;
+         RETURN query SELECT *
+                FROM _pgr_ksp(edges_sql::text, start_vid, end_vid, k, directed, heap_paths);
   END
   $BODY$
   LANGUAGE plpgsql VOLATILE
   COST 100
   ROWS 1000;
 
-
diff --git a/src/ksp/sql/withPoints_ksp.sql b/src/ksp/sql/withPoints_ksp.sql
new file mode 100644
index 0000000..eaa11a0
--- /dev/null
+++ b/src/ksp/sql/withPoints_ksp.sql
@@ -0,0 +1,44 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_ksp.sql
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+CREATE OR REPLACE FUNCTION pgr_withPointsKSP(
+    edges_sql TEXT, 
+    points_sql TEXT,
+    start_pid BIGINT, 
+    end_pid BIGINT, 
+    k INTEGER,
+
+    directed BOOLEAN DEFAULT TRUE,
+    heap_paths BOOLEAN DEFAULT FALSE,
+    driving_side CHAR DEFAULT 'b',
+    details BOOLEAN DEFAULT FALSE,
+
+    OUT seq INTEGER, OUT path_id INTEGER, OUT path_seq INTEGER,
+    OUT node BIGINT, OUT edge BIGINT,
+    OUT cost FLOAT, OUT agg_cost FLOAT)
+  RETURNS SETOF RECORD AS
+    '$libdir/${PGROUTING_LIBRARY_NAME}', 'withPoints_ksp'
+    LANGUAGE c STABLE STRICT;
+
diff --git a/src/ksp/src/CMakeLists.txt b/src/ksp/src/CMakeLists.txt
index f2398f5..cc9ac2d 100644
--- a/src/ksp/src/CMakeLists.txt
+++ b/src/ksp/src/CMakeLists.txt
@@ -1,4 +1,8 @@
 ADD_LIBRARY(ksp OBJECT 
-                            ksp.c 
-                            ksp_driver.cpp)
+    ksp.c 
+    withPoints_ksp.c 
+
+    withPoints_ksp_driver.cpp
+    ksp_driver.cpp
+    )
 
diff --git a/src/ksp/src/ksp.c b/src/ksp/src/ksp.c
index f3b54e5..91b3f2e 100644
--- a/src/ksp/src/ksp.c
+++ b/src/ksp/src/ksp.c
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: ksp.c
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,12 +20,9 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
-
-
-// #define DEBUG 1
-#include <unistd.h>
+********************************************************************PGR-GNU*/
 
+#include "./../../common/src/pgr_types.h"
 #include "postgres.h"
 #include "executor/spi.h"
 #include "funcapi.h"
@@ -32,21 +32,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #include "access/htup_details.h"
 #endif
 
-#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
 #include "./../../common/src/postgres_connection.h"
-#include "./ksp.h"
+#include "./../../common/src/edges_input.h"
 #include "./ksp_driver.h"
 
-#ifndef _MSC_VER
-Datum kshortest_path(PG_FUNCTION_ARGS);
-#else  // _MSC_VER
-PGDLLEXPORT Datum kshortest_path(PG_FUNCTION_ARGS);
-#endif  // _MSC_VER
-
-
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
 
 PG_FUNCTION_INFO_V1(kshortest_path);
 #ifndef _MSC_VER
@@ -54,167 +45,166 @@ Datum
 #else  // _MSC_VER
 PGDLLEXPORT Datum
 #endif  // _MSC_VER
-kshortest_path(PG_FUNCTION_ARGS) {
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  pgr_path_element3_t      *path;
-//  void * toDel;
-
-  /* stuff done only on the first call of the function */
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
-      path = NULL;
-
-      /* create a function context for cross-call persistence */
-      funcctx = SRF_FIRSTCALL_INIT();
-
-      /* switch to memory context appropriate for multiple function calls */
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-
-      compute(
-              pgr_text2char(PG_GETARG_TEXT_P(0)), /* SQL  */
-              PG_GETARG_INT64(1),   /* source id */
-              PG_GETARG_INT64(2),   /* target_id */
-              PG_GETARG_INT32(3),   /* number of paths */
-              PG_GETARG_BOOL(4),    /* has reverse_cost */
-              PG_GETARG_BOOL(5),    /* directed */
-              &path,
-              &path_count);
-//      toDel = path;
-
-      PGR_DBG("Total number of tuples to be returned %i ", path_count);
-      PGR_DBG("Return value %i", ret);
-
-      /* total number of tuples to be returned */
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = path;
-
-      /* Build a tuple descriptor for our result type */
-      if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
-            ereport(ERROR,
-                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                     errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-     // funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("__pgr_2i3b2f"));
-      funcctx->tuple_desc = tuple_desc;
-      MemoryContextSwitchTo(oldcontext);
-    }
-
-
-  /* stuff done on every call of the function */
-  funcctx = SRF_PERCALL_SETUP();
-
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  path = (pgr_path_element3_t*) funcctx->user_fctx;
-
-  if (call_cntr < max_calls) {   /* do when there is more left to send */
-      HeapTuple    tuple;
-      Datum        result;
-     /* //Datum values[4];
-      //bool nulls[4]; */
-
-      Datum *values;
-      bool* nulls;
-
-      values = (Datum *)palloc(7 * sizeof(Datum));
-      nulls = (bool *) palloc(7 * sizeof(bool));
-
-      values[0] = Int32GetDatum(call_cntr + 1);
-      nulls[0] = false;
-
-      values[1] = Int32GetDatum(path[call_cntr].from + 1);
-      nulls[1] = false;
-
-      values[2] = Int32GetDatum(path[call_cntr].seq);
-      nulls[2] = false;
-
-      values[3] = Int64GetDatum(path[call_cntr].vertex);
-      nulls[3] = false;
-
-      values[4] = Int64GetDatum(path[call_cntr].edge);
-      nulls[4] = false;
-
-      values[5] = Float8GetDatum(path[call_cntr].cost);
-      nulls[5] = false;
-
-      values[6] = Float8GetDatum(path[call_cntr].tot_cost);
-      nulls[6] = false;
+kshortest_path(PG_FUNCTION_ARGS);
 
-      tuple = heap_form_tuple(tuple_desc, values, nulls);
 
-      /* make the tuple into a datum */
-      result = HeapTupleGetDatum(tuple);
-
-      /* clean up (this is not really necessary) */
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
-  } else {   /* do when there is no more left */
-    if (path == (pgr_path_element3_t *)NULL) free(path);
-    SRF_RETURN_DONE(funcctx);
-  }
-}
-
-
-
-int compute(char* sql, int64_t start_vertex,
-         int64_t end_vertex, int no_paths,
-         bool has_rcost, bool directed,
-         pgr_path_element3_t **ksp_path, int *path_count) {
-  int SPIcode = 0;
+static
+void compute(char* sql, int64_t start_vertex,
+         int64_t end_vertex, int k,
+         bool directed,
+         bool heap_paths,
+         General_path_element_t **ksp_path, size_t *path_count) {
+  pgr_SPI_connect();
   pgr_edge_t *edges = NULL;
-  int64_t total_tuples = 0;
-  int readCode = 0;
+  size_t total_tuples = 0;
 
-  char *err_msg = (char *)"";
-  int ret = -1;
+  char *err_msg = NULL;
 
   if (start_vertex == end_vertex) {
     (*path_count) = 0;
     *ksp_path = NULL;
-    return  0;
+    pgr_SPI_finish();
+    return;
   }
 
   PGR_DBG("Load data");
-  readCode = pgr_get_data(sql, &edges, &total_tuples, has_rcost,
-               start_vertex, end_vertex);
-  if (readCode == -1) {
-    (*path_count) = 0;
-    *ksp_path = NULL;
-    pfree(edges);
-    PGR_DBG("Source or vertex not found from Load data\n");
-    return pgr_finish(SPIcode, ret);
-  }
+  pgr_get_data_5_columns(sql, &edges, &total_tuples);
 
   PGR_DBG("Total %ld tuples in query:", total_tuples);
   PGR_DBG("Calling do_pgr_ksp\n");
+  PGR_DBG("heap_paths = %i\n", heap_paths);
 
-  ret = do_pgr_ksp(edges, total_tuples,
+  clock_t start_t = clock();
+  int errcode = do_pgr_ksp(edges, total_tuples,
             start_vertex, end_vertex,
-                       no_paths, has_rcost, directed,
-                       ksp_path, path_count, &err_msg);
+            k, directed, heap_paths,
+            ksp_path, path_count, &err_msg);
+  time_msg(" processing KSP", start_t, clock());
 
-  PGR_DBG("total tuples found %i\n", *path_count);
+  PGR_DBG("total tuples found %ld\n", *path_count);
   PGR_DBG("Exist Status = %i\n", ret);
   PGR_DBG("Returned message = %s\n", err_msg);
 
 
 
-  if (ret < 0) {
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
-      errmsg("Error computing path: %s", err_msg)));
+  if (err_msg) free(err_msg);
+  pfree(edges);
+  pgr_SPI_finish();
+
+  if (errcode) {
+      pgr_send_error(errcode);
+  }
+}
+
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif  // _MSC_VER
+kshortest_path(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t               call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+    General_path_element_t      *path;
+    //  void * toDel;
+
+    /* stuff done only on the first call of the function */
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        size_t path_count = 0;
+        path = NULL;
+
+        /* create a function context for cross-call persistence */
+        funcctx = SRF_FIRSTCALL_INIT();
+
+        /* switch to memory context appropriate for multiple function calls */
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        // CREATE OR REPLACE FUNCTION _pgr_ksp(sql text, start_vid bigint, end_vid bigint, k integer, directed boolean, heap_paths boolean...
+        compute(
+                pgr_text2char(PG_GETARG_TEXT_P(0)), /* SQL  */
+                PG_GETARG_INT64(1),   /* start_vid */
+                PG_GETARG_INT64(2),   /* end_vid */
+                PG_GETARG_INT32(3),   /* k */
+                PG_GETARG_BOOL(4),    /* directed */
+                PG_GETARG_BOOL(5),    /* heap_paths */
+                &path,
+                &path_count);
+        //      toDel = path;
+
+        PGR_DBG("Total number of tuples to be returned %ld \n", path_count);
+
+        /* total number of tuples to be returned */
+        funcctx->max_calls = (uint32_t)path_count;
+        funcctx->user_fctx = path;
+
+        /* Build a tuple descriptor for our result type */
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record\n")));
+
+        // funcctx->tuple_desc = BlessTupleDesc(RelationNameGetTupleDesc("__pgr_2i3b2f"));
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
     }
 
-  pfree(edges);
-  return pgr_finish(SPIcode, ret);
+
+    /* stuff done on every call of the function */
+    funcctx = SRF_PERCALL_SETUP();
+
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    path = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {   /* do when there is more left to send */
+        PGR_DBG("returning %ld \n", call_cntr);
+        HeapTuple    tuple;
+        Datum        result;
+        /* //Datum values[4];
+        //bool nulls[4]; */
+
+        Datum *values;
+        bool* nulls;
+
+        values = (Datum *)palloc(7 * sizeof(Datum));
+        nulls = (bool *) palloc(7 * sizeof(bool));
+
+        nulls[0] = false;
+        nulls[1] = false;
+        nulls[2] = false;
+        nulls[3] = false;
+        nulls[4] = false;
+        nulls[5] = false;
+        nulls[6] = false;
+
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(path[call_cntr].start_id + 1);
+        values[2] = Int32GetDatum(path[call_cntr].seq);
+        values[3] = Int64GetDatum(path[call_cntr].node);
+        values[4] = Int64GetDatum(path[call_cntr].edge);
+        values[5] = Float8GetDatum(path[call_cntr].cost);
+        values[6] = Float8GetDatum(path[call_cntr].agg_cost);
+
+        tuple = heap_form_tuple(tuple_desc, values, nulls);
+
+        /* make the tuple into a datum */
+        result = HeapTupleGetDatum(tuple);
+
+        /* clean up (this is not really necessary) */
+        pfree(values);
+        pfree(nulls);
+
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {   /* do when there is no more left */
+        if (path == (General_path_element_t *) NULL) free(path);
+        SRF_RETURN_DONE(funcctx);
+    }
 }
 
 
diff --git a/src/ksp/src/ksp.h b/src/ksp/src/ksp.h
index 539d00e..600650b 100644
--- a/src/ksp/src/ksp.h
+++ b/src/ksp/src/ksp.h
@@ -1,7 +1,9 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: ksp.h
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+Mail: vicky_vergara at hotmail.com
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,17 +19,9 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
-
-#ifndef SRC_KSP_SRC_KSP_H_
-#define SRC_KSP_SRC_KSP_H_
-
-// #define TUPLIMIT 1000
-// #define PATH_ALLOC_TOTAL 5
-
-// #include <unistd.h>
-// #include "postgres.h"
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,13 +30,12 @@ extern "C" {
 
 #include "./../../common/src/pgr_types.h"
 
-int compute(char* sql, int64_t start_vertex,
+    int compute(char* sql, int64_t start_vertex,
             int64_t end_vertex, int no_paths,
             bool has_reverse_cost, bool directedFlag,
-            pgr_path_element3_t **path, int *ksp_path_count);
+            General_path_element_t **path, size_t *ksp_path_count);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif  // SRC_KSP_SRC_KSP_H_
diff --git a/src/ksp/src/ksp_driver.cpp b/src/ksp/src/ksp_driver.cpp
index cc8a4d7..62acd1e 100644
--- a/src/ksp/src/ksp_driver.cpp
+++ b/src/ksp/src/ksp_driver.cpp
@@ -1,8 +1,11 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: ksp_driver.cpp
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
 vicky_vergara at hotmail.com
 
+------
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -17,122 +20,90 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 #ifdef __MINGW32__
 #include <winsock2.h>
 #include <windows.h>
+#ifdef unlink
+#undef unlink
+#endif
 #endif
-
-
 
 
 #include <deque>
 #include <sstream>
 
-#include <boost/config.hpp>
-#include <boost/graph/adjacency_list.hpp>
 
 #include "./ksp_driver.h"
-extern "C" {
-#if 0
-#include "postgres.h"
-#include "./ksp.h"
-#include "./../../common/src/pgr_types.h"
-#endif
-#include "./../../common/src/postgres_connection.h"
-}
-
-
-
+#include "../../common/src/memory_func.hpp"
 #include "./pgr_ksp.hpp"
 
 
 
-int  do_pgr_ksp(pgr_edge_t  *data_edges, int64_t total_tuples,
-                       int64_t  start_vertex, int64_t  end_vertex,
-                       int no_paths, bool has_reverse_cost, bool directedFlag,
-                       pgr_path_element3_t **ksp_path, int *path_count,
-                       char ** err_msg) {
+int  do_pgr_ksp(
+        pgr_edge_t  *data_edges, size_t total_tuples,
+        int64_t  start_vertex, int64_t  end_vertex,
+        int k, bool directedFlag, bool heap_paths,
+        General_path_element_t **ksp_path, size_t *path_count,
+        char ** err_msg) {
     try {
-        // in c code this should have been checked:
-        //  1) start_vertex is in the data_edges  DONE
-        //  2) end_vertex is in the data_edges    DONE
-        //  3) start and end_vertex are different DONE
         std::ostringstream log;
 
         graphType gType = directedFlag? DIRECTED: UNDIRECTED;
-        const int initial_size = 1;
+        const auto initial_size = total_tuples;
 
         std::deque< Path > paths;
-        typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::undirectedS,
-            boost_vertex_t, boost_edge_t > UndirectedGraph;
-        typedef boost::adjacency_list < boost::vecS, boost::vecS,
-            boost::bidirectionalS,
-            boost_vertex_t, boost_edge_t > DirectedGraph;
-
-        Pgr_ksp < DirectedGraph > digraph(gType, initial_size);
-        Pgr_ksp < UndirectedGraph > undigraph(gType, initial_size);
 
         if (directedFlag) {
-            digraph.initialize_graph(data_edges, total_tuples);
-            paths = digraph.Yen(start_vertex, end_vertex, no_paths);
-            digraph.clear();
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            Pgr_ksp< Pgr_base_graph< DirectedGraph > > fn_yen;
+            digraph.graph_insert_data(data_edges, initial_size);
+            paths = fn_yen.Yen(digraph, start_vertex, end_vertex, k, heap_paths);
         } else {
-            undigraph.initialize_graph(data_edges, total_tuples);
-            paths = undigraph.Yen(start_vertex, end_vertex, no_paths);
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            Pgr_ksp< Pgr_base_graph< UndirectedGraph > > fn_yen;
+            undigraph.graph_insert_data(data_edges, initial_size);
+            paths = fn_yen.Yen(undigraph, start_vertex, end_vertex, k, heap_paths);
         }
 
 
-        int count(count_tuples(paths));
+        auto count(count_tuples(paths));
 
         if (count == 0) {
             *err_msg = strdup(
-               "NOTICE: No path found between Starting and Ending vertices");
-            *ksp_path = noPathFound3(-1, path_count, (*ksp_path));
+                    "NOTICE: No paths found between Starting and Ending vertices");
+            *ksp_path = noResult(path_count, (*ksp_path));
             return 0;
         }
 
         // get the space required to store all the paths
         *ksp_path = NULL;
-        *ksp_path = pgr_get_memory3(count, (*ksp_path));
+        *ksp_path = get_memory(count, (*ksp_path));
 
-        int sequence = 0;
+        size_t sequence = 0;
         int route_id = 0;
         for (const auto &path : paths) {
-            if (path.path.size() > 0)
-               path.dpPrint(ksp_path, sequence, route_id);
+            if (path.size() > 0)
+                path.get_pg_ksp_path(ksp_path, sequence, route_id);
             ++route_id;
         }
 
-        log << "NOTICE Sequence: " << sequence << "\n";
-        if (count != sequence) {
-            log << "ERROR: Internal count and real count are different. \n"
-                << "ERROR: This should not happen: Please report in GitHub:"
-                << " pgrouting issues.";
-            *err_msg = strdup(log.str().c_str());
-            return -1;
-        }
-        #if 1
+        if (count != sequence) {                                
+            *err_msg = NULL;
+            return 2;
+        }                                                                                                       
+        *path_count = count;
+
+#if 1
         *err_msg = strdup("OK");
-        #else
+#else
         *err_msg = strdup(log.str().c_str());
-        #endif
-        *path_count = count;
+#endif
         return EXIT_SUCCESS;
     } catch ( ... ) {
-     *err_msg = strdup("Caught unknown expection!");
-     return -1;
+        *err_msg = strdup("Caught unknown expection!");
+        return -1;
     }
 }
 
-
-#if 0
-// move around this lines to force a return with an empty path and the log msg
-// cool for debugging
-*err_msg = strdup(log.str().c_str());
-(*path_count) = 1;
-*path = noPathFound(start_vertex);
-return -1;
-#endif
diff --git a/src/ksp/src/ksp_driver.h b/src/ksp/src/ksp_driver.h
index 6cba968..ef0cae6 100644
--- a/src/ksp/src/ksp_driver.h
+++ b/src/ksp/src/ksp_driver.h
@@ -1,7 +1,10 @@
-/*PGR
+/*PGR-GNU*****************************************************************
+File: ksp_driver.h
 
 Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+Mail: vicky_vergara at hotmail.com
+
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,28 +20,23 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
-
-#ifndef SRC_KSP_SRC_KSP_DRIVER_H_
-#define SRC_KSP_SRC_KSP_DRIVER_H_
-
-// #include <stdarg.h>
-// #include <stdio.h>
+********************************************************************PGR-GNU*/
 
-#include "./../../common/src/pgr_types.h"
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int  do_pgr_ksp(pgr_edge_t  * edges, int64_t total_tuples,
-                      int64_t  start_vertex, int64_t end_vertex,
-                      int no_paths, bool has_reverse_cost, bool directed,
-                      pgr_path_element3_t **ksp_path, int *path_count,
-                      char ** err_msg);
+#include "./../../common/src/pgr_types.h"
+
+    int  do_pgr_ksp(pgr_edge_t  * edges, size_t total_tuples,
+            int64_t  start_vertex, int64_t end_vertex,
+            int no_paths, bool directed, bool heap_paths,
+            General_path_element_t **ksp_path, size_t *path_count,
+            char ** err_msg);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif  // SRC_KSP_SRC_KSP_DRIVER_H_
diff --git a/src/ksp/src/pgr_ksp.cpp b/src/ksp/src/pgr_ksp.cpp
index d0ce540..98004d0 100644
--- a/src/ksp/src/pgr_ksp.cpp
+++ b/src/ksp/src/pgr_ksp.cpp
@@ -1,129 +1,142 @@
-/*PGR
-
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-
-#include <deque>
-#include "./../../common/src/basePath_SSEC.hpp"
-
-template < class G >
-void Pgr_ksp< G >::clear() {
-        m_Heap.clear();
-}
-
-template < class G >
-void Pgr_ksp< G >::getFirstSolution() {
-     Path path;
-
-     this->dijkstra(path, m_start, m_end);
-
-     if (path.path.size() <= 1 ) return;
-     curr_result_path = path;
-     m_ResultSet.insert(curr_result_path);
-}
-
-template < class G>
-std::deque<Path> Pgr_ksp< G >::Yen(
-  int64_t  start_vertex, int64_t end_vertex, int K) {
-    std::deque<Path> l_ResultList;
-    if ((start_vertex != end_vertex) && (K > 0)) {
-        if   (!this->get_gVertex(start_vertex, v_source)
-           || !this->get_gVertex(end_vertex, v_target)) {
-             return l_ResultList;
-        }
-        m_start = start_vertex;
-        m_end = end_vertex;
-        executeYen(K);
-    }
-
-    while (m_Heap.size()) {
-         curr_result_path = *m_Heap.begin();
-         m_ResultSet.insert(curr_result_path);
-         m_Heap.erase(m_Heap.begin());
-    }
-
-    while (m_ResultSet.size()) {
-         l_ResultList.push_back((*m_ResultSet.begin()));
-         m_ResultSet.erase(m_ResultSet.begin());
-    }
-    return l_ResultList;
-}
-
-
-template < class G >
-void Pgr_ksp< G >::removeVertices(const Path &subpath) {
-    for (unsigned int i = 0; i < subpath.path.size(); i++)
-       this->disconnect_vertex(subpath.path[i].vertex);
-}
-
-template < class G >
-void Pgr_ksp< G >::doNextCycle() {
-    // REG_SIGINT
-
-
-    int64_t spurNodeId;
-    Path rootPath;
-    Path spurPath;
-
-    for (unsigned int i = 0; i < curr_result_path.path.size() ; ++i) {
-        // int64_t  spurEdge = curr_result_path.path[i].edge;
-        spurNodeId = curr_result_path.path[i].vertex;
-
-        rootPath = curr_result_path.getSubpath(i);
-
-        for (pIt = m_ResultSet.begin(); pIt != m_ResultSet.end(); ++pIt) {
-           if ((*pIt).isEqual(rootPath)) {
-              // edge to be removed = (*pIt).path[i].edge;
-              this->disconnect_edge((*pIt).path[i].vertex,     // from
-                                    (*pIt).path[i+1].vertex);  // to
-           }
-        }
-        removeVertices(rootPath);
-
-        // int spurPathSize;
-
-        // THROW_ON_SIGINT
-        this->dijkstra(spurPath, spurNodeId , m_end);
-        // THROW_ON_SIGINT
-
-        if (spurPath.path.size() > 0) {
-            rootPath.appendPath(spurPath);
-            m_Heap.insert(rootPath);
-        }
-
-        this->restore_graph();
-        rootPath.clear();
-        spurPath.clear();
-    }
-}
-
-template < class G >
-void Pgr_ksp< G >::executeYen(int K) {
-          clear();
-          getFirstSolution();
-
-          if (m_ResultSet.size() == 0) return;  // no path found
-
-          while ( m_ResultSet.size() < (unsigned int) K ) {
-                doNextCycle();
-                if ( m_Heap.size() == 0 ) break;
-                curr_result_path = *m_Heap.begin();
-                m_ResultSet.insert(curr_result_path);
-                m_Heap.erase(m_Heap.begin());
-          }
-}
+/*PGR-GNU*****************************************************************
+File: pgr_ksp.cpp
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#ifdef unlink
+#undef unlink
+#endif
+#endif
+
+
+#include <deque>
+#include <set>
+#include "./../../common/src/basePath_SSEC.hpp"
+
+template < class G >
+void Pgr_ksp< G >::clear() {
+        m_Heap.clear();
+}
+
+template < class G >
+void Pgr_ksp< G >::getFirstSolution(G &graph) {
+     Path path;
+
+     Pgr_dijkstra< G > fn_dijkstra;
+     fn_dijkstra.dijkstra(graph, path, m_start, m_end);
+
+     if (path.empty()) return;
+     curr_result_path = path;
+     m_ResultSet.insert(curr_result_path);
+}
+
+template < class G>
+std::deque<Path>
+Pgr_ksp< G >::Yen(G &graph, 
+  int64_t  start_vertex, int64_t end_vertex, int K, bool heap_paths) {
+    m_ResultSet.clear();
+    m_Heap.clear();
+    if ((start_vertex != end_vertex) && (K > 0)) {
+        if   (!graph.get_gVertex(start_vertex, v_source)
+           || !graph.get_gVertex(end_vertex, v_target)) {
+             std::deque<Path> l_ResultList;
+             return l_ResultList;
+        }
+        m_start = start_vertex;
+        m_end = end_vertex;
+        executeYen(graph, K);
+    }
+
+    while (!m_ResultSet.empty()) {
+        m_Heap.insert(*m_ResultSet.begin());
+        m_ResultSet.erase(m_ResultSet.begin());
+    }
+    std::deque<Path> l_ResultList(m_Heap.begin(), m_Heap.end());
+    if (!heap_paths && l_ResultList.size() > (size_t) K)
+        l_ResultList.resize(K);
+    return l_ResultList;
+}
+
+
+template < class G >
+void Pgr_ksp< G >::removeVertices(G &graph, const Path &subpath) {
+    for (const auto &e : subpath)
+        graph.disconnect_vertex(e.node);
+}
+
+template < class G >
+void Pgr_ksp< G >::doNextCycle(G &graph) {
+    // REG_SIGINT
+
+
+    int64_t spurNodeId;
+    Path rootPath;
+    Path spurPath;
+
+    for (unsigned int i = 0; i < curr_result_path.size() ; ++i) {
+        spurNodeId = curr_result_path[i].node;
+
+        rootPath = curr_result_path.getSubpath(i);
+
+        for (const auto &path : m_ResultSet) {
+            if (path.isEqual(rootPath)) {
+                graph.disconnect_edge(path[i].node,     // from
+                        path[i + 1].node);  // to
+            }
+        }
+        removeVertices(graph, rootPath);
+
+
+        // THROW_ON_SIGINT
+        Pgr_dijkstra< G > fn_dijkstra;
+        fn_dijkstra.dijkstra(graph, spurPath, spurNodeId, m_end);
+        //this->dijkstra(spurPath, spurNodeId , m_end);
+        // THROW_ON_SIGINT
+
+        if (spurPath.size() > 0) {
+            rootPath.appendPath(spurPath);
+            m_Heap.insert(rootPath);
+        }
+
+        graph.restore_graph();
+        rootPath.clear();
+        spurPath.clear();
+    }
+}
+
+template < class G >
+void Pgr_ksp< G >::executeYen(G &graph, int K) {
+    clear();
+    getFirstSolution(graph);
+
+    if (m_ResultSet.size() == 0) return;  // no path found
+
+    while ( m_ResultSet.size() < (unsigned int) K ) {
+        doNextCycle(graph);
+        if ( m_Heap.empty() ) break;
+        curr_result_path = *m_Heap.begin();
+        m_ResultSet.insert(curr_result_path);
+        m_Heap.erase(m_Heap.begin());
+    }
+}
diff --git a/src/ksp/src/pgr_ksp.hpp b/src/ksp/src/pgr_ksp.hpp
index 83a106b..b7d9583 100644
--- a/src/ksp/src/pgr_ksp.hpp
+++ b/src/ksp/src/pgr_ksp.hpp
@@ -1,96 +1,101 @@
-/*PGR
-
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#ifndef SRC_KSP_SRC_PGR_KSP_HPP_
-#define SRC_KSP_SRC_PGR_KSP_HPP_
-
-#include <deque>
-#include <set>
-#include "./../../common/src/basePath_SSEC.hpp"
-#include "./../../dijkstra/src/pgr_dijkstra.hpp"
-
-template < class G >
-class Pgr_ksp: public Pgr_dijkstra< G > {
- public:
-        explicit Pgr_ksp(graphType gtype, const int initial_size)
-                : Pgr_dijkstra <G>(gtype, initial_size)
-           {}
-
-        ~Pgr_ksp(void) {}
-        std::deque<Path> Yen(int64_t source, int64_t target, int K);
-        void clear();
-
- private:
-    class compPaths {
-     public:
-        bool operator()(const Path &p1, const Path  &p2) const {
-          if (p1.cost < p2.cost) return true;
-          if (p1.cost > p2.cost) return false;
-
-          // paths costs are equal now we check by length
-          if (p1.path.size()  < p2.path.size()) return true;
-          if (p1.path.size()  > p2.path.size()) return false;
-
-          // paths weights & lengths are equal now we check by ID
-          unsigned int i;
-          for ( i = 0; i < p1.path.size() ; i++)
-               if ( p1.path[i].vertex < p2.path[i].vertex) return true;
-
-          // we got here and everything is equal
-          return false;
-       }
-    };
-
-    //! the actual algorithm
-    void executeYen(int top_k);
-
-    /** @name Auxiliary function for yen's algorithm */
-    ///@{
-
-    //! Performs the first Dijkstra of the algorithm
-    void getFirstSolution();
-    //! Performs the next cycle of the algorithm
-    void doNextCycle();
-    //! stores in subPath the first i elements of path
-    void removeVertices(const Path &path);
-    ///@}
-
- private:
-    /** @name members */
-    ///@{
-    typedef typename boost::graph_traits < G >::vertex_descriptor V;
-    V v_source;  //!< source descriptor
-    V v_target;  //!< target descriptor
-    int64_t m_start;  //!< source id
-    int64_t m_end;   //!< target id
-
-    Path curr_result_path;  //!< storage for the current result
-
-    typedef typename  std::set<Path, compPaths> pSet;
-    typedef typename  std::set<Path, compPaths>::iterator pSet_i;
-    pSet m_ResultSet;  //!< ordered set of shortest paths
-    pSet m_Heap;  //!< the heap
-    pSet_i pIt;   //!< iterator for heap and result set
-};
-
-#include "./pgr_ksp.cpp"
-
-#endif  // SRC_KSP_SRC_PGR_KSP_HPP_
+/*PGR-GNU*****************************************************************
+File: pgr_ksp.hpp
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#ifdef unlink
+#undef unlink
+#endif
+#endif
+
+
+#include <deque>
+#include <set>
+#include "./../../common/src/basePath_SSEC.hpp"
+#include "./../../dijkstra/src/pgr_dijkstra.hpp"
+
+template < class G >
+class Pgr_ksp {
+ public:
+     std::deque<Path> Yen(G &graph, int64_t source, int64_t target, int K, bool heap_paths);
+     void clear();
+
+ private:
+     class compPaths {
+      public:
+          bool operator()(const Path &p1, const Path &p2) const {
+              if (p1.tot_cost() != p2.tot_cost())
+                  return  (p1.tot_cost() < p2.tot_cost());
+
+              // paths costs are equal now we check by length
+              if (p1.size() < p2.size())
+                  return (p1.size() < p2.size());
+
+              // paths weights & lengths are equal now we check by ID
+              unsigned int i;
+              for (i = 0; i < p1.size(); i++) {
+                  if (p1[i].node != p2[i].node)
+                      return (p1[i].node < p2[i].node);
+              }
+
+              // we got here and everything is equal
+              return false;
+          }
+     };
+
+     //! the actual algorithm
+     void executeYen(G &graph, int top_k);
+
+     /** @name Auxiliary function for yen's algorithm */
+     ///@{
+
+     //! Performs the first Dijkstra of the algorithm
+     void getFirstSolution(G &graph);
+     //! Performs the next cycle of the algorithm
+     void doNextCycle(G &graph);
+     //! stores in subPath the first i elements of path
+     void removeVertices(G &graph, const Path &path);
+     ///@}
+
+ private:
+     /** @name members */
+     ///@{
+     typedef typename G::V V;
+     V v_source;  //!< source descriptor
+     V v_target;  //!< target descriptor
+     int64_t m_start;  //!< source id
+     int64_t m_end;   //!< target id
+
+     Path curr_result_path;  //!< storage for the current result
+
+     typedef typename  std::set<Path, compPaths> pSet;
+     pSet m_ResultSet;  //!< ordered set of shortest paths
+     pSet m_Heap;  //!< the heap
+};
+
+#include "./pgr_ksp.cpp"
+
diff --git a/src/ksp/src/withPoints_ksp.c b/src/ksp/src/withPoints_ksp.c
new file mode 100644
index 0000000..c94893d
--- /dev/null
+++ b/src/ksp/src/withPoints_ksp.c
@@ -0,0 +1,282 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_ksp.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+
+#include "fmgr.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/points_input.h"
+#include "./../../withPoints/src/get_new_queries.h"
+#include "./withPoints_ksp_driver.h"
+#include "./../../common/src/debug_macro.h"
+
+PG_FUNCTION_INFO_V1(withPoints_ksp);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+withPoints_ksp(PG_FUNCTION_ARGS);
+
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process(
+        char* edges_sql,
+        char* points_sql,
+        int64_t start_pid,
+        int64_t end_pid,
+        int k,
+
+        bool directed,
+        bool heap_paths,
+        char *driving_side,
+        bool details,
+
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+
+    driving_side[0] = tolower(driving_side[0]);
+    PGR_DBG("driving side:%c",driving_side[0]);
+    if (! ((driving_side[0] == 'r')
+                || (driving_side[0] == 'l'))) {
+        driving_side[0] = 'b'; 
+    }
+
+    pgr_SPI_connect();
+
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+    get_new_queries(
+            edges_sql, points_sql,
+            &edges_of_points_query,
+            &edges_no_points_query);
+
+
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    PGR_DBG("freeing allocated memory not used anymore");
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ((total_edges + total_edges_of_points) == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    PGR_DBG("Starting processing");
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int errcode = do_pgr_withPointsKsp(
+            edges,
+            total_edges,
+            points,
+            total_points,
+            edges_of_points,
+            total_edges_of_points,
+            start_pid,
+            end_pid,
+            k,
+
+            directed,
+            heap_paths,
+            driving_side[0],
+            details,
+
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPointsKSP", start_t, clock());
+
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    if (!err_msg) free(err_msg);
+
+    pfree(edges);
+    pfree(edges_of_points);
+    pfree(points);
+
+    pgr_SPI_finish();
+
+    if (errcode) {
+        pgr_send_error(errcode);
+    }
+
+}
+
+/*                                                                             */
+/*******************************************************************************/
+
+
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+withPoints_ksp(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t             call_cntr;
+    uint32_t             max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPoint(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pid INTEGER,
+        // end_pid BIGINT,
+        // k BIGINT,
+        //
+        // directed BOOLEAN -- DEFAULT true,
+        // heap_paths BOOLEAN -- DEFAULT false,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT false,
+
+        PGR_DBG("Calling process");
+        PGR_DBG("initial driving side:%s", pgr_text2char(PG_GETARG_TEXT_P(7)));
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                pgr_text2char(PG_GETARG_TEXT_P(1)),
+                PG_GETARG_INT64(2),
+                PG_GETARG_INT64(3),
+                PG_GETARG_INT32(4),
+                PG_GETARG_BOOL(5),
+                PG_GETARG_BOOL(6),
+                pgr_text2char(PG_GETARG_TEXT_P(7)),
+                PG_GETARG_BOOL(8),
+                &result_tuples,
+                &result_count);
+
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        values = palloc(7 * sizeof(Datum));
+        nulls = palloc(7 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 7; ++i) {
+            nulls[i] = ' ';
+        }
+
+        /*
+           OUT seq INTEGER, OUT path_id INTEGER, OUT path_seq INTEGER,
+           OUT node BIGINT, OUT edge BIGINT,
+           OUT cost FLOAT, OUT agg_cost FLOAT)
+        */
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum((int)(result_tuples[call_cntr].start_id + 1));
+        values[2] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple =heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/ksp/src/withPoints_ksp_driver.cpp b/src/ksp/src/withPoints_ksp_driver.cpp
new file mode 100644
index 0000000..a01a0d2
--- /dev/null
+++ b/src/ksp/src/withPoints_ksp_driver.cpp
@@ -0,0 +1,173 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+//#ifdef unlink
+//#undef unlink
+//#endif
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./withPoints_ksp_driver.h"
+#include "./../../withPoints/src/pgr_withPoints.hpp"
+#include "./../../common/src/memory_func.hpp"
+#include "./pgr_ksp.hpp"
+
+
+
+// CREATE OR REPLACE FUNCTION pgr_withPointsKSP(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pid BIGINT,
+// end_pid BIGINT,
+// directed BOOLEAN DEFAULT true
+
+
+int
+do_pgr_withPointsKsp(
+        pgr_edge_t  *edges,           size_t total_edges,
+        Point_on_edge_t  *points_p,   size_t total_points,
+        pgr_edge_t  *edges_of_points, size_t total_edges_of_points,
+        int64_t start_vid,
+        int64_t end_vid,
+        int k,
+        bool directed,
+        bool heap_paths,
+        char driving_side,
+        bool details,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+        /*
+         * This is the original state
+         */
+        if (*err_msg) free(err_msg);
+        if (*return_tuples) free(return_tuples);
+        (*return_count) = 0;
+
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+
+        int errcode = check_points(points, log);
+        if (errcode) {
+            return errcode;
+        }
+
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges,
+                log);
+
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_edges;
+
+        std::deque< Path > paths;
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            Pgr_ksp< Pgr_base_graph< DirectedGraph > > fn_yen;
+            paths = fn_yen.Yen(digraph, start_vid, end_vid, k, heap_paths);
+        } else {
+            log << "Working with undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            Pgr_ksp< Pgr_base_graph< UndirectedGraph > > fn_yen;
+            paths = fn_yen.Yen(undigraph, start_vid, end_vid, k, heap_paths);
+        }
+
+#if 0
+        for (auto &path : paths) {
+            path.print_path(log);
+            adjust_pids(points, path);
+            path.print_path(log);
+        }
+#endif
+
+        if (!details) {
+            for (auto &path : paths) {
+                eliminate_details(path, edges_to_modify);
+            }
+        }
+
+        auto count(count_tuples(paths));
+
+        if (count == 0) {
+            return 0;
+        }
+
+
+        *return_tuples = NULL;
+        *return_tuples = get_memory(count, (*return_tuples));
+
+        size_t sequence = 0;
+        int route_id = 0;
+        for (const auto &path : paths) {
+            if (path.size() > 0)
+                path.get_pg_ksp_path(return_tuples, sequence, route_id);
+            ++route_id;
+        }
+
+        if (count != sequence) {
+            return 2;
+        }
+        (*return_count) = sequence;
+
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+    }
+    return 1000;
+}
diff --git a/src/ksp/src/withPoints_ksp_driver.h b/src/ksp/src/withPoints_ksp_driver.h
new file mode 100644
index 0000000..e304dae
--- /dev/null
+++ b/src/ksp/src/withPoints_ksp_driver.h
@@ -0,0 +1,62 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "./../../common/src/pgr_types.h"
+
+    //  CREATE OR REPLACE FUNCTION pgr_withPointKsp(
+    //  edges_sql TEXT,
+    //  points_sql TEXT,
+    //  start_pid BIGINT,
+    //  end_pid BIGINT,
+    //  directed BOOLEAN DEFAULT true,
+    int do_pgr_withPointsKsp(
+            pgr_edge_t  *edges,             size_t total_edges,
+            Point_on_edge_t  *points,       size_t total_points,
+            pgr_edge_t  *edges_of_points,   size_t total_edges_of_points,
+            int64_t start_pid,
+            int64_t end_pid,
+            int k,
+            bool directed,
+            bool heap_paths,
+            char driving_side,
+            bool details,
+
+            General_path_element_t **return_tuples,
+            size_t *return_count,
+            char ** err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/ksp/test/CMakeLists.txt b/src/ksp/test/CMakeLists.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/src/ksp/test/doc-ksp-v2.result b/src/ksp/test/doc-ksp-v2.result
new file mode 100644
index 0000000..d0dc1a4
--- /dev/null
+++ b/src/ksp/test/doc-ksp-v2.result
@@ -0,0 +1,29 @@
+--q1
+NOTICE:  Deprecated function
+0|0|7|6|1
+1|0|8|7|1
+2|0|5|8|1
+3|0|6|9|1
+4|0|9|15|1
+5|0|12|-1|0
+6|1|7|6|1
+7|1|8|7|1
+8|1|5|8|1
+9|1|6|11|1
+10|1|11|13|1
+11|1|12|-1|0
+--q2
+NOTICE:  Deprecated function
+0|0|7|6|1
+1|0|8|7|1
+2|0|5|8|1
+3|0|6|9|1
+4|0|9|15|1
+5|0|12|-1|0
+6|1|7|6|1
+7|1|8|7|1
+8|1|5|8|1
+9|1|6|11|1
+10|1|11|13|1
+11|1|12|-1|0
+--q3
diff --git a/src/ksp/test/doc-ksp-v2.test.sql b/src/ksp/test/doc-ksp-v2.test.sql
new file mode 100644
index 0000000..de709b2
--- /dev/null
+++ b/src/ksp/test/doc-ksp-v2.test.sql
@@ -0,0 +1,14 @@
+\echo --q1
+
+SELECT * FROM pgr_ksp(
+   'SELECT id, source, target, cost FROM edge_table order by id',
+   7, 12, 2, false
+ );
+
+\echo --q2
+SELECT * FROM pgr_ksp(
+   'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
+   7, 12, 2, true
+ );
+
+\echo --q3
diff --git a/src/ksp/test/doc-ksp.result b/src/ksp/test/doc-ksp.result
new file mode 100644
index 0000000..488f146
--- /dev/null
+++ b/src/ksp/test/doc-ksp.result
@@ -0,0 +1,174 @@
+--q1
+NOTICE:  Deprecated function
+0|0|2|4|1
+1|0|5|8|1
+2|0|6|9|1
+3|0|9|15|1
+4|0|12|-1|0
+5|1|2|4|1
+6|1|5|8|1
+7|1|6|11|1
+8|1|11|13|1
+9|1|12|-1|0
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+--q2
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+11|3|1|2|4|1|0
+12|3|2|5|10|1|1
+13|3|3|10|12|1|2
+14|3|4|11|13|1|3
+15|3|5|12|-1|0|4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+11|3|1|2|4|1|0
+12|3|2|5|10|1|1
+13|3|3|10|12|1|2
+14|3|4|11|13|1|3
+15|3|5|12|-1|0|4
+--q3
+1|1|1|2|2|1|0
+2|1|2|3|3|1|1
+3|1|3|4|16|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+1|1|1|2|2|1|0
+2|1|2|3|3|1|1
+3|1|3|4|16|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+11|3|1|2|4|1|0
+12|3|2|5|10|1|1
+13|3|3|10|12|1|2
+14|3|4|11|13|1|3
+15|3|5|12|-1|0|4
+16|4|1|2|4|1|0
+17|4|2|5|10|1|1
+18|4|3|10|12|1|2
+19|4|4|11|11|1|3
+20|4|5|6|9|1|4
+21|4|6|9|15|1|5
+22|4|7|12|-1|0|6
+--q4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+11|3|1|2|4|1|0
+12|3|2|5|10|1|1
+13|3|3|10|12|1|2
+14|3|4|11|13|1|3
+15|3|5|12|-1|0|4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+11|3|1|2|4|1|0
+12|3|2|5|10|1|1
+13|3|3|10|12|1|2
+14|3|4|11|13|1|3
+15|3|5|12|-1|0|4
+--q5
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+1|1|1|2|4|1|0
+2|1|2|5|8|1|1
+3|1|3|6|9|1|2
+4|1|4|9|15|1|3
+5|1|5|12|-1|0|4
+6|2|1|2|4|1|0
+7|2|2|5|8|1|1
+8|2|3|6|11|1|2
+9|2|4|11|13|1|3
+10|2|5|12|-1|0|4
+11|3|1|2|4|1|0
+12|3|2|5|10|1|1
+13|3|3|10|12|1|2
+14|3|4|11|13|1|3
+15|3|5|12|-1|0|4
+--q6
diff --git a/src/ksp/test/doc-ksp.test.sql b/src/ksp/test/doc-ksp.test.sql
new file mode 100644
index 0000000..3d467ce
--- /dev/null
+++ b/src/ksp/test/doc-ksp.test.sql
@@ -0,0 +1,94 @@
+--------------------------------------------------------------------------------
+--              PGR_ksp V3
+--------------------------------------------------------------------------------
+
+\echo --q1
+
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, 
+      true   -- takes the (V2.0) signature (has_rcost = true and works on directed graph)
+   );
+
+
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2,
+      directed:=true   -- takes the new signature
+   );
+
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2
+   );
+
+\echo --q2
+
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2
+   );
+  
+
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, heap_paths:=true
+   );
+
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, true, true
+   );
+
+
+\echo --q3
+
+  SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, directed:=false
+   );
+
+  SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 2, false, true
+   );
+
+
+\echo --q4
+
+  SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 3, 2
+   );
+
+
+  SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2
+   );
+
+  SELECT   * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, heap_paths:=true
+   );
+
+  SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, true, true
+   );
+
+
+\echo --q5
+
+  SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, directed:=false
+   );
+  
+  SELECT  * FROM pgr_ksp(
+     'SELECT id, source, target, cost FROM edge_table',
+      2, 12, 2, directed:=false, heap_paths:=true
+   );
+
+
+\echo --q6
diff --git a/src/ksp/test/ksp-any-00.data b/src/ksp/test/ksp-any-00.data
deleted file mode 100644
index 6794c89..0000000
--- a/src/ksp/test/ksp-any-00.data
+++ /dev/null
@@ -1,160 +0,0 @@
---  
--- Create a test data base
---
-
-drop table IF exists nodes ;
-create table nodes (
-	id serial NOT NULL,
-	vertex integer NOT NULL,
-	name text  not NULL
-);
--- Add a geom column
-select addgeometrycolumn('','nodes','the_geom',3857,'POINT',2);
-
-drop table IF exists network ;
-create table network (
-	id serial NOT NULL,
-	source integer NOT NULL,
-	target integer NOT NULL,
-	cost double precision,
-	reverse_cost double precision 
-);
--- Add a geom column
-select addgeometrycolumn('','network','the_geom',3857,'MULTILINESTRING',2);
--- Make the vertexs, location is not important in this example
-insert into nodes (vertex,the_geom,name) values (0,st_SetSRID(st_makepoint(0,0),3857),'Zero');
-insert into nodes (vertex,the_geom,name) values (1,st_SetSRID(st_makepoint(1,1),3857),'One');
-insert into nodes (vertex,the_geom,name) values (2,st_SetSRID(st_makepoint(2,2),3857),'Two');
-insert into nodes (vertex,the_geom,name) values (3,st_SetSRID(st_makepoint(3,3),3857),'Three');
-insert into nodes (vertex,the_geom,name) values (4,st_SetSRID(st_makepoint(4,4),3857),'Four');
-insert into nodes (vertex,the_geom,name) values (5,st_SetSRID(st_makepoint(4,6),3857),'Five');
-insert into nodes (vertex,the_geom,name) values (6,st_SetSRID(st_makepoint(6,5),3857),'Six');
-insert into nodes (vertex,the_geom,name) values (7,st_SetSRID(st_makepoint(7,2),3857),'Seven');
-insert into nodes (vertex,the_geom,name) values (8,st_SetSRID(st_makepoint(4,8),3857),'Eight');
-insert into nodes (vertex,the_geom,name) values (9,st_SetSRID(st_makepoint(2,8),3857),'Nine');
-insert into nodes (vertex,the_geom,name) values (10,st_SetSRID(st_makepoint(10,10),3857),'Ten');
-insert into nodes (vertex,the_geom,name) values (11,st_SetSRID(st_makepoint(1,10),3857),'Eleven');
-insert into nodes (vertex,the_geom,name) values (12,st_SetSRID(st_makepoint(4,12),3857),'Twelve');
-insert into nodes (vertex,the_geom,name) values (13,st_SetSRID(st_makepoint(2,12),3857),'Thirteen');
-
-insert into network(source,target) values(0,1);
-insert into network(source,target) values(0,2);
-insert into network(source,target) values(0,3);
-insert into network(source,target) values(1,0);
-insert into network(source,target) values(1,2);
-insert into network(source,target) values(1,7);
-insert into network(source,target) values(2,0);
-insert into network(source,target) values(2,1);
-insert into network(source,target) values(2,5);
-insert into network(source,target) values(3,0);
-insert into network(source,target) values(3,4);
-insert into network(source,target) values(3,10);
-insert into network(source,target) values(4,3);
-insert into network(source,target) values(4,6);
-insert into network(source,target) values(4,5);
-insert into network(source,target) values(5,2);
-insert into network(source,target) values(5,4);
-insert into network(source,target) values(5,9);
-insert into network(source,target) values(5,13);
-insert into network(source,target) values(6,4);
-insert into network(source,target) values(6,7);
-insert into network(source,target) values(7,6);
-insert into network(source,target) values(7,8);
-insert into network(source,target) values(7,1);
-insert into network(source,target) values(8,7);
-insert into network(source,target) values(8,11);
-insert into network(source,target) values(8,12);
-insert into network(source,target) values(9,5);
-insert into network(source,target) values(10,3);
-insert into network(source,target) values(10,11);
-insert into network(source,target) values(10,12);
-insert into network(source,target) values(11,8);
-insert into network(source,target) values(11,10);
-insert into network(source,target) values(11,13);
-insert into network(source,target) values(12,10);
-insert into network(source,target) values(12,8);
-insert into network(source,target) values(12,13);
-insert into network(source,target) values(13,12);
-insert into network(source,target) values(13,5);
-insert into network(source,target) values(13,11);
--- Create geoms for the network table 
-update  network set the_geom = st_setsrid(st_geomfromtext('MULTILINESTRING(('|| st_x(s.the_geom) ||' '|| st_y(s.the_geom)|| ','|| st_x(t.the_geom) || ' ' || st_y(t.the_geom) ||'))'),3857) from nodes s, nodes t where network.source=s.vertex and network.target=t.vertex;
-
-update  network set cost = st_length(the_geom);
-update  network set reverse_cost = st_length(the_geom)*5;
-
-
-
-
-
---  DATA FROM SAMPLE DATA
-
-
-DROP TABLE IF EXISTS edge_table;
-CREATE TABLE edge_table (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
-INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
-
-
-UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-                      dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
-                                 WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
-                                 WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
-                                 ELSE '' END;                                -- unknown
-
-SELECT pgr_createTopology('edge_table',0.001);
-
-
---   SAMPLE DATA FROM THE ISSUE 285
-
-drop table if exists parallel;
-CREATE TABLE parallel (
-    id serial,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO parallel (x1,y1,x2,y2) 
-    VALUES (1,0,1,1),(1,1,1,3),(1,1,1,3),(1,1,1,3),(1,3,1,4);
-
-UPDATE parallel SET the_geom = ST_makeline(ST_point(x1,y1),ST_point(x2,y2));
-UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(0,2),ST_point(1,3)]) WHERE id = 3;
-UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(2,1),ST_point(2,3),ST_point(1,3)]) WHERE id = 4;
-UPDATE parallel SET cost = ST_length(the_geom), reverse_cost = ST_length(the_geom);
-SELECT pgr_createTopology('parallel',0.001);
diff --git a/src/ksp/test/ksp-any-01.result b/src/ksp/test/ksp-any-01.result
deleted file mode 100644
index 8b9ba4e..0000000
--- a/src/ksp/test/ksp-any-01.result
+++ /dev/null
@@ -1,214 +0,0 @@
-0|0|4|15|2.0000
-1|0|5|-1|0.0000
-2|1|4|13|1.4142
-3|1|3|10|4.2426
-4|1|0|1|1.4142
-5|1|1|5|1.4142
-6|1|2|9|4.4721
-7|1|5|-1|0.0000
-8|2|4|13|1.4142
-9|2|3|10|4.2426
-10|2|0|2|2.8284
-11|2|2|9|4.4721
-12|2|5|-1|0.0000
-13|3|4|14|2.2361
-14|3|6|21|3.1623
-15|3|7|24|6.0828
-16|3|1|5|1.4142
-17|3|2|9|4.4721
-18|3|5|-1|0.0000
-19|4|4|14|2.2361
-20|4|6|21|3.1623
-21|4|7|24|6.0828
-22|4|1|4|1.4142
-23|4|0|2|2.8284
-24|4|2|9|4.4721
-25|4|5|-1|0.0000
-26|5|4|14|2.2361
-27|5|6|21|3.1623
-28|5|7|23|6.7082
-29|5|8|26|3.6056
-30|5|11|34|2.2361
-31|5|13|39|6.3246
-32|5|5|-1|0.0000
-33|6|4|14|2.2361
-34|6|6|21|3.1623
-35|6|7|23|6.7082
-36|6|8|27|4.0000
-37|6|12|37|2.0000
-38|6|13|39|6.3246
-39|6|5|-1|0.0000
-40|7|4|13|1.4142
-41|7|3|12|9.8995
-42|7|10|31|6.3246
-43|7|12|37|2.0000
-44|7|13|39|6.3246
-45|7|5|-1|0.0000
-46|8|4|13|1.4142
-47|8|3|12|9.8995
-48|8|10|30|9.0000
-49|8|11|34|2.2361
-50|8|13|39|6.3246
-51|8|5|-1|0.0000
-52|9|4|13|1.4142
-53|9|3|10|4.2426
-54|9|0|1|1.4142
-55|9|1|6|6.0828
-56|9|7|23|6.7082
-57|9|8|26|3.6056
-58|9|11|34|2.2361
-59|9|13|39|6.3246
-60|9|5|-1|0.0000
-61|10|4|13|1.4142
-62|10|3|10|4.2426
-63|10|0|1|1.4142
-64|10|1|6|6.0828
-65|10|7|23|6.7082
-66|10|8|27|4.0000
-67|10|12|37|2.0000
-68|10|13|39|6.3246
-69|10|5|-1|0.0000
-70|11|4|13|1.4142
-71|11|3|12|9.8995
-72|11|10|31|6.3246
-73|11|12|36|4.0000
-74|11|8|26|3.6056
-75|11|11|34|2.2361
-76|11|13|39|6.3246
-77|11|5|-1|0.0000
-78|12|4|13|1.4142
-79|12|3|10|4.2426
-80|12|0|2|2.8284
-81|12|2|8|1.4142
-82|12|1|6|6.0828
-83|12|7|23|6.7082
-84|12|8|26|3.6056
-85|12|11|34|2.2361
-86|12|13|39|6.3246
-87|12|5|-1|0.0000
-88|13|4|13|1.4142
-89|13|3|10|4.2426
-90|13|0|2|2.8284
-91|13|2|8|1.4142
-92|13|1|6|6.0828
-93|13|7|23|6.7082
-94|13|8|27|4.0000
-95|13|12|37|2.0000
-96|13|13|39|6.3246
-97|13|5|-1|0.0000
-98|14|4|14|2.2361
-99|14|6|21|3.1623
-100|14|7|23|6.7082
-101|14|8|26|3.6056
-102|14|11|33|9.0000
-103|14|10|31|6.3246
-104|14|12|37|2.0000
-105|14|13|39|6.3246
-106|14|5|-1|0.0000
-0|2.0000
-1|12.9574
-2|12.9574
-3|17.3675
-4|20.1959
-5|24.2727
-6|24.4311
-7|25.9628
-8|28.8743
-9|32.0282
-10|32.1866
-11|33.8044
-12|34.8566
-13|35.0150
-14|39.3612
-0|0|t|t|t
-2|1|t|t|t
-3|1|t|t|t
-4|1|t|t|t
-5|1|t|t|t
-6|1|t|t|t
-8|2|t|t|t
-9|2|t|t|t
-10|2|t|t|t
-11|2|t|t|t
-13|3|t|t|t
-14|3|t|t|t
-15|3|t|t|t
-16|3|t|t|t
-17|3|t|t|t
-19|4|t|t|t
-20|4|t|t|t
-21|4|t|t|t
-22|4|t|t|t
-23|4|t|t|t
-24|4|t|t|t
-26|5|t|t|t
-27|5|t|t|t
-28|5|t|t|t
-29|5|t|t|t
-30|5|t|t|t
-31|5|t|t|t
-33|6|t|t|t
-34|6|t|t|t
-35|6|t|t|t
-36|6|t|t|t
-37|6|t|t|t
-38|6|t|t|t
-40|7|t|t|t
-41|7|t|t|t
-42|7|t|t|t
-43|7|t|t|t
-44|7|t|t|t
-46|8|t|t|t
-47|8|t|t|t
-48|8|t|t|t
-49|8|t|t|t
-50|8|t|t|t
-52|9|t|t|t
-53|9|t|t|t
-54|9|t|t|t
-55|9|t|t|t
-56|9|t|t|t
-57|9|t|t|t
-58|9|t|t|t
-59|9|t|t|t
-61|10|t|t|t
-62|10|t|t|t
-63|10|t|t|t
-64|10|t|t|t
-65|10|t|t|t
-66|10|t|t|t
-67|10|t|t|t
-68|10|t|t|t
-70|11|t|t|t
-71|11|t|t|t
-72|11|t|t|t
-73|11|t|t|t
-74|11|t|t|t
-75|11|t|t|t
-76|11|t|t|t
-78|12|t|t|t
-79|12|t|t|t
-80|12|t|t|t
-81|12|t|t|t
-82|12|t|t|t
-83|12|t|t|t
-84|12|t|t|t
-85|12|t|t|t
-86|12|t|t|t
-88|13|t|t|t
-89|13|t|t|t
-90|13|t|t|t
-91|13|t|t|t
-92|13|t|t|t
-93|13|t|t|t
-94|13|t|t|t
-95|13|t|t|t
-96|13|t|t|t
-98|14|t|t|t
-99|14|t|t|t
-100|14|t|t|t
-101|14|t|t|t
-102|14|t|t|t
-103|14|t|t|t
-104|14|t|t|t
-105|14|t|t|t
diff --git a/src/ksp/test/ksp-any-01.test.sql b/src/ksp/test/ksp-any-01.test.sql
deleted file mode 100644
index 9232109..0000000
--- a/src/ksp/test/ksp-any-01.test.sql
+++ /dev/null
@@ -1,20 +0,0 @@
---
--- Generate 15 shortest paths between nodes 4 and 5
---
---
-select seq, id1, id2, id3, round(cost::numeric, 4) from pgr_ksp(
-    'select id, source, target, cost from network order by id',
-    4, 5,
-    15, 'f');
-
-select id1, round(sum(cost)::numeric,4) from pgr_ksp(
-    'select id, source, target, cost from network order by id',
-    4, 5,
-    15, 'f') group by id1 order by id1;
-
-
--- the equality conditions
-select seq, id1, id2 = network.source,  id3 = network.id, round(network.cost::numeric,4) = round(result.cost::numeric, 4) from pgr_ksp(
-    'select id, source, target, cost from network order by id',
-    4, 5,
-    15, 'f') result, network where id = id3 order by seq;
diff --git a/src/ksp/test/ksp-any-02.result b/src/ksp/test/ksp-any-02.result
deleted file mode 100644
index bb927a1..0000000
--- a/src/ksp/test/ksp-any-02.result
+++ /dev/null
@@ -1,214 +0,0 @@
-1|1|4|15|2.0000
-2|1|5|-1|0.0000
-3|2|4|13|1.4142
-4|2|3|10|4.2426
-5|2|0|1|1.4142
-6|2|1|5|1.4142
-7|2|2|9|4.4721
-8|2|5|-1|0.0000
-9|3|4|13|1.4142
-10|3|3|10|4.2426
-11|3|0|2|2.8284
-12|3|2|9|4.4721
-13|3|5|-1|0.0000
-14|4|4|14|2.2361
-15|4|6|21|3.1623
-16|4|7|24|6.0828
-17|4|1|5|1.4142
-18|4|2|9|4.4721
-19|4|5|-1|0.0000
-20|5|4|14|2.2361
-21|5|6|21|3.1623
-22|5|7|24|6.0828
-23|5|1|4|1.4142
-24|5|0|2|2.8284
-25|5|2|9|4.4721
-26|5|5|-1|0.0000
-27|6|4|14|2.2361
-28|6|6|21|3.1623
-29|6|7|23|6.7082
-30|6|8|26|3.6056
-31|6|11|34|2.2361
-32|6|13|39|6.3246
-33|6|5|-1|0.0000
-34|7|4|14|2.2361
-35|7|6|21|3.1623
-36|7|7|23|6.7082
-37|7|8|27|4.0000
-38|7|12|37|2.0000
-39|7|13|39|6.3246
-40|7|5|-1|0.0000
-41|8|4|13|1.4142
-42|8|3|12|9.8995
-43|8|10|31|6.3246
-44|8|12|37|2.0000
-45|8|13|39|6.3246
-46|8|5|-1|0.0000
-47|9|4|13|1.4142
-48|9|3|12|9.8995
-49|9|10|30|9.0000
-50|9|11|34|2.2361
-51|9|13|39|6.3246
-52|9|5|-1|0.0000
-53|10|4|13|1.4142
-54|10|3|10|4.2426
-55|10|0|1|1.4142
-56|10|1|6|6.0828
-57|10|7|23|6.7082
-58|10|8|26|3.6056
-59|10|11|34|2.2361
-60|10|13|39|6.3246
-61|10|5|-1|0.0000
-62|11|4|13|1.4142
-63|11|3|10|4.2426
-64|11|0|1|1.4142
-65|11|1|6|6.0828
-66|11|7|23|6.7082
-67|11|8|27|4.0000
-68|11|12|37|2.0000
-69|11|13|39|6.3246
-70|11|5|-1|0.0000
-71|12|4|13|1.4142
-72|12|3|12|9.8995
-73|12|10|31|6.3246
-74|12|12|36|4.0000
-75|12|8|26|3.6056
-76|12|11|34|2.2361
-77|12|13|39|6.3246
-78|12|5|-1|0.0000
-79|13|4|13|1.4142
-80|13|3|10|4.2426
-81|13|0|2|2.8284
-82|13|2|8|1.4142
-83|13|1|6|6.0828
-84|13|7|23|6.7082
-85|13|8|26|3.6056
-86|13|11|34|2.2361
-87|13|13|39|6.3246
-88|13|5|-1|0.0000
-89|14|4|13|1.4142
-90|14|3|10|4.2426
-91|14|0|2|2.8284
-92|14|2|8|1.4142
-93|14|1|6|6.0828
-94|14|7|23|6.7082
-95|14|8|27|4.0000
-96|14|12|37|2.0000
-97|14|13|39|6.3246
-98|14|5|-1|0.0000
-99|15|4|14|2.2361
-100|15|6|21|3.1623
-101|15|7|23|6.7082
-102|15|8|26|3.6056
-103|15|11|33|9.0000
-104|15|10|31|6.3246
-105|15|12|37|2.0000
-106|15|13|39|6.3246
-107|15|5|-1|0.0000
-1|2.0000
-2|12.9574
-3|12.9574
-4|17.3675
-5|20.1959
-6|24.2727
-7|24.4311
-8|25.9628
-9|28.8743
-10|32.0282
-11|32.1866
-12|33.8044
-13|34.8566
-14|35.0150
-15|39.3612
-1|1|t|t|t
-3|2|t|t|t
-4|2|t|t|t
-5|2|t|t|t
-6|2|t|t|t
-7|2|t|t|t
-9|3|t|t|t
-10|3|t|t|t
-11|3|t|t|t
-12|3|t|t|t
-14|4|t|t|t
-15|4|t|t|t
-16|4|t|t|t
-17|4|t|t|t
-18|4|t|t|t
-20|5|t|t|t
-21|5|t|t|t
-22|5|t|t|t
-23|5|t|t|t
-24|5|t|t|t
-25|5|t|t|t
-27|6|t|t|t
-28|6|t|t|t
-29|6|t|t|t
-30|6|t|t|t
-31|6|t|t|t
-32|6|t|t|t
-34|7|t|t|t
-35|7|t|t|t
-36|7|t|t|t
-37|7|t|t|t
-38|7|t|t|t
-39|7|t|t|t
-41|8|t|t|t
-42|8|t|t|t
-43|8|t|t|t
-44|8|t|t|t
-45|8|t|t|t
-47|9|t|t|t
-48|9|t|t|t
-49|9|t|t|t
-50|9|t|t|t
-51|9|t|t|t
-53|10|t|t|t
-54|10|t|t|t
-55|10|t|t|t
-56|10|t|t|t
-57|10|t|t|t
-58|10|t|t|t
-59|10|t|t|t
-60|10|t|t|t
-62|11|t|t|t
-63|11|t|t|t
-64|11|t|t|t
-65|11|t|t|t
-66|11|t|t|t
-67|11|t|t|t
-68|11|t|t|t
-69|11|t|t|t
-71|12|t|t|t
-72|12|t|t|t
-73|12|t|t|t
-74|12|t|t|t
-75|12|t|t|t
-76|12|t|t|t
-77|12|t|t|t
-79|13|t|t|t
-80|13|t|t|t
-81|13|t|t|t
-82|13|t|t|t
-83|13|t|t|t
-84|13|t|t|t
-85|13|t|t|t
-86|13|t|t|t
-87|13|t|t|t
-89|14|t|t|t
-90|14|t|t|t
-91|14|t|t|t
-92|14|t|t|t
-93|14|t|t|t
-94|14|t|t|t
-95|14|t|t|t
-96|14|t|t|t
-97|14|t|t|t
-99|15|t|t|t
-100|15|t|t|t
-101|15|t|t|t
-102|15|t|t|t
-103|15|t|t|t
-104|15|t|t|t
-105|15|t|t|t
-106|15|t|t|t
diff --git a/src/ksp/test/ksp-any-02.test.sql b/src/ksp/test/ksp-any-02.test.sql
deleted file mode 100644
index 2c05b94..0000000
--- a/src/ksp/test/ksp-any-02.test.sql
+++ /dev/null
@@ -1,22 +0,0 @@
---
--- Generate 15 shortest paths between nodes 4 and 5
--- with auto detection
--- V3
---
-
-select seq, path_id, node, edge, round(cost::numeric, 4) from pgr_ksp(
-    'select id, source, target, cost from network order by id',
-    4, 5::bigint,
-    15);
-
-select path_id, round(sum(cost)::numeric,4) from pgr_ksp(
-    'select id, source, target, cost from network order by id',
-    4, 5::bigint,
-    15) group by path_id order by path_id;
-
-
--- the equality conditions
-select seq, path_id, node = network.source,  edge = network.id, round(network.cost::numeric,4) = round(result.cost::numeric, 4) from pgr_ksp(
-    'select id, source, target, cost from network order by id',
-    4, 5::bigint,
-    15) result, network where id = edge order by seq;
diff --git a/src/ksp/test/ksp-network.result b/src/ksp/test/ksp-network.result
new file mode 100644
index 0000000..d5b5a80
--- /dev/null
+++ b/src/ksp/test/ksp-network.result
@@ -0,0 +1,184 @@
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
+t|t|t
diff --git a/src/ksp/test/ksp-network.test.sql b/src/ksp/test/ksp-network.test.sql
new file mode 100644
index 0000000..eadf435
--- /dev/null
+++ b/src/ksp/test/ksp-network.test.sql
@@ -0,0 +1,142 @@
+BEGIN;
+--
+-- Generate 15 shortest paths between nodes 4 and 5
+-- with auto detection
+-- V3
+--
+--  
+-- Create a test data base
+--
+
+DO $$
+DECLARE debuglevel TEXT;
+BEGIN
+EXECUTE 'show client_min_messages' into debuglevel;
+
+SET client_min_messages = WARNING;
+CREATE table nodes (
+        id serial NOT NULL,
+        vertex INTEGER NOT NULL,
+        name text  not NULL
+);
+-- Add a geom column
+PERFORM addgeometrycolumn('','nodes','the_geom',3857,'POINT',2);
+
+CREATE table network (
+        id serial NOT NULL,
+        source INTEGER NOT NULL,
+        target INTEGER NOT NULL,
+        cost double precision,
+        reverse_cost double precision 
+);
+-- Add a geom column
+PERFORM addgeometrycolumn('','network','the_geom',3857,'MULTILINESTRING',2);
+-- Make the vertexs, location is not important in this example
+INSERT INTO nodes (vertex,the_geom,name) values (0,st_SetSRID(st_makepoint(0,0),3857),'Zero');
+INSERT INTO nodes (vertex,the_geom,name) values (1,st_SetSRID(st_makepoint(1,1),3857),'One');
+INSERT INTO nodes (vertex,the_geom,name) values (2,st_SetSRID(st_makepoint(2,2),3857),'Two');
+INSERT INTO nodes (vertex,the_geom,name) values (3,st_SetSRID(st_makepoint(3,3),3857),'Three');
+INSERT INTO nodes (vertex,the_geom,name) values (4,st_SetSRID(st_makepoint(4,4),3857),'Four');
+INSERT INTO nodes (vertex,the_geom,name) values (5,st_SetSRID(st_makepoint(4,6),3857),'Five');
+INSERT INTO nodes (vertex,the_geom,name) values (6,st_SetSRID(st_makepoint(6,5),3857),'Six');
+INSERT INTO nodes (vertex,the_geom,name) values (7,st_SetSRID(st_makepoint(7,2),3857),'Seven');
+INSERT INTO nodes (vertex,the_geom,name) values (8,st_SetSRID(st_makepoint(4,8),3857),'Eight');
+INSERT INTO nodes (vertex,the_geom,name) values (9,st_SetSRID(st_makepoint(2,8),3857),'Nine');
+INSERT INTO nodes (vertex,the_geom,name) values (10,st_SetSRID(st_makepoint(10,10),3857),'Ten');
+INSERT INTO nodes (vertex,the_geom,name) values (11,st_SetSRID(st_makepoint(1,10),3857),'Eleven');
+INSERT INTO nodes (vertex,the_geom,name) values (12,st_SetSRID(st_makepoint(4,12),3857),'Twelve');
+INSERT INTO nodes (vertex,the_geom,name) values (13,st_SetSRID(st_makepoint(2,12),3857),'Thirteen');
+
+INSERT INTO network(source,target) values(0,1);
+INSERT INTO network(source,target) values(0,2);
+INSERT INTO network(source,target) values(0,3);
+INSERT INTO network(source,target) values(1,0);
+INSERT INTO network(source,target) values(1,2);
+INSERT INTO network(source,target) values(1,7);
+INSERT INTO network(source,target) values(2,0);
+INSERT INTO network(source,target) values(2,1);
+INSERT INTO network(source,target) values(2,5);
+INSERT INTO network(source,target) values(3,0);
+INSERT INTO network(source,target) values(3,4);
+INSERT INTO network(source,target) values(3,10);
+INSERT INTO network(source,target) values(4,3);
+INSERT INTO network(source,target) values(4,6);
+INSERT INTO network(source,target) values(4,5);
+INSERT INTO network(source,target) values(5,2);
+INSERT INTO network(source,target) values(5,4);
+INSERT INTO network(source,target) values(5,9);
+INSERT INTO network(source,target) values(5,13);
+INSERT INTO network(source,target) values(6,4);
+INSERT INTO network(source,target) values(6,7);
+INSERT INTO network(source,target) values(7,6);
+INSERT INTO network(source,target) values(7,8);
+INSERT INTO network(source,target) values(7,1);
+INSERT INTO network(source,target) values(8,7);
+INSERT INTO network(source,target) values(8,11);
+INSERT INTO network(source,target) values(8,12);
+INSERT INTO network(source,target) values(9,5);
+INSERT INTO network(source,target) values(10,3);
+INSERT INTO network(source,target) values(10,11);
+INSERT INTO network(source,target) values(10,12);
+INSERT INTO network(source,target) values(11,8);
+INSERT INTO network(source,target) values(11,10);
+INSERT INTO network(source,target) values(11,13);
+INSERT INTO network(source,target) values(12,10);
+INSERT INTO network(source,target) values(12,8);
+INSERT INTO network(source,target) values(12,13);
+INSERT INTO network(source,target) values(13,12);
+INSERT INTO network(source,target) values(13,5);
+INSERT INTO network(source,target) values(13,11);
+-- Create geoms for the network table 
+update  network set 
+    the_geom = st_setsrid(st_geomfromtext('MULTILINESTRING(('|| st_x(s.the_geom) ||' '|| st_y(s.the_geom)|| ','|| st_x(t.the_geom) || ' ' || st_y(t.the_geom) ||'))'),3857)
+    from nodes s, nodes t where network.source=s.vertex and network.target=t.vertex;
+
+update  network set cost = st_length(the_geom);
+update  network set reverse_cost = st_length(the_geom)*5;
+
+
+EXECUTE 'set client_min_messages  to '|| debuglevel;
+END $$;
+
+
+-- TESTS START
+/*
+SELECT seq, path_id, node, edge, round(cost::numeric, 4) from pgr_ksp(
+    'SELECT id, source, target, cost from network order by id',
+    4, 5::BIGINT,
+    15);
+
+SELECT path_id, round(sum(cost)::numeric,4) from pgr_ksp(
+    'SELECT id, source, target, cost from network order by id',
+    4, 5::BIGINT,
+    15) group by path_id order by path_id;
+*/
+
+-- the equality conditions
+SELECT node = network.source,  edge = network.id, round(network.cost::numeric,4) = round(result.cost::numeric, 4) from pgr_ksp(
+    'SELECT id, source, target, cost from network order by id',
+    4, 5::BIGINT,
+    15) result, network where id = edge order by seq;
+
+
+--VERSION 2.0
+/*
+SELECT seq, path_id, node, edge, round(cost::numeric, 4), round(agg_cost::numeric,4) from pgr_ksp(
+    'SELECT id, source, target, cost from network order by id',
+    4, 5,
+    15);
+
+SELECT path_id, round(agg_cost::numeric,4) from pgr_ksp(
+    'SELECT id, source, target, cost from network order by id',
+    4, 5,
+    15) WHERE edge = -1;
+*/
+
+-- the equality conditions
+SELECT node = network.source,  edge = network.id, round(network.cost::numeric,4) = round(result.cost::numeric, 4) from pgr_ksp(
+    'SELECT id, source, target, cost from network order by id',
+    4, 5,
+    15) AS result, network WHERE id = edge ORDER BY seq;
+
+ROLLBACK;
diff --git a/src/ksp/test/ksp-parallel-any-03.result b/src/ksp/test/ksp-parallel-any-03.result
deleted file mode 100644
index 0a48d12..0000000
--- a/src/ksp/test/ksp-parallel-any-03.result
+++ /dev/null
@@ -1,26 +0,0 @@
-0|0|2|2|2
-1|0|3|-1|0
-0|0|2|2|2
-1|0|3|-1|0
-0|0|2|2|2
-1|0|3|-1|0
-0|0|2|2|2
-1|0|3|-1|0
-0|0|2|2|2
-1|0|3|-1|0
-0|0|1|1|1
-1|0|2|2|2
-2|0|3|5|1
-3|0|4|-1|0
-0|0|1|1|1
-1|0|2|2|2
-2|0|3|5|1
-3|0|4|-1|0
-0|0|1|1|1
-1|0|2|2|2
-2|0|3|5|1
-3|0|4|-1|0
-0|0|1|1|1
-1|0|2|2|2
-2|0|3|5|1
-3|0|4|-1|0
diff --git a/src/ksp/test/ksp-parallel-any-03.test.sql b/src/ksp/test/ksp-parallel-any-03.test.sql
deleted file mode 100644
index fa5b048..0000000
--- a/src/ksp/test/ksp-parallel-any-03.test.sql
+++ /dev/null
@@ -1,59 +0,0 @@
----
---   TESTS FROM ISSUE 285
----
-
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost 
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        2, 3, 1, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        2, 3, 2, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        2, 3, 3, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        2, 3, 4, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        2, 3, 100, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        1, 4, 1, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        1, 4, 2, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        1, 4, 3, true
-);
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
-    FROM pgr_ksp(
-        'SELECT id, source, target, cost, reverse_cost FROM parallel',
-        1, 4, 100, true
-);
-
diff --git a/src/ksp/test/ksp-v2.result b/src/ksp/test/ksp-v2.result
deleted file mode 100644
index 897e502..0000000
--- a/src/ksp/test/ksp-v2.result
+++ /dev/null
@@ -1,24 +0,0 @@
-0|0|7|6|1
-1|0|8|7|1
-2|0|5|8|1
-3|0|6|9|1
-4|0|9|15|1
-5|0|12|-1|0
-6|1|7|6|1
-7|1|8|7|1
-8|1|5|8|1
-9|1|6|11|1
-10|1|11|13|1
-11|1|12|-1|0
-0|0|7|6|1
-1|0|8|7|1
-2|0|5|8|1
-3|0|6|9|1
-4|0|9|15|1
-5|0|12|-1|0
-6|1|7|6|1
-7|1|8|7|1
-8|1|5|8|1
-9|1|6|11|1
-10|1|11|13|1
-11|1|12|-1|0
diff --git a/src/ksp/test/ksp-v2.test.sql b/src/ksp/test/ksp-v2.test.sql
deleted file mode 100644
index 02432a3..0000000
--- a/src/ksp/test/ksp-v2.test.sql
+++ /dev/null
@@ -1,15 +0,0 @@
---------------------------------------------------------------------------------
---              PGR_ksp
---------------------------------------------------------------------------------
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
- FROM pgr_ksp(
-   'SELECT id, source, target, cost FROM edge_table order by id',
-   7, 12, 2, false
- );
-
-SELECT seq, id1 AS route, id2 AS node, id3 AS edge, cost
- FROM pgr_ksp(
-   'SELECT id, source, target, cost, reverse_cost FROM edge_table order by id',
-   7, 12, 2, true
- );
-
diff --git a/src/ksp/test/ksp-v3-1route.result b/src/ksp/test/ksp-v3-1route.result
deleted file mode 100644
index d701ff7..0000000
--- a/src/ksp/test/ksp-v3-1route.result
+++ /dev/null
@@ -1,93 +0,0 @@
-1|1|2|1|1
-2|2|3|-1|1
-3|3|4|-1|1
-4|2|5|1|1
-5|3|6|1|-1
-6|7|8|1|1
-7|8|5|1|1
-8|5|6|1|1
-9|6|9|1|1
-10|5|10|1|1
-11|6|11|1|-1
-12|10|11|1|-1
-13|11|12|1|-1
-14|10|13|1|1
-15|9|12|1|1
-16|4|9|1|1
-17|14|15|1|1
-18|16|17|1|1
-1|0|0|2|4|1
-1|1|0|5|8|1
-1|2|0|6|9|1
-1|3|0|9|15|1
-1|4|0|12|-1|0
-2|1|1|1|2|4|1|0
-2|2|1|2|5|8|1|1
-2|3|1|3|6|9|1|2
-2|4|1|4|9|15|1|3
-2|5|1|5|12|-1|0|4
-3|1|1|1|2|4|1|0
-3|2|1|2|5|8|1|1
-3|3|1|3|6|9|1|2
-3|4|1|4|9|15|1|3
-3|5|1|5|12|-1|0|4
-4|1|1|1|2|4|1|0
-4|2|1|2|5|8|1|1
-4|3|1|3|6|9|1|2
-4|4|1|4|9|15|1|3
-4|5|1|5|12|-1|0|4
-5|1|1|1|2|4|1|0
-5|2|1|2|5|8|1|1
-5|3|1|3|6|9|1|2
-5|4|1|4|9|15|1|3
-5|5|1|5|12|-1|0|4
-6|1|1|1|2|4|1|0
-6|2|1|2|5|8|1|1
-6|3|1|3|6|9|1|2
-6|4|1|4|9|15|1|3
-6|5|1|5|12|-1|0|4
-7|1|1|1|2|4|1|0
-7|2|1|2|5|10|1|1
-7|3|1|3|10|12|1|2
-7|4|1|4|11|13|1|3
-7|5|1|5|12|-1|0|4
-8|1|1|1|2|4|1|0
-8|2|1|2|5|10|1|1
-8|3|1|3|10|12|1|2
-8|4|1|4|11|13|1|3
-8|5|1|5|12|-1|0|4
-9|1|1|1|2|4|1|0
-9|2|1|2|5|10|1|1
-9|3|1|3|10|12|1|2
-9|4|1|4|11|13|1|3
-9|5|1|5|12|-1|0|4
-11|1|1|1|0
-11|2|1|1|1
-11|3|1|1|2
-11|4|1|1|3
-11|5|1|0|4
-12|1|1|1|0
-12|2|1|1|1
-12|3|1|1|2
-12|4|1|1|3
-12|5|1|0|4
-13|1|1|1|0
-13|2|1|1|1
-13|3|1|1|2
-13|4|1|1|3
-13|5|1|0|4
-14|1|1|1|2|4|1|0
-14|2|1|2|5|8|1|1
-14|3|1|3|6|9|1|2
-14|4|1|4|9|15|1|3
-14|5|1|5|12|-1|0|4
-15|1|1|1|2|4|1|0
-15|2|1|2|5|8|1|1
-15|3|1|3|6|9|1|2
-15|4|1|4|9|15|1|3
-15|5|1|5|12|-1|0|4
-16|1|1|1|2|4|1|0
-16|2|1|2|5|8|1|1
-16|3|1|3|6|9|1|2
-16|4|1|4|9|15|1|3
-16|5|1|5|12|-1|0|4
diff --git a/src/ksp/test/ksp-v3-1route.test.sql b/src/ksp/test/ksp-v3-1route.test.sql
deleted file mode 100644
index 6048979..0000000
--- a/src/ksp/test/ksp-v3-1route.test.sql
+++ /dev/null
@@ -1,116 +0,0 @@
---------------------------------------------------------------------------------
---              PGR_ksp V3 only
---------------------------------------------------------------------------------
-
--- data
-SELECT id, source, target, cost, reverse_cost FROM edge_table order by id;
-
-
--- Examples to handle the one flag to choose signatures using :ref:`fig1-direct-Cost-Reverse`
-------------------------------------------------------------------------------------------
-
-
-   SELECT 1, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1, 
-      true   
-   );
-
-   SELECT 2, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1,
-      directed:=true   -- takes the new signature
-   );
-
-   SELECT 3, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1
-   );
-
-
-
---Examples using :ref:`fig1-direct-Cost-Reverse`
--------------------------------------------------------------------------------
-
-
-   SELECT 4, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1
-   );
-  
-
-   SELECT 5, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1, heap_paths:=true
-   );
-
-   SELECT 6, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1, true, true
-   );
-
---Example for :ref:`fig2-undirect-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-  SELECT 7, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1, directed:=false
-   );
-
-  SELECT 8, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1, directed:=false, heap_paths:=true
-   );
-
-  SELECT 9, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 1, false, true
-   );
-
-
-
--- Examples for :ref:`fig3-direct-Cost` 
--------------------------------------------------------------------------------
-
-
-  SELECT 10, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 3, 2
-   );
-
-
-  SELECT 11, seq, path_id, cost, agg_cost  FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 1
-   );
-
-
-  SELECT 12, seq, path_id,  cost, agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 1, heap_paths:=true
-   );
-
-  SELECT 13, seq, path_id,  cost, agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 1, true, true
-   );
-
---Examples for :ref:`fig4-undirect-Cost` 
--------------------------------------------------------------------------------
-
-
-  SELECT 14, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 1, directed:=false
-   );
-  
-  SELECT 15, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 1, directed:=false, heap_paths:=true
-   );
-
-  SELECT 16, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 1, false, true
-   );
diff --git a/src/ksp/test/ksp-v3.result b/src/ksp/test/ksp-v3.result
deleted file mode 100644
index 1ca2113..0000000
--- a/src/ksp/test/ksp-v3.result
+++ /dev/null
@@ -1,154 +0,0 @@
-1|0|0|2|4|1
-1|1|0|5|8|1
-1|2|0|6|9|1
-1|3|0|9|15|1
-1|4|0|12|-1|0
-1|5|1|2|4|1
-1|6|1|5|8|1
-1|7|1|6|11|1
-1|8|1|11|13|1
-1|9|1|12|-1|0
-2|1|1|1|2|4|1|0
-2|2|1|2|5|8|1|1
-2|3|1|3|6|9|1|2
-2|4|1|4|9|15|1|3
-2|5|1|5|12|-1|0|4
-2|6|2|1|2|4|1|0
-2|7|2|2|5|8|1|1
-2|8|2|3|6|11|1|2
-2|9|2|4|11|13|1|3
-2|10|2|5|12|-1|0|4
-3|1|1|1|2|4|1|0
-3|2|1|2|5|8|1|1
-3|3|1|3|6|9|1|2
-3|4|1|4|9|15|1|3
-3|5|1|5|12|-1|0|4
-3|6|2|1|2|4|1|0
-3|7|2|2|5|8|1|1
-3|8|2|3|6|11|1|2
-3|9|2|4|11|13|1|3
-3|10|2|5|12|-1|0|4
-4|1|1|1|2|4|1|0
-4|2|1|2|5|8|1|1
-4|3|1|3|6|9|1|2
-4|4|1|4|9|15|1|3
-4|5|1|5|12|-1|0|4
-4|6|2|1|2|4|1|0
-4|7|2|2|5|8|1|1
-4|8|2|3|6|11|1|2
-4|9|2|4|11|13|1|3
-4|10|2|5|12|-1|0|4
-5|1|1|1|2|4|1|0
-5|2|1|2|5|8|1|1
-5|3|1|3|6|9|1|2
-5|4|1|4|9|15|1|3
-5|5|1|5|12|-1|0|4
-5|6|2|1|2|4|1|0
-5|7|2|2|5|8|1|1
-5|8|2|3|6|11|1|2
-5|9|2|4|11|13|1|3
-5|10|2|5|12|-1|0|4
-5|11|3|1|2|4|1|0
-5|12|3|2|5|10|1|1
-5|13|3|3|10|12|1|2
-5|14|3|4|11|13|1|3
-5|15|3|5|12|-1|0|4
-6|1|1|1|2|4|1|0
-6|2|1|2|5|8|1|1
-6|3|1|3|6|9|1|2
-6|4|1|4|9|15|1|3
-6|5|1|5|12|-1|0|4
-6|6|2|1|2|4|1|0
-6|7|2|2|5|8|1|1
-6|8|2|3|6|11|1|2
-6|9|2|4|11|13|1|3
-6|10|2|5|12|-1|0|4
-6|11|3|1|2|4|1|0
-6|12|3|2|5|10|1|1
-6|13|3|3|10|12|1|2
-6|14|3|4|11|13|1|3
-6|15|3|5|12|-1|0|4
-7|1|1|1|0
-7|2|1|1|1
-7|3|1|1|2
-7|4|1|1|3
-7|5|1|0|4
-7|6|2|1|0
-7|7|2|1|1
-7|8|2|1|2
-7|9|2|1|3
-7|10|2|0|4
-8|1|1|1|0
-8|2|1|1|1
-8|3|1|1|2
-8|4|1|1|3
-8|5|1|0|4
-8|6|2|1|0
-8|7|2|1|1
-8|8|2|1|2
-8|9|2|1|3
-8|10|2|0|4
-8|11|3|1|0
-8|12|3|1|1
-8|13|3|1|2
-8|14|3|1|3
-8|15|3|0|4
-8|16|4|1|0
-8|17|4|1|1
-8|18|4|1|2
-8|19|4|1|3
-8|20|4|1|4
-8|21|4|1|5
-8|22|4|0|6
-9|5|1|5|12|-1|0|4
-9|10|2|5|12|-1|0|4
-9|15|3|5|12|-1|0|4
-9|22|4|7|12|-1|0|6
-11|4
-11|4
-12|4
-12|4
-12|4
-13|4
-13|4
-13|4
-14|1|1|1|2|4|1|0
-14|2|1|2|5|8|1|1
-14|3|1|3|6|9|1|2
-14|4|1|4|9|15|1|3
-14|5|1|5|12|-1|0|4
-14|6|2|1|2|4|1|0
-14|7|2|2|5|8|1|1
-14|8|2|3|6|11|1|2
-14|9|2|4|11|13|1|3
-14|10|2|5|12|-1|0|4
-15|1|1|1|2|4|1|0
-15|2|1|2|5|8|1|1
-15|3|1|3|6|9|1|2
-15|4|1|4|9|15|1|3
-15|5|1|5|12|-1|0|4
-15|6|2|1|2|4|1|0
-15|7|2|2|5|8|1|1
-15|8|2|3|6|11|1|2
-15|9|2|4|11|13|1|3
-15|10|2|5|12|-1|0|4
-15|11|3|1|2|4|1|0
-15|12|3|2|5|10|1|1
-15|13|3|3|10|12|1|2
-15|14|3|4|11|13|1|3
-15|15|3|5|12|-1|0|4
-16|1|1|1|2|4|1|0
-16|2|1|2|5|8|1|1
-16|3|1|3|6|9|1|2
-16|4|1|4|9|15|1|3
-16|5|1|5|12|-1|0|4
-16|6|2|1|2|4|1|0
-16|7|2|2|5|8|1|1
-16|8|2|3|6|11|1|2
-16|9|2|4|11|13|1|3
-16|10|2|5|12|-1|0|4
-16|11|3|1|2|4|1|0
-16|12|3|2|5|10|1|1
-16|13|3|3|10|12|1|2
-16|14|3|4|11|13|1|3
-16|15|3|5|12|-1|0|4
diff --git a/src/ksp/test/ksp-v3.test.sql b/src/ksp/test/ksp-v3.test.sql
deleted file mode 100644
index 49b7d74..0000000
--- a/src/ksp/test/ksp-v3.test.sql
+++ /dev/null
@@ -1,117 +0,0 @@
---------------------------------------------------------------------------------
---              PGR_ksp V3
---------------------------------------------------------------------------------
-
-
-
-
--- Examples to handle the one flag to choose signatures using :ref:`fig1-direct-Cost-Reverse`
-------------------------------------------------------------------------------------------
-
-
-   SELECT 1, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, 
-      true   -- takes the (V2.0) signature (has_rcost = true and works on directed graph)
-   );
-
-
-   SELECT 2, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2,
-      directed:=true   -- takes the new signature
-   );
-
-   SELECT 3, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2
-   );
-
-
-
---Examples using :ref:`fig1-direct-Cost-Reverse`
--------------------------------------------------------------------------------
-
-
-   SELECT 4, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2
-   );
-  
-
-   SELECT 5, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, heap_paths:=true
-   );
-
-   SELECT 6, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, true, true
-   );
-
---Example for :ref:`fig2-undirect-Cost-Reverse` 
--------------------------------------------------------------------------------
-
-
-  SELECT 7, seq, path_id, cost, agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, directed:=false
-   );
-
-  SELECT 8, seq, path_id, cost, agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, directed:=false, heap_paths:=true
-   );
-
-  SELECT 9, * FROM pgr_ksp(
-     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
-      2, 12, 2, false, true
-   ) where edge = -1;
-
-
-
--- Examples for :ref:`fig3-direct-Cost` 
--------------------------------------------------------------------------------
-
-
-  SELECT 10, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 3, 2
-   );
-
-
-  SELECT 11,  agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2
-   ) where edge = -1 order by agg_cost;
-
-
-  SELECT 12,  agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, heap_paths:=true
-   ) where edge = -1 order by agg_cost;
-
-  SELECT 13, agg_cost FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, true, true
-   ) where edge = -1 order by agg_cost;
-
---Examples for :ref:`fig4-undirect-Cost` 
--------------------------------------------------------------------------------
-
-
-  SELECT 14, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, directed:=false
-   );
-  
-  SELECT 15, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, directed:=false, heap_paths:=true
-   );
-
-  SELECT 16, * FROM pgr_ksp(
-     'SELECT id, source, target, cost FROM edge_table',
-      2, 12, 2, false, true
-   );
-
diff --git a/src/ksp/test/makeTests.sh b/src/ksp/test/makeTests.sh
deleted file mode 100644
index 4837bc9..0000000
--- a/src/ksp/test/makeTests.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-psql -U postgres  -h localhost -A -t -q -f ksp-any-00.data ksp_test
-
-psql -U postgres  -h localhost -A -t -q -f ksp-any-01.test ksp_test &> ksp-any-01.aaa
-sed s/psql:ksp-any-01.test:[0-9]*:// <ksp-any-01.aaa > ksp-any-01.rest
-
-psql -U postgres  -h localhost -A -t -q -f ksp-any-02.test ksp_test &> ksp-any-02.aaa
-sed s/psql:ksp-any-02.test:[0-9]*:// <ksp-any-02.aaa >ksp-any-02.rest
-
-psql -U postgres  -h localhost -A -t -q -f ksp-parallel-any-03.test ksp_test &> ksp-parallel-any-03.aaa
-sed s/psql:ksp-parallel-any-03.test:[0-9]*:// <ksp-parallel-any-03.aaa >ksp-parallel-any-03.rest
-
-rm *.aaa
diff --git a/src/ksp/test/pgtap/ksp-v3-1route.test.sql b/src/ksp/test/pgtap/ksp-v3-1route.test.sql
new file mode 100644
index 0000000..623c763
--- /dev/null
+++ b/src/ksp/test/pgtap/ksp-v3-1route.test.sql
@@ -0,0 +1,109 @@
+\i setup.sql
+
+
+SELECT plan(7);
+
+
+PREPARE q2 AS
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 1,
+      directed:=true   -- takes the new signature
+   );
+
+PREPARE q3 AS
+   SELECT * FROM pgr_ksp(
+     'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+      2, 12, 1
+   );
+SELECT set_eq('q2','q3','1: With and with out directed flag gives the same result');
+
+
+-------------------------------------------------------------------------------
+
+PREPARE q4 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 12, 1
+);
+
+
+PREPARE q5 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 12, 1, heap_paths:=true
+);
+
+PREPARE q6 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 12, 1, true, true
+);
+
+SELECT set_eq('q4','q5','2: no flags vs with heap paths, gives the same result');
+SELECT set_eq('q4','q6','3: no flags vs true true gives the same result');
+
+-------------------------------------------------------------------------------
+
+
+PREPARE q7 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 12, 1, directed:=false
+);
+
+PREPARE q8 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 12, 1, directed:=false, heap_paths:=true
+);
+
+PREPARE q9 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, 12, 1, false, true
+);
+
+SELECT set_eq('q7','q8','4: Undirected vs directed heappaths gives the same result');
+SELECT set_eq('q7','q9','5: Unirected vs 2 flags gives the same result');
+
+
+-------------------------------------------------------------------------------
+
+
+
+PREPARE q12 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 12, 1, heap_paths:=true
+);
+
+PREPARE q13 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 12, 1, true, true
+);
+
+SELECT set_eq('q12','q13','6: (No rev_costs) noflags vs 2 flags gives the same result');
+
+
+-------------------------------------------------------------------------------
+
+
+
+PREPARE q15 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 12, 1, directed:=false, heap_paths:=true
+);
+
+PREPARE q16 AS
+SELECT * FROM pgr_ksp(
+    'SELECT id, source, target, cost FROM edge_table',
+    2, 12, 1, false, true
+);
+
+SELECT set_eq('q15','q16','7:(No rev_costs) undirected vs 2 flags gives the same result');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/ksp/test/pgtap/parallel-v2.test.sql b/src/ksp/test/pgtap/parallel-v2.test.sql
new file mode 100644
index 0000000..d5003e0
--- /dev/null
+++ b/src/ksp/test/pgtap/parallel-v2.test.sql
@@ -0,0 +1,106 @@
+\i setup.sql
+SET client_min_messages=WARNING;
+
+
+--   SAMPLE DATA FROM THE ISSUE 285
+
+drop table if exists parallel;
+CREATE TABLE parallel (
+    id serial,
+    source integer,
+    target integer,
+    cost double precision,
+    reverse_cost double precision,
+    x1 double precision,
+    y1 double precision,
+    x2 double precision,
+    y2 double precision,
+    the_geom geometry
+);
+
+INSERT INTO parallel (x1,y1,x2,y2)
+VALUES (1,0,1,1),(1,1,1,3),(1,1,1,3),(1,1,1,3),(1,3,1,4);
+
+UPDATE parallel SET the_geom = ST_makeline(ST_point(x1,y1),ST_point(x2,y2));
+UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(0,2),ST_point(1,3)]) WHERE id = 3;
+UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(2,1),ST_point(2,3),ST_point(1,3)]) WHERE id = 4;
+UPDATE parallel SET cost = ST_length(the_geom), reverse_cost = ST_length(the_geom);
+SELECT pgr_createTopology('parallel',0.001);
+
+SELECT PLAN(7);
+
+PREPARE q1 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 1, true
+);
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 2, true
+);
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 3, true
+);
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 4, true
+);
+
+
+PREPARE q5 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 100, true
+);
+
+SELECT set_eq('q1', 'q2');
+SELECT set_eq('q1', 'q3');
+SELECT set_eq('q1', 'q4');
+SELECT set_eq('q1', 'q5');
+
+PREPARE q6 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 1, true
+);
+
+PREPARE q7 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 2, true
+);
+
+PREPARE q8 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 3, true
+);
+
+PREPARE q9 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 100, true
+);
+
+SELECT set_eq('q6', 'q7');
+SELECT set_eq('q6', 'q8');
+SELECT set_eq('q6', 'q9');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/ksp/test/pgtap/parallel.test.sql b/src/ksp/test/pgtap/parallel.test.sql
new file mode 100644
index 0000000..b51727d
--- /dev/null
+++ b/src/ksp/test/pgtap/parallel.test.sql
@@ -0,0 +1,106 @@
+\i setup.sql
+
+
+--   SAMPLE DATA FROM THE ISSUE 285
+
+CREATE TABLE parallel (
+    id serial,
+    source integer,
+    target integer,
+    cost double precision,
+    reverse_cost double precision,
+    x1 double precision,
+    y1 double precision,
+    x2 double precision,
+    y2 double precision,
+    the_geom geometry
+);
+
+INSERT INTO parallel (x1,y1,x2,y2)
+VALUES (1,0,1,1),(1,1,1,3),(1,1,1,3),(1,1,1,3),(1,3,1,4);
+
+UPDATE parallel SET the_geom = ST_makeline(ST_point(x1,y1),ST_point(x2,y2));
+UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(0,2),ST_point(1,3)]) WHERE id = 3;
+UPDATE parallel SET the_geom = ST_makeline(ARRAY[ST_point(1,1),ST_point(2,1),ST_point(2,3),ST_point(1,3)]) WHERE id = 4;
+UPDATE parallel SET cost = ST_length(the_geom), reverse_cost = ST_length(the_geom);
+SET client_min_messages=WARNING;
+SELECT pgr_createTopology('parallel',0.001);
+SET client_min_messages=NOTICE;
+
+SELECT PLAN(7);
+
+PREPARE q1 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 1, directed:=true
+);
+
+PREPARE q2 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 2, directed:=true
+);
+
+PREPARE q3 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 3, directed:=true
+);
+
+PREPARE q4 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 4, directed:=true
+);
+
+
+PREPARE q5 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    2, 3, 100, directed:=true
+);
+
+SELECT set_eq('q1', 'q2');
+SELECT set_eq('q1', 'q3');
+SELECT set_eq('q1', 'q4');
+SELECT set_eq('q1', 'q5');
+
+PREPARE q6 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 1, directed:=true
+);
+
+PREPARE q7 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 2, directed:=true
+);
+
+PREPARE q8 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 3, directed:=true
+);
+
+PREPARE q9 AS
+SELECT *
+FROM pgr_ksp(
+    'SELECT id, source, target, cost, reverse_cost FROM parallel',
+    1, 4, 100, directed:=true
+);
+
+SELECT set_eq('q6', 'q7');
+SELECT set_eq('q6', 'q8');
+SELECT set_eq('q6', 'q9');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/ksp/test/show_data.result b/src/ksp/test/show_data.result
deleted file mode 100644
index 858e671..0000000
--- a/src/ksp/test/show_data.result
+++ /dev/null
@@ -1,104 +0,0 @@
-network
-1|0|1|1.4142135623731|7.07106781186548|0105000020110F00000100000001020000000200000000000000000000000000000000000000000000000000F03F000000000000F03F
-2|0|2|2.82842712474619|14.142135623731|0105000020110F0000010000000102000000020000000000000000000000000000000000000000000000000000400000000000000040
-3|0|3|4.24264068711928|21.2132034355964|0105000020110F0000010000000102000000020000000000000000000000000000000000000000000000000008400000000000000840
-4|1|0|1.4142135623731|7.07106781186548|0105000020110F000001000000010200000002000000000000000000F03F000000000000F03F00000000000000000000000000000000
-5|1|2|1.4142135623731|7.07106781186548|0105000020110F000001000000010200000002000000000000000000F03F000000000000F03F00000000000000400000000000000040
-6|1|7|6.08276253029822|30.4138126514911|0105000020110F000001000000010200000002000000000000000000F03F000000000000F03F0000000000001C400000000000000040
-7|2|0|2.82842712474619|14.142135623731|0105000020110F0000010000000102000000020000000000000000000040000000000000004000000000000000000000000000000000
-8|2|1|1.4142135623731|7.07106781186548|0105000020110F00000100000001020000000200000000000000000000400000000000000040000000000000F03F000000000000F03F
-9|2|5|4.47213595499958|22.3606797749979|0105000020110F0000010000000102000000020000000000000000000040000000000000004000000000000010400000000000001840
-10|3|0|4.24264068711928|21.2132034355964|0105000020110F0000010000000102000000020000000000000000000840000000000000084000000000000000000000000000000000
-11|3|4|1.4142135623731|7.07106781186548|0105000020110F0000010000000102000000020000000000000000000840000000000000084000000000000010400000000000001040
-12|3|10|9.89949493661167|49.4974746830583|0105000020110F0000010000000102000000020000000000000000000840000000000000084000000000000024400000000000002440
-13|4|3|1.4142135623731|7.07106781186548|0105000020110F0000010000000102000000020000000000000000001040000000000000104000000000000008400000000000000840
-14|4|6|2.23606797749979|11.1803398874989|0105000020110F0000010000000102000000020000000000000000001040000000000000104000000000000018400000000000001440
-15|4|5|2|10|0105000020110F0000010000000102000000020000000000000000001040000000000000104000000000000010400000000000001840
-16|5|2|4.47213595499958|22.3606797749979|0105000020110F0000010000000102000000020000000000000000001040000000000000184000000000000000400000000000000040
-17|5|4|2|10|0105000020110F0000010000000102000000020000000000000000001040000000000000184000000000000010400000000000001040
-18|5|9|2.82842712474619|14.142135623731|0105000020110F0000010000000102000000020000000000000000001040000000000000184000000000000000400000000000002040
-19|5|13|6.32455532033676|31.6227766016838|0105000020110F0000010000000102000000020000000000000000001040000000000000184000000000000000400000000000002840
-20|6|4|2.23606797749979|11.1803398874989|0105000020110F0000010000000102000000020000000000000000001840000000000000144000000000000010400000000000001040
-21|6|7|3.16227766016838|15.8113883008419|0105000020110F000001000000010200000002000000000000000000184000000000000014400000000000001C400000000000000040
-22|7|6|3.16227766016838|15.8113883008419|0105000020110F0000010000000102000000020000000000000000001C40000000000000004000000000000018400000000000001440
-23|7|8|6.70820393249937|33.5410196624969|0105000020110F0000010000000102000000020000000000000000001C40000000000000004000000000000010400000000000002040
-24|7|1|6.08276253029822|30.4138126514911|0105000020110F0000010000000102000000020000000000000000001C400000000000000040000000000000F03F000000000000F03F
-25|8|7|6.70820393249937|33.5410196624969|0105000020110F000001000000010200000002000000000000000000104000000000000020400000000000001C400000000000000040
-26|8|11|3.60555127546399|18.0277563773199|0105000020110F00000100000001020000000200000000000000000010400000000000002040000000000000F03F0000000000002440
-27|8|12|4|20|0105000020110F0000010000000102000000020000000000000000001040000000000000204000000000000010400000000000002840
-28|9|5|2.82842712474619|14.142135623731|0105000020110F0000010000000102000000020000000000000000000040000000000000204000000000000010400000000000001840
-29|10|3|9.89949493661167|49.4974746830583|0105000020110F0000010000000102000000020000000000000000002440000000000000244000000000000008400000000000000840
-30|10|11|9|45|0105000020110F00000100000001020000000200000000000000000024400000000000002440000000000000F03F0000000000002440
-31|10|12|6.32455532033676|31.6227766016838|0105000020110F0000010000000102000000020000000000000000002440000000000000244000000000000010400000000000002840
-32|11|8|3.60555127546399|18.0277563773199|0105000020110F000001000000010200000002000000000000000000F03F000000000000244000000000000010400000000000002040
-33|11|10|9|45|0105000020110F000001000000010200000002000000000000000000F03F000000000000244000000000000024400000000000002440
-34|11|13|2.23606797749979|11.1803398874989|0105000020110F000001000000010200000002000000000000000000F03F000000000000244000000000000000400000000000002840
-35|12|10|6.32455532033676|31.6227766016838|0105000020110F0000010000000102000000020000000000000000001040000000000000284000000000000024400000000000002440
-36|12|8|4|20|0105000020110F0000010000000102000000020000000000000000001040000000000000284000000000000010400000000000002040
-37|12|13|2|10|0105000020110F0000010000000102000000020000000000000000001040000000000000284000000000000000400000000000002840
-38|13|12|2|10|0105000020110F0000010000000102000000020000000000000000000040000000000000284000000000000010400000000000002840
-39|13|5|6.32455532033676|31.6227766016838|0105000020110F0000010000000102000000020000000000000000000040000000000000284000000000000010400000000000001840
-40|13|11|2.23606797749979|11.1803398874989|0105000020110F00000100000001020000000200000000000000000000400000000000002840000000000000F03F0000000000002440
-nodes
-1|0|Zero|0101000020110F000000000000000000000000000000000000
-2|1|One|0101000020110F0000000000000000F03F000000000000F03F
-3|2|Two|0101000020110F000000000000000000400000000000000040
-4|3|Three|0101000020110F000000000000000008400000000000000840
-5|4|Four|0101000020110F000000000000000010400000000000001040
-6|5|Five|0101000020110F000000000000000010400000000000001840
-7|6|Six|0101000020110F000000000000000018400000000000001440
-8|7|Seven|0101000020110F00000000000000001C400000000000000040
-9|8|Eight|0101000020110F000000000000000010400000000000002040
-10|9|Nine|0101000020110F000000000000000000400000000000002040
-11|10|Ten|0101000020110F000000000000000024400000000000002440
-12|11|Eleven|0101000020110F0000000000000000F03F0000000000002440
-13|12|Twelve|0101000020110F000000000000000010400000000000002840
-14|13|Thirteen|0101000020110F000000000000000000400000000000002840
-edge_table
-1|B|1|2|1|1|2|0|2|1|010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2|TF|2|3|-1|1|2|1|3|1|0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3|TF|3|4|-1|1|3|1|4|1|0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4|B|2|5|1|1|2|1|2|2|0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5|FT|3|6|1|-1|3|1|3|2|0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6|B|7|8|1|1|0|2|1|2|01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7|B|8|5|1|1|1|2|2|2|010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8|B|5|6|1|1|2|2|3|2|0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9|B|6|9|1|1|3|2|4|2|0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10|B|5|10|1|1|2|2|2|3|0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11|FT|6|11|1|-1|3|2|3|3|0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12|FT|10|11|1|-1|2|3|3|3|0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13|FT|11|12|1|-1|3|3|4|3|0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14|B|10|13|1|1|2|3|2|4|0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15|B|9|12|1|1|4|2|4|3|0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16|B|4|9|1|1|4|1|4|2|0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-17|B|14|15|1|1|0.5|3.5|1.999999999999|3.5|010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
-18|B|16|17|1|1|3.5|2.3|3.5|4|0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040
-edge_table_vertices
-1|||||010100000000000000000000400000000000000000
-2|||||01010000000000000000000040000000000000F03F
-3|||||01010000000000000000000840000000000000F03F
-4|||||01010000000000000000001040000000000000F03F
-5|||||010100000000000000000000400000000000000040
-6|||||010100000000000000000008400000000000000040
-7|||||010100000000000000000000000000000000000040
-8|||||0101000000000000000000F03F0000000000000040
-9|||||010100000000000000000010400000000000000040
-10|||||010100000000000000000000400000000000000840
-11|||||010100000000000000000008400000000000000840
-12|||||010100000000000000000010400000000000000840
-13|||||010100000000000000000000400000000000001040
-14|||||0101000000000000000000E03F0000000000000C40
-15|||||010100000068EEFFFFFFFFFF3F0000000000000C40
-16|||||01010000000000000000000C406666666666660240
-17|||||01010000000000000000000C400000000000001040
-paralell
-1|1|2|1|1|1|0|1|1|010200000002000000000000000000F03F0000000000000000000000000000F03F000000000000F03F
-2|2|3|2|2|1|1|1|3|010200000002000000000000000000F03F000000000000F03F000000000000F03F0000000000000840
-3|2|3|2.82842712474619|2.82842712474619|1|1|1|3|010200000003000000000000000000F03F000000000000F03F00000000000000000000000000000040000000000000F03F0000000000000840
-4|2|3|4|4|1|1|1|3|010200000004000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000840000000000000F03F0000000000000840
-5|3|4|1|1|1|3|1|4|010200000002000000000000000000F03F0000000000000840000000000000F03F0000000000001040
-paralell_vertices
-1|||||0101000000000000000000F03F0000000000000000
-2|||||0101000000000000000000F03F000000000000F03F
-3|||||0101000000000000000000F03F0000000000000840
-4|||||0101000000000000000000F03F0000000000001040
diff --git a/src/ksp/test/show_data.test.sql b/src/ksp/test/show_data.test.sql
deleted file mode 100644
index 14a0416..0000000
--- a/src/ksp/test/show_data.test.sql
+++ /dev/null
@@ -1,18 +0,0 @@
---------------------------------------------------
--- Test to see that we are working with the same data 
---------------------------------------------------
-\echo network
-select * from network order by id;
-\echo nodes
-select * from nodes order by id;
---------------------------------------------------
-\echo edge_table
-select * from edge_table order by id;
-\echo edge_table_vertices
-select * from edge_table_vertices_pgr order by id;
---------------------------------------------------
-\echo paralell
-select * from parallel order by id;
-\echo paralell_vertices
-select * from parallel_vertices_pgr order by id;
- 
diff --git a/src/ksp/test/test.conf b/src/ksp/test/test.conf
index addfc85..a0541bc 100644
--- a/src/ksp/test/test.conf
+++ b/src/ksp/test/test.conf
@@ -2,20 +2,19 @@
 
 %main::tests = (
     'any' => {
-        'comment' => 'KSP test for any versions.',
-        'data' => ['ksp-any-00.data'],
+        'comment' => 'KSP',
+        'data' => [''],
         'tests' => [qw(
-show_data
-ksp-v3-1route
-ksp-parallel-any-03
-ksp-any-01
-ksp-any-02
-ksp-v2
-ksp-v3
-)],
-        'not done tests' => [qw(
-)]
-        },
+            ksp-network
+
+            doc-ksp
+            doc-ksp-v2
+            )],
+        'documentation' => [qw(
+            doc-ksp
+            doc-ksp-v2
+            )]
+    },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
 #    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
diff --git a/src/label_graph/doc/analyze_brokengraph.rst b/src/label_graph/doc/analyze_brokengraph.rst
deleted file mode 100644
index 501d898..0000000
--- a/src/label_graph/doc/analyze_brokengraph.rst
+++ /dev/null
@@ -1,176 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_labelGraph:
-
-
-pgr_labelGraph
-===============================================================================
-
-.. index:: 
-	single: pgr_labelGraph(text, text, text, text, text, text)
-	module: common
-
-
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_labelGraph`` — Locates and labels sub-networks within a network which are not topologically connected. Must be run after ``pgr_createTopology()``. No use of ``geometry`` column. Only ``id``, ``source`` and  ``target`` columns are required.
-
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The function returns:
-
-  - ``OK`` when a column with provided name has been generated and populated successfully. All connected edges will have unique similar integer values. In case of ``rows_where`` condition, non participating rows will have -1 integer values.
-  - ``FAIL`` when the processing cannot be finished due to some error. Notice will be thrown accordingly.
-  - ``rows_where condition generated 0 rows`` when passed SQL condition has not been fulfilled by any row. 
-
-.. code-block:: sql
-
-	varchar pgr_labelGraph(text, text, text, text, text, text)
-
-
-
-Description
--------------------------------------------------------------------------------
-
-A network behind any routing query may consist of sub-networks completely isolated from each other. Possible reasons could be:
-
-- An island with no bridge connecting to the mainland.
-- An edge or mesh of edges failed to connect to other networks because of human negligence during data generation.
-- The data is not properly noded.
-- Topology creation failed to succeed. 
-
-pgr_labelGraph() will create an integer column (with the name provided by the user) and will assign same integer values to all those edges in the network which are connected topologically. Thus better analysis regarding network structure is possible. In case of ``rows_where`` condition, non participating rows will have -1 integer values.
-
-Prerequisites:
-Must run ``pgr_createTopology()`` in order to generate ``source`` and ``target`` columns. Primary key column ``id`` should also be there in the network table.
-
-Function accepts the following parameters:
-
-:edge_table: ``text`` Network table name, with optional schema name.
-:id: ``text`` Primary key column name of the network table. Default is ``id``.
-:source: ``text`` Source column name generated after ``pgr_createTopology()``. Default is ``source``.
-:target: ``text`` Target column name generated after ``pgr_createTopology()``. Default is ``target``.
-:subgraph: ``text`` Column name which will hold the integer labels for each sub-graph. Default is ``subgraph``.
-:rows_where: ``text`` The SQL where condition. Default is ``true``, means the processing will be done on the whole table. 
-
-
-
-
-Possible Usage
--------------------------------------------------------------------------------
--- The following should be OK
-
-.. code-block:: sql
-
-  select pgr_labelGraph('ways');
-  select pgr_labelGraph('Ways');
-  select pgr_labelGraph('ways', 'id');
-  select pgr_labelGraph('ways', 'id', 'source');
-  select pgr_labelGraph('ways', 'id', 'source', 'target');
-  select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph');
-  select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<100');
-
--- When table located in another schema e03
-
-.. code-block:: sql
-
-  select pgr_labelGraph('e03.ways');
-  select pgr_labelGraph('e03.Ways');
-  select pgr_labelGraph('e03.ways', 'id');
-  select pgr_labelGraph('e03.ways', 'id', 'source');
-  select pgr_labelGraph('e03.ways', 'id', 'source', 'target');
-  select pgr_labelGraph('e03.ways', 'id', 'source', 'target', 'subgraph');
-  select pgr_labelGraph('e03.ways', 'id', 'source', 'target', 'subgraph', 'id<100');
-
--- When using the named notation
-
-.. code-block:: sql
-
-  select pgr_labelGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido', source:='salida');
-  select pgr_labelGraph('e03.calles', rows_where:='gido<100', id:='gido', source:='salida', target:='destino', subgraph:='subgraph');
-
--- The following should FAIL
-
-.. code-block:: sql 
-
-  select pgr_labelGraph('id', 'ways');
-  select pgr_labelGraph('ways', 'id', 'sourc', 'target');
-  select pgr_labelGraph('ways', 'id', 'source', 'Target');
-  select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<');
-
--- When table located in another schema e03
-
-.. code-block:: sql
-
-  select pgr_labelGraph('e03.calles');
-  select pgr_labelGraph('e03.Calles');
-  select pgr_labelGraph('id', 'e03.calles');
-  select pgr_labelGraph('e03.calles', 'id', 'sourc', 'target');
-  select pgr_labelGraph('e03.calles', 'gido', 'source', 'target', 'subgraph', 'id<');
-  select pgr_labelGraph('e03.calles', 'gid', 'salida', 'target', 'subgraph', 'id<10');
-  select pgr_labelGraph('e03.calles', 'gid', 'salida', 'destino', 'subgraph', 'id<10 AND id>100');
-
--- When using the named notation
-
-.. code-block:: sql
-
-  select pgr_labelGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido');
-  select pgr_labelGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido', source:='salido');
-  select pgr_labelGraph(rows_where:='gido<100', id:='gido', source:='salida', 'e03.calles', target:='destino', subgraph:='subgraph');
-
--- The following should return "rows_where condition generated 0 rows"
-
-.. code-block:: sql
-
-  select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<10 AND id>100');
-  select pgr_labelGraph('e03.calles', id:='gido', rows_where:='gido<100 AND gido>200', source:='salida', target:='destino', subgraph:='subgraph');
-
-
-
-
-Examples Output pane Messages
--------------------------------------------------------------------------------
-
-.. code-block:: sql
-
-  NOTICE:  Processing:
-  NOTICE:  pgr_labelGraph('ways','id','source','target','subgraph','true')
-  NOTICE:  Performing initial checks, please hold on ...
-  NOTICE:  Starting - Checking table ...
-  NOTICE:  Ending - Checking table
-  NOTICE:  Starting - Checking columns
-  NOTICE:  Ending - Checking columns
-  NOTICE:  Starting - Checking rows_where condition
-  NOTICE:  Ending - Checking rows_where condition
-  NOTICE:  Starting - Calculating subgraphs
-  NOTICE:  Successfully complicated calculating subgraphs
-  NOTICE:  Ending - Calculating subgraphs
-
-  Total query runtime: 5426 ms.
-  1 row retrieved.
-
-  pgr_labelgraph
-  character varying
-  --------------------
-  OK
-  (1 row)
-
-
-
-
-See Also
--------------------------------------------------------------------------------
-
-* `pgr_createTopology <https://github.com/Zia-/pgrouting/blob/develop/src/common/sql/pgrouting_topology.sql>`_ to create the topology of a table based on its geometry and tolerance value.
diff --git a/src/label_graph/doc/doc-pgr_labelGraph.queries b/src/label_graph/doc/doc-pgr_labelGraph.queries
new file mode 100644
index 0000000..245a3dc
--- /dev/null
+++ b/src/label_graph/doc/doc-pgr_labelGraph.queries
@@ -0,0 +1,24 @@
+BEGIN;
+BEGIN
+SET client_min_messages TO ERROR;
+SET
+--q1
+SELECT pgr_labelGraph('edge_table', 'id', 'source', 'target', 'subgraph');
+ pgr_labelgraph 
+----------------
+ OK
+(1 row)
+
+SELECT subgraph, count(*) FROM edge_table group by subgraph;
+ subgraph | count 
+----------+-------
+        1 |    16
+        3 |     1
+        2 |     1
+(3 rows)
+
+--q2
+SET client_min_messages TO DEBUG;
+SET
+ROLLBACK;
+ROLLBACK
diff --git a/src/label_graph/doc/pgr_labelGraph.rst b/src/label_graph/doc/pgr_labelGraph.rst
new file mode 100644
index 0000000..84a9225
--- /dev/null
+++ b/src/label_graph/doc/pgr_labelGraph.rst
@@ -0,0 +1,85 @@
+.. 
+   ****************************************************************************
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_labelGraph:
+
+
+pgr_labelGraph
+===============================================================================
+
+.. index:: 
+	single: pgr_labelGraph(text, text, text, text, text, text)
+	module: common
+
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_labelGraph`` — Locates and labels sub-networks within a network which are not topologically connected. Must be run after ``pgr_createTopology()``. No use of ``geometry`` column. Only ``id``, ``source`` and  ``target`` columns are required.
+
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The function returns:
+
+  - ``OK`` when a column with provided name has been generated and populated successfully. All connected edges will have unique similar integer values. In case of ``rows_where`` condition, non participating rows will have -1 integer values.
+  - ``FAIL`` when the processing cannot be finished due to some error. Notice will be thrown accordingly.
+  - ``rows_where condition generated 0 rows`` when passed SQL condition has not been fulfilled by any row. 
+
+.. code-block:: sql
+
+	varchar pgr_labelGraph(text, text, text, text, text, text)
+
+
+
+Description
+-------------------------------------------------------------------------------
+
+A network behind any routing query may consist of sub-networks completely isolated from each other. Possible reasons could be:
+
+- An island with no bridge connecting to the mainland.
+- An edge or mesh of edges failed to connect to other networks because of human negligence during data generation.
+- The data is not properly noded.
+- Topology creation failed to succeed. 
+
+pgr_labelGraph() will create an integer column (with the name provided by the user) and will assign same integer values to all those edges in the network which are connected topologically. Thus better analysis regarding network structure is possible. In case of ``rows_where`` condition, non participating rows will have -1 integer values.
+
+Prerequisites:
+Must run ``pgr_createTopology()`` in order to generate ``source`` and ``target`` columns. Primary key column ``id`` should also be there in the network table.
+
+Function accepts the following parameters:
+
+:edge_table: ``text`` Network table name, with optional schema name.
+:id: ``text`` Primary key column name of the network table. Default is ``id``.
+:source: ``text`` Source column name generated after ``pgr_createTopology()``. Default is ``source``.
+:target: ``text`` Target column name generated after ``pgr_createTopology()``. Default is ``target``.
+:subgraph: ``text`` Column name which will hold the integer labels for each sub-graph. Default is ``subgraph``.
+:rows_where: ``text`` The SQL where condition. Default is ``true``, means the processing will be done on the whole table. 
+
+
+
+
+Example Usage
+-------------------------------------------------------------------------------
+
+The sample data, has 3 subgraphs.
+
+.. literalinclude:: doc-pgr_labelGraph.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* `pgr_createTopology <https://github.com/Zia-/pgrouting/blob/develop/src/common/sql/pgrouting_topology.sql>`_ to create the topology of a table based on its geometry and tolerance value.
diff --git a/src/label_graph/sql/label_graph.sql b/src/label_graph/sql/label_graph.sql
index bd079fa..6be3cf3 100644
--- a/src/label_graph/sql/label_graph.sql
+++ b/src/label_graph/sql/label_graph.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 CREATE OR REPLACE FUNCTION pgr_labelGraph(
                 edge_table text,
                 id text default 'id',
diff --git a/src/label_graph/test/doc-pgr_labelGraph.result b/src/label_graph/test/doc-pgr_labelGraph.result
new file mode 100644
index 0000000..244e737
--- /dev/null
+++ b/src/label_graph/test/doc-pgr_labelGraph.result
@@ -0,0 +1,6 @@
+--q1
+OK
+1|16
+3|1
+2|1
+--q2
diff --git a/src/label_graph/test/doc-pgr_labelGraph.test.sql b/src/label_graph/test/doc-pgr_labelGraph.test.sql
new file mode 100644
index 0000000..b539e81
--- /dev/null
+++ b/src/label_graph/test/doc-pgr_labelGraph.test.sql
@@ -0,0 +1,8 @@
+BEGIN;
+SET client_min_messages TO ERROR;
+\echo --q1
+SELECT pgr_labelGraph('edge_table', 'id', 'source', 'target', 'subgraph');
+SELECT subgraph, count(*) FROM edge_table group by subgraph;
+\echo --q2
+SET client_min_messages TO DEBUG;
+ROLLBACK;
diff --git a/src/label_graph/test/pgrouting_brokengraph.data b/src/label_graph/test/pgrouting_brokengraph.data
deleted file mode 100644
index 9ec2ffd..0000000
--- a/src/label_graph/test/pgrouting_brokengraph.data
+++ /dev/null
@@ -1,4214 +0,0 @@
-create schema e03;
-
-create table ways(
-	id integer,
-	source integer,
-	target integer
-);
- 
-insert into ways values 
-	(1, 1, 2),
-	(2, 2, 3),
-	(3, 3, 4),
-	(4, 4, 5),
-	(5, 5, 6),
-	(7, 7, 8),
-	(8, 9, 10),
-	(9, 11, 12),
-	(10, 12, 13),
-	(11, 13, 14),
-	(12, 14, 15),
-	(13, 15, 16),
-	(15, 17, 18),
-	(16, 18, 19),
-	(17, 19, 20),
-	(18, 20, 21),
-	(19, 21, 22),
-	(20, 22, 23),
-	(21, 23, 24),
-	(22, 24, 25),
-	(23, 25, 26),
-	(24, 26, 27),
-	(25, 27, 28),
-	(26, 28, 29),
-	(27, 29, 30),
-	(28, 30, 31),
-	(29, 31, 32),
-	(31, 33, 34),
-	(32, 34, 35),
-	(33, 35, 36),
-	(34, 36, 37),
-	(35, 37, 38),
-	(36, 38, 39),
-	(37, 39, 40),
-	(38, 40, 41),
-	(39, 41, 42),
-	(40, 42, 43),
-	(41, 43, 44),
-	(42, 44, 45),
-	(43, 45, 46),
-	(44, 46, 47),
-	(45, 47, 48),
-	(46, 48, 49),
-	(47, 49, 50),
-	(48, 50, 51),
-	(49, 51, 52),
-	(50, 52, 53),
-	(51, 53, 54),
-	(52, 54, 55),
-	(53, 55, 56),
-	(54, 56, 57),
-	(55, 57, 58),
-	(56, 58, 59),
-	(57, 59, 60),
-	(58, 60, 61),
-	(59, 61, 62),
-	(60, 62, 63),
-	(61, 63, 64),
-	(62, 64, 65),
-	(63, 65, 66),
-	(64, 66, 67),
-	(65, 67, 68),
-	(66, 68, 69),
-	(67, 69, 70),
-	(69, 41, 71),
-	(70, 71, 72),
-	(71, 72, 73),
-	(72, 73, 74),
-	(73, 74, 75),
-	(74, 75, 76),
-	(75, 76, 77),
-	(76, 77, 78),
-	(77, 78, 79),
-	(78, 79, 80),
-	(79, 80, 81),
-	(80, 81, 82),
-	(81, 82, 83),
-	(82, 83, 84),
-	(83, 84, 85),
-	(84, 85, 86),
-	(85, 86, 87),
-	(86, 87, 88),
-	(87, 88, 89),
-	(88, 89, 90),
-	(89, 90, 91),
-	(90, 91, 92),
-	(91, 92, 93),
-	(92, 93, 94),
-	(93, 94, 95),
-	(94, 95, 96),
-	(95, 96, 97),
-	(96, 97, 98),
-	(97, 98, 99),
-	(98, 99, 100),
-	(99, 100, 101),
-	(100, 101, 102),
-	(101, 102, 103),
-	(102, 103, 62),
-	(103, 62, 104),
-	(105, 105, 106),
-	(106, 106, 48),
-	(107, 48, 107),
-	(108, 107, 108),
-	(109, 108, 109),
-	(110, 109, 110),
-	(111, 110, 111),
-	(112, 111, 112),
-	(113, 112, 113),
-	(114, 113, 114),
-	(115, 114, 115),
-	(116, 115, 116),
-	(117, 116, 117),
-	(118, 117, 118),
-	(119, 118, 119),
-	(120, 119, 120),
-	(121, 120, 121),
-	(122, 121, 122),
-	(124, 122, 123),
-	(125, 123, 124),
-	(126, 124, 125),
-	(127, 125, 126),
-	(128, 126, 127),
-	(129, 127, 128),
-	(130, 128, 129),
-	(132, 6, 130),
-	(133, 130, 131),
-	(134, 131, 132),
-	(135, 132, 133),
-	(136, 133, 134),
-	(137, 134, 135),
-	(138, 135, 136),
-	(139, 137, 138),
-	(140, 138, 139),
-	(141, 139, 140),
-	(142, 140, 141),
-	(143, 141, 142),
-	(144, 142, 143),
-	(146, 144, 145),
-	(148, 146, 147),
-	(149, 147, 148),
-	(150, 148, 149),
-	(151, 149, 150),
-	(152, 150, 151),
-	(153, 151, 152),
-	(154, 152, 153),
-	(155, 153, 154),
-	(156, 154, 155),
-	(157, 155, 156),
-	(159, 157, 158),
-	(160, 158, 159),
-	(162, 160, 161),
-	(163, 161, 162),
-	(164, 162, 163),
-	(165, 163, 164),
-	(166, 164, 165),
-	(167, 165, 166),
-	(168, 166, 167),
-	(169, 167, 168),
-	(170, 168, 169),
-	(171, 169, 170),
-	(172, 170, 171),
-	(173, 171, 172),
-	(174, 172, 159),
-	(176, 173, 174),
-	(178, 175, 176),
-	(179, 176, 177),
-	(180, 177, 178),
-	(181, 178, 179),
-	(182, 179, 180),
-	(183, 181, 178),
-	(184, 178, 182),
-	(185, 179, 183),
-	(186, 183, 184),
-	(188, 151, 185),
-	(190, 186, 187),
-	(191, 188, 189),
-	(192, 189, 190),
-	(193, 190, 191),
-	(194, 191, 192),
-	(195, 192, 193),
-	(196, 193, 194),
-	(197, 194, 195),
-	(198, 196, 197),
-	(199, 197, 198),
-	(200, 198, 199),
-	(202, 200, 201),
-	(203, 201, 197),
-	(204, 197, 202),
-	(205, 202, 203),
-	(206, 203, 204),
-	(207, 204, 205),
-	(209, 204, 199),
-	(211, 206, 207),
-	(212, 207, 208),
-	(213, 207, 209),
-	(214, 210, 211),
-	(216, 212, 213),
-	(217, 213, 214),
-	(218, 214, 215),
-	(220, 216, 217),
-	(221, 217, 218),
-	(223, 219, 220),
-	(224, 220, 221),
-	(225, 221, 222),
-	(226, 222, 223),
-	(227, 223, 224),
-	(228, 224, 225),
-	(229, 225, 226),
-	(230, 226, 219),
-	(232, 213, 227),
-	(234, 228, 229),
-	(235, 229, 227),
-	(236, 227, 230),
-	(237, 230, 231),
-	(239, 232, 233),
-	(240, 233, 234),
-	(241, 234, 235),
-	(243, 236, 237),
-	(244, 237, 238),
-	(245, 238, 239),
-	(246, 239, 240),
-	(247, 240, 241),
-	(248, 241, 242),
-	(249, 242, 243),
-	(250, 243, 244),
-	(251, 244, 245),
-	(252, 245, 246),
-	(253, 246, 247),
-	(254, 247, 248),
-	(255, 248, 249),
-	(256, 249, 250),
-	(257, 250, 251),
-	(258, 251, 252),
-	(259, 252, 253),
-	(260, 253, 254),
-	(261, 254, 255),
-	(262, 255, 256),
-	(263, 256, 257),
-	(265, 237, 235),
-	(266, 235, 258),
-	(268, 259, 260),
-	(269, 260, 261),
-	(270, 262, 263),
-	(272, 259, 263),
-	(274, 263, 264),
-	(275, 264, 265),
-	(276, 265, 266),
-	(277, 266, 267),
-	(278, 267, 268),
-	(280, 265, 269),
-	(281, 269, 270),
-	(282, 270, 271),
-	(283, 269, 266),
-	(285, 272, 218),
-	(286, 218, 231),
-	(287, 231, 272),
-	(289, 273, 274),
-	(291, 275, 274),
-	(292, 274, 246),
-	(294, 276, 277),
-	(295, 278, 279),
-	(296, 279, 280),
-	(297, 280, 281),
-	(298, 281, 282),
-	(299, 282, 283),
-	(300, 283, 284),
-	(301, 284, 285),
-	(302, 285, 286),
-	(303, 286, 276),
-	(304, 276, 287),
-	(305, 288, 289),
-	(306, 289, 290),
-	(307, 290, 257),
-	(309, 291, 292),
-	(310, 292, 293),
-	(312, 294, 295),
-	(314, 296, 288),
-	(315, 288, 289),
-	(316, 289, 286),
-	(317, 286, 285),
-	(319, 297, 298),
-	(320, 299, 300),
-	(321, 300, 301),
-	(322, 302, 303),
-	(324, 304, 305),
-	(325, 77, 306),
-	(373, 347, 348),
-	(327, 3, 307),
-	(328, 307, 308),
-	(330, 309, 310),
-	(331, 310, 4),
-	(333, 311, 312),
-	(334, 312, 313),
-	(335, 313, 314),
-	(336, 314, 315),
-	(337, 316, 317),
-	(338, 317, 318),
-	(339, 318, 319),
-	(341, 320, 321),
-	(342, 321, 322),
-	(343, 322, 323),
-	(345, 322, 324),
-	(347, 38, 325),
-	(348, 325, 326),
-	(349, 326, 327),
-	(350, 327, 328),
-	(351, 328, 329),
-	(352, 329, 330),
-	(353, 330, 43),
-	(355, 115, 331),
-	(356, 332, 333),
-	(357, 333, 334),
-	(358, 334, 335),
-	(359, 335, 336),
-	(361, 335, 337),
-	(362, 337, 338),
-	(363, 338, 59),
-	(365, 339, 340),
-	(366, 340, 341),
-	(367, 341, 342),
-	(368, 342, 343),
-	(369, 343, 344),
-	(370, 344, 345),
-	(371, 345, 346),
-	(372, 346, 347),
-	(374, 348, 349),
-	(376, 346, 350),
-	(377, 350, 351),
-	(378, 351, 352),
-	(380, 353, 354),
-	(381, 354, 355),
-	(382, 355, 356),
-	(383, 356, 357),
-	(384, 357, 358),
-	(385, 358, 359),
-	(386, 359, 360),
-	(387, 360, 361),
-	(388, 361, 362),
-	(389, 362, 363),
-	(390, 363, 364),
-	(391, 364, 365),
-	(392, 365, 366),
-	(393, 366, 367),
-	(394, 367, 368),
-	(395, 368, 369),
-	(396, 369, 370),
-	(397, 370, 86),
-	(398, 86, 371),
-	(400, 354, 372),
-	(401, 372, 373),
-	(402, 373, 374),
-	(403, 374, 375),
-	(404, 375, 376),
-	(405, 376, 377),
-	(406, 377, 378),
-	(407, 378, 379),
-	(408, 379, 380),
-	(409, 380, 381),
-	(410, 381, 382),
-	(411, 382, 383),
-	(413, 55, 384),
-	(414, 384, 385),
-	(415, 385, 336),
-	(416, 336, 386),
-	(417, 386, 387),
-	(418, 385, 388),
-	(419, 388, 58),
-	(421, 389, 50),
-	(422, 50, 390),
-	(423, 390, 391),
-	(424, 391, 392),
-	(425, 392, 88),
-	(427, 36, 393),
-	(428, 393, 394),
-	(429, 394, 395),
-	(430, 395, 396),
-	(431, 396, 352),
-	(432, 352, 397),
-	(433, 397, 339),
-	(434, 339, 398),
-	(435, 398, 399),
-	(436, 399, 400),
-	(437, 400, 401),
-	(438, 401, 402),
-	(439, 402, 403),
-	(440, 403, 404),
-	(441, 404, 405),
-	(443, 406, 407),
-	(444, 407, 316),
-	(445, 316, 321),
-	(446, 321, 323),
-	(447, 323, 408),
-	(448, 408, 409),
-	(449, 409, 410),
-	(450, 410, 411),
-	(451, 411, 411),
-	(452, 411, 412),
-	(453, 412, 394),
-	(455, 413, 414),
-	(457, 415, 414),
-	(459, 416, 417),
-	(460, 417, 418),
-	(462, 419, 420),
-	(463, 420, 421),
-	(464, 421, 116),
-	(465, 116, 422),
-	(466, 422, 423),
-	(467, 423, 424),
-	(469, 417, 422),
-	(471, 425, 426),
-	(473, 124, 427),
-	(474, 427, 428),
-	(476, 425, 428),
-	(477, 428, 416),
-	(478, 416, 121),
-	(479, 121, 429),
-	(481, 430, 401),
-	(483, 431, 432),
-	(484, 432, 433),
-	(485, 433, 434),
-	(486, 434, 291),
-	(487, 291, 435),
-	(488, 435, 436),
-	(489, 436, 437),
-	(490, 437, 431),
-	(492, 129, 332),
-	(493, 332, 438),
-	(494, 438, 70),
-	(495, 70, 437),
-	(497, 429, 427),
-	(499, 418, 120),
-	(500, 120, 439),
-	(501, 439, 420),
-	(502, 420, 440),
-	(503, 440, 441),
-	(504, 441, 442),
-	(505, 442, 328),
-	(507, 327, 443),
-	(509, 444, 419),
-	(510, 419, 440),
-	(512, 445, 446),
-	(513, 446, 441),
-	(514, 441, 447),
-	(515, 447, 114),
-	(517, 442, 448),
-	(518, 448, 46),
-	(520, 443, 449),
-	(522, 449, 450),
-	(524, 450, 451),
-	(526, 451, 452),
-	(528, 452, 444),
-	(529, 444, 399),
-	(531, 76, 453),
-	(532, 441, 452),
-	(534, 454, 455),
-	(535, 455, 456),
-	(536, 456, 457),
-	(537, 457, 458),
-	(538, 458, 459),
-	(539, 459, 460),
-	(540, 460, 461),
-	(541, 461, 462),
-	(543, 463, 464),
-	(545, 465, 464),
-	(547, 463, 465),
-	(548, 465, 464),
-	(549, 464, 466),
-	(551, 467, 468),
-	(552, 468, 469),
-	(554, 470, 471),
-	(555, 471, 472),
-	(556, 472, 473),
-	(557, 473, 474),
-	(558, 474, 475),
-	(592, 90, 502),
-	(559, 475, 476),
-	(560, 477, 236),
-	(561, 236, 478),
-	(563, 479, 480),
-	(564, 480, 481),
-	(566, 482, 483),
-	(567, 483, 297),
-	(613, 484, 485),
-	(614, 485, 105),
-	(615, 105, 391),
-	(682, 486, 487),
-	(568, 297, 488),
-	(569, 145, 489),
-	(571, 270, 268),
-	(573, 490, 138),
-	(575, 140, 491),
-	(576, 491, 263),
-	(578, 492, 493),
-	(579, 493, 494),
-	(580, 494, 495),
-	(581, 349, 496),
-	(583, 497, 498),
-	(584, 498, 92),
-	(586, 494, 499),
-	(587, 499, 466),
-	(589, 500, 501),
-	(590, 501, 94),
-	(593, 502, 503),
-	(594, 503, 504),
-	(596, 366, 505),
-	(597, 505, 506),
-	(598, 506, 507),
-	(599, 507, 504),
-	(600, 504, 91),
-	(602, 508, 509),
-	(603, 509, 510),
-	(604, 510, 333),
-	(606, 511, 512),
-	(607, 512, 511),
-	(609, 511, 513),
-	(610, 513, 101),
-	(612, 75, 484),
-	(617, 466, 514),
-	(619, 463, 515),
-	(620, 515, 516),
-	(621, 516, 517),
-	(623, 518, 93),
-	(625, 519, 520),
-	(626, 520, 521),
-	(627, 521, 74),
-	(629, 522, 521),
-	(631, 523, 520),
-	(633, 524, 52),
-	(637, 57, 525),
-	(638, 525, 526),
-	(640, 56, 525),
-	(642, 527, 528),
-	(644, 527, 529),
-	(645, 529, 530),
-	(647, 524, 529),
-	(649, 59, 531),
-	(651, 532, 533),
-	(652, 533, 531),
-	(653, 531, 60),
-	(655, 533, 512),
-	(657, 511, 534),
-	(658, 534, 99),
-	(660, 535, 95),
-	(662, 536, 537),
-	(663, 537, 538),
-	(664, 538, 539),
-	(665, 539, 540),
-	(667, 53, 530),
-	(669, 45, 540),
-	(671, 541, 43),
-	(673, 329, 326),
-	(675, 96, 542),
-	(676, 542, 543),
-	(677, 543, 544),
-	(678, 544, 545),
-	(679, 545, 546),
-	(680, 546, 547),
-	(681, 547, 486),
-	(683, 487, 548),
-	(684, 548, 549),
-	(685, 549, 550),
-	(686, 550, 551),
-	(687, 551, 552),
-	(688, 552, 553),
-	(689, 553, 554),
-	(691, 555, 543),
-	(693, 556, 544),
-	(695, 557, 545),
-	(697, 558, 546),
-	(699, 559, 560),
-	(701, 561, 562),
-	(702, 562, 560),
-	(704, 563, 564),
-	(705, 564, 37),
-	(707, 565, 564),
-	(709, 566, 386),
-	(711, 423, 566),
-	(713, 567, 79),
-	(715, 568, 569),
-	(716, 569, 65),
-	(718, 67, 570),
-	(719, 570, 571),
-	(721, 459, 572),
-	(722, 572, 573),
-	(723, 573, 462),
-	(725, 574, 573),
-	(727, 575, 434),
-	(729, 576, 577),
-	(730, 577, 578),
-	(731, 578, 579),
-	(732, 579, 580),
-	(733, 580, 581),
-	(734, 581, 582),
-	(735, 582, 312),
-	(736, 312, 583),
-	(737, 583, 584),
-	(738, 584, 585),
-	(739, 585, 407),
-	(740, 407, 586),
-	(741, 586, 587),
-	(742, 587, 588),
-	(743, 588, 589),
-	(744, 589, 590),
-	(745, 590, 591),
-	(746, 591, 592),
-	(747, 592, 593),
-	(748, 593, 594),
-	(749, 594, 308),
-	(750, 308, 309),
-	(751, 309, 595),
-	(752, 595, 596),
-	(753, 596, 597),
-	(754, 597, 304),
-	(755, 304, 496),
-	(756, 496, 598),
-	(855, 599, 293),
-	(757, 598, 600),
-	(758, 600, 404),
-	(759, 404, 601),
-	(760, 601, 125),
-	(762, 602, 503),
-	(764, 603, 520),
-	(766, 604, 605),
-	(767, 605, 606),
-	(768, 606, 607),
-	(769, 607, 454),
-	(770, 454, 571),
-	(771, 571, 604),
-	(773, 606, 433),
-	(775, 608, 609),
-	(776, 609, 458),
-	(777, 458, 610),
-	(779, 611, 144),
-	(781, 612, 145),
-	(782, 145, 477),
-	(783, 477, 469),
-	(784, 469, 481),
-	(785, 481, 611),
-	(786, 611, 612),
-	(788, 613, 489),
-	(789, 489, 470),
-	(790, 470, 482),
-	(791, 482, 478),
-	(792, 478, 613),
-	(794, 614, 615),
-	(796, 616, 617),
-	(797, 617, 618),
-	(798, 618, 11),
-	(799, 11, 619),
-	(800, 619, 620),
-	(801, 620, 621),
-	(802, 621, 622),
-	(803, 622, 413),
-	(805, 623, 624),
-	(807, 623, 625),
-	(809, 626, 627),
-	(810, 627, 624),
-	(811, 624, 628),
-	(813, 629, 630),
-	(814, 630, 173),
-	(816, 623, 631),
-	(817, 631, 632),
-	(818, 632, 633),
-	(819, 633, 634),
-	(820, 635, 636),
-	(822, 626, 635),
-	(824, 637, 3),
-	(825, 3, 638),
-	(826, 638, 639),
-	(828, 627, 640),
-	(830, 639, 633),
-	(832, 641, 642),
-	(833, 642, 643),
-	(835, 2, 637),
-	(837, 644, 645),
-	(838, 645, 639),
-	(839, 639, 641),
-	(841, 646, 647),
-	(842, 647, 132),
-	(844, 131, 648),
-	(846, 649, 650),
-	(847, 650, 651),
-	(848, 651, 652),
-	(849, 652, 616),
-	(851, 649, 653),
-	(852, 653, 6),
-	(854, 653, 599),
-	(856, 293, 654),
-	(857, 654, 655),
-	(858, 655, 656),
-	(859, 656, 657),
-	(860, 657, 156),
-	(862, 155, 658),
-	(863, 658, 659),
-	(864, 659, 660),
-	(866, 656, 661),
-	(867, 661, 662),
-	(868, 662, 617),
-	(870, 663, 658),
-	(871, 658, 664),
-	(872, 664, 652),
-	(874, 153, 663),
-	(876, 158, 154),
-	(878, 31, 13),
-	(880, 14, 665),
-	(882, 666, 621),
-	(884, 667, 666),
-	(886, 29, 667),
-	(888, 668, 5),
-	(890, 152, 659),
-	(892, 669, 670),
-	(893, 670, 671),
-	(894, 672, 233),
-	(896, 670, 245),
-	(898, 673, 674),
-	(899, 674, 675),
-	(901, 676, 273),
-	(982, 734, 735),
-	(902, 273, 238),
-	(904, 240, 673),
-	(905, 673, 675),
-	(906, 675, 677),
-	(907, 217, 678),
-	(952, 633, 679),
-	(908, 678, 680),
-	(909, 680, 681),
-	(910, 681, 682),
-	(911, 682, 683),
-	(912, 683, 684),
-	(913, 685, 686),
-	(914, 686, 687),
-	(915, 687, 688),
-	(916, 688, 689),
-	(917, 689, 690),
-	(918, 690, 691),
-	(919, 691, 692),
-	(920, 692, 693),
-	(921, 693, 694),
-	(923, 230, 695),
-	(924, 645, 696),
-	(925, 214, 697),
-	(926, 698, 699),
-	(927, 700, 701),
-	(929, 300, 702),
-	(931, 703, 704),
-	(933, 705, 565),
-	(934, 565, 706),
-	(935, 706, 306),
-	(937, 707, 678),
-	(939, 708, 709),
-	(940, 709, 710),
-	(941, 710, 711),
-	(942, 711, 712),
-	(1025, 773, 774),
-	(943, 712, 713),
-	(944, 713, 714),
-	(945, 714, 715),
-	(947, 716, 698),
-	(948, 698, 717),
-	(949, 313, 718),
-	(950, 718, 706),
-	(953, 679, 719),
-	(954, 719, 720),
-	(955, 720, 721),
-	(956, 721, 722),
-	(958, 723, 724),
-	(959, 724, 725),
-	(960, 725, 726),
-	(962, 727, 703),
-	(963, 703, 679),
-	(964, 679, 722),
-	(966, 483, 728),
-	(967, 621, 729),
-	(968, 729, 15),
-	(970, 730, 731),
-	(971, 731, 732),
-	(972, 622, 733),
-	(973, 734, 735),
-	(974, 735, 736),
-	(975, 736, 737),
-	(976, 737, 731),
-	(978, 730, 738),
-	(979, 738, 739),
-	(980, 739, 740),
-	(981, 740, 734),
-	(984, 741, 738),
-	(986, 742, 743),
-	(987, 743, 744),
-	(988, 744, 745),
-	(989, 745, 143),
-	(991, 746, 747),
-	(992, 747, 748),
-	(993, 748, 749),
-	(994, 749, 260),
-	(996, 750, 751),
-	(997, 751, 752),
-	(999, 725, 743),
-	(1000, 743, 753),
-	(1001, 754, 755),
-	(1002, 755, 756),
-	(1003, 756, 757),
-	(1004, 757, 758),
-	(1006, 759, 760),
-	(1007, 760, 761),
-	(1008, 761, 762),
-	(1010, 763, 758),
-	(1011, 758, 762),
-	(1012, 762, 764),
-	(1013, 764, 141),
-	(1015, 765, 766),
-	(1017, 767, 768),
-	(1018, 768, 769),
-	(1019, 769, 770),
-	(1020, 770, 142),
-	(1022, 771, 757),
-	(1024, 772, 773),
-	(1027, 744, 767),
-	(1028, 767, 763),
-	(1029, 763, 771),
-	(1030, 771, 765),
-	(1032, 775, 750),
-	(1033, 750, 776),
-	(1035, 724, 777),
-	(1036, 778, 779),
-	(1037, 779, 780),
-	(1039, 769, 781),
-	(1040, 779, 775),
-	(1041, 775, 782),
-	(1042, 783, 751),
-	(1044, 756, 784),
-	(1045, 755, 785),
-	(1046, 749, 786),
-	(1047, 786, 787),
-	(1049, 768, 745),
-	(1051, 770, 760),
-	(1052, 760, 788),
-	(1053, 788, 789),
-	(1055, 762, 790),
-	(1056, 790, 746),
-	(1057, 746, 263),
-	(1059, 748, 787),
-	(1060, 787, 776),
-	(1061, 776, 780),
-	(1062, 780, 754),
-	(1063, 754, 747),
-	(1065, 290, 791),
-	(1066, 674, 792),
-	(1067, 139, 793),
-	(1069, 794, 795),
-	(1111, 817, 830),
-	(1070, 795, 796),
-	(1071, 796, 737),
-	(1073, 789, 761),
-	(1075, 797, 798),
-	(1076, 264, 799),
-	(1077, 773, 800),
-	(1078, 801, 802),
-	(1079, 795, 803),
-	(1080, 804, 805),
-	(1081, 719, 806),
-	(1082, 720, 807),
-	(1083, 721, 808),
-	(1084, 808, 704),
-	(1086, 809, 808),
-	(1088, 810, 150),
-	(1090, 165, 811),
-	(1091, 811, 812),
-	(1092, 812, 813),
-	(1093, 814, 815),
-	(1094, 816, 817),
-	(1096, 818, 819),
-	(1097, 819, 820),
-	(1099, 821, 822),
-	(1101, 823, 824),
-	(1103, 825, 819),
-	(1105, 826, 827),
-	(1106, 811, 168),
-	(1108, 828, 30),
-	(1110, 829, 817),
-	(1112, 831, 828),
-	(1114, 177, 176),
-	(1116, 793, 797),
-	(1117, 797, 793),
-	(1121, 832, 528),
-	(1122, 528, 526),
-	(1123, 526, 54),
-	(1125, 833, 821),
-	(1126, 821, 822),
-	(1127, 822, 833),
-	(1129, 834, 823),
-	(1130, 823, 835),
-	(1131, 835, 834),
-	(1133, 383, 836),
-	(1134, 836, 837),
-	(1135, 837, 561),
-	(1136, 561, 554),
-	(1137, 554, 383),
-	(1139, 295, 838),
-	(1141, 299, 716),
-	(1142, 716, 623),
-	(1144, 295, 839),
-	(1456, 840, 841),
-	(1146, 625, 636),
-	(1147, 636, 668),
-	(1149, 842, 825),
-	(1150, 825, 820),
-	(1151, 820, 843),
-	(1152, 843, 844),
-	(1153, 844, 816),
-	(1237, 878, 646),
-	(1154, 816, 845),
-	(1155, 845, 846),
-	(1156, 846, 629),
-	(1157, 629, 847),
-	(1158, 847, 848),
-	(1159, 848, 849),
-	(1160, 849, 850),
-	(1161, 850, 628),
-	(1162, 628, 851),
-	(1163, 839, 847),
-	(1165, 838, 173),
-	(1167, 852, 853),
-	(1168, 853, 854),
-	(1169, 855, 415),
-	(1171, 796, 856),
-	(1172, 856, 857),
-	(1173, 857, 737),
-	(1175, 736, 857),
-	(1176, 857, 856),
-	(1178, 620, 858),
-	(1179, 858, 665),
-	(1180, 665, 12),
-	(1181, 12, 32),
-	(1182, 32, 859),
-	(1183, 859, 660),
-	(1184, 660, 664),
-	(1185, 664, 657),
-	(1186, 657, 157),
-	(1187, 157, 860),
-	(1188, 860, 861),
-	(1189, 861, 646),
-	(1190, 646, 648),
-	(1191, 648, 862),
-	(1192, 862, 294),
-	(1194, 863, 855),
-	(1195, 855, 413),
-	(1197, 413, 415),
-	(1198, 415, 863),
-	(1200, 144, 801),
-	(1201, 801, 766),
-	(1202, 766, 864),
-	(1203, 864, 752),
-	(1204, 752, 865),
-	(1205, 865, 866),
-	(1206, 866, 867),
-	(1260, 493, 868),
-	(1262, 869, 185),
-	(1263, 185, 826),
-	(1207, 867, 870),
-	(1208, 788, 871),
-	(1209, 764, 872),
-	(1210, 873, 874),
-	(1212, 790, 491),
-	(1213, 491, 267),
-	(1215, 875, 750),
-	(1217, 786, 874),
-	(1218, 874, 875),
-	(1219, 875, 876),
-	(1220, 876, 866),
-	(1222, 865, 876),
-	(1223, 876, 873),
-	(1224, 873, 867),
-	(1226, 618, 859),
-	(1228, 868, 730),
-	(1230, 730, 619),
-	(1231, 619, 858),
-	(1233, 835, 877),
-	(1234, 29, 828),
-	(1236, 647, 878),
-	(1239, 599, 435),
-	(1241, 860, 651),
-	(1242, 651, 879),
-	(1243, 879, 599),
-	(1245, 880, 881),
-	(1246, 514, 517),
-	(1247, 517, 462),
-	(1249, 861, 650),
-	(1250, 650, 879),
-	(1251, 879, 293),
-	(1253, 730, 742),
-	(1254, 742, 726),
-	(1256, 868, 492),
-	(1257, 492, 514),
-	(1259, 514, 493),
-	(1264, 826, 882),
-	(1265, 882, 883),
-	(1266, 878, 880),
-	(1268, 499, 884),
-	(1269, 884, 885),
-	(1270, 885, 460),
-	(1272, 516, 460),
-	(1274, 743, 886),
-	(1275, 729, 887),
-	(1276, 739, 740),
-	(1278, 515, 888),
-	(1279, 432, 605),
-	(1281, 577, 774),
-	(1283, 889, 890),
-	(1284, 890, 891),
-	(1285, 891, 892),
-	(1286, 892, 562),
-	(1287, 562, 893),
-	(1288, 378, 894),
-	(1289, 837, 892),
-	(1291, 836, 891),
-	(1293, 890, 895),
-	(1295, 489, 576),
-	(1297, 896, 470),
-	(1299, 502, 505),
-	(1301, 470, 472),
-	(1303, 506, 889),
-	(1304, 889, 895),
-	(1305, 895, 382),
-	(1307, 480, 804),
-	(1308, 804, 897),
-	(1309, 258, 478),
-	(1311, 482, 258),
-	(1313, 864, 778),
-	(1314, 778, 765),
-	(1539, 898, 899),
-	(1316, 900, 901),
-	(1317, 902, 903),
-	(1318, 248, 904),
-	(1319, 234, 905),
-	(1320, 174, 303),
-	(1321, 303, 814),
-	(1322, 814, 175),
-	(1323, 175, 906),
-	(1325, 846, 907),
-	(1326, 845, 133),
-	(1328, 906, 908),
-	(1329, 843, 183),
-	(1330, 183, 829),
-	(1332, 130, 909),
-	(1334, 829, 184),
-	(1335, 184, 844),
-	(1337, 850, 849),
-	(1339, 910, 911),
-	(1341, 912, 906),
-	(1343, 911, 913),
-	(1345, 174, 914),
-	(1347, 911, 848),
-	(1349, 630, 302),
-	(1351, 862, 909),
-	(1352, 909, 131),
-	(1354, 299, 910),
-	(1355, 910, 913),
-	(1356, 913, 914),
-	(1357, 914, 173),
-	(1359, 615, 632),
-	(1361, 812, 133),
-	(1363, 643, 615),
-	(1365, 638, 631),
-	(1366, 631, 915),
-	(1368, 643, 916),
-	(1370, 702, 916),
-	(1372, 916, 702),
-	(1374, 915, 642),
-	(1376, 917, 583),
-	(1377, 583, 853),
-	(1378, 853, 314),
-	(1379, 314, 918),
-	(1380, 918, 919),
-	(1381, 919, 33),
-	(1383, 397, 920),
-	(1384, 920, 341),
-	(1386, 921, 922),
-	(1387, 922, 923),
-	(1388, 923, 350),
-	(1390, 922, 924),
-	(1391, 924, 396),
-	(1393, 925, 921),
-	(1394, 921, 926),
-	(1395, 926, 927),
-	(1397, 928, 929),
-	(1455, 947, 840),
-	(1398, 929, 930),
-	(1399, 930, 923),
-	(1401, 930, 931),
-	(1402, 929, 347),
-	(1404, 932, 933),
-	(1405, 933, 926),
-	(1407, 409, 934),
-	(1408, 934, 935),
-	(1410, 936, 928),
-	(1411, 928, 932),
-	(1413, 932, 927),
-	(1414, 927, 937),
-	(1416, 937, 938),
-	(1418, 939, 935),
-	(1419, 935, 940),
-	(1420, 940, 938),
-	(1422, 348, 936),
-	(1424, 933, 921),
-	(1426, 510, 941),
-	(1427, 941, 942),
-	(1429, 941, 509),
-	(1431, 943, 852),
-	(1432, 852, 944),
-	(1433, 944, 584),
-	(1434, 584, 945),
-	(1435, 945, 946),
-	(1439, 947, 948),
-	(1440, 948, 39),
-	(1442, 949, 948),
-	(1443, 948, 40),
-	(1445, 841, 72),
-	(1447, 840, 72),
-	(1449, 950, 71),
-	(1451, 951, 952),
-	(1453, 953, 950),
-	(1454, 950, 947),
-	(1457, 841, 954),
-	(1458, 955, 956),
-	(1459, 956, 402),
-	(1461, 957, 958),
-	(1463, 958, 400),
-	(1465, 957, 959),
-	(1466, 959, 121),
-	(1468, 960, 952),
-	(1470, 335, 961),
-	(1471, 962, 87),
-	(1473, 963, 368),
-	(1475, 559, 553),
-	(1476, 553, 964),
-	(1477, 381, 552),
-	(1479, 552, 965),
-	(1481, 551, 966),
-	(1482, 966, 967),
-	(1483, 967, 968),
-	(1484, 968, 380),
-	(1486, 551, 969),
-	(1541, 898, 970),
-	(1487, 969, 486),
-	(1489, 969, 487),
-	(1491, 559, 971),
-	(1492, 966, 965),
-	(1494, 972, 967),
-	(1495, 967, 973),
-	(1496, 973, 974),
-	(1497, 974, 550),
-	(1499, 974, 973),
-	(1500, 973, 968),
-	(1502, 549, 975),
-	(1503, 975, 378),
-	(1505, 548, 976),
-	(1506, 975, 977),
-	(1507, 978, 379),
-	(1509, 507, 979),
-	(1510, 542, 980),
-	(1511, 981, 982),
-	(1513, 112, 983),
-	(1514, 984, 985),
-	(1515, 985, 398),
-	(1517, 940, 411),
-	(1518, 411, 411),
-	(1520, 986, 587),
-	(1521, 587, 987),
-	(1523, 885, 988),
-	(1524, 989, 990),
-	(1525, 990, 991),
-	(1526, 990, 992),
-	(1527, 990, 993),
-	(1528, 994, 990),
-	(1530, 990, 995),
-	(1531, 996, 709),
-	(1532, 709, 997),
-	(1533, 998, 898),
-	(1534, 898, 899),
-	(1535, 899, 970),
-	(1536, 970, 999),
-	(1537, 999, 898),
-	(1543, 898, 999),
-	(1545, 334, 1000),
-	(1546, 69, 1001),
-	(1547, 1001, 1002),
-	(1548, 1003, 1004),
-	(1550, 1005, 1006),
-	(1552, 337, 1007),
-	(1553, 69, 1008),
-	(1554, 570, 1009),
-	(1555, 1009, 1010),
-	(1556, 1011, 1012),
-	(1557, 884, 772),
-	(1559, 1013, 1014),
-	(1613, 508, 129),
-	(1560, 1014, 1015),
-	(1562, 1016, 1014),
-	(1564, 1017, 1018),
-	(1565, 581, 1019),
-	(1566, 582, 1020),
-	(1567, 78, 1021),
-	(1568, 536, 1022),
-	(1569, 1022, 73),
-	(1571, 44, 539),
-	(1573, 537, 1023),
-	(1574, 538, 1024),
-	(1575, 317, 1025),
-	(1576, 317, 1026),
-	(1577, 319, 1027),
-	(1578, 318, 944),
-	(1580, 718, 1028),
-	(1581, 126, 1029),
-	(1582, 1029, 1030),
-	(1583, 1030, 405),
-	(1584, 405, 1031),
-	(1585, 1031, 1032),
-	(1586, 1032, 1033),
-	(1588, 403, 430),
-	(1589, 430, 1034),
-	(1590, 1034, 123),
-	(1592, 1032, 1035),
-	(1593, 1035, 1036),
-	(1595, 1035, 1037),
-	(1597, 1038, 405),
-	(1599, 1039, 1030),
-	(1601, 598, 1040),
-	(1602, 1036, 1041),
-	(1604, 1042, 1043),
-	(1606, 1042, 1044),
-	(1607, 1043, 1045),
-	(1608, 1046, 1047),
-	(1610, 1046, 1048),
-	(1611, 1047, 1049),
-	(1612, 128, 508),
-	(1615, 127, 426),
-	(1617, 215, 222),
-	(1619, 223, 707),
-	(1621, 707, 224),
-	(1623, 224, 216),
-	(1625, 216, 225),
-	(1627, 226, 211),
-	(1629, 211, 220),
-	(1631, 215, 221),
-	(1633, 640, 644),
-	(1635, 49, 390),
-	(1636, 390, 1050),
-	(1637, 1050, 1051),
-	(1638, 438, 1001),
-	(1639, 1001, 569),
-	(1640, 569, 104),
-	(1641, 104, 1052),
-	(1642, 1052, 338),
-	(1643, 338, 388),
-	(1644, 388, 384),
-	(1645, 384, 982),
-	(1646, 982, 1053),
-	(1647, 1053, 389),
-	(1648, 389, 107),
-	(1649, 107, 1054),
-	(1650, 1054, 448),
-	(1651, 448, 330),
-	(1652, 330, 325),
-	(1653, 325, 393),
-	(1654, 393, 1055),
-	(1655, 1055, 943),
-	(1657, 436, 1056),
-	(1658, 1056, 1029),
-	(1659, 1029, 601),
-	(1660, 601, 1057),
-	(1661, 1057, 1034),
-	(1662, 1034, 959),
-	(1663, 959, 439),
-	(1664, 439, 421),
-	(1665, 421, 447),
-	(1666, 447, 446),
-	(1667, 446, 1054),
-	(1668, 1054, 47),
-	(1669, 47, 485),
-	(1671, 604, 1009),
-	(1672, 1009, 68),
-	(1674, 1031, 600),
-	(1675, 600, 956),
-	(1676, 956, 985),
-	(1677, 985, 340),
-	(1678, 340, 920),
-	(1679, 920, 351),
-	(1680, 351, 924),
-	(1681, 924, 1058),
-	(1682, 1058, 412),
-	(1683, 412, 1055),
-	(1684, 1055, 35),
-	(1686, 1059, 579),
-	(1687, 579, 1060),
-	(1688, 1060, 81),
-	(1690, 82, 1061),
-	(1691, 1061, 1062),
-	(1692, 1062, 484),
-	(1693, 484, 1022),
-	(1694, 1022, 42),
-	(1696, 392, 371),
-	(1697, 371, 1063),
-	(1698, 1063, 1061),
-	(1699, 1061, 80),
-	(1700, 80, 580),
-	(1701, 580, 1064),
-	(1703, 89, 1065),
-	(1704, 1065, 51),
-	(1705, 51, 1053),
-	(1707, 1052, 61),
-	(1708, 61, 513),
-	(1709, 513, 534),
-	(1710, 534, 501),
-	(1711, 501, 498),
-	(1712, 498, 1065),
-	(1713, 1065, 392),
-	(1715, 461, 572),
-	(1716, 572, 610),
-	(1717, 610, 1066),
-	(1718, 1066, 1067),
-	(1719, 1067, 1068),
-	(1720, 1068, 607),
-	(1722, 711, 1069),
-	(1723, 1069, 1070),
-	(1724, 1070, 701),
-	(1725, 701, 1071),
-	(1726, 1071, 694),
-	(1727, 694, 609),
-	(1728, 609, 1072),
-	(1729, 1072, 456),
-	(1730, 456, 1067),
-	(1772, 1073, 946),
-	(1732, 715, 1074),
-	(1733, 1074, 1075),
-	(1734, 1075, 1076),
-	(1735, 1076, 710),
-	(1737, 1068, 455),
-	(1738, 455, 1077),
-	(1739, 1077, 608),
-	(1740, 608, 693),
-	(1741, 693, 1078),
-	(1742, 1078, 712),
-	(1743, 712, 1076),
-	(1744, 1076, 1079),
-	(1745, 1079, 1080),
-	(1746, 1080, 1081),
-	(1747, 1081, 1082),
-	(1748, 1066, 457),
-	(1749, 457, 1072),
-	(1750, 1072, 1077),
-	(1752, 1083, 1075),
-	(1753, 1075, 713),
-	(1755, 714, 1074),
-	(1756, 1074, 1084),
-	(1757, 1071, 1078),
-	(1759, 1078, 1070),
-	(1760, 1070, 700),
-	(1762, 1033, 1085),
-	(1763, 1085, 310),
-	(1764, 310, 307),
-	(1765, 307, 1086),
-	(1766, 1086, 1087),
-	(1767, 1087, 986),
-	(1768, 986, 1088),
-	(1769, 1088, 1089),
-	(1770, 1089, 406),
-	(1771, 406, 1073),
-	(1773, 946, 917),
-	(1774, 917, 1090),
-	(1775, 1090, 1091),
-	(1776, 1091, 1092),
-	(1777, 1092, 1093),
-	(1778, 1093, 1094),
-	(1779, 1094, 1064),
-	(1780, 1064, 1059),
-	(1781, 1059, 1095),
-	(1782, 1095, 1096),
-	(1783, 1096, 896),
-	(1785, 395, 1058),
-	(1786, 1058, 1097),
-	(1787, 1097, 934),
-	(1788, 934, 1098),
-	(1789, 1098, 1099),
-	(1790, 1099, 320),
-	(1791, 320, 586),
-	(1792, 586, 1089),
-	(1794, 987, 588),
-	(1795, 588, 1087),
-	(1797, 1063, 85),
-	(1798, 85, 1100),
-	(1799, 1100, 353),
-	(1801, 1050, 106),
-	(1803, 1062, 1101),
-	(1804, 370, 1100),
-	(1805, 1100, 1102),
-	(1807, 1102, 1103);
-
-create table e03.calles(
-	gido integer,
-	salida integer,
-	destino integer
-);
- 
-insert into e03.calles values 
-	(1, 1, 2),
-	(2, 2, 3),
-	(3, 3, 4),
-	(4, 4, 5),
-	(5, 5, 6),
-	(7, 7, 8),
-	(8, 9, 10),
-	(9, 11, 12),
-	(10, 12, 13),
-	(11, 13, 14),
-	(12, 14, 15),
-	(13, 15, 16),
-	(15, 17, 18),
-	(16, 18, 19),
-	(17, 19, 20),
-	(18, 20, 21),
-	(19, 21, 22),
-	(20, 22, 23),
-	(21, 23, 24),
-	(22, 24, 25),
-	(23, 25, 26),
-	(24, 26, 27),
-	(25, 27, 28),
-	(26, 28, 29),
-	(27, 29, 30),
-	(28, 30, 31),
-	(29, 31, 32),
-	(31, 33, 34),
-	(32, 34, 35),
-	(33, 35, 36),
-	(34, 36, 37),
-	(35, 37, 38),
-	(36, 38, 39),
-	(37, 39, 40),
-	(38, 40, 41),
-	(39, 41, 42),
-	(40, 42, 43),
-	(41, 43, 44),
-	(42, 44, 45),
-	(43, 45, 46),
-	(44, 46, 47),
-	(45, 47, 48),
-	(46, 48, 49),
-	(47, 49, 50),
-	(48, 50, 51),
-	(49, 51, 52),
-	(50, 52, 53),
-	(51, 53, 54),
-	(52, 54, 55),
-	(53, 55, 56),
-	(54, 56, 57),
-	(55, 57, 58),
-	(56, 58, 59),
-	(57, 59, 60),
-	(58, 60, 61),
-	(59, 61, 62),
-	(60, 62, 63),
-	(61, 63, 64),
-	(62, 64, 65),
-	(63, 65, 66),
-	(64, 66, 67),
-	(65, 67, 68),
-	(66, 68, 69),
-	(67, 69, 70),
-	(69, 41, 71),
-	(70, 71, 72),
-	(71, 72, 73),
-	(72, 73, 74),
-	(73, 74, 75),
-	(74, 75, 76),
-	(75, 76, 77),
-	(76, 77, 78),
-	(77, 78, 79),
-	(78, 79, 80),
-	(79, 80, 81),
-	(80, 81, 82),
-	(81, 82, 83),
-	(82, 83, 84),
-	(83, 84, 85),
-	(84, 85, 86),
-	(85, 86, 87),
-	(86, 87, 88),
-	(87, 88, 89),
-	(88, 89, 90),
-	(89, 90, 91),
-	(90, 91, 92),
-	(91, 92, 93),
-	(92, 93, 94),
-	(93, 94, 95),
-	(94, 95, 96),
-	(95, 96, 97),
-	(96, 97, 98),
-	(97, 98, 99),
-	(98, 99, 100),
-	(99, 100, 101),
-	(100, 101, 102),
-	(101, 102, 103),
-	(102, 103, 62),
-	(103, 62, 104),
-	(105, 105, 106),
-	(106, 106, 48),
-	(107, 48, 107),
-	(108, 107, 108),
-	(109, 108, 109),
-	(110, 109, 110),
-	(111, 110, 111),
-	(112, 111, 112),
-	(113, 112, 113),
-	(114, 113, 114),
-	(115, 114, 115),
-	(116, 115, 116),
-	(117, 116, 117),
-	(118, 117, 118),
-	(119, 118, 119),
-	(120, 119, 120),
-	(121, 120, 121),
-	(122, 121, 122),
-	(124, 122, 123),
-	(125, 123, 124),
-	(126, 124, 125),
-	(127, 125, 126),
-	(128, 126, 127),
-	(129, 127, 128),
-	(130, 128, 129),
-	(132, 6, 130),
-	(133, 130, 131),
-	(134, 131, 132),
-	(135, 132, 133),
-	(136, 133, 134),
-	(137, 134, 135),
-	(138, 135, 136),
-	(139, 137, 138),
-	(140, 138, 139),
-	(141, 139, 140),
-	(142, 140, 141),
-	(143, 141, 142),
-	(144, 142, 143),
-	(146, 144, 145),
-	(148, 146, 147),
-	(149, 147, 148),
-	(150, 148, 149),
-	(151, 149, 150),
-	(152, 150, 151),
-	(153, 151, 152),
-	(154, 152, 153),
-	(155, 153, 154),
-	(156, 154, 155),
-	(157, 155, 156),
-	(159, 157, 158),
-	(160, 158, 159),
-	(162, 160, 161),
-	(163, 161, 162),
-	(164, 162, 163),
-	(165, 163, 164),
-	(166, 164, 165),
-	(167, 165, 166),
-	(168, 166, 167),
-	(169, 167, 168),
-	(170, 168, 169),
-	(171, 169, 170),
-	(172, 170, 171),
-	(173, 171, 172),
-	(174, 172, 159),
-	(176, 173, 174),
-	(178, 175, 176),
-	(179, 176, 177),
-	(180, 177, 178),
-	(181, 178, 179),
-	(182, 179, 180),
-	(183, 181, 178),
-	(184, 178, 182),
-	(185, 179, 183),
-	(186, 183, 184),
-	(188, 151, 185),
-	(190, 186, 187),
-	(191, 188, 189),
-	(192, 189, 190),
-	(193, 190, 191),
-	(194, 191, 192),
-	(195, 192, 193),
-	(196, 193, 194),
-	(197, 194, 195),
-	(198, 196, 197),
-	(199, 197, 198),
-	(200, 198, 199),
-	(202, 200, 201),
-	(203, 201, 197),
-	(204, 197, 202),
-	(205, 202, 203),
-	(206, 203, 204),
-	(207, 204, 205),
-	(209, 204, 199),
-	(211, 206, 207),
-	(212, 207, 208),
-	(213, 207, 209),
-	(214, 210, 211),
-	(216, 212, 213),
-	(217, 213, 214),
-	(218, 214, 215),
-	(220, 216, 217),
-	(221, 217, 218),
-	(223, 219, 220),
-	(224, 220, 221),
-	(225, 221, 222),
-	(226, 222, 223),
-	(227, 223, 224),
-	(228, 224, 225),
-	(229, 225, 226),
-	(230, 226, 219),
-	(232, 213, 227),
-	(234, 228, 229),
-	(235, 229, 227),
-	(236, 227, 230),
-	(237, 230, 231),
-	(239, 232, 233),
-	(240, 233, 234),
-	(241, 234, 235),
-	(243, 236, 237),
-	(244, 237, 238),
-	(245, 238, 239),
-	(246, 239, 240),
-	(247, 240, 241),
-	(248, 241, 242),
-	(249, 242, 243),
-	(250, 243, 244),
-	(251, 244, 245),
-	(252, 245, 246),
-	(253, 246, 247),
-	(254, 247, 248),
-	(255, 248, 249),
-	(256, 249, 250),
-	(257, 250, 251),
-	(258, 251, 252),
-	(259, 252, 253),
-	(260, 253, 254),
-	(261, 254, 255),
-	(262, 255, 256),
-	(263, 256, 257),
-	(265, 237, 235),
-	(266, 235, 258),
-	(268, 259, 260),
-	(269, 260, 261),
-	(270, 262, 263),
-	(272, 259, 263),
-	(274, 263, 264),
-	(275, 264, 265),
-	(276, 265, 266),
-	(277, 266, 267),
-	(278, 267, 268),
-	(280, 265, 269),
-	(281, 269, 270),
-	(282, 270, 271),
-	(283, 269, 266),
-	(285, 272, 218),
-	(286, 218, 231),
-	(287, 231, 272),
-	(289, 273, 274),
-	(291, 275, 274),
-	(292, 274, 246),
-	(294, 276, 277),
-	(295, 278, 279),
-	(296, 279, 280),
-	(297, 280, 281),
-	(298, 281, 282),
-	(299, 282, 283),
-	(300, 283, 284),
-	(301, 284, 285),
-	(302, 285, 286),
-	(303, 286, 276),
-	(304, 276, 287),
-	(305, 288, 289),
-	(306, 289, 290),
-	(307, 290, 257),
-	(309, 291, 292),
-	(310, 292, 293),
-	(312, 294, 295),
-	(314, 296, 288),
-	(315, 288, 289),
-	(316, 289, 286),
-	(317, 286, 285),
-	(319, 297, 298),
-	(320, 299, 300),
-	(321, 300, 301),
-	(322, 302, 303),
-	(324, 304, 305),
-	(325, 77, 306),
-	(373, 347, 348),
-	(327, 3, 307),
-	(328, 307, 308),
-	(330, 309, 310),
-	(331, 310, 4),
-	(333, 311, 312),
-	(334, 312, 313),
-	(335, 313, 314),
-	(336, 314, 315),
-	(337, 316, 317),
-	(338, 317, 318),
-	(339, 318, 319),
-	(341, 320, 321),
-	(342, 321, 322),
-	(343, 322, 323),
-	(345, 322, 324),
-	(347, 38, 325),
-	(348, 325, 326),
-	(349, 326, 327),
-	(350, 327, 328),
-	(351, 328, 329),
-	(352, 329, 330),
-	(353, 330, 43),
-	(355, 115, 331),
-	(356, 332, 333),
-	(357, 333, 334),
-	(358, 334, 335),
-	(359, 335, 336),
-	(361, 335, 337),
-	(362, 337, 338),
-	(363, 338, 59),
-	(365, 339, 340),
-	(366, 340, 341),
-	(367, 341, 342),
-	(368, 342, 343),
-	(369, 343, 344),
-	(370, 344, 345),
-	(371, 345, 346),
-	(372, 346, 347),
-	(374, 348, 349),
-	(376, 346, 350),
-	(377, 350, 351),
-	(378, 351, 352),
-	(380, 353, 354),
-	(381, 354, 355),
-	(382, 355, 356),
-	(383, 356, 357),
-	(384, 357, 358),
-	(385, 358, 359),
-	(386, 359, 360),
-	(387, 360, 361),
-	(388, 361, 362),
-	(389, 362, 363),
-	(390, 363, 364),
-	(391, 364, 365),
-	(392, 365, 366),
-	(393, 366, 367),
-	(394, 367, 368),
-	(395, 368, 369),
-	(396, 369, 370),
-	(397, 370, 86),
-	(398, 86, 371),
-	(400, 354, 372),
-	(401, 372, 373),
-	(402, 373, 374),
-	(403, 374, 375),
-	(404, 375, 376),
-	(405, 376, 377),
-	(406, 377, 378),
-	(407, 378, 379),
-	(408, 379, 380),
-	(409, 380, 381),
-	(410, 381, 382),
-	(411, 382, 383),
-	(413, 55, 384),
-	(414, 384, 385),
-	(415, 385, 336),
-	(416, 336, 386),
-	(417, 386, 387),
-	(418, 385, 388),
-	(419, 388, 58),
-	(421, 389, 50),
-	(422, 50, 390),
-	(423, 390, 391),
-	(424, 391, 392),
-	(425, 392, 88),
-	(427, 36, 393),
-	(428, 393, 394),
-	(429, 394, 395),
-	(430, 395, 396),
-	(431, 396, 352),
-	(432, 352, 397),
-	(433, 397, 339),
-	(434, 339, 398),
-	(435, 398, 399),
-	(436, 399, 400),
-	(437, 400, 401),
-	(438, 401, 402),
-	(439, 402, 403),
-	(440, 403, 404),
-	(441, 404, 405),
-	(443, 406, 407),
-	(444, 407, 316),
-	(445, 316, 321),
-	(446, 321, 323),
-	(447, 323, 408),
-	(448, 408, 409),
-	(449, 409, 410),
-	(450, 410, 411),
-	(451, 411, 411),
-	(452, 411, 412),
-	(453, 412, 394),
-	(455, 413, 414),
-	(457, 415, 414),
-	(459, 416, 417),
-	(460, 417, 418),
-	(462, 419, 420),
-	(463, 420, 421),
-	(464, 421, 116),
-	(465, 116, 422),
-	(466, 422, 423),
-	(467, 423, 424),
-	(469, 417, 422),
-	(471, 425, 426),
-	(473, 124, 427),
-	(474, 427, 428),
-	(476, 425, 428),
-	(477, 428, 416),
-	(478, 416, 121),
-	(479, 121, 429),
-	(481, 430, 401),
-	(483, 431, 432),
-	(484, 432, 433),
-	(485, 433, 434),
-	(486, 434, 291),
-	(487, 291, 435),
-	(488, 435, 436),
-	(489, 436, 437),
-	(490, 437, 431),
-	(492, 129, 332),
-	(493, 332, 438),
-	(494, 438, 70),
-	(495, 70, 437),
-	(497, 429, 427),
-	(499, 418, 120),
-	(500, 120, 439),
-	(501, 439, 420),
-	(502, 420, 440),
-	(503, 440, 441),
-	(504, 441, 442),
-	(505, 442, 328),
-	(507, 327, 443),
-	(509, 444, 419),
-	(510, 419, 440),
-	(512, 445, 446),
-	(513, 446, 441),
-	(514, 441, 447),
-	(515, 447, 114),
-	(517, 442, 448),
-	(518, 448, 46),
-	(520, 443, 449),
-	(522, 449, 450),
-	(524, 450, 451),
-	(526, 451, 452),
-	(528, 452, 444),
-	(529, 444, 399),
-	(531, 76, 453),
-	(532, 441, 452),
-	(534, 454, 455),
-	(535, 455, 456),
-	(536, 456, 457),
-	(537, 457, 458),
-	(538, 458, 459),
-	(539, 459, 460),
-	(540, 460, 461),
-	(541, 461, 462),
-	(543, 463, 464),
-	(545, 465, 464),
-	(547, 463, 465),
-	(548, 465, 464),
-	(549, 464, 466),
-	(551, 467, 468),
-	(552, 468, 469),
-	(554, 470, 471),
-	(555, 471, 472),
-	(556, 472, 473),
-	(557, 473, 474),
-	(558, 474, 475),
-	(592, 90, 502),
-	(559, 475, 476),
-	(560, 477, 236),
-	(561, 236, 478),
-	(563, 479, 480),
-	(564, 480, 481),
-	(566, 482, 483),
-	(567, 483, 297),
-	(613, 484, 485),
-	(614, 485, 105),
-	(615, 105, 391),
-	(682, 486, 487),
-	(568, 297, 488),
-	(569, 145, 489),
-	(571, 270, 268),
-	(573, 490, 138),
-	(575, 140, 491),
-	(576, 491, 263),
-	(578, 492, 493),
-	(579, 493, 494),
-	(580, 494, 495),
-	(581, 349, 496),
-	(583, 497, 498),
-	(584, 498, 92),
-	(586, 494, 499),
-	(587, 499, 466),
-	(589, 500, 501),
-	(590, 501, 94),
-	(593, 502, 503),
-	(594, 503, 504),
-	(596, 366, 505),
-	(597, 505, 506),
-	(598, 506, 507),
-	(599, 507, 504),
-	(600, 504, 91),
-	(602, 508, 509),
-	(603, 509, 510),
-	(604, 510, 333),
-	(606, 511, 512),
-	(607, 512, 511),
-	(609, 511, 513),
-	(610, 513, 101),
-	(612, 75, 484),
-	(617, 466, 514),
-	(619, 463, 515),
-	(620, 515, 516),
-	(621, 516, 517),
-	(623, 518, 93),
-	(625, 519, 520),
-	(626, 520, 521),
-	(627, 521, 74),
-	(629, 522, 521),
-	(631, 523, 520),
-	(633, 524, 52),
-	(637, 57, 525),
-	(638, 525, 526),
-	(640, 56, 525),
-	(642, 527, 528),
-	(644, 527, 529),
-	(645, 529, 530),
-	(647, 524, 529),
-	(649, 59, 531),
-	(651, 532, 533),
-	(652, 533, 531),
-	(653, 531, 60),
-	(655, 533, 512),
-	(657, 511, 534),
-	(658, 534, 99),
-	(660, 535, 95),
-	(662, 536, 537),
-	(663, 537, 538),
-	(664, 538, 539),
-	(665, 539, 540),
-	(667, 53, 530),
-	(669, 45, 540),
-	(671, 541, 43),
-	(673, 329, 326),
-	(675, 96, 542),
-	(676, 542, 543),
-	(677, 543, 544),
-	(678, 544, 545),
-	(679, 545, 546),
-	(680, 546, 547),
-	(681, 547, 486),
-	(683, 487, 548),
-	(684, 548, 549),
-	(685, 549, 550),
-	(686, 550, 551),
-	(687, 551, 552),
-	(688, 552, 553),
-	(689, 553, 554),
-	(691, 555, 543),
-	(693, 556, 544),
-	(695, 557, 545),
-	(697, 558, 546),
-	(699, 559, 560),
-	(701, 561, 562),
-	(702, 562, 560),
-	(704, 563, 564),
-	(705, 564, 37),
-	(707, 565, 564),
-	(709, 566, 386),
-	(711, 423, 566),
-	(713, 567, 79),
-	(715, 568, 569),
-	(716, 569, 65),
-	(718, 67, 570),
-	(719, 570, 571),
-	(721, 459, 572),
-	(722, 572, 573),
-	(723, 573, 462),
-	(725, 574, 573),
-	(727, 575, 434),
-	(729, 576, 577),
-	(730, 577, 578),
-	(731, 578, 579),
-	(732, 579, 580),
-	(733, 580, 581),
-	(734, 581, 582),
-	(735, 582, 312),
-	(736, 312, 583),
-	(737, 583, 584),
-	(738, 584, 585),
-	(739, 585, 407),
-	(740, 407, 586),
-	(741, 586, 587),
-	(742, 587, 588),
-	(743, 588, 589),
-	(744, 589, 590),
-	(745, 590, 591),
-	(746, 591, 592),
-	(747, 592, 593),
-	(748, 593, 594),
-	(749, 594, 308),
-	(750, 308, 309),
-	(751, 309, 595),
-	(752, 595, 596),
-	(753, 596, 597),
-	(754, 597, 304),
-	(755, 304, 496),
-	(756, 496, 598),
-	(855, 599, 293),
-	(757, 598, 600),
-	(758, 600, 404),
-	(759, 404, 601),
-	(760, 601, 125),
-	(762, 602, 503),
-	(764, 603, 520),
-	(766, 604, 605),
-	(767, 605, 606),
-	(768, 606, 607),
-	(769, 607, 454),
-	(770, 454, 571),
-	(771, 571, 604),
-	(773, 606, 433),
-	(775, 608, 609),
-	(776, 609, 458),
-	(777, 458, 610),
-	(779, 611, 144),
-	(781, 612, 145),
-	(782, 145, 477),
-	(783, 477, 469),
-	(784, 469, 481),
-	(785, 481, 611),
-	(786, 611, 612),
-	(788, 613, 489),
-	(789, 489, 470),
-	(790, 470, 482),
-	(791, 482, 478),
-	(792, 478, 613),
-	(794, 614, 615),
-	(796, 616, 617),
-	(797, 617, 618),
-	(798, 618, 11),
-	(799, 11, 619),
-	(800, 619, 620),
-	(801, 620, 621),
-	(802, 621, 622),
-	(803, 622, 413),
-	(805, 623, 624),
-	(807, 623, 625),
-	(809, 626, 627),
-	(810, 627, 624),
-	(811, 624, 628),
-	(813, 629, 630),
-	(814, 630, 173),
-	(816, 623, 631),
-	(817, 631, 632),
-	(818, 632, 633),
-	(819, 633, 634),
-	(820, 635, 636),
-	(822, 626, 635),
-	(824, 637, 3),
-	(825, 3, 638),
-	(826, 638, 639),
-	(828, 627, 640),
-	(830, 639, 633),
-	(832, 641, 642),
-	(833, 642, 643),
-	(835, 2, 637),
-	(837, 644, 645),
-	(838, 645, 639),
-	(839, 639, 641),
-	(841, 646, 647),
-	(842, 647, 132),
-	(844, 131, 648),
-	(846, 649, 650),
-	(847, 650, 651),
-	(848, 651, 652),
-	(849, 652, 616),
-	(851, 649, 653),
-	(852, 653, 6),
-	(854, 653, 599),
-	(856, 293, 654),
-	(857, 654, 655),
-	(858, 655, 656),
-	(859, 656, 657),
-	(860, 657, 156),
-	(862, 155, 658),
-	(863, 658, 659),
-	(864, 659, 660),
-	(866, 656, 661),
-	(867, 661, 662),
-	(868, 662, 617),
-	(870, 663, 658),
-	(871, 658, 664),
-	(872, 664, 652),
-	(874, 153, 663),
-	(876, 158, 154),
-	(878, 31, 13),
-	(880, 14, 665),
-	(882, 666, 621),
-	(884, 667, 666),
-	(886, 29, 667),
-	(888, 668, 5),
-	(890, 152, 659),
-	(892, 669, 670),
-	(893, 670, 671),
-	(894, 672, 233),
-	(896, 670, 245),
-	(898, 673, 674),
-	(899, 674, 675),
-	(901, 676, 273),
-	(982, 734, 735),
-	(902, 273, 238),
-	(904, 240, 673),
-	(905, 673, 675),
-	(906, 675, 677),
-	(907, 217, 678),
-	(952, 633, 679),
-	(908, 678, 680),
-	(909, 680, 681),
-	(910, 681, 682),
-	(911, 682, 683),
-	(912, 683, 684),
-	(913, 685, 686),
-	(914, 686, 687),
-	(915, 687, 688),
-	(916, 688, 689),
-	(917, 689, 690),
-	(918, 690, 691),
-	(919, 691, 692),
-	(920, 692, 693),
-	(921, 693, 694),
-	(923, 230, 695),
-	(924, 645, 696),
-	(925, 214, 697),
-	(926, 698, 699),
-	(927, 700, 701),
-	(929, 300, 702),
-	(931, 703, 704),
-	(933, 705, 565),
-	(934, 565, 706),
-	(935, 706, 306),
-	(937, 707, 678),
-	(939, 708, 709),
-	(940, 709, 710),
-	(941, 710, 711),
-	(942, 711, 712),
-	(1025, 773, 774),
-	(943, 712, 713),
-	(944, 713, 714),
-	(945, 714, 715),
-	(947, 716, 698),
-	(948, 698, 717),
-	(949, 313, 718),
-	(950, 718, 706),
-	(953, 679, 719),
-	(954, 719, 720),
-	(955, 720, 721),
-	(956, 721, 722),
-	(958, 723, 724),
-	(959, 724, 725),
-	(960, 725, 726),
-	(962, 727, 703),
-	(963, 703, 679),
-	(964, 679, 722),
-	(966, 483, 728),
-	(967, 621, 729),
-	(968, 729, 15),
-	(970, 730, 731),
-	(971, 731, 732),
-	(972, 622, 733),
-	(973, 734, 735),
-	(974, 735, 736),
-	(975, 736, 737),
-	(976, 737, 731),
-	(978, 730, 738),
-	(979, 738, 739),
-	(980, 739, 740),
-	(981, 740, 734),
-	(984, 741, 738),
-	(986, 742, 743),
-	(987, 743, 744),
-	(988, 744, 745),
-	(989, 745, 143),
-	(991, 746, 747),
-	(992, 747, 748),
-	(993, 748, 749),
-	(994, 749, 260),
-	(996, 750, 751),
-	(997, 751, 752),
-	(999, 725, 743),
-	(1000, 743, 753),
-	(1001, 754, 755),
-	(1002, 755, 756),
-	(1003, 756, 757),
-	(1004, 757, 758),
-	(1006, 759, 760),
-	(1007, 760, 761),
-	(1008, 761, 762),
-	(1010, 763, 758),
-	(1011, 758, 762),
-	(1012, 762, 764),
-	(1013, 764, 141),
-	(1015, 765, 766),
-	(1017, 767, 768),
-	(1018, 768, 769),
-	(1019, 769, 770),
-	(1020, 770, 142),
-	(1022, 771, 757),
-	(1024, 772, 773),
-	(1027, 744, 767),
-	(1028, 767, 763),
-	(1029, 763, 771),
-	(1030, 771, 765),
-	(1032, 775, 750),
-	(1033, 750, 776),
-	(1035, 724, 777),
-	(1036, 778, 779),
-	(1037, 779, 780),
-	(1039, 769, 781),
-	(1040, 779, 775),
-	(1041, 775, 782),
-	(1042, 783, 751),
-	(1044, 756, 784),
-	(1045, 755, 785),
-	(1046, 749, 786),
-	(1047, 786, 787),
-	(1049, 768, 745),
-	(1051, 770, 760),
-	(1052, 760, 788),
-	(1053, 788, 789),
-	(1055, 762, 790),
-	(1056, 790, 746),
-	(1057, 746, 263),
-	(1059, 748, 787),
-	(1060, 787, 776),
-	(1061, 776, 780),
-	(1062, 780, 754),
-	(1063, 754, 747),
-	(1065, 290, 791),
-	(1066, 674, 792),
-	(1067, 139, 793),
-	(1069, 794, 795),
-	(1111, 817, 830),
-	(1070, 795, 796),
-	(1071, 796, 737),
-	(1073, 789, 761),
-	(1075, 797, 798),
-	(1076, 264, 799),
-	(1077, 773, 800),
-	(1078, 801, 802),
-	(1079, 795, 803),
-	(1080, 804, 805),
-	(1081, 719, 806),
-	(1082, 720, 807),
-	(1083, 721, 808),
-	(1084, 808, 704),
-	(1086, 809, 808),
-	(1088, 810, 150),
-	(1090, 165, 811),
-	(1091, 811, 812),
-	(1092, 812, 813),
-	(1093, 814, 815),
-	(1094, 816, 817),
-	(1096, 818, 819),
-	(1097, 819, 820),
-	(1099, 821, 822),
-	(1101, 823, 824),
-	(1103, 825, 819),
-	(1105, 826, 827),
-	(1106, 811, 168),
-	(1108, 828, 30),
-	(1110, 829, 817),
-	(1112, 831, 828),
-	(1114, 177, 176),
-	(1116, 793, 797),
-	(1117, 797, 793),
-	(1121, 832, 528),
-	(1122, 528, 526),
-	(1123, 526, 54),
-	(1125, 833, 821),
-	(1126, 821, 822),
-	(1127, 822, 833),
-	(1129, 834, 823),
-	(1130, 823, 835),
-	(1131, 835, 834),
-	(1133, 383, 836),
-	(1134, 836, 837),
-	(1135, 837, 561),
-	(1136, 561, 554),
-	(1137, 554, 383),
-	(1139, 295, 838),
-	(1141, 299, 716),
-	(1142, 716, 623),
-	(1144, 295, 839),
-	(1456, 840, 841),
-	(1146, 625, 636),
-	(1147, 636, 668),
-	(1149, 842, 825),
-	(1150, 825, 820),
-	(1151, 820, 843),
-	(1152, 843, 844),
-	(1153, 844, 816),
-	(1237, 878, 646),
-	(1154, 816, 845),
-	(1155, 845, 846),
-	(1156, 846, 629),
-	(1157, 629, 847),
-	(1158, 847, 848),
-	(1159, 848, 849),
-	(1160, 849, 850),
-	(1161, 850, 628),
-	(1162, 628, 851),
-	(1163, 839, 847),
-	(1165, 838, 173),
-	(1167, 852, 853),
-	(1168, 853, 854),
-	(1169, 855, 415),
-	(1171, 796, 856),
-	(1172, 856, 857),
-	(1173, 857, 737),
-	(1175, 736, 857),
-	(1176, 857, 856),
-	(1178, 620, 858),
-	(1179, 858, 665),
-	(1180, 665, 12),
-	(1181, 12, 32),
-	(1182, 32, 859),
-	(1183, 859, 660),
-	(1184, 660, 664),
-	(1185, 664, 657),
-	(1186, 657, 157),
-	(1187, 157, 860),
-	(1188, 860, 861),
-	(1189, 861, 646),
-	(1190, 646, 648),
-	(1191, 648, 862),
-	(1192, 862, 294),
-	(1194, 863, 855),
-	(1195, 855, 413),
-	(1197, 413, 415),
-	(1198, 415, 863),
-	(1200, 144, 801),
-	(1201, 801, 766),
-	(1202, 766, 864),
-	(1203, 864, 752),
-	(1204, 752, 865),
-	(1205, 865, 866),
-	(1206, 866, 867),
-	(1260, 493, 868),
-	(1262, 869, 185),
-	(1263, 185, 826),
-	(1207, 867, 870),
-	(1208, 788, 871),
-	(1209, 764, 872),
-	(1210, 873, 874),
-	(1212, 790, 491),
-	(1213, 491, 267),
-	(1215, 875, 750),
-	(1217, 786, 874),
-	(1218, 874, 875),
-	(1219, 875, 876),
-	(1220, 876, 866),
-	(1222, 865, 876),
-	(1223, 876, 873),
-	(1224, 873, 867),
-	(1226, 618, 859),
-	(1228, 868, 730),
-	(1230, 730, 619),
-	(1231, 619, 858),
-	(1233, 835, 877),
-	(1234, 29, 828),
-	(1236, 647, 878),
-	(1239, 599, 435),
-	(1241, 860, 651),
-	(1242, 651, 879),
-	(1243, 879, 599),
-	(1245, 880, 881),
-	(1246, 514, 517),
-	(1247, 517, 462),
-	(1249, 861, 650),
-	(1250, 650, 879),
-	(1251, 879, 293),
-	(1253, 730, 742),
-	(1254, 742, 726),
-	(1256, 868, 492),
-	(1257, 492, 514),
-	(1259, 514, 493),
-	(1264, 826, 882),
-	(1265, 882, 883),
-	(1266, 878, 880),
-	(1268, 499, 884),
-	(1269, 884, 885),
-	(1270, 885, 460),
-	(1272, 516, 460),
-	(1274, 743, 886),
-	(1275, 729, 887),
-	(1276, 739, 740),
-	(1278, 515, 888),
-	(1279, 432, 605),
-	(1281, 577, 774),
-	(1283, 889, 890),
-	(1284, 890, 891),
-	(1285, 891, 892),
-	(1286, 892, 562),
-	(1287, 562, 893),
-	(1288, 378, 894),
-	(1289, 837, 892),
-	(1291, 836, 891),
-	(1293, 890, 895),
-	(1295, 489, 576),
-	(1297, 896, 470),
-	(1299, 502, 505),
-	(1301, 470, 472),
-	(1303, 506, 889),
-	(1304, 889, 895),
-	(1305, 895, 382),
-	(1307, 480, 804),
-	(1308, 804, 897),
-	(1309, 258, 478),
-	(1311, 482, 258),
-	(1313, 864, 778),
-	(1314, 778, 765),
-	(1539, 898, 899),
-	(1316, 900, 901),
-	(1317, 902, 903),
-	(1318, 248, 904),
-	(1319, 234, 905),
-	(1320, 174, 303),
-	(1321, 303, 814),
-	(1322, 814, 175),
-	(1323, 175, 906),
-	(1325, 846, 907),
-	(1326, 845, 133),
-	(1328, 906, 908),
-	(1329, 843, 183),
-	(1330, 183, 829),
-	(1332, 130, 909),
-	(1334, 829, 184),
-	(1335, 184, 844),
-	(1337, 850, 849),
-	(1339, 910, 911),
-	(1341, 912, 906),
-	(1343, 911, 913),
-	(1345, 174, 914),
-	(1347, 911, 848),
-	(1349, 630, 302),
-	(1351, 862, 909),
-	(1352, 909, 131),
-	(1354, 299, 910),
-	(1355, 910, 913),
-	(1356, 913, 914),
-	(1357, 914, 173),
-	(1359, 615, 632),
-	(1361, 812, 133),
-	(1363, 643, 615),
-	(1365, 638, 631),
-	(1366, 631, 915),
-	(1368, 643, 916),
-	(1370, 702, 916),
-	(1372, 916, 702),
-	(1374, 915, 642),
-	(1376, 917, 583),
-	(1377, 583, 853),
-	(1378, 853, 314),
-	(1379, 314, 918),
-	(1380, 918, 919),
-	(1381, 919, 33),
-	(1383, 397, 920),
-	(1384, 920, 341),
-	(1386, 921, 922),
-	(1387, 922, 923),
-	(1388, 923, 350),
-	(1390, 922, 924),
-	(1391, 924, 396),
-	(1393, 925, 921),
-	(1394, 921, 926),
-	(1395, 926, 927),
-	(1397, 928, 929),
-	(1455, 947, 840),
-	(1398, 929, 930),
-	(1399, 930, 923),
-	(1401, 930, 931),
-	(1402, 929, 347),
-	(1404, 932, 933),
-	(1405, 933, 926),
-	(1407, 409, 934),
-	(1408, 934, 935),
-	(1410, 936, 928),
-	(1411, 928, 932),
-	(1413, 932, 927),
-	(1414, 927, 937),
-	(1416, 937, 938),
-	(1418, 939, 935),
-	(1419, 935, 940),
-	(1420, 940, 938),
-	(1422, 348, 936),
-	(1424, 933, 921),
-	(1426, 510, 941),
-	(1427, 941, 942),
-	(1429, 941, 509),
-	(1431, 943, 852),
-	(1432, 852, 944),
-	(1433, 944, 584),
-	(1434, 584, 945),
-	(1435, 945, 946),
-	(1439, 947, 948),
-	(1440, 948, 39),
-	(1442, 949, 948),
-	(1443, 948, 40),
-	(1445, 841, 72),
-	(1447, 840, 72),
-	(1449, 950, 71),
-	(1451, 951, 952),
-	(1453, 953, 950),
-	(1454, 950, 947),
-	(1457, 841, 954),
-	(1458, 955, 956),
-	(1459, 956, 402),
-	(1461, 957, 958),
-	(1463, 958, 400),
-	(1465, 957, 959),
-	(1466, 959, 121),
-	(1468, 960, 952),
-	(1470, 335, 961),
-	(1471, 962, 87),
-	(1473, 963, 368),
-	(1475, 559, 553),
-	(1476, 553, 964),
-	(1477, 381, 552),
-	(1479, 552, 965),
-	(1481, 551, 966),
-	(1482, 966, 967),
-	(1483, 967, 968),
-	(1484, 968, 380),
-	(1486, 551, 969),
-	(1541, 898, 970),
-	(1487, 969, 486),
-	(1489, 969, 487),
-	(1491, 559, 971),
-	(1492, 966, 965),
-	(1494, 972, 967),
-	(1495, 967, 973),
-	(1496, 973, 974),
-	(1497, 974, 550),
-	(1499, 974, 973),
-	(1500, 973, 968),
-	(1502, 549, 975),
-	(1503, 975, 378),
-	(1505, 548, 976),
-	(1506, 975, 977),
-	(1507, 978, 379),
-	(1509, 507, 979),
-	(1510, 542, 980),
-	(1511, 981, 982),
-	(1513, 112, 983),
-	(1514, 984, 985),
-	(1515, 985, 398),
-	(1517, 940, 411),
-	(1518, 411, 411),
-	(1520, 986, 587),
-	(1521, 587, 987),
-	(1523, 885, 988),
-	(1524, 989, 990),
-	(1525, 990, 991),
-	(1526, 990, 992),
-	(1527, 990, 993),
-	(1528, 994, 990),
-	(1530, 990, 995),
-	(1531, 996, 709),
-	(1532, 709, 997),
-	(1533, 998, 898),
-	(1534, 898, 899),
-	(1535, 899, 970),
-	(1536, 970, 999),
-	(1537, 999, 898),
-	(1543, 898, 999),
-	(1545, 334, 1000),
-	(1546, 69, 1001),
-	(1547, 1001, 1002),
-	(1548, 1003, 1004),
-	(1550, 1005, 1006),
-	(1552, 337, 1007),
-	(1553, 69, 1008),
-	(1554, 570, 1009),
-	(1555, 1009, 1010),
-	(1556, 1011, 1012),
-	(1557, 884, 772),
-	(1559, 1013, 1014),
-	(1613, 508, 129),
-	(1560, 1014, 1015),
-	(1562, 1016, 1014),
-	(1564, 1017, 1018),
-	(1565, 581, 1019),
-	(1566, 582, 1020),
-	(1567, 78, 1021),
-	(1568, 536, 1022),
-	(1569, 1022, 73),
-	(1571, 44, 539),
-	(1573, 537, 1023),
-	(1574, 538, 1024),
-	(1575, 317, 1025),
-	(1576, 317, 1026),
-	(1577, 319, 1027),
-	(1578, 318, 944),
-	(1580, 718, 1028),
-	(1581, 126, 1029),
-	(1582, 1029, 1030),
-	(1583, 1030, 405),
-	(1584, 405, 1031),
-	(1585, 1031, 1032),
-	(1586, 1032, 1033),
-	(1588, 403, 430),
-	(1589, 430, 1034),
-	(1590, 1034, 123),
-	(1592, 1032, 1035),
-	(1593, 1035, 1036),
-	(1595, 1035, 1037),
-	(1597, 1038, 405),
-	(1599, 1039, 1030),
-	(1601, 598, 1040),
-	(1602, 1036, 1041),
-	(1604, 1042, 1043),
-	(1606, 1042, 1044),
-	(1607, 1043, 1045),
-	(1608, 1046, 1047),
-	(1610, 1046, 1048),
-	(1611, 1047, 1049),
-	(1612, 128, 508),
-	(1615, 127, 426),
-	(1617, 215, 222),
-	(1619, 223, 707),
-	(1621, 707, 224),
-	(1623, 224, 216),
-	(1625, 216, 225),
-	(1627, 226, 211),
-	(1629, 211, 220),
-	(1631, 215, 221),
-	(1633, 640, 644),
-	(1635, 49, 390),
-	(1636, 390, 1050),
-	(1637, 1050, 1051),
-	(1638, 438, 1001),
-	(1639, 1001, 569),
-	(1640, 569, 104),
-	(1641, 104, 1052),
-	(1642, 1052, 338),
-	(1643, 338, 388),
-	(1644, 388, 384),
-	(1645, 384, 982),
-	(1646, 982, 1053),
-	(1647, 1053, 389),
-	(1648, 389, 107),
-	(1649, 107, 1054),
-	(1650, 1054, 448),
-	(1651, 448, 330),
-	(1652, 330, 325),
-	(1653, 325, 393),
-	(1654, 393, 1055),
-	(1655, 1055, 943),
-	(1657, 436, 1056),
-	(1658, 1056, 1029),
-	(1659, 1029, 601),
-	(1660, 601, 1057),
-	(1661, 1057, 1034),
-	(1662, 1034, 959),
-	(1663, 959, 439),
-	(1664, 439, 421),
-	(1665, 421, 447),
-	(1666, 447, 446),
-	(1667, 446, 1054),
-	(1668, 1054, 47),
-	(1669, 47, 485),
-	(1671, 604, 1009),
-	(1672, 1009, 68),
-	(1674, 1031, 600),
-	(1675, 600, 956),
-	(1676, 956, 985),
-	(1677, 985, 340),
-	(1678, 340, 920),
-	(1679, 920, 351),
-	(1680, 351, 924),
-	(1681, 924, 1058),
-	(1682, 1058, 412),
-	(1683, 412, 1055),
-	(1684, 1055, 35),
-	(1686, 1059, 579),
-	(1687, 579, 1060),
-	(1688, 1060, 81),
-	(1690, 82, 1061),
-	(1691, 1061, 1062),
-	(1692, 1062, 484),
-	(1693, 484, 1022),
-	(1694, 1022, 42),
-	(1696, 392, 371),
-	(1697, 371, 1063),
-	(1698, 1063, 1061),
-	(1699, 1061, 80),
-	(1700, 80, 580),
-	(1701, 580, 1064),
-	(1703, 89, 1065),
-	(1704, 1065, 51),
-	(1705, 51, 1053),
-	(1707, 1052, 61),
-	(1708, 61, 513),
-	(1709, 513, 534),
-	(1710, 534, 501),
-	(1711, 501, 498),
-	(1712, 498, 1065),
-	(1713, 1065, 392),
-	(1715, 461, 572),
-	(1716, 572, 610),
-	(1717, 610, 1066),
-	(1718, 1066, 1067),
-	(1719, 1067, 1068),
-	(1720, 1068, 607),
-	(1722, 711, 1069),
-	(1723, 1069, 1070),
-	(1724, 1070, 701),
-	(1725, 701, 1071),
-	(1726, 1071, 694),
-	(1727, 694, 609),
-	(1728, 609, 1072),
-	(1729, 1072, 456),
-	(1730, 456, 1067),
-	(1772, 1073, 946),
-	(1732, 715, 1074),
-	(1733, 1074, 1075),
-	(1734, 1075, 1076),
-	(1735, 1076, 710),
-	(1737, 1068, 455),
-	(1738, 455, 1077),
-	(1739, 1077, 608),
-	(1740, 608, 693),
-	(1741, 693, 1078),
-	(1742, 1078, 712),
-	(1743, 712, 1076),
-	(1744, 1076, 1079),
-	(1745, 1079, 1080),
-	(1746, 1080, 1081),
-	(1747, 1081, 1082),
-	(1748, 1066, 457),
-	(1749, 457, 1072),
-	(1750, 1072, 1077),
-	(1752, 1083, 1075),
-	(1753, 1075, 713),
-	(1755, 714, 1074),
-	(1756, 1074, 1084),
-	(1757, 1071, 1078),
-	(1759, 1078, 1070),
-	(1760, 1070, 700),
-	(1762, 1033, 1085),
-	(1763, 1085, 310),
-	(1764, 310, 307),
-	(1765, 307, 1086),
-	(1766, 1086, 1087),
-	(1767, 1087, 986),
-	(1768, 986, 1088),
-	(1769, 1088, 1089),
-	(1770, 1089, 406),
-	(1771, 406, 1073),
-	(1773, 946, 917),
-	(1774, 917, 1090),
-	(1775, 1090, 1091),
-	(1776, 1091, 1092),
-	(1777, 1092, 1093),
-	(1778, 1093, 1094),
-	(1779, 1094, 1064),
-	(1780, 1064, 1059),
-	(1781, 1059, 1095),
-	(1782, 1095, 1096),
-	(1783, 1096, 896),
-	(1785, 395, 1058),
-	(1786, 1058, 1097),
-	(1787, 1097, 934),
-	(1788, 934, 1098),
-	(1789, 1098, 1099),
-	(1790, 1099, 320),
-	(1791, 320, 586),
-	(1792, 586, 1089),
-	(1794, 987, 588),
-	(1795, 588, 1087),
-	(1797, 1063, 85),
-	(1798, 85, 1100),
-	(1799, 1100, 353),
-	(1801, 1050, 106),
-	(1803, 1062, 1101),
-	(1804, 370, 1100),
-	(1805, 1100, 1102),
-	(1807, 1102, 1103);
-
-create table e03.ways(
-	id integer,
-	source integer,
-	target integer
-);
- 
-insert into e03.ways values 
-	(1, 1, 2),
-	(2, 2, 3),
-	(3, 3, 4),
-	(4, 4, 5),
-	(5, 5, 6),
-	(7, 7, 8),
-	(8, 9, 10),
-	(9, 11, 12),
-	(10, 12, 13),
-	(11, 13, 14),
-	(12, 14, 15),
-	(13, 15, 16),
-	(15, 17, 18),
-	(16, 18, 19),
-	(17, 19, 20),
-	(18, 20, 21),
-	(19, 21, 22),
-	(20, 22, 23),
-	(21, 23, 24),
-	(22, 24, 25),
-	(23, 25, 26),
-	(24, 26, 27),
-	(25, 27, 28),
-	(26, 28, 29),
-	(27, 29, 30),
-	(28, 30, 31),
-	(29, 31, 32),
-	(31, 33, 34),
-	(32, 34, 35),
-	(33, 35, 36),
-	(34, 36, 37),
-	(35, 37, 38),
-	(36, 38, 39),
-	(37, 39, 40),
-	(38, 40, 41),
-	(39, 41, 42),
-	(40, 42, 43),
-	(41, 43, 44),
-	(42, 44, 45),
-	(43, 45, 46),
-	(44, 46, 47),
-	(45, 47, 48),
-	(46, 48, 49),
-	(47, 49, 50),
-	(48, 50, 51),
-	(49, 51, 52),
-	(50, 52, 53),
-	(51, 53, 54),
-	(52, 54, 55),
-	(53, 55, 56),
-	(54, 56, 57),
-	(55, 57, 58),
-	(56, 58, 59),
-	(57, 59, 60),
-	(58, 60, 61),
-	(59, 61, 62),
-	(60, 62, 63),
-	(61, 63, 64),
-	(62, 64, 65),
-	(63, 65, 66),
-	(64, 66, 67),
-	(65, 67, 68),
-	(66, 68, 69),
-	(67, 69, 70),
-	(69, 41, 71),
-	(70, 71, 72),
-	(71, 72, 73),
-	(72, 73, 74),
-	(73, 74, 75),
-	(74, 75, 76),
-	(75, 76, 77),
-	(76, 77, 78),
-	(77, 78, 79),
-	(78, 79, 80),
-	(79, 80, 81),
-	(80, 81, 82),
-	(81, 82, 83),
-	(82, 83, 84),
-	(83, 84, 85),
-	(84, 85, 86),
-	(85, 86, 87),
-	(86, 87, 88),
-	(87, 88, 89),
-	(88, 89, 90),
-	(89, 90, 91),
-	(90, 91, 92),
-	(91, 92, 93),
-	(92, 93, 94),
-	(93, 94, 95),
-	(94, 95, 96),
-	(95, 96, 97),
-	(96, 97, 98),
-	(97, 98, 99),
-	(98, 99, 100),
-	(99, 100, 101),
-	(100, 101, 102),
-	(101, 102, 103),
-	(102, 103, 62),
-	(103, 62, 104),
-	(105, 105, 106),
-	(106, 106, 48),
-	(107, 48, 107),
-	(108, 107, 108),
-	(109, 108, 109),
-	(110, 109, 110),
-	(111, 110, 111),
-	(112, 111, 112),
-	(113, 112, 113),
-	(114, 113, 114),
-	(115, 114, 115),
-	(116, 115, 116),
-	(117, 116, 117),
-	(118, 117, 118),
-	(119, 118, 119),
-	(120, 119, 120),
-	(121, 120, 121),
-	(122, 121, 122),
-	(124, 122, 123),
-	(125, 123, 124),
-	(126, 124, 125),
-	(127, 125, 126),
-	(128, 126, 127),
-	(129, 127, 128),
-	(130, 128, 129),
-	(132, 6, 130),
-	(133, 130, 131),
-	(134, 131, 132),
-	(135, 132, 133),
-	(136, 133, 134),
-	(137, 134, 135),
-	(138, 135, 136),
-	(139, 137, 138),
-	(140, 138, 139),
-	(141, 139, 140),
-	(142, 140, 141),
-	(143, 141, 142),
-	(144, 142, 143),
-	(146, 144, 145),
-	(148, 146, 147),
-	(149, 147, 148),
-	(150, 148, 149),
-	(151, 149, 150),
-	(152, 150, 151),
-	(153, 151, 152),
-	(154, 152, 153),
-	(155, 153, 154),
-	(156, 154, 155),
-	(157, 155, 156),
-	(159, 157, 158),
-	(160, 158, 159),
-	(162, 160, 161),
-	(163, 161, 162),
-	(164, 162, 163),
-	(165, 163, 164),
-	(166, 164, 165),
-	(167, 165, 166),
-	(168, 166, 167),
-	(169, 167, 168),
-	(170, 168, 169),
-	(171, 169, 170),
-	(172, 170, 171),
-	(173, 171, 172),
-	(174, 172, 159),
-	(176, 173, 174),
-	(178, 175, 176),
-	(179, 176, 177),
-	(180, 177, 178),
-	(181, 178, 179),
-	(182, 179, 180),
-	(183, 181, 178),
-	(184, 178, 182),
-	(185, 179, 183),
-	(186, 183, 184),
-	(188, 151, 185),
-	(190, 186, 187),
-	(191, 188, 189),
-	(192, 189, 190),
-	(193, 190, 191),
-	(194, 191, 192),
-	(195, 192, 193),
-	(196, 193, 194),
-	(197, 194, 195),
-	(198, 196, 197),
-	(199, 197, 198),
-	(200, 198, 199),
-	(202, 200, 201),
-	(203, 201, 197),
-	(204, 197, 202),
-	(205, 202, 203),
-	(206, 203, 204),
-	(207, 204, 205),
-	(209, 204, 199),
-	(211, 206, 207),
-	(212, 207, 208),
-	(213, 207, 209),
-	(214, 210, 211),
-	(216, 212, 213),
-	(217, 213, 214),
-	(218, 214, 215),
-	(220, 216, 217),
-	(221, 217, 218),
-	(223, 219, 220),
-	(224, 220, 221),
-	(225, 221, 222),
-	(226, 222, 223),
-	(227, 223, 224),
-	(228, 224, 225),
-	(229, 225, 226),
-	(230, 226, 219),
-	(232, 213, 227),
-	(234, 228, 229),
-	(235, 229, 227),
-	(236, 227, 230),
-	(237, 230, 231),
-	(239, 232, 233),
-	(240, 233, 234),
-	(241, 234, 235),
-	(243, 236, 237),
-	(244, 237, 238),
-	(245, 238, 239),
-	(246, 239, 240),
-	(247, 240, 241),
-	(248, 241, 242),
-	(249, 242, 243),
-	(250, 243, 244),
-	(251, 244, 245),
-	(252, 245, 246),
-	(253, 246, 247),
-	(254, 247, 248),
-	(255, 248, 249),
-	(256, 249, 250),
-	(257, 250, 251),
-	(258, 251, 252),
-	(259, 252, 253),
-	(260, 253, 254),
-	(261, 254, 255),
-	(262, 255, 256),
-	(263, 256, 257),
-	(265, 237, 235),
-	(266, 235, 258),
-	(268, 259, 260),
-	(269, 260, 261),
-	(270, 262, 263),
-	(272, 259, 263),
-	(274, 263, 264),
-	(275, 264, 265),
-	(276, 265, 266),
-	(277, 266, 267),
-	(278, 267, 268),
-	(280, 265, 269),
-	(281, 269, 270),
-	(282, 270, 271),
-	(283, 269, 266),
-	(285, 272, 218),
-	(286, 218, 231),
-	(287, 231, 272),
-	(289, 273, 274),
-	(291, 275, 274),
-	(292, 274, 246),
-	(294, 276, 277),
-	(295, 278, 279),
-	(296, 279, 280),
-	(297, 280, 281),
-	(298, 281, 282),
-	(299, 282, 283),
-	(300, 283, 284),
-	(301, 284, 285),
-	(302, 285, 286),
-	(303, 286, 276),
-	(304, 276, 287),
-	(305, 288, 289),
-	(306, 289, 290),
-	(307, 290, 257),
-	(309, 291, 292),
-	(310, 292, 293),
-	(312, 294, 295),
-	(314, 296, 288),
-	(315, 288, 289),
-	(316, 289, 286),
-	(317, 286, 285),
-	(319, 297, 298),
-	(320, 299, 300),
-	(321, 300, 301),
-	(322, 302, 303),
-	(324, 304, 305),
-	(325, 77, 306),
-	(373, 347, 348),
-	(327, 3, 307),
-	(328, 307, 308),
-	(330, 309, 310),
-	(331, 310, 4),
-	(333, 311, 312),
-	(334, 312, 313),
-	(335, 313, 314),
-	(336, 314, 315),
-	(337, 316, 317),
-	(338, 317, 318),
-	(339, 318, 319),
-	(341, 320, 321),
-	(342, 321, 322),
-	(343, 322, 323),
-	(345, 322, 324),
-	(347, 38, 325),
-	(348, 325, 326),
-	(349, 326, 327),
-	(350, 327, 328),
-	(351, 328, 329),
-	(352, 329, 330),
-	(353, 330, 43),
-	(355, 115, 331),
-	(356, 332, 333),
-	(357, 333, 334),
-	(358, 334, 335),
-	(359, 335, 336),
-	(361, 335, 337),
-	(362, 337, 338),
-	(363, 338, 59),
-	(365, 339, 340),
-	(366, 340, 341),
-	(367, 341, 342),
-	(368, 342, 343),
-	(369, 343, 344),
-	(370, 344, 345),
-	(371, 345, 346),
-	(372, 346, 347),
-	(374, 348, 349),
-	(376, 346, 350),
-	(377, 350, 351),
-	(378, 351, 352),
-	(380, 353, 354),
-	(381, 354, 355),
-	(382, 355, 356),
-	(383, 356, 357),
-	(384, 357, 358),
-	(385, 358, 359),
-	(386, 359, 360),
-	(387, 360, 361),
-	(388, 361, 362),
-	(389, 362, 363),
-	(390, 363, 364),
-	(391, 364, 365),
-	(392, 365, 366),
-	(393, 366, 367),
-	(394, 367, 368),
-	(395, 368, 369),
-	(396, 369, 370),
-	(397, 370, 86),
-	(398, 86, 371),
-	(400, 354, 372),
-	(401, 372, 373),
-	(402, 373, 374),
-	(403, 374, 375),
-	(404, 375, 376),
-	(405, 376, 377),
-	(406, 377, 378),
-	(407, 378, 379),
-	(408, 379, 380),
-	(409, 380, 381),
-	(410, 381, 382),
-	(411, 382, 383),
-	(413, 55, 384),
-	(414, 384, 385),
-	(415, 385, 336),
-	(416, 336, 386),
-	(417, 386, 387),
-	(418, 385, 388),
-	(419, 388, 58),
-	(421, 389, 50),
-	(422, 50, 390),
-	(423, 390, 391),
-	(424, 391, 392),
-	(425, 392, 88),
-	(427, 36, 393),
-	(428, 393, 394),
-	(429, 394, 395),
-	(430, 395, 396),
-	(431, 396, 352),
-	(432, 352, 397),
-	(433, 397, 339),
-	(434, 339, 398),
-	(435, 398, 399),
-	(436, 399, 400),
-	(437, 400, 401),
-	(438, 401, 402),
-	(439, 402, 403),
-	(440, 403, 404),
-	(441, 404, 405),
-	(443, 406, 407),
-	(444, 407, 316),
-	(445, 316, 321),
-	(446, 321, 323),
-	(447, 323, 408),
-	(448, 408, 409),
-	(449, 409, 410),
-	(450, 410, 411),
-	(451, 411, 411),
-	(452, 411, 412),
-	(453, 412, 394),
-	(455, 413, 414),
-	(457, 415, 414),
-	(459, 416, 417),
-	(460, 417, 418),
-	(462, 419, 420),
-	(463, 420, 421),
-	(464, 421, 116),
-	(465, 116, 422),
-	(466, 422, 423),
-	(467, 423, 424),
-	(469, 417, 422),
-	(471, 425, 426),
-	(473, 124, 427),
-	(474, 427, 428),
-	(476, 425, 428),
-	(477, 428, 416),
-	(478, 416, 121),
-	(479, 121, 429),
-	(481, 430, 401),
-	(483, 431, 432),
-	(484, 432, 433),
-	(485, 433, 434),
-	(486, 434, 291),
-	(487, 291, 435),
-	(488, 435, 436),
-	(489, 436, 437),
-	(490, 437, 431),
-	(492, 129, 332),
-	(493, 332, 438),
-	(494, 438, 70),
-	(495, 70, 437),
-	(497, 429, 427),
-	(499, 418, 120),
-	(500, 120, 439),
-	(501, 439, 420),
-	(502, 420, 440),
-	(503, 440, 441),
-	(504, 441, 442),
-	(505, 442, 328),
-	(507, 327, 443),
-	(509, 444, 419),
-	(510, 419, 440),
-	(512, 445, 446),
-	(513, 446, 441),
-	(514, 441, 447),
-	(515, 447, 114),
-	(517, 442, 448),
-	(518, 448, 46),
-	(520, 443, 449),
-	(522, 449, 450),
-	(524, 450, 451),
-	(526, 451, 452),
-	(528, 452, 444),
-	(529, 444, 399),
-	(531, 76, 453),
-	(532, 441, 452),
-	(534, 454, 455),
-	(535, 455, 456),
-	(536, 456, 457),
-	(537, 457, 458),
-	(538, 458, 459),
-	(539, 459, 460),
-	(540, 460, 461),
-	(541, 461, 462),
-	(543, 463, 464),
-	(545, 465, 464),
-	(547, 463, 465),
-	(548, 465, 464),
-	(549, 464, 466),
-	(551, 467, 468),
-	(552, 468, 469),
-	(554, 470, 471),
-	(555, 471, 472),
-	(556, 472, 473),
-	(557, 473, 474),
-	(558, 474, 475),
-	(592, 90, 502),
-	(559, 475, 476),
-	(560, 477, 236),
-	(561, 236, 478),
-	(563, 479, 480),
-	(564, 480, 481),
-	(566, 482, 483),
-	(567, 483, 297),
-	(613, 484, 485),
-	(614, 485, 105),
-	(615, 105, 391),
-	(682, 486, 487),
-	(568, 297, 488),
-	(569, 145, 489),
-	(571, 270, 268),
-	(573, 490, 138),
-	(575, 140, 491),
-	(576, 491, 263),
-	(578, 492, 493),
-	(579, 493, 494),
-	(580, 494, 495),
-	(581, 349, 496),
-	(583, 497, 498),
-	(584, 498, 92),
-	(586, 494, 499),
-	(587, 499, 466),
-	(589, 500, 501),
-	(590, 501, 94),
-	(593, 502, 503),
-	(594, 503, 504),
-	(596, 366, 505),
-	(597, 505, 506),
-	(598, 506, 507),
-	(599, 507, 504),
-	(600, 504, 91),
-	(602, 508, 509),
-	(603, 509, 510),
-	(604, 510, 333),
-	(606, 511, 512),
-	(607, 512, 511),
-	(609, 511, 513),
-	(610, 513, 101),
-	(612, 75, 484),
-	(617, 466, 514),
-	(619, 463, 515),
-	(620, 515, 516),
-	(621, 516, 517),
-	(623, 518, 93),
-	(625, 519, 520),
-	(626, 520, 521),
-	(627, 521, 74),
-	(629, 522, 521),
-	(631, 523, 520),
-	(633, 524, 52),
-	(637, 57, 525),
-	(638, 525, 526),
-	(640, 56, 525),
-	(642, 527, 528),
-	(644, 527, 529),
-	(645, 529, 530),
-	(647, 524, 529),
-	(649, 59, 531),
-	(651, 532, 533),
-	(652, 533, 531),
-	(653, 531, 60),
-	(655, 533, 512),
-	(657, 511, 534),
-	(658, 534, 99),
-	(660, 535, 95),
-	(662, 536, 537),
-	(663, 537, 538),
-	(664, 538, 539),
-	(665, 539, 540),
-	(667, 53, 530),
-	(669, 45, 540),
-	(671, 541, 43),
-	(673, 329, 326),
-	(675, 96, 542),
-	(676, 542, 543),
-	(677, 543, 544),
-	(678, 544, 545),
-	(679, 545, 546),
-	(680, 546, 547),
-	(681, 547, 486),
-	(683, 487, 548),
-	(684, 548, 549),
-	(685, 549, 550),
-	(686, 550, 551),
-	(687, 551, 552),
-	(688, 552, 553),
-	(689, 553, 554),
-	(691, 555, 543),
-	(693, 556, 544),
-	(695, 557, 545),
-	(697, 558, 546),
-	(699, 559, 560),
-	(701, 561, 562),
-	(702, 562, 560),
-	(704, 563, 564),
-	(705, 564, 37),
-	(707, 565, 564),
-	(709, 566, 386),
-	(711, 423, 566),
-	(713, 567, 79),
-	(715, 568, 569),
-	(716, 569, 65),
-	(718, 67, 570),
-	(719, 570, 571),
-	(721, 459, 572),
-	(722, 572, 573),
-	(723, 573, 462),
-	(725, 574, 573),
-	(727, 575, 434),
-	(729, 576, 577),
-	(730, 577, 578),
-	(731, 578, 579),
-	(732, 579, 580),
-	(733, 580, 581),
-	(734, 581, 582),
-	(735, 582, 312),
-	(736, 312, 583),
-	(737, 583, 584),
-	(738, 584, 585),
-	(739, 585, 407),
-	(740, 407, 586),
-	(741, 586, 587),
-	(742, 587, 588),
-	(743, 588, 589),
-	(744, 589, 590),
-	(745, 590, 591),
-	(746, 591, 592),
-	(747, 592, 593),
-	(748, 593, 594),
-	(749, 594, 308),
-	(750, 308, 309),
-	(751, 309, 595),
-	(752, 595, 596),
-	(753, 596, 597),
-	(754, 597, 304),
-	(755, 304, 496),
-	(756, 496, 598),
-	(855, 599, 293),
-	(757, 598, 600),
-	(758, 600, 404),
-	(759, 404, 601),
-	(760, 601, 125),
-	(762, 602, 503),
-	(764, 603, 520),
-	(766, 604, 605),
-	(767, 605, 606),
-	(768, 606, 607),
-	(769, 607, 454),
-	(770, 454, 571),
-	(771, 571, 604),
-	(773, 606, 433),
-	(775, 608, 609),
-	(776, 609, 458),
-	(777, 458, 610),
-	(779, 611, 144),
-	(781, 612, 145),
-	(782, 145, 477),
-	(783, 477, 469),
-	(784, 469, 481),
-	(785, 481, 611),
-	(786, 611, 612),
-	(788, 613, 489),
-	(789, 489, 470),
-	(790, 470, 482),
-	(791, 482, 478),
-	(792, 478, 613),
-	(794, 614, 615),
-	(796, 616, 617),
-	(797, 617, 618),
-	(798, 618, 11),
-	(799, 11, 619),
-	(800, 619, 620),
-	(801, 620, 621),
-	(802, 621, 622),
-	(803, 622, 413),
-	(805, 623, 624),
-	(807, 623, 625),
-	(809, 626, 627),
-	(810, 627, 624),
-	(811, 624, 628),
-	(813, 629, 630),
-	(814, 630, 173),
-	(816, 623, 631),
-	(817, 631, 632),
-	(818, 632, 633),
-	(819, 633, 634),
-	(820, 635, 636),
-	(822, 626, 635),
-	(824, 637, 3),
-	(825, 3, 638),
-	(826, 638, 639),
-	(828, 627, 640),
-	(830, 639, 633),
-	(832, 641, 642),
-	(833, 642, 643),
-	(835, 2, 637),
-	(837, 644, 645),
-	(838, 645, 639),
-	(839, 639, 641),
-	(841, 646, 647),
-	(842, 647, 132),
-	(844, 131, 648),
-	(846, 649, 650),
-	(847, 650, 651),
-	(848, 651, 652),
-	(849, 652, 616),
-	(851, 649, 653),
-	(852, 653, 6),
-	(854, 653, 599),
-	(856, 293, 654),
-	(857, 654, 655),
-	(858, 655, 656),
-	(859, 656, 657),
-	(860, 657, 156),
-	(862, 155, 658),
-	(863, 658, 659),
-	(864, 659, 660),
-	(866, 656, 661),
-	(867, 661, 662),
-	(868, 662, 617),
-	(870, 663, 658),
-	(871, 658, 664),
-	(872, 664, 652),
-	(874, 153, 663),
-	(876, 158, 154),
-	(878, 31, 13),
-	(880, 14, 665),
-	(882, 666, 621),
-	(884, 667, 666),
-	(886, 29, 667),
-	(888, 668, 5),
-	(890, 152, 659),
-	(892, 669, 670),
-	(893, 670, 671),
-	(894, 672, 233),
-	(896, 670, 245),
-	(898, 673, 674),
-	(899, 674, 675),
-	(901, 676, 273),
-	(982, 734, 735),
-	(902, 273, 238),
-	(904, 240, 673),
-	(905, 673, 675),
-	(906, 675, 677),
-	(907, 217, 678),
-	(952, 633, 679),
-	(908, 678, 680),
-	(909, 680, 681),
-	(910, 681, 682),
-	(911, 682, 683),
-	(912, 683, 684),
-	(913, 685, 686),
-	(914, 686, 687),
-	(915, 687, 688),
-	(916, 688, 689),
-	(917, 689, 690),
-	(918, 690, 691),
-	(919, 691, 692),
-	(920, 692, 693),
-	(921, 693, 694),
-	(923, 230, 695),
-	(924, 645, 696),
-	(925, 214, 697),
-	(926, 698, 699),
-	(927, 700, 701),
-	(929, 300, 702),
-	(931, 703, 704),
-	(933, 705, 565),
-	(934, 565, 706),
-	(935, 706, 306),
-	(937, 707, 678),
-	(939, 708, 709),
-	(940, 709, 710),
-	(941, 710, 711),
-	(942, 711, 712),
-	(1025, 773, 774),
-	(943, 712, 713),
-	(944, 713, 714),
-	(945, 714, 715),
-	(947, 716, 698),
-	(948, 698, 717),
-	(949, 313, 718),
-	(950, 718, 706),
-	(953, 679, 719),
-	(954, 719, 720),
-	(955, 720, 721),
-	(956, 721, 722),
-	(958, 723, 724),
-	(959, 724, 725),
-	(960, 725, 726),
-	(962, 727, 703),
-	(963, 703, 679),
-	(964, 679, 722),
-	(966, 483, 728),
-	(967, 621, 729),
-	(968, 729, 15),
-	(970, 730, 731),
-	(971, 731, 732),
-	(972, 622, 733),
-	(973, 734, 735),
-	(974, 735, 736),
-	(975, 736, 737),
-	(976, 737, 731),
-	(978, 730, 738),
-	(979, 738, 739),
-	(980, 739, 740),
-	(981, 740, 734),
-	(984, 741, 738),
-	(986, 742, 743),
-	(987, 743, 744),
-	(988, 744, 745),
-	(989, 745, 143),
-	(991, 746, 747),
-	(992, 747, 748),
-	(993, 748, 749),
-	(994, 749, 260),
-	(996, 750, 751),
-	(997, 751, 752),
-	(999, 725, 743),
-	(1000, 743, 753),
-	(1001, 754, 755),
-	(1002, 755, 756),
-	(1003, 756, 757),
-	(1004, 757, 758),
-	(1006, 759, 760),
-	(1007, 760, 761),
-	(1008, 761, 762),
-	(1010, 763, 758),
-	(1011, 758, 762),
-	(1012, 762, 764),
-	(1013, 764, 141),
-	(1015, 765, 766),
-	(1017, 767, 768),
-	(1018, 768, 769),
-	(1019, 769, 770),
-	(1020, 770, 142),
-	(1022, 771, 757),
-	(1024, 772, 773),
-	(1027, 744, 767),
-	(1028, 767, 763),
-	(1029, 763, 771),
-	(1030, 771, 765),
-	(1032, 775, 750),
-	(1033, 750, 776),
-	(1035, 724, 777),
-	(1036, 778, 779),
-	(1037, 779, 780),
-	(1039, 769, 781),
-	(1040, 779, 775),
-	(1041, 775, 782),
-	(1042, 783, 751),
-	(1044, 756, 784),
-	(1045, 755, 785),
-	(1046, 749, 786),
-	(1047, 786, 787),
-	(1049, 768, 745),
-	(1051, 770, 760),
-	(1052, 760, 788),
-	(1053, 788, 789),
-	(1055, 762, 790),
-	(1056, 790, 746),
-	(1057, 746, 263),
-	(1059, 748, 787),
-	(1060, 787, 776),
-	(1061, 776, 780),
-	(1062, 780, 754),
-	(1063, 754, 747),
-	(1065, 290, 791),
-	(1066, 674, 792),
-	(1067, 139, 793),
-	(1069, 794, 795),
-	(1111, 817, 830),
-	(1070, 795, 796),
-	(1071, 796, 737),
-	(1073, 789, 761),
-	(1075, 797, 798),
-	(1076, 264, 799),
-	(1077, 773, 800),
-	(1078, 801, 802),
-	(1079, 795, 803),
-	(1080, 804, 805),
-	(1081, 719, 806),
-	(1082, 720, 807),
-	(1083, 721, 808),
-	(1084, 808, 704),
-	(1086, 809, 808),
-	(1088, 810, 150),
-	(1090, 165, 811),
-	(1091, 811, 812),
-	(1092, 812, 813),
-	(1093, 814, 815),
-	(1094, 816, 817),
-	(1096, 818, 819),
-	(1097, 819, 820),
-	(1099, 821, 822),
-	(1101, 823, 824),
-	(1103, 825, 819),
-	(1105, 826, 827),
-	(1106, 811, 168),
-	(1108, 828, 30),
-	(1110, 829, 817),
-	(1112, 831, 828),
-	(1114, 177, 176),
-	(1116, 793, 797),
-	(1117, 797, 793),
-	(1121, 832, 528),
-	(1122, 528, 526),
-	(1123, 526, 54),
-	(1125, 833, 821),
-	(1126, 821, 822),
-	(1127, 822, 833),
-	(1129, 834, 823),
-	(1130, 823, 835),
-	(1131, 835, 834),
-	(1133, 383, 836),
-	(1134, 836, 837),
-	(1135, 837, 561),
-	(1136, 561, 554),
-	(1137, 554, 383),
-	(1139, 295, 838),
-	(1141, 299, 716),
-	(1142, 716, 623),
-	(1144, 295, 839),
-	(1456, 840, 841),
-	(1146, 625, 636),
-	(1147, 636, 668),
-	(1149, 842, 825),
-	(1150, 825, 820),
-	(1151, 820, 843),
-	(1152, 843, 844),
-	(1153, 844, 816),
-	(1237, 878, 646),
-	(1154, 816, 845),
-	(1155, 845, 846),
-	(1156, 846, 629),
-	(1157, 629, 847),
-	(1158, 847, 848),
-	(1159, 848, 849),
-	(1160, 849, 850),
-	(1161, 850, 628),
-	(1162, 628, 851),
-	(1163, 839, 847),
-	(1165, 838, 173),
-	(1167, 852, 853),
-	(1168, 853, 854),
-	(1169, 855, 415),
-	(1171, 796, 856),
-	(1172, 856, 857),
-	(1173, 857, 737),
-	(1175, 736, 857),
-	(1176, 857, 856),
-	(1178, 620, 858),
-	(1179, 858, 665),
-	(1180, 665, 12),
-	(1181, 12, 32),
-	(1182, 32, 859),
-	(1183, 859, 660),
-	(1184, 660, 664),
-	(1185, 664, 657),
-	(1186, 657, 157),
-	(1187, 157, 860),
-	(1188, 860, 861),
-	(1189, 861, 646),
-	(1190, 646, 648),
-	(1191, 648, 862),
-	(1192, 862, 294),
-	(1194, 863, 855),
-	(1195, 855, 413),
-	(1197, 413, 415),
-	(1198, 415, 863),
-	(1200, 144, 801),
-	(1201, 801, 766),
-	(1202, 766, 864),
-	(1203, 864, 752),
-	(1204, 752, 865),
-	(1205, 865, 866),
-	(1206, 866, 867),
-	(1260, 493, 868),
-	(1262, 869, 185),
-	(1263, 185, 826),
-	(1207, 867, 870),
-	(1208, 788, 871),
-	(1209, 764, 872),
-	(1210, 873, 874),
-	(1212, 790, 491),
-	(1213, 491, 267),
-	(1215, 875, 750),
-	(1217, 786, 874),
-	(1218, 874, 875),
-	(1219, 875, 876),
-	(1220, 876, 866),
-	(1222, 865, 876),
-	(1223, 876, 873),
-	(1224, 873, 867),
-	(1226, 618, 859),
-	(1228, 868, 730),
-	(1230, 730, 619),
-	(1231, 619, 858),
-	(1233, 835, 877),
-	(1234, 29, 828),
-	(1236, 647, 878),
-	(1239, 599, 435),
-	(1241, 860, 651),
-	(1242, 651, 879),
-	(1243, 879, 599),
-	(1245, 880, 881),
-	(1246, 514, 517),
-	(1247, 517, 462),
-	(1249, 861, 650),
-	(1250, 650, 879),
-	(1251, 879, 293),
-	(1253, 730, 742),
-	(1254, 742, 726),
-	(1256, 868, 492),
-	(1257, 492, 514),
-	(1259, 514, 493),
-	(1264, 826, 882),
-	(1265, 882, 883),
-	(1266, 878, 880),
-	(1268, 499, 884),
-	(1269, 884, 885),
-	(1270, 885, 460),
-	(1272, 516, 460),
-	(1274, 743, 886),
-	(1275, 729, 887),
-	(1276, 739, 740),
-	(1278, 515, 888),
-	(1279, 432, 605),
-	(1281, 577, 774),
-	(1283, 889, 890),
-	(1284, 890, 891),
-	(1285, 891, 892),
-	(1286, 892, 562),
-	(1287, 562, 893),
-	(1288, 378, 894),
-	(1289, 837, 892),
-	(1291, 836, 891),
-	(1293, 890, 895),
-	(1295, 489, 576),
-	(1297, 896, 470),
-	(1299, 502, 505),
-	(1301, 470, 472),
-	(1303, 506, 889),
-	(1304, 889, 895),
-	(1305, 895, 382),
-	(1307, 480, 804),
-	(1308, 804, 897),
-	(1309, 258, 478),
-	(1311, 482, 258),
-	(1313, 864, 778),
-	(1314, 778, 765),
-	(1539, 898, 899),
-	(1316, 900, 901),
-	(1317, 902, 903),
-	(1318, 248, 904),
-	(1319, 234, 905),
-	(1320, 174, 303),
-	(1321, 303, 814),
-	(1322, 814, 175),
-	(1323, 175, 906),
-	(1325, 846, 907),
-	(1326, 845, 133),
-	(1328, 906, 908),
-	(1329, 843, 183),
-	(1330, 183, 829),
-	(1332, 130, 909),
-	(1334, 829, 184),
-	(1335, 184, 844),
-	(1337, 850, 849),
-	(1339, 910, 911),
-	(1341, 912, 906),
-	(1343, 911, 913),
-	(1345, 174, 914),
-	(1347, 911, 848),
-	(1349, 630, 302),
-	(1351, 862, 909),
-	(1352, 909, 131),
-	(1354, 299, 910),
-	(1355, 910, 913),
-	(1356, 913, 914),
-	(1357, 914, 173),
-	(1359, 615, 632),
-	(1361, 812, 133),
-	(1363, 643, 615),
-	(1365, 638, 631),
-	(1366, 631, 915),
-	(1368, 643, 916),
-	(1370, 702, 916),
-	(1372, 916, 702),
-	(1374, 915, 642),
-	(1376, 917, 583),
-	(1377, 583, 853),
-	(1378, 853, 314),
-	(1379, 314, 918),
-	(1380, 918, 919),
-	(1381, 919, 33),
-	(1383, 397, 920),
-	(1384, 920, 341),
-	(1386, 921, 922),
-	(1387, 922, 923),
-	(1388, 923, 350),
-	(1390, 922, 924),
-	(1391, 924, 396),
-	(1393, 925, 921),
-	(1394, 921, 926),
-	(1395, 926, 927),
-	(1397, 928, 929),
-	(1455, 947, 840),
-	(1398, 929, 930),
-	(1399, 930, 923),
-	(1401, 930, 931),
-	(1402, 929, 347),
-	(1404, 932, 933),
-	(1405, 933, 926),
-	(1407, 409, 934),
-	(1408, 934, 935),
-	(1410, 936, 928),
-	(1411, 928, 932),
-	(1413, 932, 927),
-	(1414, 927, 937),
-	(1416, 937, 938),
-	(1418, 939, 935),
-	(1419, 935, 940),
-	(1420, 940, 938),
-	(1422, 348, 936),
-	(1424, 933, 921),
-	(1426, 510, 941),
-	(1427, 941, 942),
-	(1429, 941, 509),
-	(1431, 943, 852),
-	(1432, 852, 944),
-	(1433, 944, 584),
-	(1434, 584, 945),
-	(1435, 945, 946),
-	(1439, 947, 948),
-	(1440, 948, 39),
-	(1442, 949, 948),
-	(1443, 948, 40),
-	(1445, 841, 72),
-	(1447, 840, 72),
-	(1449, 950, 71),
-	(1451, 951, 952),
-	(1453, 953, 950),
-	(1454, 950, 947),
-	(1457, 841, 954),
-	(1458, 955, 956),
-	(1459, 956, 402),
-	(1461, 957, 958),
-	(1463, 958, 400),
-	(1465, 957, 959),
-	(1466, 959, 121),
-	(1468, 960, 952),
-	(1470, 335, 961),
-	(1471, 962, 87),
-	(1473, 963, 368),
-	(1475, 559, 553),
-	(1476, 553, 964),
-	(1477, 381, 552),
-	(1479, 552, 965),
-	(1481, 551, 966),
-	(1482, 966, 967),
-	(1483, 967, 968),
-	(1484, 968, 380),
-	(1486, 551, 969),
-	(1541, 898, 970),
-	(1487, 969, 486),
-	(1489, 969, 487),
-	(1491, 559, 971),
-	(1492, 966, 965),
-	(1494, 972, 967),
-	(1495, 967, 973),
-	(1496, 973, 974),
-	(1497, 974, 550),
-	(1499, 974, 973),
-	(1500, 973, 968),
-	(1502, 549, 975),
-	(1503, 975, 378),
-	(1505, 548, 976),
-	(1506, 975, 977),
-	(1507, 978, 379),
-	(1509, 507, 979),
-	(1510, 542, 980),
-	(1511, 981, 982),
-	(1513, 112, 983),
-	(1514, 984, 985),
-	(1515, 985, 398),
-	(1517, 940, 411),
-	(1518, 411, 411),
-	(1520, 986, 587),
-	(1521, 587, 987),
-	(1523, 885, 988),
-	(1524, 989, 990),
-	(1525, 990, 991),
-	(1526, 990, 992),
-	(1527, 990, 993),
-	(1528, 994, 990),
-	(1530, 990, 995),
-	(1531, 996, 709),
-	(1532, 709, 997),
-	(1533, 998, 898),
-	(1534, 898, 899),
-	(1535, 899, 970),
-	(1536, 970, 999),
-	(1537, 999, 898),
-	(1543, 898, 999),
-	(1545, 334, 1000),
-	(1546, 69, 1001),
-	(1547, 1001, 1002),
-	(1548, 1003, 1004),
-	(1550, 1005, 1006),
-	(1552, 337, 1007),
-	(1553, 69, 1008),
-	(1554, 570, 1009),
-	(1555, 1009, 1010),
-	(1556, 1011, 1012),
-	(1557, 884, 772),
-	(1559, 1013, 1014),
-	(1613, 508, 129),
-	(1560, 1014, 1015),
-	(1562, 1016, 1014),
-	(1564, 1017, 1018),
-	(1565, 581, 1019),
-	(1566, 582, 1020),
-	(1567, 78, 1021),
-	(1568, 536, 1022),
-	(1569, 1022, 73),
-	(1571, 44, 539),
-	(1573, 537, 1023),
-	(1574, 538, 1024),
-	(1575, 317, 1025),
-	(1576, 317, 1026),
-	(1577, 319, 1027),
-	(1578, 318, 944),
-	(1580, 718, 1028),
-	(1581, 126, 1029),
-	(1582, 1029, 1030),
-	(1583, 1030, 405),
-	(1584, 405, 1031),
-	(1585, 1031, 1032),
-	(1586, 1032, 1033),
-	(1588, 403, 430),
-	(1589, 430, 1034),
-	(1590, 1034, 123),
-	(1592, 1032, 1035),
-	(1593, 1035, 1036),
-	(1595, 1035, 1037),
-	(1597, 1038, 405),
-	(1599, 1039, 1030),
-	(1601, 598, 1040),
-	(1602, 1036, 1041),
-	(1604, 1042, 1043),
-	(1606, 1042, 1044),
-	(1607, 1043, 1045),
-	(1608, 1046, 1047),
-	(1610, 1046, 1048),
-	(1611, 1047, 1049),
-	(1612, 128, 508),
-	(1615, 127, 426),
-	(1617, 215, 222),
-	(1619, 223, 707),
-	(1621, 707, 224),
-	(1623, 224, 216),
-	(1625, 216, 225),
-	(1627, 226, 211),
-	(1629, 211, 220),
-	(1631, 215, 221),
-	(1633, 640, 644),
-	(1635, 49, 390),
-	(1636, 390, 1050),
-	(1637, 1050, 1051),
-	(1638, 438, 1001),
-	(1639, 1001, 569),
-	(1640, 569, 104),
-	(1641, 104, 1052),
-	(1642, 1052, 338),
-	(1643, 338, 388),
-	(1644, 388, 384),
-	(1645, 384, 982),
-	(1646, 982, 1053),
-	(1647, 1053, 389),
-	(1648, 389, 107),
-	(1649, 107, 1054),
-	(1650, 1054, 448),
-	(1651, 448, 330),
-	(1652, 330, 325),
-	(1653, 325, 393),
-	(1654, 393, 1055),
-	(1655, 1055, 943),
-	(1657, 436, 1056),
-	(1658, 1056, 1029),
-	(1659, 1029, 601),
-	(1660, 601, 1057),
-	(1661, 1057, 1034),
-	(1662, 1034, 959),
-	(1663, 959, 439),
-	(1664, 439, 421),
-	(1665, 421, 447),
-	(1666, 447, 446),
-	(1667, 446, 1054),
-	(1668, 1054, 47),
-	(1669, 47, 485),
-	(1671, 604, 1009),
-	(1672, 1009, 68),
-	(1674, 1031, 600),
-	(1675, 600, 956),
-	(1676, 956, 985),
-	(1677, 985, 340),
-	(1678, 340, 920),
-	(1679, 920, 351),
-	(1680, 351, 924),
-	(1681, 924, 1058),
-	(1682, 1058, 412),
-	(1683, 412, 1055),
-	(1684, 1055, 35),
-	(1686, 1059, 579),
-	(1687, 579, 1060),
-	(1688, 1060, 81),
-	(1690, 82, 1061),
-	(1691, 1061, 1062),
-	(1692, 1062, 484),
-	(1693, 484, 1022),
-	(1694, 1022, 42),
-	(1696, 392, 371),
-	(1697, 371, 1063),
-	(1698, 1063, 1061),
-	(1699, 1061, 80),
-	(1700, 80, 580),
-	(1701, 580, 1064),
-	(1703, 89, 1065),
-	(1704, 1065, 51),
-	(1705, 51, 1053),
-	(1707, 1052, 61),
-	(1708, 61, 513),
-	(1709, 513, 534),
-	(1710, 534, 501),
-	(1711, 501, 498),
-	(1712, 498, 1065),
-	(1713, 1065, 392),
-	(1715, 461, 572),
-	(1716, 572, 610),
-	(1717, 610, 1066),
-	(1718, 1066, 1067),
-	(1719, 1067, 1068),
-	(1720, 1068, 607),
-	(1722, 711, 1069),
-	(1723, 1069, 1070),
-	(1724, 1070, 701),
-	(1725, 701, 1071),
-	(1726, 1071, 694),
-	(1727, 694, 609),
-	(1728, 609, 1072),
-	(1729, 1072, 456),
-	(1730, 456, 1067),
-	(1772, 1073, 946),
-	(1732, 715, 1074),
-	(1733, 1074, 1075),
-	(1734, 1075, 1076),
-	(1735, 1076, 710),
-	(1737, 1068, 455),
-	(1738, 455, 1077),
-	(1739, 1077, 608),
-	(1740, 608, 693),
-	(1741, 693, 1078),
-	(1742, 1078, 712),
-	(1743, 712, 1076),
-	(1744, 1076, 1079),
-	(1745, 1079, 1080),
-	(1746, 1080, 1081),
-	(1747, 1081, 1082),
-	(1748, 1066, 457),
-	(1749, 457, 1072),
-	(1750, 1072, 1077),
-	(1752, 1083, 1075),
-	(1753, 1075, 713),
-	(1755, 714, 1074),
-	(1756, 1074, 1084),
-	(1757, 1071, 1078),
-	(1759, 1078, 1070),
-	(1760, 1070, 700),
-	(1762, 1033, 1085),
-	(1763, 1085, 310),
-	(1764, 310, 307),
-	(1765, 307, 1086),
-	(1766, 1086, 1087),
-	(1767, 1087, 986),
-	(1768, 986, 1088),
-	(1769, 1088, 1089),
-	(1770, 1089, 406),
-	(1771, 406, 1073),
-	(1773, 946, 917),
-	(1774, 917, 1090),
-	(1775, 1090, 1091),
-	(1776, 1091, 1092),
-	(1777, 1092, 1093),
-	(1778, 1093, 1094),
-	(1779, 1094, 1064),
-	(1780, 1064, 1059),
-	(1781, 1059, 1095),
-	(1782, 1095, 1096),
-	(1783, 1096, 896),
-	(1785, 395, 1058),
-	(1786, 1058, 1097),
-	(1787, 1097, 934),
-	(1788, 934, 1098),
-	(1789, 1098, 1099),
-	(1790, 1099, 320),
-	(1791, 320, 586),
-	(1792, 586, 1089),
-	(1794, 987, 588),
-	(1795, 588, 1087),
-	(1797, 1063, 85),
-	(1798, 85, 1100),
-	(1799, 1100, 353),
-	(1801, 1050, 106),
-	(1803, 1062, 1101),
-	(1804, 370, 1100),
-	(1805, 1100, 1102),
-	(1807, 1102, 1103);
-
diff --git a/src/label_graph/test/pgrouting_brokengraph.result b/src/label_graph/test/pgrouting_brokengraph.result
deleted file mode 100644
index e69de29..0000000
diff --git a/src/label_graph/test/pgrouting_brokengraph.test.sql b/src/label_graph/test/pgrouting_brokengraph.test.sql
deleted file mode 100644
index f41b7f4..0000000
--- a/src/label_graph/test/pgrouting_brokengraph.test.sql
+++ /dev/null
@@ -1,52 +0,0 @@
-set client_min_messages to warning;
-SET search_path TO public;
-drop table if exists "ways";
-
--- The following should be OK
-
-	select pgr_brokenGraph('ways');
-	select pgr_brokenGraph('Ways');
-	select pgr_brokenGraph('ways', 'id');
-	select pgr_brokenGraph('ways', 'id', 'source');
-	select pgr_brokenGraph('ways', 'id', 'source', 'target');
-	select pgr_brokenGraph('ways', 'id', 'source', 'target', 'subgraph');
-	select pgr_brokenGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<100');
-
-	-- When table located in another schema e03
-	select pgr_brokenGraph('e03.ways');
-	select pgr_brokenGraph('e03.Ways');
-	select pgr_brokenGraph('e03.ways', 'id');
-	select pgr_brokenGraph('e03.ways', 'id', 'source');
-	select pgr_brokenGraph('e03.ways', 'id', 'source', 'target');
-	select pgr_brokenGraph('e03.ways', 'id', 'source', 'target', 'subgraph');
-	select pgr_brokenGraph('e03.ways', 'id', 'source', 'target', 'subgraph', 'id<100');
-
-	-- When using the named notation
-	select pgr_brokenGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido', source:='salida');
-	select pgr_brokenGraph('e03.calles', rows_where:='gido<100', id:='gido', source:='salida', target:='destino', subgraph:='subgraph');
-
--- The following should FAIL
-	
-	select pgr_brokenGraph('id', 'ways');
-	select pgr_brokenGraph('ways', 'id', 'sourc', 'target');
-	select pgr_brokenGraph('ways', 'id', 'source', 'Target');
-	select pgr_brokenGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<');
-
-	-- When table located in another schema e03
-	select pgr_brokenGraph('e03.calles');
-	select pgr_brokenGraph('e03.Calles');
-	select pgr_brokenGraph('id', 'e03.calles');
-	select pgr_brokenGraph('e03.calles', 'id', 'sourc', 'target');
-	select pgr_brokenGraph('e03.calles', 'gido', 'source', 'target', 'subgraph', 'id<');
-	select pgr_brokenGraph('e03.calles', 'gid', 'salida', 'target', 'subgraph', 'id<10');
-	select pgr_brokenGraph('e03.calles', 'gid', 'salida', 'destino', 'subgraph', 'id<10 AND id>100');
-
-	-- When using the named notation
-	select pgr_brokenGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido');
-	select pgr_brokenGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido', source:='salido');
-	select pgr_brokenGraph(rows_where:='gido<100', id:='gido', source:='salida', 'e03.calles', target:='destino', subgraph:='subgraph');
-
--- The following should return "rows_where condition generated 0 rows"
-
-	select pgr_brokenGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<10 AND id>100');
-	select pgr_brokenGraph('e03.calles', id:='gido', rows_where:='gido<100 AND gido>200', source:='salida', target:='destino', subgraph:='subgraph');
diff --git a/src/label_graph/test/pgrouting_labelgraph.data b/src/label_graph/test/pgrouting_labelgraph.data
new file mode 100644
index 0000000..5c3f15a
--- /dev/null
+++ b/src/label_graph/test/pgrouting_labelgraph.data
@@ -0,0 +1,134 @@
+create table ways(
+	id BIGSERIAL,
+    dir character varying,
+    source BIGINT,
+    target BIGINT,
+    cost FLOAT,
+    reverse_cost FLOAT,
+    x1 FLOAT,
+    y1 FLOAT,
+    x2 FLOAT,
+    y2 FLOAT,
+    the_geom geometry
+);
+
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
+INSERT INTO ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
+
+UPDATE ways SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
+dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
+   WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
+   WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
+   ELSE '' END;                                -- unknown
+
+SELECT pgr_createTopology('ways',0.001);
+
+
+------------------------------------------------------------------------------------------------
+
+create schema e03;
+
+create table e03.calles(
+	gido BIGSERIAL,
+	dir character varying,
+	salida BIGINT,
+	destino BIGINT,
+    cost FLOAT,
+    reverse_cost FLOAT,
+    x1 FLOAT,
+    y1 FLOAT,
+    x2 FLOAT,
+    y2 FLOAT,
+    the_geom geometry
+);
+
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
+INSERT INTO e03.calles (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
+
+UPDATE e03.calles SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
+dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
+   WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
+   WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
+   ELSE '' END;                                -- unknown
+
+SELECT pgr_createTopology('e03.calles',0.001,id:='gido',source:='salida',target:='destino');
+
+
+------------------------------------------------------------------------------------------------
+
+
+create table e03.ways(
+	id BIGSERIAL,
+    dir character varying,
+    source BIGINT,
+    target BIGINT,
+    cost FLOAT,
+    reverse_cost FLOAT,
+    x1 FLOAT,
+    y1 FLOAT,
+    x2 FLOAT,
+    y2 FLOAT,
+    the_geom geometry
+);
+
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
+INSERT INTO e03.ways (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
+
+UPDATE e03.ways SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
+dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
+   WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
+   WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
+   ELSE '' END;                                -- unknown
+
+SELECT pgr_createTopology('e03.ways',0.001);
+
+
+------------------------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/src/apsp_warshall/test/CMakeLists.txt b/src/label_graph/test/pgrouting_labelgraph.result
similarity index 100%
rename from src/apsp_warshall/test/CMakeLists.txt
rename to src/label_graph/test/pgrouting_labelgraph.result
diff --git a/src/label_graph/test/pgrouting_labelgraph.test.sql b/src/label_graph/test/pgrouting_labelgraph.test.sql
new file mode 100644
index 0000000..5160957
--- /dev/null
+++ b/src/label_graph/test/pgrouting_labelgraph.test.sql
@@ -0,0 +1,74 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+set client_min_messages to warning;
+SET search_path TO public;
+drop table if exists "ways";
+
+-- The following should be OK
+
+	select pgr_labelGraph('ways');
+	select pgr_labelGraph('Ways');
+	select pgr_labelGraph('ways', 'id');
+	select pgr_labelGraph('ways', 'id', 'source');
+	select pgr_labelGraph('ways', 'id', 'source', 'target');
+	select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph');
+	select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<100');
+
+	-- When table located in another schema e03
+	select pgr_labelGraph('e03.ways');
+	select pgr_labelGraph('e03.Ways');
+	select pgr_labelGraph('e03.ways', 'id');
+	select pgr_labelGraph('e03.ways', 'id', 'source');
+	select pgr_labelGraph('e03.ways', 'id', 'source', 'target');
+	select pgr_labelGraph('e03.ways', 'id', 'source', 'target', 'subgraph');
+	select pgr_labelGraph('e03.ways', 'id', 'source', 'target', 'subgraph', 'id<100');
+
+	-- When using the named notation
+	select pgr_labelGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido', source:='salida');
+	select pgr_labelGraph('e03.calles', rows_where:='gido<100', id:='gido', source:='salida', target:='destino', subgraph:='subgraph');
+
+-- The following should FAIL
+	
+	select pgr_labelGraph('id', 'ways');
+	select pgr_labelGraph('ways', 'id', 'sourc', 'target');
+	select pgr_labelGraph('ways', 'id', 'source', 'Target');
+	select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<');
+
+	-- When table located in another schema e03
+	select pgr_labelGraph('e03.calles');
+	select pgr_labelGraph('e03.Calles');
+	select pgr_labelGraph('id', 'e03.calles');
+	select pgr_labelGraph('e03.calles', 'id', 'sourc', 'target');
+	select pgr_labelGraph('e03.calles', 'gido', 'source', 'target', 'subgraph', 'id<');
+	select pgr_labelGraph('e03.calles', 'gid', 'salida', 'target', 'subgraph', 'id<10');
+	select pgr_labelGraph('e03.calles', 'gid', 'salida', 'destino', 'subgraph', 'id<10 AND id>100');
+
+	-- When using the named notation
+	select pgr_labelGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido');
+	select pgr_labelGraph('e03.calles', target:='destino', subgraph:='subgraph', id:='gido', source:='salido');
+	select pgr_labelGraph(rows_where:='gido<100', id:='gido', source:='salida', 'e03.calles', target:='destino', subgraph:='subgraph');
+
+-- The following should return "rows_where condition generated 0 rows"
+
+	select pgr_labelGraph('ways', 'id', 'source', 'target', 'subgraph', 'id<10 AND id>100');
+	select pgr_labelGraph('e03.calles', id:='gido', rows_where:='gido<100 AND gido>200', source:='salida', target:='destino', subgraph:='subgraph');
diff --git a/src/label_graph/test/test.conf b/src/label_graph/test/test.conf
index 021c65e..d3820d2 100644
--- a/src/label_graph/test/test.conf
+++ b/src/label_graph/test/test.conf
@@ -5,6 +5,10 @@
         'comment' => 'pgr_labelGraph tests for any versions.',
         'data' => [' '],
         'tests' => [qw( 
+            doc-pgr_labelGraph
+)],
+        'documentation' => [qw( 
+            doc-pgr_labelGraph
 )],
 
 
diff --git a/src/linecommand/src/Makefile b/src/linecommand/src/Makefile
index 9869da1..871d66a 100644
--- a/src/linecommand/src/Makefile
+++ b/src/linecommand/src/Makefile
@@ -1,22 +1,28 @@
 CC= g++
 CCFLAGS=  -g -O3 -std=c++11 -Wall -pedantic  
 LDFLAGS= -lboost_program_options -lpq 
-INCFLAGS= -I /usr/include/postgresql/9.4/server/ -I /usr/include/postgresql/ 
+INCFLAGS= -I /usr/include/postgresql/9.3/server/ -I /usr/include/postgresql/ 
 SOURCES= pgRouting.cpp ./../../common/src/signalhandler.cpp ./../../common/src/pgr_assert.cpp  ./../../common/src/basePath_SSEC.cpp
 
 OBJECTS= $(SOURCES:.cpp=.o)
 TARGET= pgRouting
  
 all: $(OBJECTS) $(TARGET) 
- 
-$(TARGET): signalhandler.o pgr_assert.o pgRouting.o basePath_SSEC.o
+
+$(TARGET): pgRouting.o basePath_SSEC.o 
 	$(CC)  -o $@ $^ $(LDFLAGS)
  
-$(TARGET).o: $(TARGET).cpp ./../../common/src/baseGraph.hpp ./../../common/src/pgr_types.h ./../../dijkstra/src/pgr_dijkstra.hpp ../../ksp/src/pgr_ksp.cpp ./../../common/src/basePath_SSEC.hpp
+$(TARGET).o: $(TARGET).cpp ./../../common/src/baseGraph.hpp \
+         ./../../common/src/pgr_types.h \
+         ./../../common/src/basePath_SSEC.hpp \
+         ./../../dijkstra/src/pgr_dijkstra.hpp \
+         ./../../ksp/src/pgr_ksp.hpp \
+         ./../../warshall/src/pgr_warshall.hpp \
+         ./warshall.hpp
 	$(CC)  $(CCFLAGS) $(INCFLAGS) -c $<
  
-%.o: %.cpp %.h 
-	$(CC)  $(CCFLAGS) $(INCFLAGS) -c $<
+#%.o: ./../../common/src/%.c ./../../common/src/%.h 
+#	g++  -c  $(INCFLAGS) $<
 
 %.o: %.cpp %.hpp 
 	$(CC)  $(CCFLAGS) $(INCFLAGS) -c $<
diff --git a/src/linecommand/src/dijkstra.cpp b/src/linecommand/src/dijkstra.cpp
deleted file mode 100644
index eedb23b..0000000
--- a/src/linecommand/src/dijkstra.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-
-      
-template <typename G> 
-void process_dijkstra(G &graph, const std::vector<std::string> &tokens) {
-
-      std::string::size_type sz;
-      if (tokens[1].compare("from") != 0) {
-        std::cout << "missing 'from' kewyword\n";
-        return;
-      }
-
-      std::vector< int64_t > sources; 
-      unsigned int i_ptr = 2;
-
-      for ( ; i_ptr < tokens.size(); ++i_ptr) {
-          if (tokens[i_ptr].compare("to") == 0) break;
-          try {
-            uint64_t start_vertex(stol(tokens[i_ptr], &sz));
-            sources.push_back(start_vertex);
-          } catch(...) {
-            break;
-          }
-      }
-
-      if (i_ptr == tokens.size() || tokens[i_ptr].compare("to") != 0) {
-        std::cout << "dijkstra: 'dist' kewyword not found\n";
-        return;
-      }
-
-      if (sources.size() == 0) {
-        std::cout << "dijkstra: No start value found\n";
-        return;
-      }
-
-      ++i_ptr;
-      if (i_ptr == tokens.size()) {
-        std::cout << "dijkstra: No 'to' values found\n";
-        return;
-      }
-
-      std::vector< int64_t > targets; 
-      for ( ; i_ptr < tokens.size(); ++i_ptr) {
-        auto end_vertex(stol(tokens[i_ptr], &sz));
-        targets.push_back(end_vertex);
-      }
-
-      
-      if (sources.size() == 1 && targets.size() == 1) {
-        // one to one
-        Path path;
-        graph.dijkstra(path, sources[0], targets[0]);
-        std::cout << "THE OPUTPUT ---->  total cost: " << path.cost << "\n";
-        path.print_path();
-        path.clear();
-      } else if (sources.size() == 1 && targets.size() > 1){
-        std::deque<Path> paths;
-        // one to many
-        graph.dijkstra(paths, sources[0], targets);
-
-        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
-        for (unsigned int i = 0; i < paths.size(); ++i) {
-           if (sizeof(paths[i]) == 0) continue; //no solution found
-           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
-           paths[i].print_path();
-        }
-      } else if (sources.size() > 1 && targets.size() == 1){
-        // many to 1
-        std::deque<Path> paths;
-        graph.dijkstra(paths, sources, targets[0]);
-        
-
-        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
-        for (unsigned int i = 0; i < paths.size(); ++i) {
-           if (sizeof(paths[i]) == 0) continue; //no solution found
-           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
-           paths[i].print_path();
-        }
-      } else {
-        //many to many
-        std::deque<Path> paths;
-        graph.dijkstra(paths, sources, targets);
-
-        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
-        for (unsigned int i = 0; i < paths.size(); ++i) {
-          if (sizeof(paths[i]) == 0) continue; //no solution found
-          std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
-          paths[i].print_path();
-        }
-      }
-  
-}
\ No newline at end of file
diff --git a/src/linecommand/src/dijkstra.hpp b/src/linecommand/src/dijkstra.hpp
new file mode 100644
index 0000000..9d338f6
--- /dev/null
+++ b/src/linecommand/src/dijkstra.hpp
@@ -0,0 +1,113 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+      
+template <typename G> 
+void process_dijkstra(G &graph, const std::vector<std::string> &tokens) {
+
+      std::string::size_type sz;
+      if (tokens[1].compare("from") != 0) {
+        std::cout << "missing 'from' kewyword\n";
+        return;
+      }
+
+      std::vector< int64_t > sources; 
+      unsigned int i_ptr = 2;
+
+      for ( ; i_ptr < tokens.size(); ++i_ptr) {
+          if (tokens[i_ptr].compare("to") == 0) break;
+          try {
+            uint64_t start_vertex(stol(tokens[i_ptr], &sz));
+            sources.push_back(start_vertex);
+          } catch(...) {
+            break;
+          }
+      }
+
+      if (i_ptr == tokens.size() || tokens[i_ptr].compare("to") != 0) {
+        std::cout << "dijkstra: 'dist' kewyword not found\n";
+        return;
+      }
+
+      if (sources.size() == 0) {
+        std::cout << "dijkstra: No start value found\n";
+        return;
+      }
+
+      ++i_ptr;
+      if (i_ptr == tokens.size()) {
+        std::cout << "dijkstra: No 'to' values found\n";
+        return;
+      }
+
+      std::vector< int64_t > targets; 
+      for ( ; i_ptr < tokens.size(); ++i_ptr) {
+        auto end_vertex(stol(tokens[i_ptr], &sz));
+        targets.push_back(end_vertex);
+      }
+
+      
+      if (sources.size() == 1 && targets.size() == 1) {
+        // one to one
+        Path path;
+        pgr_dijkstra(graph, path, sources[0], targets[0]);
+        std::cout << "THE OPUTPUT ---->  total cost: " << path.cost << "\n";
+        path.print_path();
+        path.clear();
+
+
+      } else if (sources.size() == 1 && targets.size() > 1){
+        // one to many
+        pgr_dijkstra(graph, paths, sources[0], targets);
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+           if (sizeof(paths[i]) == 0) continue; //no solution found
+           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+           paths[i].print_path();
+        }
+      } else if (sources.size() > 1 && targets.size() == 1){
+        // many to 1
+        std::deque<Path> paths;
+        pgr_dijkstra(graph, paths, sources, targets[0]);
+        
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+           if (sizeof(paths[i]) == 0) continue; //no solution found
+           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+           paths[i].print_path();
+        }
+      } else {
+        //many to many
+        std::deque<Path> paths;
+        pgr_dijkstra(graph, paths, sources, targets);
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+          if (sizeof(paths[i]) == 0) continue; //no solution found
+          std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+          paths[i].print_path();
+        }
+      }
+}
diff --git a/src/linecommand/src/driving.cpp b/src/linecommand/src/driving.cpp
index 0ca5e9a..5d911f4 100644
--- a/src/linecommand/src/driving.cpp
+++ b/src/linecommand/src/driving.cpp
@@ -1,7 +1,9 @@
-/*PGR
+/*PGR-GNU*****************************************************************
 
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,9 +19,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
-
-template <typename G> 
+********************************************************************PGR-GNU*/
 void process_drivingDistance(G &graph, const std::vector<std::string> &tokens) {
 
       std::string::size_type sz;
@@ -71,18 +71,18 @@ void process_drivingDistance(G &graph, const std::vector<std::string> &tokens) {
       }
 
       std::cout << "found " << sources.size() << "starting locations\n";
+      Pgr_dijkstra< G > fn_dijkstra;
 
       if (sources.size() == 1) {
         std::cout << "Performing pgr_DrivingDistance for single source\n";
         Path path;
-        graph.dijkstra_dd(path, sources[0], distance);
+        pgr_drivingDistance(graph, path, sources[0], distance);
         std::cout << "\t\t\tTHE OPUTPUT\n";
         std::cout << "seq\tfrom\tnode\tedge\tcost\n";
         path.print_path();
       } else {
-
         std::deque< Path >  paths;
-        graph.dijkstra_dd(paths, sources, distance);
+        pgr_drivingDistance(graph, paths, sources, distance);
         if (equiCost == false) {
           std::cout << "Performing pgr_DrivingDistance for multiple sources\n";
           std::cout << "\t\t\tTHE OPUTPUT\n";
diff --git a/src/linecommand/src/ksp.cpp b/src/linecommand/src/ksp.cpp
new file mode 100644
index 0000000..c020fd0
--- /dev/null
+++ b/src/linecommand/src/ksp.cpp
@@ -0,0 +1,99 @@
+
+      
+template <typename G> 
+void process_ksp(G &graph, const std::vector<std::string> &tokens) {
+
+      std::string::size_type sz;
+      if (tokens[1].compare("from") != 0) {
+        std::cout << "ksp: missing 'from' kewyword\n";
+        return;
+      }
+
+      std::vector< int64_t > sources; 
+      unsigned int i_ptr = 2;
+
+      for ( ; i_ptr < tokens.size(); ++i_ptr) {
+          if (tokens[i_ptr].compare("to") == 0) break;
+          try {
+            uint64_t start_vertex(stol(tokens[i_ptr], &sz));
+            sources.push_back(start_vertex);
+          } catch(...) {
+            break;
+          }
+      }
+
+      if (i_ptr == tokens.size() || tokens[i_ptr].compare("to") != 0) {
+        std::cout << "ksp: 'to' kewyword not found\n";
+        return;
+      }
+
+      if (sources.size() == 0) {
+        std::cout << "ksp: No start value found\n";
+        return;
+      }
+
+      ++i_ptr;
+      if (i_ptr == tokens.size()) {
+        std::cout << "ksp: No 'to' values found\n";
+        return;
+      }
+
+      std::vector< int64_t > targets; 
+      for ( ; i_ptr < tokens.size(); ++i_ptr) {
+        auto end_vertex(stol(tokens[i_ptr], &sz));
+        targets.push_back(end_vertex);
+      }
+
+      Pgr_ksp< G > ksp;
+      
+      if (sources.size() == 1 && targets.size() == 1) {
+        // one to one
+        std::deque< Path > paths;
+        paths = ksp.Yen(graph, sources[0], targets[0], 3); //TODO make variable
+        std::cout << "THE OPUTPUT ----" << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+           if (sizeof(paths[i]) == 0) continue; //no solution found
+           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+           paths[i].print_path();
+        }
+      } else {
+	std::cout << "ksp: unknown number of arguments\n";
+      }
+#if 0 // ksp is only one to 1
+	else if (sources.size() == 1 && targets.size() > 1){
+        // one to many
+        std::deque<Path> paths;
+        dijkstra.dijkstra(graph, paths, sources[0], targets);
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+           if (sizeof(paths[i]) == 0) continue; //no solution found
+           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+           paths[i].print_path();
+        }
+      } else if (sources.size() > 1 && targets.size() == 1){
+        // many to 1
+        std::deque<Path> paths;
+        dijkstra.dijkstra(graph, paths, sources, targets[0]);
+        
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+           if (sizeof(paths[i]) == 0) continue; //no solution found
+           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+           paths[i].print_path();
+        }
+      } else {
+        //many to many
+        std::deque<Path> paths;
+        dijkstra.dijkstra(graph, paths, sources, targets);
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+          if (sizeof(paths[i]) == 0) continue; //no solution found
+          std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
+          paths[i].print_path();
+        }
+      }
+#endif
+
+}
diff --git a/src/linecommand/src/performance/dijkstra/Makefile b/src/linecommand/src/performance/dijkstra/Makefile
new file mode 100644
index 0000000..848852b
--- /dev/null
+++ b/src/linecommand/src/performance/dijkstra/Makefile
@@ -0,0 +1,31 @@
+CC= g++
+CCFLAGS=  -g -O3 -std=c++0x -Wall -pedantic  
+LDFLAGS= -lboost_program_options -lpq 
+INCFLAGS= -I /usr/include/postgresql/9.3/server/ -I /usr/include/postgresql/ 
+SOURCES= pgRouting.cpp  ./../../../../common/src/basePath_SSEC.cpp
+
+OBJECTS= $(SOURCES:.cpp=.o)
+TARGET= pgRouting
+ 
+all: $(OBJECTS) $(TARGET) 
+
+$(TARGET): pgRouting.o basePath_SSEC.o 
+	$(CC)  -o $@ $^ $(LDFLAGS)
+ 
+$(TARGET).o: $(TARGET).cpp ./../../../../common/src/baseGraph.hpp \
+         ./../../../../common/src/pgr_types.h \
+         ./../../../../common/src/basePath_SSEC.hpp \
+         ./../../../../dijkstra/src/pgr_dijkstra.hpp 
+	$(CC)  $(CCFLAGS) $(INCFLAGS) -c $<
+ 
+#%.o: ./../../common/src/%.c ./../../common/src/%.h 
+#	g++  -c  $(INCFLAGS) $<
+
+%.o: %.cpp %.hpp 
+	$(CC)  $(CCFLAGS) $(INCFLAGS) -c $<
+
+valgrind: pgRouting
+	valgrind -v --track-origins=yes --undef-value-errors=yes --leak-check=full --show-leak-kinds=all ./mainP &> ./valgrindlog.txt
+clean:
+	rm -f *.o $(TARGET) 
+
diff --git a/src/linecommand/src/performance/dijkstra/dijkstra.hpp b/src/linecommand/src/performance/dijkstra/dijkstra.hpp
new file mode 100644
index 0000000..a74f013
--- /dev/null
+++ b/src/linecommand/src/performance/dijkstra/dijkstra.hpp
@@ -0,0 +1,139 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include <ctime>
+#include <chrono>
+
+
+template <typename G> 
+void process_dijkstra(G &graph, const std::vector<std::string> &tokens) {
+
+    std::string::size_type sz;
+    if (tokens[1].compare("from") != 0) {
+        std::cout << "missing 'from' kewyword\n";
+        return;
+    }
+
+    std::vector< int64_t > sources; 
+    unsigned int i_ptr = 2;
+
+    for ( ; i_ptr < tokens.size(); ++i_ptr) {
+        if (tokens[i_ptr].compare("to") == 0) break;
+        try {
+            uint64_t start_vertex(stol(tokens[i_ptr], &sz));
+            sources.push_back(start_vertex);
+        } catch(...) {
+            break;
+        }
+    }
+
+    if (i_ptr == tokens.size() || tokens[i_ptr].compare("to") != 0) {
+        std::cout << "dijkstra: 'dist' kewyword not found\n";
+        return;
+    }
+
+    if (sources.size() == 0) {
+        std::cout << "dijkstra: No start value found\n";
+        return;
+    }
+
+    ++i_ptr;
+    if (i_ptr == tokens.size()) {
+        std::cout << "dijkstra: No 'to' values found\n";
+        return;
+    }
+
+    std::vector< int64_t > targets; 
+    for ( ; i_ptr < tokens.size(); ++i_ptr) {
+        auto end_vertex(stol(tokens[i_ptr], &sz));
+        targets.push_back(end_vertex);
+    }
+
+
+    if (sources.size() == 1 && targets.size() == 1) {
+        // one to one
+        Path path;
+
+        // TIMING DIJKSTRA
+        std::cout << "**************\n\n";
+        clock_t begin = clock();
+        std::time_t start_t = std::time(NULL);
+        std::cout << "Execution starts at: " << std::ctime(&start_t) << "\n";
+        std::chrono::steady_clock::time_point begin_elapsed = std::chrono::steady_clock::now();
+
+
+        pgr_dijkstra(graph, path, sources[0], targets[0]);
+        clock_t end = clock();
+        double elapsed_secs = double(end - begin) / static_cast<double>(CLOCKS_PER_SEC);
+
+        std::time_t end_t = std::time(NULL);
+        std::chrono::steady_clock::time_point end_elapsed = std::chrono::steady_clock::now();
+
+        typedef std::chrono::duration<int,std::milli> millisecs_t ;
+        millisecs_t duration = std::chrono::duration_cast<millisecs_t>(end_elapsed - begin_elapsed);
+
+        std::cout << "Execution started at: " << std::ctime(&start_t);
+        std::cout << "Execution ended at:   " << std::ctime(&end_t);
+        std::cout << "Elapsed time: " << (double)duration.count()/(double)1000 << " Seconds.\n" ;
+        std::cout << "User CPU time: -> " << elapsed_secs << " seconds\n";
+        std::cout << "**************\n\n";
+        // END TIMING DIJKSTRA
+
+        std::cout << "THE OPUTPUT ---->  total cost: " << path.tot_cost() << "\n"
+            << path;
+    } else if (sources.size() == 1 && targets.size() > 1){
+        std::deque<Path> paths;
+        // one to many
+        pgr_dijkstra(graph, paths, sources[0], targets);
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+            if (sizeof(paths[i]) == 0) continue; //no solution found
+            std::cout << "Path #" << i << " cost: " << paths[i].tot_cost() << "\n"
+                << paths[i];
+        }
+    } else if (sources.size() > 1 && targets.size() == 1){
+        // many to 1
+        std::deque<Path> paths;
+        pgr_dijkstra(graph, paths, sources, targets[0]);
+
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+            if (sizeof(paths[i]) == 0) continue; //no solution found
+            std::cout << "Path #" << i << " cost: " << paths[i].tot_cost() << "\n"
+                << paths[i];
+        }
+    } else {
+        //many to many
+        std::deque<Path> paths;
+        pgr_dijkstra(graph, paths, sources, targets);
+
+        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
+        for (unsigned int i = 0; i < paths.size(); ++i) {
+            if (sizeof(paths[i]) == 0) continue; //no solution found
+            std::cout << "Path #" << i << " cost: " << paths[i].tot_cost() << "\n"
+                << paths[i];
+        }
+    }
+}
diff --git a/src/linecommand/src/performance/dijkstra/pgRouting.cpp b/src/linecommand/src/performance/dijkstra/pgRouting.cpp
new file mode 100644
index 0000000..1356b1a
--- /dev/null
+++ b/src/linecommand/src/performance/dijkstra/pgRouting.cpp
@@ -0,0 +1,374 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include <boost/config.hpp>
+#include <string>
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+#include <boost/graph/adjacency_list.hpp>
+
+#include <iostream>
+#include <sstream>
+#include <fstream>
+#include <deque>
+#include <unistd.h>
+#include <libpq-fe.h>
+
+
+#include "postgres.h"
+#include "./../../../../common/src/pgr_types.h"
+#include "./../../../../common/src/basePath_SSEC.hpp"
+#include "./../../../../common/src/baseGraph.hpp"
+#include "./../../../../dijkstra/src/pgr_dijkstra.hpp"
+#include "./dijkstra.hpp"
+
+
+
+/****************************************
+  SIMULATES  THE C CODE THAT LOADS THE DATA
+ ****************************************/
+void import_from_file(const std::string &input_file_name, pgr_edge_t *edges, unsigned int *count, int64_t start_vertex, int64_t end_vertex, bool &found) {
+    const char* file_name = input_file_name.c_str();
+
+    std::ifstream ifs(file_name);
+    if (!ifs) {
+        std::cerr << "The file " << file_name << " can not be opened!" << std::endl;
+        exit(1);
+    }
+
+    ifs >> (*count);
+
+    long edge_id; // , start_id, end_id;
+    //double edge_weight, reverse_weight;
+    bool s_found = false;
+    bool t_found = false;
+
+    unsigned int i = 0;
+    while (i < (*count) && ifs >> edge_id) {
+        if (edge_id == -1)  break;
+        edges[i].id = edge_id;
+        ifs >> edges[i].source;
+        ifs >> edges[i].target;
+        ifs >> edges[i].cost;
+        ifs >> edges[i].reverse_cost;
+        // when loading checking if start and end are found
+        if (!s_found)
+            s_found = ((edges[i].source == start_vertex) || (edges[i].target == end_vertex));
+        if (!t_found)
+            t_found = ((edges[i].source == end_vertex) || (edges[i].target == end_vertex));
+        i++;
+    }
+    ifs.close();
+    found = s_found && t_found;
+}
+
+void get_options_description(po::options_description &od_desc) {
+    od_desc.add_options()
+        ("help", "Produce this help message.")
+        ("test,t",  po::value<bool>()->default_value(true),
+         "For testing purposes.")
+        ("dbname,d", po::value<std::string>()->required(), 
+         "Specifies the name of the database to connect to.")
+        ("host,h",  po::value<std::string>()->default_value("localhost"),
+         "Specifies the host name of the machine on which the server is running.")
+        ("port,p",  po::value<std::string>()->default_value("5432"),
+         "Port number to connect to at the server host.")
+        ("username,U",  po::value<std::string>()->default_value(getlogin()),
+         "Connect to the database as the user username instead of the default.\n (You must have permission to do so, of course.)")
+        ("password,W",  po::value<std::string>()->default_value(""),
+         "User's the password.\n")
+        ;
+}
+
+
+int process_command_line(
+        po::variables_map &vm, 
+        po::options_description &od_desc) {
+
+    if (vm.count("help")) {
+        std::cout << od_desc << "\n";
+        return 0;
+    }
+
+    if (vm.count("dbname")) 
+        std::cout << "dbname = " << vm["dbname"].as<std::string>() << "\n";
+    else
+        std::cout << "Parameter: dbname missing\n";
+
+    if (vm.count("host")) 
+        std::cout << "host = " << vm["host"].as<std::string>() << "\n";
+    else
+        std::cout << "Parameter: host missing\n";
+
+    if (vm.count("port")) 
+        std::cout << "port = " << vm["port"].as<std::string>() << "\n";
+    else
+        std::cout << "Parameter: port missing\n";
+
+    if (vm.count("username")) 
+        std::cout << "username = " << vm["username"].as<std::string>() << "\n";
+    else
+        std::cout << "Parameter: username missing\n";
+
+    if (vm.count("password")) 
+        std::cout << "password = " << vm["password"].as<std::string>() << "\n";
+    else
+        std::cout << "Parameter: password missing\n";
+
+    if (vm.count("dbname") & vm.count("username") & vm.count("host") & vm.count("password")) {
+        std::cout << "Parameters: \n"
+            << vm["dbname"].as<std::string>() << "\n"
+            << vm["username"].as<std::string>() << "\n"
+            << vm["password"].as<std::string>() << "\n"
+            << vm["host"].as<std::string>() << ".\n";
+        return 2;
+    } else {
+        std::cout << "Missing parameter.\n";
+        std::cout << od_desc << "\n";
+        return 1;
+    }
+}
+
+
+    static void
+exit_nicely(PGconn *conn)
+{
+    PQfinish(conn);
+    exit(1);
+}
+
+
+
+template <typename G> 
+void process(G graph, pgr_edge_t *data_edges, int row_count) {
+    graph.graph_insert_data(data_edges, row_count);
+    std::vector<int64_t> targets;
+    std::string::size_type sz;
+
+
+    // read the command and break into tokens
+    std::string cmd;
+    std::string buf;
+    std::vector<std::string> tokens;
+    while (true) {
+        std::cout << "\n\n\n\n\t\t COMMANDS\n\n "
+
+            << "\n\tDIJKSTRA\n"
+            << "(Input the command separating with spaces)\n"
+            << "\tdijkstra from  to \n"
+            << "\tdijkstra from  to1 to2 to3\n\n"
+
+            << "\n\tFINISH\n"
+            << "\tend\n\n"
+            << ">>>";
+        tokens.clear();
+        targets.clear();
+        cmd = "";
+        std::getline(std::cin, cmd);
+        std::stringstream ss(cmd);
+        while (ss >> buf) {
+            tokens.push_back(buf);
+        }
+
+        if (tokens.size() == 0) {
+            std::cout << "No command received\n";
+            continue;
+        }
+
+        if (tokens[0].compare("end")==0) return;
+
+        if (tokens[0].compare("dijkstra") != 0) {
+            std::cout << "Command: " << cmd << " not found\n";
+            continue;
+        }
+
+
+        if (tokens[0].compare("dijkstra") == 0) {
+            process_dijkstra(graph, tokens);
+        }
+    }
+}
+
+
+
+int main(int ac, char* av[]) {
+    po::options_description od_desc("Allowed options");
+    get_options_description(od_desc);
+
+    po::variables_map vm;
+    po::store(po::parse_command_line(ac, av, od_desc), vm);
+    if (vm.count("help")) {
+        std::cout << od_desc << "\n"; 
+        return 0;
+    }
+
+    try{
+        po::notify(vm);
+    }
+    catch(...){
+        std::cout << od_desc << "\n"; 
+        return 0;	
+    } 
+
+    auto ret_val = process_command_line(vm, od_desc);
+    if (ret_val != 2) return ret_val;
+
+
+    auto db_dbase(vm["dbname"].as<std::string>());
+    auto db_host(vm["host"].as<std::string>());
+    auto db_port(vm["port"].as<std::string>());
+    auto db_username(vm["username"].as<std::string>());
+    auto db_pwd(vm["password"].as<std::string>());
+    auto test(vm["test"].as<bool>());
+    auto db_conn = "host=" + db_host
+            + " user=" +  db_username
+            + " dbname=" + db_dbase
+            + " port=" + db_port
+            + " password=" + db_pwd;
+
+    std::cout << "connection: " << db_conn <<"\n";
+
+    const char *conninfo = db_conn.c_str();
+    PGconn     *conn;
+    PGresult   *res;
+    int rec_count, col_count;
+
+
+    conn = PQconnectdb(conninfo);
+    /* Check to see that the backend connection was successfully made */
+    if (PQstatus(conn) != CONNECTION_OK)
+    {
+        fprintf(stderr, "Connection to database failed: %s",
+                PQerrorMessage(conn));
+        exit_nicely(conn);
+        exit(0);
+    }
+
+    std::string data_sql;
+    if (test) {
+        data_sql = "select id, source, target, cost, reverse_cost from edge_table order by id";
+    } else {
+        std::cout << "Input data query: ";
+        std::getline (std::cin,data_sql);
+    }
+    std::cout << "\nThe data is from:" << data_sql <<"\n";
+
+    res = PQexec(conn, data_sql.c_str());
+
+    if (PQresultStatus(res) != PGRES_TUPLES_OK) {
+        std::cout << "We did not get any data!\n";
+        exit_nicely(conn);
+        exit(1);
+    }
+
+    rec_count = PQntuples(res);
+    col_count = PQnfields(res);
+    if (col_count > 5 || col_count < 4) {
+        std::cout << "Max number of columns 5\n";
+        std::cout << "Min number of columns 4\n";
+        exit_nicely(conn);
+        exit(1);
+    }
+
+    auto id_fnum = PQfnumber(res, "id");
+    auto source_fnum = PQfnumber(res, "source");
+    auto target_fnum = PQfnumber(res, "target");
+    auto cost_fnum = PQfnumber(res, "cost");
+    auto reverse_fnum = PQfnumber(res, "reverse_cost");
+
+
+
+    pgr_edge_t *data_edges;
+    data_edges = (pgr_edge_t *) malloc(rec_count * sizeof(pgr_edge_t));
+
+
+    printf("We received %d records.\n", rec_count);
+    puts("==========================");
+
+
+
+    std::string::size_type sz;
+    std::string str;
+
+    for (int row = 0; row < rec_count; ++row) {
+        str = std::string(PQgetvalue(res, row, id_fnum));
+        data_edges[row].id = stol(str, &sz);
+
+        str = std::string(PQgetvalue(res, row, source_fnum));
+        data_edges[row].source = stol(str, &sz);
+
+        str = std::string(PQgetvalue(res, row, target_fnum));
+        data_edges[row].target = stol(str, &sz);
+
+        str = std::string(PQgetvalue(res, row, cost_fnum));
+        data_edges[row].cost = stod(str, &sz);
+
+        if (reverse_fnum != -1) {
+            str = std::string(PQgetvalue(res, row, reverse_fnum));
+            data_edges[row].reverse_cost = stod(str, &sz);
+        } 
+#if 0
+        std::cout << "\tid: " << data_edges[row].id << "\t";
+        std::cout << "\tsource: " << data_edges[row].source << "\t";
+        std::cout << "\ttarget: " << data_edges[row].target << "\t";
+        std::cout << "\tcost: " << data_edges[row].cost << "\t";
+        if (reverse_fnum != -1) {
+            std::cout << "\treverse: " << data_edges[row].reverse_cost << "\t";
+        }
+        std::cout << "\n";
+#endif
+    }
+
+
+    puts("==========================");
+
+    PQclear(res);
+
+    PQfinish(conn);
+
+
+    //////////////////////  END READING DATA FROM DATABASE ///////////////////
+
+    std::string directed;
+    std::cout << "Is the graph directed [N,n]? default[Y]";
+    std::getline(std::cin,directed);
+    graphType gType =  (directed.compare("N")==0 || directed.compare("n")==0)? UNDIRECTED: DIRECTED;
+    bool directedFlag =  (directed.compare("N")==0 || directed.compare("n")==0)? false: true;
+
+
+    const int initial_size = rec_count;
+
+
+    Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+    Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+
+    if (directedFlag) {
+        process(digraph, data_edges, rec_count);
+    } else {
+        process(undigraph, data_edges, rec_count);
+    }
+
+}
+
+
diff --git a/src/linecommand/src/pgRouting.cpp b/src/linecommand/src/pgRouting.cpp
index 60be22a..771af5b 100644
--- a/src/linecommand/src/pgRouting.cpp
+++ b/src/linecommand/src/pgRouting.cpp
@@ -1,7 +1,9 @@
-/*PGR
+/*PGR-GNU*****************************************************************
 
-Copyright (c) 2015 Celia Virginia Vergara Castillo
-vicky_vergara at hotmail.com
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,7 +19,7 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-*/
+********************************************************************PGR-GNU*/
 
 /************************************************************************/
 /* $Id: MainP.cpp 65 2010-09-08 06:48:36Z yan.qi.asu $                                                                 */
@@ -41,9 +43,12 @@ namespace po = boost::program_options;
 #include "./../../common/src/pgr_types.h"
 #include "./../../common/src/basePath_SSEC.hpp"
 #include "./../../dijkstra/src/pgr_dijkstra.hpp"
+#include "./../../warshall/src/pgr_warshall.hpp"
 #include "./../../ksp/src/pgr_ksp.hpp"
 #include "./driving.cpp"
-#include "./dijkstra.cpp"
+#include "./dijkstra.hpp"
+#include "./ksp.cpp"
+#include "./warshall.hpp"
 
 
 
@@ -88,7 +93,7 @@ void import_from_file(const std::string &input_file_name, pgr_edge_t *edges, uns
 void get_options_description(po::options_description &od_desc) {
     od_desc.add_options()
         ("help", "Produce this help message.")
-        ("test,t",  po::value<bool>()->default_value(false),
+        ("test,t",  po::value<bool>()->default_value(true),
             "For testing purposes.")
         ("dbname,d", po::value<std::string>()->required(), 
             "Specifies the name of the database to connect to.")
@@ -164,7 +169,7 @@ exit_nicely(PGconn *conn)
 
 template <typename G> 
 void process(G graph, pgr_edge_t *data_edges, int row_count) {
-  graph.initialize_graph(data_edges, row_count);
+  graph.graph_insert_data(data_edges, row_count);
   std::vector<int64_t> targets;
   std::string::size_type sz;
 
@@ -175,13 +180,23 @@ void process(G graph, pgr_edge_t *data_edges, int row_count) {
   std::vector<std::string> tokens;
   while (true) {
     std::cout << "\n\n\n\n\t\t COMMANDS\n\n "
-     << "\tDIJKSTRA\n"
+     << "\tWARSHALL\n"
+     << "\twarshall\n"
+
+     << "\n\tKSP\n"
+     << "(Input the command separating with spaces)\n"
+     << "\tksp from  to \n"
+
+     << "\n\tDIJKSTRA\n"
      << "(Input the command separating with spaces)\n"
      << "\tdijkstra from  to \n"
      << "\tdijkstra from  to1 to2 to3\n\n"
-     << "\tDRIVING DISTANCE\n"
+
+     << "\n\tDRIVING DISTANCE\n"
      << "(Use kewywords)\n"
      << "\tdrivDist from <id> [<id> ...] dist <distance> [equi]\n"
+
+     << "\n\tFINISH\n"
      << "\tend\n\n"
      << ">>>";
     tokens.clear();
@@ -200,13 +215,9 @@ void process(G graph, pgr_edge_t *data_edges, int row_count) {
 
     if (tokens[0].compare("end")==0) return;
 
-    if (tokens.size() < 2 ) {
-      std::cout << "Missing parameters\n";
-      continue;
-    }
-
-  
     if (tokens[0].compare("dijkstra") != 0 
+       && tokens[0].compare("warshall") != 0 
+       && tokens[0].compare("ksp") != 0 
        && tokens[0].compare("drivDist") != 0 ) {
       std::cout << "Command: " << cmd << " not found\n";
       continue;
@@ -215,37 +226,11 @@ void process(G graph, pgr_edge_t *data_edges, int row_count) {
     
     if (tokens[0].compare("dijkstra") == 0) {
        process_dijkstra(graph, tokens);
+    } else if (tokens[0].compare("ksp") == 0) {
+       process_ksp(graph, tokens);
+    } else if (tokens[0].compare("warshall") == 0) {
+       process_warshall(graph, tokens);
     } else {
-#if 0
-      if (tokens[1].compare("from") == 0) {
-        std::cout << "missing 'from' kewyword";
-      }
-      start_vertex = stol(tokens[1], &sz);
-      if (tokens.size() == 2) {   
-        Path path;
-        end_vertex = stol(tokens[2], &sz);
-        graph.dijkstra(path, start_vertex, end_vertex);
-        std::cout << "THE OPUTPUT ---->  total cost: " << path.cost << "\n";
-        path.print_path();
-        path.clear();
-      } else {
-        std::deque<Path> paths;
-        for (unsigned int i = 2; i < tokens.size(); ++i) {
-          end_vertex = stol(tokens[i], &sz);
-          targets.push_back(end_vertex);
-        }
-
-        graph.dijkstra(paths, start_vertex, targets);
-
-        std::cout << "THE OPUTPUTS ---->  total outputs: " << paths.size() << "\n";
-        for (unsigned int i = 0; i < paths.size(); ++i) {
-           if (sizeof(paths[i]) == 0) continue; //no solution found
-           std::cout << "Path #" << i << " cost: " << paths[i].cost << "\n";
-           paths[i].print_path();
-        }
-      }
-    } else if (tokens[0].compare("drivDist") == 0) {
-    #endif
       process_drivingDistance(graph, tokens);
     }
   }
@@ -303,7 +288,8 @@ int main(int ac, char* av[]) {
 
    std::string data_sql;
    if (test) {
-     data_sql = "select id, source, target, cost, reverse_cost from edge_table order by id";
+     data_sql = "select id, source, target, cost, -1 as reverse_cost  from table1 order by id";
+     // data_sql = "select id, source, target, cost, reverse_cost from edge_table order by id";
    } else {
      std::cout << "Input data query: ";
      std::getline (std::cin,data_sql);
@@ -387,29 +373,24 @@ int main(int ac, char* av[]) {
 //////////////////////  END READING DATA FROM DATABASE ///////////////////
 
     std::string directed;
-    std::cout << "Is the graph directed? default[N] [Y,y]";
+    std::cout << "Is the graph directed [N,n]? default[Y]";
     std::getline(std::cin,directed);
-    graphType gType =  (directed.compare("Y")==0 || directed.compare("y")==0)? DIRECTED: UNDIRECTED;
-    bool directedFlag =  (directed.compare("Y")==0 || directed.compare("y")==0)? true: false;
-
+    graphType gType =  (directed.compare("N")==0 || directed.compare("n")==0)? UNDIRECTED: DIRECTED;
+    bool directedFlag =  (directed.compare("N")==0 || directed.compare("n")==0)? false: true;
 
 
-    typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
-        boost_vertex_t, boost_edge_t > UndirectedGraph;
-    typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::bidirectionalS,
-        boost_vertex_t, boost_edge_t > DirectedGraph;
-
-    const int initial_size = 1;
+    const int initial_size = rec_count;
 
     
-    Pgr_dijkstra< DirectedGraph > digraph(gType, initial_size);
-    Pgr_dijkstra< UndirectedGraph > undigraph(gType, initial_size);
+    Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+    Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
     
     if (directedFlag) {
       process(digraph, data_edges, rec_count);
     } else {
       process(undigraph, data_edges, rec_count);
     }
+
 }
 
 
diff --git a/src/linecommand/src/warshall.hpp b/src/linecommand/src/warshall.hpp
new file mode 100644
index 0000000..8378986
--- /dev/null
+++ b/src/linecommand/src/warshall.hpp
@@ -0,0 +1,56 @@
+/*PGR
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+#include "./../../warshall/src/pgr_warshall.hpp"
+
+template <typename G> 
+void process_warshall(G &graph, const std::vector<std::string> &tokens) {
+      std::string::size_type sz;
+
+
+      if (tokens.size() == 1) {
+        std::cout << "Performing warshall\n";
+        std::vector< Matrix_cell_t> matrix_rows;
+
+        pgr_warshall(graph, matrix_rows);
+
+        std::cout << "\t\t\tTHE OPUTPUT\n";
+        std::cout << "seq\tfrom\tto\tcost\n";
+        size_t seq = 0;
+        for (size_t i = 0; i < matrix_rows.size(); i++) {
+            std::cout << seq++ << "\t" << matrix_rows[i].from_vid << "\t" <<  matrix_rows[i].to_vid << "\t" << matrix_rows[i].cost << "\n";
+        }
+#ifdef TEST_POSTGRES
+        size_t result_tuple_count;
+        Matrix_cell_t *postgres_rows = NULL;
+        pgr_warshall(graph, result_tuple_count, &postgres_rows);
+        std::cout << "\t\t\tTHE POSTGRESQL OPUTPUT\n";
+        std::cout << "seq\tfrom\tto\tcost\n";
+        seq = 0;
+        for (size_t i = 0; i < result_tuple_count; i++) {
+            std::cout << seq++ << "\t" << postgres_rows[i].from_vid << "\t" <<  postgres_rows[i].to_vid << "\t" << postgres_rows[i].cost << "\n";
+        }
+#endif  // TEST_POSTGRES
+        
+      } else {
+        std::cout << "unknown number of parameters\n";
+      }
+}
+
diff --git a/src/mainpage.dox b/src/mainpage.dox
new file mode 100644
index 0000000..89f10e5
--- /dev/null
+++ b/src/mainpage.dox
@@ -0,0 +1,272 @@
+/*! \mainpage pgRouting Developer's Documentation
+ 
+\section intro_sec Introduction
+ 
+This documentation is focused on the developer of pgRouting.
+
+A developer might want to:
+
+  - Fix a bug
+  - Add new functionality
+  - Modify the documentation
+  - Add tests
+    - regression
+    - benchmark
+ 
+The following steps are based on:
+  - [My Experience with GitHub](https://github.com/pgRouting/pgrouting/wiki/My-Experience-with-GitHub)
+wirtten by Mohamed Zia
+  - [Git Branch Model](http://nvie.com/posts/a-successful-git-branching-model)
+
+\section install_sec Installation for developing
+
+
+Step by Step processing
+
+1. Create a fork of the original pgRouting repository.
+   - If you don't have an account in Github, please [create one](https://github.com/)
+     - for purposes of this document the account name is: `acountName`
+   - Navigate to [pgRouting repository](https://github.com/pgRouting/pgrouting)
+   - In the top-right corner of the page, click Fork.
+   - Additional information can be found in [fork-a-repo](https://help.github.com/articles/fork-a-repo)
+
+2. Now create a local clone of your above created fork
+   - [set up Git](https://help.github.com/articles/set-up-git) in your computer. 
+   - clone your repo
+~~~~{.c}
+     git clone https://github.com/acountName/pgrouting pgrouting
+~~~~
+
+3. Go to your repo
+~~~~{.c}
+     cd pgrouting
+~~~~
+
+4. Seting the remote fetching connections
+   - More on remotes](https://help.github.com/categories/managing-remotes/) . 
+   - check the remote connection
+~~~~{.c}
+    git remote -v
+~~~~
+   -  Add upstream remote (ussually the main repository) 
+~~~~{.c}
+    git remote add upstream https://github.com/pgRouting/pgrouting
+~~~~
+   - check the remote connection
+~~~~{.c}
+    git remote -v
+~~~~
+   - Now you shoud have something like this:
+~~~~{.c}
+origin  https://github.com/acountName/pgrouting (fetch)
+origin  https://github.com/acountName/pgrouting (push)
+upstream        https://github.com/acountName/pgrouting (fetch)
+upstream        https://github.com/acountName/pgrouting (push)
+~~~~
+
+\section branch_model Git Branching Model
+
+We are making big efforts to start using the Git Branching Model
+So here are some basic rules about Master and develop:
+   - Pull requests against Master are almost never be accepted.
+     - For micro changes
+     - let us branch Master to a quick-fix branch
+     - Merge into the quick-fix
+     - We need to do some changes for the release numers etc...
+     - Finnaly we merge into Master
+   - To accept a pull request into develop:
+     - Its the same quick fix as for Master
+     - It has to pass the tests on travis and Jenkins (linux & Windows)
+     - Documentation must be "up to date"
+     - Say that 99.9% is complete
+     
+
+The way we want to work:
+   - If you want to work on a particular issue
+     - Let us know creating an [issue](https://github.com/pgRouting/pgrouting/issues)
+   - We will:
+     - Create a branch derived from develop in the main repo that you can use in your fork
+     - We will make the branch be checked on Travis
+     - Your pull requests will be accepted (even with failures or incomplete)
+     - We can help you with your work (remember it can have failures)
+     - Once is stable we will start making tests on Jenkins
+   - When the work is that 99.9% complete we can:
+     - Merge into develop
+     
+For the rest of the document the following branch has being created in the main repository:
+
+  dev-myFeature
+   
+
+1. To get a list of all the branches
+  - 
+~~~~{.c}
+   git branch -a
+~~~~
+
+2. To make sure you are in the correct branch
+  - 
+~~~~{.c}
+   git status
+~~~~
+
+3. When your forked before `dev-myFeature` was created
+  - fetch the main repository
+~~~~{.c}
+   git fetch upstream
+~~~~
+  - get a list of your branches you should see the branch you are going to use:
+~~~~{.c}
+    git branch -a
+    ...
+    remotes/upstream/dev-myFeature
+    ...
+~~~~
+  - go to your your local copy of the branch and push
+~~~~{.c}
+    git checkout dev-myFeature
+    git push --set-upstream origin dev-myFeature
+~~~~
+
+4. Try new ideas in local branches, commit and merge back when you feel its worth to keep:
+  - branch to a local branch
+~~~~{.c}
+    git checkout -b dev-myFeature-idea1
+~~~~
+  - Work, work, work
+  - Always make sure you are in the branch you want to commit your work
+~~~~{.c}
+    git status
+~~~~
+  - add, delete, commit changes
+~~~~{.c}
+    git add <file>
+    git remove <file>
+    git mv <oldNmae> <newName>
+    git commit -a -m '<commit message>'
+~~~~
+
+5. Merge back your ideas when you feel its worth to keep:
+~~~~{.c}
+    git checkout dev-myFeature
+    git merge dev-myFeature-idea1
+    <fix conflics if any>
+~~~~
+
+  
+\section up_to_date Keep Fork Up to Date
+
+1. To keep your local repository up-to-date
+~~~~{.c}
+    git fetch upstream
+~~~~
+
+2. If you see changes in develop or master:
+   - Commit your work
+   - Update the branch that changed
+~~~~{.c}
+    git checkout develop
+    git pull upstream
+~~~~
+   - Update your branch to include the change
+~~~~{.c}
+    git checkout dev-myFeature
+    git merge develop
+    <fix conflics if any>
+~~~~
+
+
+\section perform_tests Beware of Side Effects
+
+Modifications that you make should not affect other parts of the library.
+pgRouting has a testing tool, so that developers make sure of
+  - Code changes don't generate unexpected results
+  - Bug fixes actually fix the bug
+  - Expected output is generated
+
+1. Move to the root directory.
+
+2. get the help of testing tool:
+~~~~{.c}
+     tools/test-runner.pl -help
+~~~~
+3. run all the tests
+~~~~{.c}
+     tools/test-runner.pl 
+~~~~
+
+\section automate_process Make a run.sh
+
+A shell to automate the compilation and execution is usefull when developing.
+
+1. Move to the root directory.
+
+2. Create your tool:
+~~~~{.c}
+   vi run.sh
+~~~~
+
+3. Insert the usual process for creating and testing, for example:
+~~~~{.c}
+cd build/
+#make clean
+#rm -rf *
+#cmake -DBOOST_ROOT:PATH=/usr/local/boost_1_58_0 ..
+#cmake -DWITH_DOC=ON ..
+cmake ..
+
+make
+
+sudo make install
+#make doc
+
+cd ..
+tools/test-runner.pl -alg common -v -clean -ignorenotice
+#tools/test-runner.pl -alg dijkstra -v -clean 
+#tools/test-runner.pl -alg dijkstra_via_vertices -v -clean 
+#tools/test-runner.pl -alg doc -v -clean -ignorenotice
+~~~~
+
+4. Comment and uncommet the file depending on your particular needs and execute it.
+~~~~{.c}
+   sh run.sh
+~~~~
+
+5. Don't add that file to the repository, its for your development only.
+
+
+\section setup_travis Setup Travis
+
+The main difference between your run.sh test and Travis test is:
+  - With run.sh you are testing locally.
+  - Travis test a matrix combination of  postgreSQL and postGIS versions
+
+To make use of travis test make sure that:
+
+1. Add your branch to  .travis.yml:
+~~~~{.c}
+branches:
+  only:
+    - master
+    - develop
+    - dev-myFeature
+~~~~
+
+2. Push your commit and navigate to [travis-ci](https://travis-ci.org)
+
+
+
+\section file_convetions File conventions
+
+Some conventions for directories and files
+~~~~{.c}
+/src/myfunction/doc/myfunction.rst ---> for myfunction wiki
+/src/myfunction/sql/myfunction.sql ---> stored function code
+/src/myfunction/test/myfunction.data ---> sql to generate test data
+/src/myfunction/test/myfunction.test.sql ---> all possible myfunction usage
+/src/myfunction/test/test.conf ---> perl file to test the function
+/src/myfunction/CMakeLists.txt ---> CMake file
+~~~~
+
+
+*/
diff --git a/src/pickDeliver/CMakeLists.txt b/src/pickDeliver/CMakeLists.txt
new file mode 100644
index 0000000..302fdcd
--- /dev/null
+++ b/src/pickDeliver/CMakeLists.txt
@@ -0,0 +1,5 @@
+SET(PACKAGE_SQL_FILES "")
+ADD_SUBDIRECTORY(sql)
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
+SUBDIRS(doc src test)
+
diff --git a/src/astar/test/CMakeLists.txt b/src/pickDeliver/doc/CMakeLists.txt
similarity index 100%
rename from src/astar/test/CMakeLists.txt
rename to src/pickDeliver/doc/CMakeLists.txt
diff --git a/src/pickDeliver/doc/index.rst b/src/pickDeliver/doc/index.rst
new file mode 100755
index 0000000..ffe5cad
--- /dev/null
+++ b/src/pickDeliver/doc/index.rst
@@ -0,0 +1,85 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_gsocvrppdtw:
+
+pgr_vrppdtw - Pickup and Delivery problem 
+===============================================================================
+
+.. index:: 
+	single: pgr_gsocvrppdtw(text,integer,integer)
+	module: vrppdtw
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_gsoc_vrppdtw`` — Returns optimized  solution
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Vehicle Routing Problem with Pickup and Delivery (VRPPD): A number of goods need to be moved from certain pickup locations to other delivery locations. The goal is to find optimal routes for a fleet of vehicles to visit the pickup and drop-off locations.
+
+.. code-block:: sql
+
+	 pgr_gsoc_vrppdtw(text sql, integer , integer;
+
+
+Description
+-------------------------------------------------------------------------------
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		select * from pgr_gsoc_vrppdtw(
+                                                'select * from customer order by id'::text, 25,200
+                                                                );
+                                                                                                 
+                                                                                                               
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:rid:   route ID
+:nid:   node ID (``-1`` for the last row)
+:cost:  cost to traverse to ``seq``
+
+Examples
+-------------------------------------------------------------------------------
+
+
+.. code-block:: sql
+
+	
+                SELECT  * from pgr_gsoc_vrppdtw(
+                                                'select * from customer order by id'::text, 25,200
+                                                                );
+                                                                                                 
+                                                                                                 
+
+
+	 seq | rid  | nid  | cost 
+	-----+------+------+------
+	   0 |    7 |    8 |    1
+	   1 |    8 |    9 |    1
+	   2 |    9 |   15 |    1
+	   3 |   12 |   -1 |    0
+           . |   .  |   .  |    .  
+           . |   .  |   .  |    .
+ 
+
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* http://en.wikipedia.org/wiki/Vehicle_routing_problem
diff --git a/src/pickDeliver/sql/CMakeLists.txt b/src/pickDeliver/sql/CMakeLists.txt
new file mode 100644
index 0000000..afbdc3c
--- /dev/null
+++ b/src/pickDeliver/sql/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/routing_vrppdtw.sql
+    )
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
+
diff --git a/src/pickDeliver/sql/routing_vrppdtw.sql b/src/pickDeliver/sql/routing_vrppdtw.sql
new file mode 100644
index 0000000..3d2dcd5
--- /dev/null
+++ b/src/pickDeliver/sql/routing_vrppdtw.sql
@@ -0,0 +1,43 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+-----------------------------------------------------------------------
+-- Core function for vrp with sigle depot computation
+-- See README for description
+-----------------------------------------------------------------------
+--
+--
+create or replace function pgr_gsoc_vrppdtw(
+    sql text,
+    vehicle_num INTEGER,
+    capacity FLOAT,
+    OUT seq integer,
+    OUT route_id BIGINT,
+    OUT node_id BIGINT,
+    OUT cost FLOAT
+)
+returns setof record as
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'vrppdtw'
+LANGUAGE c VOLATILE STRICT;
+
+
diff --git a/src/pickDeliver/src/CMakeLists.txt b/src/pickDeliver/src/CMakeLists.txt
new file mode 100644
index 0000000..bd0e6f3
--- /dev/null
+++ b/src/pickDeliver/src/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_library(vrppdtw OBJECT
+    pdp.c
+    customers_input.c
+    pdp_solver.cpp
+    )
+
+
diff --git a/src/pickDeliver/src/Route.h b/src/pickDeliver/src/Route.h
new file mode 100644
index 0000000..9e7e847
--- /dev/null
+++ b/src/pickDeliver/src/Route.h
@@ -0,0 +1,257 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#pragma once
+
+#include <vector>
+#include <algorithm>
+#include "pdp.hpp"
+
+class Route  {
+ public:
+     int twv;
+     int cv;
+     double dis;
+     std::vector < int64_t > path;
+     double capacity;
+     Depot depot;
+
+     Route(int _capacity, const Depot &_depot) :
+         twv(0),
+         cv(0),
+         dis(0),
+         capacity(_capacity),
+         depot(_depot) {
+             path.clear();
+         }
+     void update(const Customers &c);
+     double cost() const;
+     bool insertOrder(const Customers &c, const Pickup &order);
+     void append(const Customers &c, const Pickup &order);
+     void remove(const State &S);
+     int RemoveOrder(
+             const Customers &customers,
+             const Pickup &p);
+     bool has_violation(const Customers &customers);
+     bool has_twv(const Customers &customers);
+};
+
+
+/*
+ * Returns:
+ * 1 - when the order was found and removed
+ * 0 - When the order was not found
+ */
+int
+Route::RemoveOrder(
+        const Customers &customers,
+        const Pickup &pickup) {
+    Route oldRoute = *this;
+    oldRoute.update(customers);
+
+
+    auto pickup_pos = find(path.begin(), path.end(), pickup.Pid);
+
+    if (pickup_pos != path.end())  {
+        path.erase(pickup_pos);
+        auto delivery_pos = find(path.begin(), path.end(), pickup.Did);
+        path.erase(delivery_pos);
+
+        update(customers);
+        return ((dis < depot.Ltime)
+                && (twv < oldRoute.twv || cv < oldRoute.cv || dis < oldRoute.dis))? 1: 2;
+    } else {
+        return 0;
+    }
+}
+
+void
+Route::append(const Customers &customers,
+        const Pickup &pickup) {
+    path.push_back(pickup.Pid);
+    path.push_back(pickup.Did);
+    update(customers);
+}
+
+
+void
+Route::update(const Customers &customers)  {
+    dis = 0;
+    twv = 0;
+    cv = 0;
+    int load = 0;
+    double agg_cost = 0;
+    int prev_node = 0;
+    for (const auto &node : path) {
+        /*
+         * Between nodes
+         */
+        agg_cost += CalculateDistance(customers[prev_node], customers[node]);
+
+        if (agg_cost < customers[node].Etime) {
+            /*
+             * Arrving before the opening time, adjust time, moving it to the opening time
+             */
+            agg_cost = customers[node].Etime;
+        }
+        if (customers[node].Ltime < agg_cost) {
+            /*
+             * arrived after closing time
+             */
+            ++twv;
+        }
+        agg_cost += customers[node].Stime;
+        load += customers[node].demand;
+        if (load > capacity || load < 0) {
+            ++cv;
+        }
+        prev_node = node;
+    }
+    /*
+     * Going back to the depot
+     */
+    agg_cost += CalculateDistance(customers[prev_node], depot);
+    if (depot.Ltime < agg_cost) {
+        ++twv;
+    }
+
+    if (load != 0)  {
+        ++cv;
+    }
+    dis = agg_cost;
+    return;
+}
+
+
+double
+Route::cost() const  {
+    return (0.3*dis)+(0.5*twv)+(0.2*cv);
+}
+
+bool
+Route::has_violation(const Customers &customers) {
+    update(customers);
+    return (twv > 0 || cv > 0);
+}
+
+bool
+Route::has_twv(const Customers &customers) {
+    update(customers);
+    return (twv > 0);
+}
+
+
+bool
+Route::insertOrder(const Customers &customers, const Pickup &order) {
+    /*
+     *  inserting only on a route that does not have twv or cv
+     */
+    if (has_violation(customers)) return false;
+
+
+    path.insert(path.begin(), order.Pid);
+    /*
+     * The pickup is in:
+     */
+    int Ppos = 0;
+    int i;
+    for (i = 1; i < (int)path.size(); i++)  {
+        /*
+         * Inserting without creating violation
+         */
+        if (!has_twv(customers)) break;
+        std::swap(path[Ppos], path[i]);
+        Ppos = i;
+    }
+
+    path.push_back(order.Did);
+    /*
+     * The delivery is in:
+     */
+    int Dpos = path.size() - 1;
+
+    int j;
+    for (j = Dpos; Ppos < j; --j)  {
+        if (!has_violation(customers)) break;
+        std::swap(path[j], path[Dpos]);
+        Dpos = j;
+    }
+
+    /*
+     * Here 2 thngs can happen
+     * We inserted succesfully without violation
+     * Inserting created a violation
+     */
+
+
+    if (has_violation(customers)) {
+        RemoveOrder(customers, order);
+        return false;
+    }
+
+    /* 
+     * ....  Ppos a b c d Dpos ....
+     *
+     * The current route
+     */
+    update(customers);
+    Route bestRoute = *this;
+    Route currRoute = *this;
+
+    for (i = Ppos; i < Dpos; i++) {
+        *this = currRoute;
+        /* 
+         * ....  Ppos a b c d Dpos ....
+         */
+        std::swap(path[Ppos], path[i]);
+        Ppos = i;
+        currRoute = *this;
+
+        /*
+         * for the same position of Ppos
+         * - move the D
+         * - keep track of the best
+         */
+        for (j = Dpos; Ppos < j; j--) {
+            std::swap(path[j], path[Dpos]);
+            Dpos = j;
+            if (!has_violation(customers)
+                    && dis < bestRoute.dis) {
+                bestRoute = *this;
+                bestRoute.update(customers);
+            }
+        }
+    }
+
+    *this = bestRoute;
+
+    return true;
+}
+
+void Route::remove(const State &S)  {
+    twv = S.twv;
+    cv = S.cv;
+    dis = S.dis;
+    path  = S.path;
+}
diff --git a/src/pickDeliver/src/Solution.h b/src/pickDeliver/src/Solution.h
new file mode 100644
index 0000000..8b12c36
--- /dev/null
+++ b/src/pickDeliver/src/Solution.h
@@ -0,0 +1,140 @@
+/*PGR-GNU*****************************************************************
+
+Copyright  (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include <vector>
+
+#include "./Route.h"
+
+class Solution {
+ public:
+     Solution() {
+         cost_total = 0, twv_total = 0, cv_total = 0, dis_total = 0;
+     }
+     // Variables
+     int twv_total;
+     int cv_total;
+     int dis_total;
+     double cost_total;
+     std::vector<Route> routes;
+     // Methods
+     void dump() const;
+     double getCost() const;
+     Solution getBestofNeighborhood(const Solution S,
+             const std::vector<Customer> &c,
+             const std::vector<Pickup> &p) const;
+     void UpdateSol(const Customers &customers);
+};
+
+class Neighborhoods {
+ public:
+     Neighborhoods() {}
+     Solution BestSPI(const Solution S,
+             const std::vector<Customer> &customers,
+             const std::vector<Pickup> &pickups) const;
+};
+
+void
+Solution::UpdateSol(const Customers &customers) {
+    cost_total = 0, twv_total = 0, cv_total = 0, dis_total = 0;
+    routes.erase(std::remove_if(routes.begin(), routes.end(),
+                [] (const Route &r)
+                {return r.path.empty();}),
+            routes.end());
+    for (auto &r : routes) {
+        r.update(customers);
+        twv_total += r.twv;
+        dis_total += r.dis;
+        cv_total  += r.cv;
+        cost_total += r.cost();
+    }
+}
+
+
+// Methods in Solution
+
+
+double
+Solution::getCost() const {
+    double cost_total = 0;
+    for  (const auto &r : routes) {
+        cost_total += r.cost();
+    }
+    return cost_total;
+}
+
+Solution
+Solution::getBestofNeighborhood(const Solution S,
+        const std::vector<Customer> &customers,
+        const std::vector<Pickup> &pickups) const {
+    Neighborhoods N;
+    Solution S1;
+    S1 = N.BestSPI(S, customers, pickups);
+    return S1;
+}
+
+
+Solution
+Neighborhoods::BestSPI(const Solution S,
+        const Customers &customers,
+        const Pickups &pickups) const {
+    Solution CurrSol, BestSol, TempSol;
+    CurrSol = BestSol = S;
+    std::vector<Pickup> OrderRequests = pickups;
+    State TempState;
+
+    BestSol.UpdateSol(customers);
+    // Main SPI
+    for (const auto &order : OrderRequests) {
+        // Order Find and Remove it!
+        CurrSol = BestSol;
+        for (unsigned int route_remove = 0;
+                route_remove < CurrSol.routes.size();
+                route_remove++) {
+
+            int OK = CurrSol.routes[route_remove].RemoveOrder(customers,order);
+
+            if  (OK != 1) continue;
+            TempSol = CurrSol;
+            TempSol.UpdateSol(customers);
+
+            for (auto &route : TempSol.routes) {
+                int OK = route.insertOrder(customers, order);
+                if (!OK) continue;
+                TempSol.UpdateSol(customers);
+                if (TempSol.getCost() < BestSol.getCost()) {
+                    BestSol = TempSol;
+                    CurrSol = TempSol;
+                    break;
+                }
+                /*
+                 * the order was inserted but the distance was not best
+                 */
+                route.RemoveOrder(customers, order);
+            }
+        }
+    }
+
+    return BestSol;
+}
diff --git a/src/pickDeliver/src/customers_input.c b/src/pickDeliver/src/customers_input.c
new file mode 100644
index 0000000..a001679
--- /dev/null
+++ b/src/pickDeliver/src/customers_input.c
@@ -0,0 +1,155 @@
+/*PGR-GNU*****************************************************************
+File: customers_input.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+// #define DEBUG
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/get_check_data.h"
+#include "./customers_input.h"
+
+
+
+
+static
+void pgr_fetch_customer(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info[9],
+        Customer *customer) {
+
+    customer->id = pgr_SPI_getBigInt(tuple, tupdesc, info[0]);
+    customer->x = pgr_SPI_getFloat8(tuple, tupdesc,  info[1]);
+    customer->y = pgr_SPI_getFloat8(tuple, tupdesc, info[2]);
+    customer->demand = pgr_SPI_getFloat8(tuple, tupdesc, info[3]);
+    customer->Etime = pgr_SPI_getFloat8(tuple, tupdesc, info[4]);
+    customer->Ltime = pgr_SPI_getFloat8(tuple, tupdesc, info[5]);
+    customer->Stime = pgr_SPI_getFloat8(tuple, tupdesc, info[6]);
+    customer->Pindex = pgr_SPI_getBigInt(tuple, tupdesc, info[7]);
+    customer->Dindex = pgr_SPI_getBigInt(tuple, tupdesc, info[8]);
+    customer->Ddist = 0;
+}
+
+void
+pgr_get_customers(
+        char *sql,
+        Customer **customers,
+        size_t *total_customers) {
+    const int tuple_limit = 1000;
+
+    size_t ntuples;
+    size_t total_tuples = 0;
+
+    Column_info_t info[9];
+
+    int i;
+    for (i = 0; i < 9; ++i) {
+        info[i].colNumber = -1;
+        info[i].type = -1;
+        info[i].strict = true;
+        info[i].eType = ANY_NUMERICAL;
+    }
+    /*!
+      int64_t id;
+      double x;
+      double y;
+      double demand;
+      double Etime;
+      double Ltime;
+      double Stime;
+      int64_t Pindex;
+      int64_t Dindex;
+      double Ddist;
+      */
+    info[0].name = strdup("id");
+    info[1].name = strdup("x");
+    info[2].name = strdup("y");
+    info[3].name = strdup("demand");
+    info[4].name = strdup("etime");
+    info[5].name = strdup("ltime");
+    info[6].name = strdup("stime");
+    info[7].name = strdup("pindex");
+    info[8].name = strdup("dindex");
+
+    info[0].eType = ANY_INTEGER;
+    info[7].eType = ANY_INTEGER;
+    info[8].eType = ANY_INTEGER;
+
+
+    void *SPIplan;
+    SPIplan = pgr_SPI_prepare(sql);
+
+    Portal SPIportal;
+    SPIportal = pgr_SPI_cursor_open(SPIplan);
+
+
+    bool moredata = TRUE;
+    (*total_customers) = total_tuples;
+
+
+    while (moredata == TRUE) {
+        SPI_cursor_fetch(SPIportal, TRUE, tuple_limit);
+        if (total_tuples == 0)
+            pgr_fetch_column_info(info, 9);
+
+        ntuples = SPI_processed;
+        total_tuples += ntuples;
+
+        if (ntuples > 0) {
+            if ((*customers) == NULL)
+                (*customers) = (Customer *)palloc0(total_tuples * sizeof(Customer));
+            else
+                (*customers) = (Customer *)repalloc((*customers), total_tuples * sizeof(Customer));
+
+            if ((*customers) == NULL) {
+                elog(ERROR, "Out of memory");
+            }
+
+            int t;
+            SPITupleTable *tuptable = SPI_tuptable;
+            TupleDesc tupdesc = SPI_tuptable->tupdesc;
+            PGR_DBG("processing %d customer tupĺes", ntuples);
+
+            for (t = 0; t < ntuples; t++) {
+                HeapTuple tuple = tuptable->vals[t];
+                pgr_fetch_customer(&tuple, &tupdesc, info,
+                        &(*customers)[total_tuples - ntuples + t]);
+            }
+            SPI_freetuptable(tuptable);
+        } else {
+            moredata = FALSE;
+        }
+    }
+
+    if (total_tuples == 0) {
+        (*total_customers) = 0;
+        PGR_DBG("NO _customers");
+        return;
+    }
+
+
+    (*total_customers) = total_tuples;
+    PGR_DBG("Finish reading %ld customers, %ld", total_tuples, (*total_customers));
+}
+
diff --git a/src/pickDeliver/src/customers_input.h b/src/pickDeliver/src/customers_input.h
new file mode 100644
index 0000000..eb8055e
--- /dev/null
+++ b/src/pickDeliver/src/customers_input.h
@@ -0,0 +1,46 @@
+/*PGR-GNU*****************************************************************
+File: edges_input.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./pgr_types.h"
+#include "./pdp.h"
+
+
+/*!
+  int64_t id;
+  double x;
+  double y;
+  double demand;
+  double Etime;
+  double Ltime;
+  double Stime;
+  int64_t Pindex;
+  int64_t Dindex;
+  double Ddist;
+*/
+void pgr_get_customers(
+        char *sql,
+        Customer **customers,
+        size_t *total_customers);
diff --git a/src/pickDeliver/src/pdp.c b/src/pickDeliver/src/pdp.c
new file mode 100644
index 0000000..a242895
--- /dev/null
+++ b/src/pickDeliver/src/pdp.c
@@ -0,0 +1,170 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+#include "fmgr.h"
+#include "./pdp.h"
+
+
+Datum vrppdtw(PG_FUNCTION_ARGS);
+
+
+// #define DEBUG 1
+#include "../../common/src/debug_macro.h"
+#include "../../common/src/postgres_connection.h"
+#include "./customers_input.h"
+
+
+
+
+static
+int compute_shortest_path(
+        char* sql,
+        int64_t vehicle_count,
+        double capacity,
+        path_element **results,
+        size_t *length_results_struct) {
+    PGR_DBG("start shortest_path\n");
+
+    pgr_SPI_connect();
+    char *err_msg = NULL;
+    size_t total_customers = 0;
+    Customer *customers = NULL;
+    pgr_get_customers(sql, &customers, &total_customers);
+
+
+    PGR_DBG("Calling Solver Instance\n");
+
+    int ret = Solver(customers, total_customers, vehicle_count,
+            capacity, &err_msg, results, length_results_struct);
+
+    if (ret < -2) {
+        ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED),
+                    errmsg("Error computing path: %s", err_msg)));
+    }
+
+
+    PGR_DBG("*length_results_count  = %i\n", *length_results_struct);
+    PGR_DBG("ret = %i\n", ret);
+
+    pfree(customers);
+    free(err_msg);
+    pgr_SPI_finish();
+    return 0;
+}
+
+
+
+PG_FUNCTION_INFO_V1(vrppdtw);
+Datum
+vrppdtw(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    int                  call_cntr;
+    int                  max_calls;
+    TupleDesc            tuple_desc;
+    path_element     *results = 0;
+
+
+    /* stuff done only on the first call of the function */
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        size_t length_results_struct = 0;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+        results = (path_element *)palloc(sizeof(path_element)*((length_results_struct) + 1));
+
+        PGR_DBG("Calling compute_shortes_path");
+
+        compute_shortest_path(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),  // customers sql
+                PG_GETARG_INT64(1),  // vehicles  count
+                PG_GETARG_FLOAT8(2),  // capacity 
+                &results, &length_results_struct);
+
+        PGR_DBG("Back from solve_vrp, length_results: %d", length_results_struct);
+
+        /* total number of tuples to be returned */
+        funcctx->max_calls = length_results_struct;
+        funcctx->user_fctx = results;
+
+        /* Build a tuple descriptor for our result type */
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = BlessTupleDesc(tuple_desc);
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    /* stuff done on every call of the function */
+    funcctx = SRF_PERCALL_SETUP();
+
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    results = (path_element *) funcctx->user_fctx;
+
+    /* do when there is more left to send */
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum *values;
+        char* nulls;
+
+        PGR_DBG("Till hereee ", NULL);
+        values = palloc(4 * sizeof(Datum));
+        nulls = palloc(4 * sizeof(char));
+
+        nulls[0] = ' ';
+        nulls[1] = ' ';
+        nulls[2] = ' ';
+        nulls[3] = ' ';
+        values[0] = Int32GetDatum(results[call_cntr].seq);
+        values[1] = Int64GetDatum(results[call_cntr].rid);
+        values[2] = Int64GetDatum(results[call_cntr].nid);
+        values[3] = Float8GetDatum(results[call_cntr].cost);
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+
+        /* make the tuple into a datum */
+        result = HeapTupleGetDatum(tuple);
+
+        /* clean up (this is not really necessary) */
+        pfree(values);
+        pfree(nulls);
+
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        /* do when there is no more left */
+        free(results);
+        SRF_RETURN_DONE(funcctx);
+    }
+}
diff --git a/src/pickDeliver/src/pdp.h b/src/pickDeliver/src/pdp.h
new file mode 100644
index 0000000..4763e90
--- /dev/null
+++ b/src/pickDeliver/src/pdp.h
@@ -0,0 +1,69 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<math.h>
+#include "postgres.h"
+
+#pragma once
+
+// For C and C++ inclusion
+
+typedef struct {
+        int64_t id;
+        double x;
+        double y;
+        double demand;
+        double Etime;
+        double Ltime;
+        double Stime;
+        int64_t Pindex;
+        int64_t Dindex;
+        double Ddist;
+} Customer;
+
+typedef struct  {
+         int64_t seq;
+         int64_t rid;
+         int64_t nid;
+         double cost;
+} path_element;
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+int64_t Solver(Customer *c,
+        size_t total_tuples,
+        int64_t vehicle_count,
+        int64_t capacity ,
+        char **msg,
+        path_element **results,
+        size_t *length_results);
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
diff --git a/src/pickDeliver/src/pdp.hpp b/src/pickDeliver/src/pdp.hpp
new file mode 100644
index 0000000..9477675
--- /dev/null
+++ b/src/pickDeliver/src/pdp.hpp
@@ -0,0 +1,69 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include <math.h>
+#include <vector>
+
+// Exclusive for c++ inclusion
+
+typedef struct {
+        int64_t id;
+        double x;
+        double y;
+        double demand;
+        double Etime;
+        double Ltime;
+        double Stime;
+        int64_t Pindex;
+        int64_t Dindex;
+} Depot;
+
+
+typedef struct {
+        int64_t Pid;
+        double Ddist;
+        int64_t Did;
+} Pickup;
+
+typedef std::vector< Customer > Customers;
+typedef std::vector< Pickup > Pickups;
+
+
+// It is used to save some variables and helps if we need to revisit
+// previous state.
+
+typedef struct {
+        int64_t twv;
+        int64_t cv;
+        int64_t dis;
+        std::vector< int64_t > path;
+} State;
+
+template <class T1, class T2>
+double
+CalculateDistance(const T1 &from, const T2 &to) {
+        return sqrt((from.x - to.x) * (from.x - to.x)
+                + (from.y - to.y) * (from.y - to.y));
+}
diff --git a/src/pickDeliver/src/pdp_solver.cpp b/src/pickDeliver/src/pdp_solver.cpp
new file mode 100644
index 0000000..1425df9
--- /dev/null
+++ b/src/pickDeliver/src/pdp_solver.cpp
@@ -0,0 +1,355 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2014 Manikata Kondeti
+mani.iiit123 at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+/*
+
+ *****list of files in this dir*******
+ pdp.cpp --> Main solver
+ pdp.h  ---> Structures defined in this header file
+ Solution.h -----> It contains the Solution Class and Code related to Neighborhoods
+ Route.h   -----> Explains all about Route Class.
+ pdp.c ---> Contains all the details on pgRouting integration.
+
+ The main problem is in two steps. 1.)Getting the initial solutiion and 2.)Optimizing it.
+
+ 1.) "Initial solution":
+ A few heuristics are applied to find a feasible initial solution. Sequential Construction and Hill climbing. More implementation details are found here:: https://github.com/pgRouting/pgrouting/wiki/VRP-Pickup-Delivery-Problem
+
+ 2.) "Optimizing the Solution":
+ A reactive tabu search is applied on the initial solution to get a feasible optimized solution. TabuSearch comes under local search methods. We have three neighborhoods
+            i) Single Paired Insertion
+            ii) Swapping pairs between routes
+            iii)Within Route Insertion.
+            Tabu attributes plays an important role in giving the best solution(it includes TabuLength, A vector containing feasible solutions and a counter for number of solutions).
+            Reactive part discussed in the paper is to modify TabuLength based on the solution cycle.
+
+ */
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <vector>
+#include <algorithm>
+
+#include "./pdp.h"
+#include "./pdp.hpp"
+#include "./Solution.h"
+#include "./Route.h"
+
+
+//forward declaration
+static
+int
+TabuSearch(
+        const std::vector<Customer> &customers,
+        const std::vector<Pickup> &pickups,
+        int maxIter,
+        std::vector<Solution> &T);
+
+static
+void
+get_result(
+        Solution &solution,
+        const std::vector < Customer > &customers,
+        const Depot &depot,
+        int64_t VehicleLength,
+        std::vector< path_element > &result);
+
+int64_t Solver(Customer *c1,
+        size_t total_tuples,
+        int64_t VehicleLength,
+        int64_t capacity,
+        char **msg,
+        path_element **results,
+        size_t *length_results_struct) {
+    std::vector<Customer> customers(c1, c1 + total_tuples);
+    std::vector<Pickup> pickups;
+    std::vector<Route> routes;
+
+    Depot depot({c1[0].id, c1[0].x, c1[0].y,
+            c1[0].demand,
+            c1[0].Etime, c1[0].Ltime, c1[0].Stime,
+            c1[0].Pindex, c1[0].Dindex
+            });
+
+    if (total_tuples != 107) {
+        return 0;
+    }
+
+
+    // Customer Data
+    for (auto &c : customers) {
+        if (c.id == 0) continue; 
+        c.Ddist = CalculateDistance(c, depot);
+        if (c.Pindex == 0) {
+            // From Customers put aside all the Pickup's;
+            Pickup pickup({c.id, c.Ddist, c.Dindex});
+            pickups.push_back(pickup);
+        }
+    }
+
+    if (pickups.size() != 53) {
+        (*results) = NULL;
+        (*length_results_struct) = 0;
+        return 0;
+    }
+
+    /* Sort Pickup's
+     * The sequential construction inserts from largest distance to smallest
+     * but he had it ordered from smallest to largest
+     */
+    std::sort(pickups.begin(), pickups.end(),
+            [] (const Pickup &p1, const Pickup &p2)
+            {return p2.Ddist < p1.Ddist;});
+
+
+    // Sequential Construction
+    size_t v = 0;
+    Route route(capacity, depot);
+    routes.push_back(route);
+    for (auto &pickup : pickups) {
+        int OK = 0;
+        OK = routes[v].insertOrder(customers, pickup);
+        if (OK) continue;
+        Route route(capacity, depot);
+        routes.push_back(route);
+        /* adding a new vehicle*/
+        ++v;
+        routes[v].insertOrder(customers, pickup);
+    }
+
+
+    std::sort(pickups.begin(), pickups.end(),
+            [] (const Pickup &p1, const Pickup &p2)
+            {return p1.Ddist < p2.Ddist;});
+
+    // Initial Solution
+    Solution S0;
+    S0.routes = routes;
+    //S0.UpdateSol(customers);
+
+    std::vector<Solution> T;
+    T.push_back(S0);
+
+    // Starting the TABU SEARCH
+
+    TabuSearch(customers, pickups, 30, T);
+
+
+    std::vector< path_element > result;
+#ifdef DEBUG
+    for (auto &solution: T) {
+        get_result(solution, customers, depot, VehicleLength, result);
+    }
+#else
+    T.back().UpdateSol(customers);
+    get_result(T.back(), customers, depot, VehicleLength, result);
+#endif
+
+
+
+    // Getting memory to store results
+    *results = static_cast<path_element *>(malloc(sizeof(path_element) * (result.size())));
+
+    //store the results
+    int seq = 0;
+    for (const auto &row : result) {
+        (*results)[seq] = row;
+        ++seq;
+    }
+
+    *length_results_struct = result.size();
+
+    (*msg) = NULL;
+    return 0;
+}
+
+
+
+
+
+
+
+/* TABU search helps us to store the solutions after every different move.
+ * The overview of TABU search will be a list containing list of solutions
+
+ **********Before*********
+ int n = 0; //Counter
+
+ Create Tabu List Vector of Solutions std::vector<Solution> T;
+
+ **********After**********
+ Solution S,S0,SBest; //S0 is initial
+ S = S0;
+ Double CBest,SBest;
+ CBest = S.getCost();
+ SBest = S0;
+ n = 0; //Counter
+ while(1)
+ {
+ S = S.getBextofNeighborhood();
+ if (S ==NULL)
+ break;
+ if (S.getCost() < CBest){
+ SBest = S;
+ CBest = S.getCost();
+ }
+ T.push_back(S);
+ n++;
+ if (n>maxItr)
+ break;
+ }
+
+*/
+static
+int
+TabuSearch(const std::vector<Customer> &customers,
+        const std::vector<Pickup> &pickups,
+        int maxItr,
+        std::vector<Solution> &T) {
+    Solution S;
+    Solution SBest;
+    double CBest;
+    S = T[0];
+    CBest = S.getCost();
+    SBest = S;
+
+    S.UpdateSol(customers);
+
+    int n = 0;
+    while (n++ < maxItr) {
+        S = S.getBestofNeighborhood(S, customers, pickups);
+        S.UpdateSol(customers);
+        T.push_back(S);
+        if (S.getCost() == 0) break;
+        if (S.getCost() < CBest) {
+            SBest = S;
+            CBest = S.getCost();
+        } else if (S.getCost() == CBest) {
+            // printf("\n****************Repeated Solution****************\n");
+            int k = ((12)*maxItr)/100;
+            maxItr = maxItr-k;
+            // printf("Maxitr after repeating %d k = %d\n",maxItr,k);
+        }
+    }
+    T.push_back(SBest);
+    return T.size()-1;
+}
+
+
+/*
+ * For each route in the solution:
+ *    For each node in the route in the solution:
+ *       this is the route.
+ *       d, p0, p1 .... pn, d
+ *       (rid, nid, cost) 
+ *       (1, d, 0)
+ *       (1, p0, 0 + dist(d, p0) OR etime)
+ */
+static
+void
+get_result(
+        Solution &solution,
+        const Customers &customers,
+        const Depot &depot,
+        int64_t VehicleLength,
+        std::vector< path_element > &result) {
+#if DEBUG
+    double last_cost = 0;
+    int twv = 0;
+    int cv = 0;
+#endif
+    int route_id = 0;
+    int seq = 1;
+    solution.UpdateSol(customers);
+    for (const auto &route : solution.routes) {
+        double agg_cost = 0;
+        double distance = 0;
+        int agg_load = 0;
+        result.push_back({seq, route_id, depot.id, agg_cost});
+        ++seq;
+
+        int prev_node = -1;
+        for (const auto &node : route.path) {
+
+            if (node == route.path.front()) {
+                /*
+                 * Is the first node or last node in the path
+                 */
+                distance = CalculateDistance(depot, customers[node]);
+                agg_cost += distance;
+            } else {
+                /*
+                 * Between nodes
+                 */
+                distance = CalculateDistance(customers[prev_node], customers[node]);
+                agg_cost += distance;
+            }
+
+            if (agg_cost < customers[node].Etime) {
+                /*
+                 * Arrving before the opening time, adjust time, moving it to the opening time
+                 */
+                agg_cost = customers[node].Etime;
+            }
+
+            agg_load +=  customers[node].demand;
+
+            result.push_back({
+                    seq,
+                    route_id,
+                    customers[node].id,
+                    agg_cost});
+#ifdef DEBUG
+            result.push_back({
+                    customers[node].id,
+                    customers[node].Etime,
+                    customers[node].Ltime,
+                    distance});
+            result.push_back({
+                    seq,
+                    agg_cost > customers[node].Ltime? ++twv: twv,
+                    agg_load > 200? ++cv: cv,
+                    0});
+            last_cost = agg_cost;
+#endif
+            agg_cost +=  customers[node].Stime;
+            prev_node = node;
+            ++seq;
+        }
+        /*
+         * Going back to the depot
+         */
+        agg_cost += CalculateDistance(customers[prev_node], depot);
+        result.push_back({seq, route_id, depot.id, agg_cost});
+        ++seq;
+        ++route_id;
+#if 1
+        if (VehicleLength < route_id) break;
+#endif
+    }
+    result.push_back({0, 0, 0, solution.getCost()});
+}
+
diff --git a/src/common/test/CMakeLists.txt b/src/pickDeliver/test/CMakeLists.txt
similarity index 100%
rename from src/common/test/CMakeLists.txt
rename to src/pickDeliver/test/CMakeLists.txt
diff --git a/src/pickDeliver/test/pdp-any-00.data b/src/pickDeliver/test/pdp-any-00.data
new file mode 100644
index 0000000..9347f06
--- /dev/null
+++ b/src/pickDeliver/test/pdp-any-00.data
@@ -0,0 +1,120 @@
+drop table if exists customer cascade;
+create table customer (
+                id integer not null primary key,
+                x integer,
+                y integer,
+                demand integer,
+                etime integer,
+                ltime integer, 
+                stime integer, 
+                pindex integer,
+                dindex integer 
+                );
+copy customer (id,x,y,demand,etime,ltime, stime,pindex, dindex) from stdin;
+0	40	50	0	0	1236	0	0	0
+1	45	68	-10	912	967	90	11	0
+2	45	70	-20	825	870	90	6	0
+3	42	66	10	65	146	90	0	75
+4	42	68	-10	727	782	90	9	0
+5	42	65	10	15	67	90	0	7
+6	40	69	20	621	702	90	0	2
+7	40	66	-10	170	225	90	5	0
+8	38	68	20	255	324	90	0	10
+9	38	70	10	534	605	90	0	4
+10	35	66	-20	357	410	90	8	0
+11	35	69	10	448	505	90	0	1
+12	25	85	-20	652	721	90	18	0
+13	22	75	30	30	92	90	0	17
+14	22	85	-40	567	620	90	16	0
+15	20	80	-10	384	429	90	19	0
+16	20	85	40	475	528	90	0	14
+17	18	75	-30	99	148	90	13	0
+18	15	75	20	179	254	90	0	12
+19	15	80	10	278	345	90	0	15
+20	30	50	10	10	73	90	0	24
+21	30	52	-10	914	965	90	30	0
+22	28	52	-20	812	883	90	28	0
+23	28	55	10	732	777	0	0	103
+24	25	50	-10	65	144	90	20	0
+25	25	52	40	169	224	90	0	27
+26	25	55	-10	622	701	90	29	0
+27	23	52	-40	261	316	90	25	0
+28	23	55	20	546	593	90	0	22
+29	20	50	10	358	405	90	0	26
+30	20	55	10	449	504	90	0	21
+31	10	35	-30	200	237	90	32	0
+32	10	40	30	31	100	90	0	31
+33	8	40	40	87	158	90	0	37
+34	8	45	-30	751	816	90	38	0
+35	5	35	10	283	344	90	0	39
+36	5	45	10	665	716	0	0	105
+37	2	40	-40	383	434	90	33	0
+38	0	40	30	479	522	90	0	34
+39	0	45	-10	567	624	90	35	0
+40	35	30	-20	264	321	90	42	0
+41	35	32	-10	166	235	90	43	0
+42	33	32	20	68	149	90	0	40
+43	33	35	10	16	80	90	0	41
+44	32	30	10	359	412	90	0	46
+45	30	30	10	541	600	90	0	48
+46	30	32	-10	448	509	90	44	0
+47	30	35	-10	1054	1127	90	49	0
+48	28	30	-10	632	693	90	45	0
+49	28	35	10	1001	1066	90	0	47
+50	26	32	10	815	880	90	0	52
+51	25	30	10	725	786	0	0	101
+52	25	35	-10	912	969	90	50	0
+53	44	5	20	286	347	90	0	58
+54	42	10	40	186	257	90	0	60
+55	42	15	-40	95	158	90	57	0
+56	40	5	30	385	436	90	0	59
+57	40	15	40	35	87	90	0	55
+58	38	5	-20	471	534	90	53	0
+59	38	15	-30	651	740	90	56	0
+60	35	5	-40	562	629	90	54	0
+61	50	30	-10	531	610	90	67	0
+62	50	35	20	262	317	90	0	68
+63	50	40	50	171	218	90	0	74
+64	48	30	10	632	693	0	0	102
+65	48	40	10	76	129	90	0	72
+66	47	35	10	826	875	90	0	69
+67	47	40	10	12	77	90	0	61
+68	45	30	-20	734	777	90	62	0
+69	45	35	-10	916	969	90	66	0
+70	95	30	-30	387	456	90	81	0
+71	95	35	20	293	360	90	0	77
+72	53	30	-10	450	505	90	65	0
+73	92	30	-10	478	551	90	76	0
+74	53	35	-50	353	412	90	63	0
+75	45	65	-10	997	1068	90	3	0
+76	90	35	10	203	260	90	0	73
+77	88	30	-20	574	643	90	71	0
+78	88	35	20	109	170	0	0	104
+79	87	30	10	668	731	90	0	80
+80	85	25	-10	769	820	90	79	0
+81	85	35	30	47	124	90	0	70
+82	75	55	20	369	420	90	0	85
+83	72	55	-20	265	338	90	87	0
+84	70	58	20	458	523	90	0	89
+85	68	60	-20	555	612	90	82	0
+86	66	55	10	173	238	90	0	91
+87	65	55	20	85	144	90	0	83
+88	65	60	-10	645	708	90	90	0
+89	63	58	-20	737	802	90	84	0
+90	60	55	10	20	84	90	0	88
+91	60	60	-10	836	889	90	86	0
+92	67	85	20	368	441	90	0	93
+93	65	85	-20	475	518	90	92	0
+94	65	82	-10	285	336	90	96	0
+95	62	80	-20	196	239	90	98	0
+96	60	80	10	95	156	90	0	94
+97	60	85	30	561	622	0	0	106
+98	58	75	20	30	84	90	0	95
+99	55	80	-20	743	820	90	100	0
+100	55	85	20	647	726	90	0	99
+101	25	30	-10	725	786	90	51	0
+102	48	30	-10	632	693	90	64	0
+103	28	55	-10	732	777	90	23	0
+104	88	35	-20	109	170	90	78	0
+105	5	45	-10	665	716	90	36	0
+106	60	85	-30	561	622	90	97	0
diff --git a/src/pickDeliver/test/pdp-any-01.result b/src/pickDeliver/test/pdp-any-01.result
new file mode 100644
index 0000000..c3bc989
--- /dev/null
+++ b/src/pickDeliver/test/pdp-any-01.result
@@ -0,0 +1,3 @@
+t
+137
+t
diff --git a/src/pickDeliver/test/pdp-any-01.test.sql b/src/pickDeliver/test/pdp-any-01.test.sql
new file mode 100644
index 0000000..18ab85e
--- /dev/null
+++ b/src/pickDeliver/test/pdp-any-01.test.sql
@@ -0,0 +1,44 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+BEGIN;
+
+    WITH results AS
+    (SELECT seq, route_id, node_id, cost from pgr_gsoc_vrppdtw(
+        'select * from customer order by id'::text, 25,200)
+    )
+    SELECT cost < 4000 FROM results WHERE seq = 0;
+
+    /*
+    WITH results AS
+    (SELECT seq, route_id, node_id, cost from pgr_gsoc_vrppdtw(
+        'select * from customer order by id'::text, 25,200)
+    )
+    SELECT count(*) FROM results;
+
+    WITH results AS
+    (SELECT seq, route_id, node_id, cost from pgr_gsoc_vrppdtw(
+        'select * from customer order by id'::text, 25,200)
+    )
+    SELECT route_id <= 14 FROM results WHERE seq = 136;
+*/
+    ROLLBACK;
diff --git a/src/proposed.rst b/src/proposed.rst
new file mode 100644
index 0000000..8257271
--- /dev/null
+++ b/src/proposed.rst
@@ -0,0 +1,100 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _proposed:
+
+Experimental and Proposed functions
+===============================================================================
+
+:ref:`proposed`
+
+These are proposed functions
+
+  - They are not officially of the current release.
+  - They likely will not be officialy be part of the version 2.3 release:
+
+    - The functions might not make use of ANY-INTEGER and ANY-NUMERICAL
+    - Name might change.
+    - Signature might change.
+    - Functionality might change.
+    - pgTap tests might not being done.
+    - Might need c/c++ coding.
+    - May lack documentation,
+    - Documentation if any might need to be rewritten.
+    - Documentation examples might need to be automatically generated.
+    - Might need a lot of feedback from the comunity.
+    - Might need a non official function of pgRouting
+    - Might need a deprecated function of pgRouting
+
+
+Proposed functions: Proposed by Steve Woodbridge
+------------------------------------------------
+
+:ref:`convenience_functions`
+  -  :ref:`pgr_point_to_edgenode` - convert a point geometry to a ``vertex_id`` based on closest edge.
+  -  :ref:`pgr_flip_edges` - flip the edges in an array of geometries so the connect end to end.
+  -  :ref:`pgr_text_to_points` - convert a string of ``x,y;x,y;...`` locations into point geometries.
+  -  :ref:`pgr_points_to_vids` - convert an array of point geometries into vertex ids.
+  -  :ref:`pgr_points_to_dmatrix` - Create a distance matrix from an array of points.
+  -  :ref:`pgr_vids_to_dmatrix` - Create a distance matrix from an array of ``vertix_id``.
+  -  :ref:`pgr_vids_to_dmatrix2` - Create a distance matrix from an array of ``vertix_id``.
+
+Proposed functions: Proposed by Zia Mohammed
+---------------------------------------------
+
+  -  :ref:`pgr_labelGraph` - Analyze / label  subgraphs within a network
+
+.. toctree::
+  :hidden:
+
+  ../src/label_graph/doc/pgr_labelGraph.rst
+
+.. toctree::
+   :hidden:
+
+   ../src/convinience/doc/convenience
+
+
+Proposed functions: Proposed by Rohith Reddy
+---------------------------------------------
+
+  -  :ref:`contraction` - Reduce network size using contraction techniques
+
+.. toctree::
+  :hidden:
+
+  ../src/contraction/doc/contraction.rst
+
+.. toctree::
+  :hidden:
+
+  ../src/contraction/doc/contraction
+
+Experimental functions: by GSoC Students
+----------------------------------------
+
+  -  :ref:`pgr_vrp_basic` - VRP One Depot
+  -  :ref:`pgr_gsocvrppdtw` - VRP Pickup & Delivery
+
+..
+    The template
+    ------------
+
+    - :ref:`pgr_funnyDijkstra`
+
+.. toctree::
+    :hidden:
+
+    ../src/vrp_basic/doc/pgr_vrpOneDepot
+    ../src/vrppdtw/doc/index
+
+..
+    ../src/funnyDijkstra/doc/pgr_funnyDijkstra.rst
+    ../src/vrppdtw/doc/index.rst
+
diff --git a/src/proposedNext.rst b/src/proposedNext.rst
new file mode 100644
index 0000000..36d9507
--- /dev/null
+++ b/src/proposedNext.rst
@@ -0,0 +1,52 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _proposedNext:
+
+Proposed Functions for version 2.3
+==================================
+
+:ref:`proposedNext`
+
+This are proposed functions for version 2.3.
+
+  - They are not officially in the version 2.2 release.
+  - They will likely officialy be part of the version 2.3 release:
+
+    - The functions make use of ANY-INTEGER and ANY-NUMERICAL
+    - Name might not change.
+    - Signature might not  change.
+    - Functionality might not change.
+    - pgTap tests have being done.
+    - Needs feedback from the comunity.
+
+
+Proposed Routing Functions
+--------------------------
+
+:author: Vicky Vergara
+
+  - As part of Dijkstra Family of functions
+
+    - :ref:`pgr_dijkstraVia` - Use pgr_dijkstra to make a route via vertices.
+
+  - :ref:`pgr_withPoints<withPoints>` - withPoints family functions
+
+    - :ref:`pgr_withPoints` - Route from/to points anywhere on the graph.
+    - :ref:`pgr_withPointsCost` - Costs of the shortest paths.
+    - :ref:`pgr_withPointsKSP<pgr_withPointsKSP>` - K shortest paths with points.
+    - :ref:`pgr_withPointsDD<pgr_withPointsDD>` - Driving distance.
+
+
+.. toctree::
+   :hidden: 
+
+   ../src/dijkstra/doc/pgr_dijkstraVia
+   ../src/withPoints/doc/withPoints
+
diff --git a/src/routingFunctions.rst b/src/routingFunctions.rst
new file mode 100644
index 0000000..ee22063
--- /dev/null
+++ b/src/routingFunctions.rst
@@ -0,0 +1,63 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _routing_functions:
+
+
+Routing Functions
+=================
+
+..
+    from-here
+
+:ref:`routing_functions`
+
+  - :ref:`All pairs<all_pairs>` - All pair of vertices.
+
+    - :ref:`pgr_floydWarshall<pgr_floydWarshall>` - Floyd-Warshall's Algorithm
+    - :ref:`pgr_johnson<pgr_johnson>`- Johnson’s Algorithm
+
+  - :ref:`pgr_astar<pgr_astar>` - Shortest Path A*
+  - :ref:`pgr_bdAstar<bd_astar>` - Bi-directional A* Shortest Path
+  - :ref:`pgr_bdDijkstra<bd_dijkstra>` - Bi-directional Dijkstra Shortest Path
+  - :ref:`dijkstra<dijkstra>` - Dijkstra family functions
+
+    - :ref:`pgr_dijkstra` - Dijkstra's shortest path algorithm.
+    - :ref:`pgr_dijkstraCost` - Use pgr_dijkstra to calculate the costs of the shortest paths.
+        
+  - :ref:`Driving Distance<drivingDistance>` - Driving Distance
+
+    - :ref:`pgr_drivingDistance<pgr_drivingDistance>` - Driving Distance
+
+    - Post processing
+
+      - :ref:`pgr_alphaShape` - Alpha shape computation
+      - :ref:`pgr_points_as_polygon` - Polygon around set of points
+
+  - :ref:`pgr_ksp<pgr_ksp>` - K-Shortest Path
+  - :ref:`pgr_trsp<trsp>` - Turn Restriction Shortest Path (TRSP)
+  - :ref:`pgr_tsp<pgr_tsp>` - Traveling Sales Person
+
+..
+    to-here
+
+.. toctree::
+	:hidden: 
+
+	allpairs/doc/allpairs
+	astar/doc/pgr_astar
+	bd_astar/doc/pgr_bdAstar
+	bd_dijkstra/doc/pgr_bdDijkstra
+	dijkstra/doc/dijkstra
+	driving_distance/doc/drivingDistance
+	ksp/doc/pgr_ksp
+	tsp/doc/pgr_tsp
+	trsp/doc/pgr_trsp
+
+
diff --git a/src/shooting_star/doc/index.rst b/src/shooting_star/doc/index.rst
index dcff760..a4a8f77 100644
--- a/src/shooting_star/doc/index.rst
+++ b/src/shooting_star/doc/index.rst
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 .. _shooting_star-index:
 
 ================================================================
diff --git a/src/shooting_star/sql/shooting_star.sql b/src/shooting_star/sql/shooting_star.sql
index 458a811..edcbcf0 100644
--- a/src/shooting_star/sql/shooting_star.sql
+++ b/src/shooting_star/sql/shooting_star.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 --
 -- Copyright (c) 2005 Sylvain Pasche,
 --               2006-2007 Anton A. Patrushev, Orkney, Inc.
diff --git a/src/shooting_star/src/edge_visitors.hpp b/src/shooting_star/src/edge_visitors.hpp
index b7db07c..19399cc 100644
--- a/src/shooting_star/src/edge_visitors.hpp
+++ b/src/shooting_star/src/edge_visitors.hpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #ifndef EDGE_VISITORS_HPP
 #define EDGE_VISITORS_HPP
 
diff --git a/src/shooting_star/src/shooting_star.c b/src/shooting_star/src/shooting_star.c
index 5e761a2..36081cb 100644
--- a/src/shooting_star/src/shooting_star.c
+++ b/src/shooting_star/src/shooting_star.c
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 /*
  * Shooting* Shortest path algorithm for PostgreSQL
  *
diff --git a/src/shooting_star/src/shooting_star.h b/src/shooting_star/src/shooting_star.h
index e36fd34..9001593 100644
--- a/src/shooting_star/src/shooting_star.h
+++ b/src/shooting_star/src/shooting_star.h
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 /*
  * Shooting* shortest path algorithm for PostgreSQL
  *
diff --git a/src/shooting_star/src/shooting_star_boost_wrapper.cpp b/src/shooting_star/src/shooting_star_boost_wrapper.cpp
index 7f213bc..8d45a31 100644
--- a/src/shooting_star/src/shooting_star_boost_wrapper.cpp
+++ b/src/shooting_star/src/shooting_star_boost_wrapper.cpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 /*
  * Shooting* Shortest path algorithm for PostgreSQL
  *
diff --git a/src/shooting_star/src/shooting_star_relax.hpp b/src/shooting_star/src/shooting_star_relax.hpp
index ea7ef82..98f0a8c 100644
--- a/src/shooting_star/src/shooting_star_relax.hpp
+++ b/src/shooting_star/src/shooting_star_relax.hpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 //=======================================================================
 // Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek,
diff --git a/src/shooting_star/src/shooting_star_search.hpp b/src/shooting_star/src/shooting_star_search.hpp
index 71d9679..33a4c84 100644
--- a/src/shooting_star/src/shooting_star_search.hpp
+++ b/src/shooting_star/src/shooting_star_search.hpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 //
 //=======================================================================
 // Copyright (c) 2004 Kristopher Beevers
diff --git a/src/shooting_star/test/spss-any-00.test.sql b/src/shooting_star/test/spss-any-00.test.sql
index 4bb3f98..9a36c94 100644
--- a/src/shooting_star/test/spss-any-00.test.sql
+++ b/src/shooting_star/test/spss-any-00.test.sql
@@ -1,2 +1,24 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select * from pgr_shootingstar('select eid as id, source::int4, target::int4, case when cost<=0 then 999 else cost end as cost, case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost, x1, y1, x2, y2, to_cost, rule from edges1', 11, 6, true, true);
 
diff --git a/src/shooting_star/test/spss-any-01.test.sql b/src/shooting_star/test/spss-any-01.test.sql
index be76ad9..6135652 100644
--- a/src/shooting_star/test/spss-any-01.test.sql
+++ b/src/shooting_star/test/spss-any-01.test.sql
@@ -1,2 +1,24 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select * from pgr_shootingstar('select eid as id, source::int4, target::int4, case when cost<=0 then 999 else cost end as cost, case when reverse_cost<=0 then 999 else reverse_cost end as reverse_cost, x1, y1, x2, y2, to_cost, rule from edges1', 11, 6, false, true);
 
diff --git a/src/topology/doc/doc-pgr_analyzeGraph.queries b/src/topology/doc/doc-pgr_analyzeGraph.queries
new file mode 100644
index 0000000..25e304c
--- /dev/null
+++ b/src/topology/doc/doc-pgr_analyzeGraph.queries
@@ -0,0 +1,534 @@
+BEGIN;
+BEGIN
+SELECT  pgr_createTopology('edge_table',0.001, clean := true);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Got function st_srid(bigint) does not exist
+NOTICE:  ERROR: something went wrong when checking for SRID of id in table public.edge_table
+ pgr_analyzegraph 
+------------------
+ FAIL
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 4
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 5
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ;
+SELECT 1
+SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 10
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , the_geom AS mygeom FROM edge_table);
+SELECT 18
+SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt', clean := true);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where := 'true', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.0001,'gid','mygeom','src','tgt');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.0001,'gid','mygeom','src','tgt','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Got function st_srid(bigint) does not exist
+NOTICE:  ERROR: something went wrong when checking for SRID of gid in table public.mytable
+ pgr_analyzegraph 
+------------------
+ FAIL
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 4
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 4
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
+        rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 1
+NOTICE:                            Dead ends: 5
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
+        rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 1
+NOTICE:                            Dead ends: 5
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+DROP TABLE IF EXISTS otherTable;
+DROP TABLE
+CREATE TABLE otherTable AS  (SELECT 'myhouse'::text AS place, st_point(2.5,2.5) AS other_geom) ;
+SELECT 1
+SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
+        rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='myhouse')')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 10
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
+        rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='myhouse')')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 10
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_createTopology('edge_table',0.001, clean := true);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT pgr_analyzeGraph('edge_table', 0.001);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 4
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id >= 10');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id >= 10')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 8
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 17');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 17')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 3
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17', clean := true);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'id <17', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT pgr_analyzeGraph('edge_table', 0.001);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 0
+NOTICE:                            Dead ends: 3
+NOTICE:  Potential gaps found near dead ends: 0
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+ pgr_analyzegraph 
+------------------
+ OK
+(1 row)
+
+ROLLBACK;
+ROLLBACK
diff --git a/src/topology/doc/doc-pgr_createTopology.queries b/src/topology/doc/doc-pgr_createTopology.queries
new file mode 100644
index 0000000..8353024
--- /dev/null
+++ b/src/topology/doc/doc-pgr_createTopology.queries
@@ -0,0 +1,260 @@
+BEGIN;
+BEGIN
+SET client_min_messages TO NOTICE;
+SET
+DROP TABLE edge_table_vertices_pgr;
+DROP TABLE
+UPDATE edge_table SET source = NULL,  target = NULL;
+UPDATE 18
+--q1
+SELECT  pgr_createTopology('edge_table', 0.001);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q1.1
+DROP TABLE edge_table_vertices_pgr;
+DROP TABLE
+UPDATE edge_table SET source = NULL,  target = NULL;
+UPDATE 18
+--q2
+SELECT  pgr_createTopology('edge_table', 0.001,
+        'the_geom', 'id', 'source', 'target');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q2.1
+SET client_min_messages TO NOTICE;
+SET
+--q3
+SELECT  pgr_createTopology('edge_table', 0.001,
+        'id', 'the_geom');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'id', 'the_geom', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  ----> PGR ERROR in pgr_createTopology: Wrong type of Column id:the_geom
+NOTICE:  Unexpected error raise_exception
+ pgr_createtopology 
+--------------------
+ FAIL
+(1 row)
+
+--q3.1
+SET client_min_messages TO WARNING;
+SET
+DROP TABLE edge_table_vertices_pgr;
+DROP TABLE
+UPDATE edge_table SET source = NULL,  target = NULL;
+UPDATE 18
+--q4
+SELECT  pgr_createTopology('edge_table', 0.001,
+        the_geom:='the_geom', id:='id', source:='source', target:='target');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q4.1
+DROP TABLE edge_table_vertices_pgr;
+DROP TABLE
+UPDATE edge_table SET source = NULL,  target = NULL;
+UPDATE 18
+--q5
+SELECT  pgr_createTopology('edge_table', 0.001,
+        source:='source', id:='id', target:='target', the_geom:='the_geom');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q5.1
+DROP TABLE edge_table_vertices_pgr;
+DROP TABLE
+UPDATE edge_table SET source = NULL,  target = NULL;
+UPDATE 18
+--q6
+SELECT  pgr_createTopology('edge_table', 0.001, source:='source');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q6.1
+--q7
+SELECT  pgr_createTopology('edge_table', 0.001, rows_where:='id < 10');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q7.1
+--q8
+SELECT  pgr_createTopology('edge_table', 0.001,
+        rows_where:='the_geom && (SELECT st_buffer(the_geom, 0.05) FROM edge_table WHERE id=5)');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q8.1
+--q9
+CREATE TABLE otherTable AS  (SELECT 100 AS gid,  st_point(2.5, 2.5) AS other_geom);
+SELECT 1
+SELECT  pgr_createTopology('edge_table', 0.001,
+        rows_where:='the_geom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q9.1
+--q10
+CREATE TABLE mytable AS (SELECT id AS gid,  the_geom AS mygeom, source AS src , target AS tgt FROM edge_table) ;
+SELECT 18
+--q10.1
+--q11
+SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', clean := TRUE);
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q11.1
+DROP TABLE mytable_vertices_pgr;
+DROP TABLE
+UPDATE mytable SET src = NULL,  tgt = NULL;
+UPDATE 18
+SET client_min_messages TO NOTICE;
+SET
+--q12
+SELECT  pgr_createTopology('mytable', 0.001, 'gid', 'mygeom', 'src', 'tgt');
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('mytable', 0.001, 'gid', 'mygeom', 'src', 'tgt', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  ----> PGR ERROR in pgr_createTopology: Wrong type of Column id:mygeom
+NOTICE:  Unexpected error raise_exception
+ pgr_createtopology 
+--------------------
+ FAIL
+(1 row)
+
+--q12.1
+SET client_min_messages TO WARNING;
+SET
+--q13
+SELECT  pgr_createTopology('mytable', 0.001, the_geom:='mygeom', id:='gid', source:='src', target:='tgt');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q13.1
+DROP TABLE mytable_vertices_pgr;
+DROP TABLE
+UPDATE mytable SET src = NULL,  tgt = NULL;
+UPDATE 18
+--q14
+SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q14.1
+--q15
+SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where:='gid < 10');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', rows_where:='gid < 10');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', 
+        rows_where:='mygeom && (SELECT st_buffer(mygeom, 1) FROM mytable WHERE gid=5)');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', 
+        rows_where:='mygeom && (SELECT st_buffer(mygeom, 1) FROM mytable WHERE gid=5)');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q15.1
+--q16
+SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', 
+        rows_where:='mygeom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', 
+        rows_where:='mygeom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)');
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q16.1
+SET client_min_messages TO NOTICE;
+SET
+--q17
+SELECT pgr_createTopology('edge_table',  0.001, rows_where:='id < 6', clean := true);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'id < 6', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  5 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+SELECT pgr_createTopology('edge_table',  0.001);
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  13 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+ pgr_createtopology 
+--------------------
+ OK
+(1 row)
+
+--q17.1
+ROLLBACK;
+ROLLBACK
diff --git a/src/common/doc/functions/images/Fig3-reverseCost.png b/src/topology/doc/images/Fig3-reverseCost.png
similarity index 100%
rename from src/common/doc/functions/images/Fig3-reverseCost.png
rename to src/topology/doc/images/Fig3-reverseCost.png
diff --git a/src/common/doc/functions/images/Fig5-reverseCostUndirected.png b/src/topology/doc/images/Fig5-reverseCostUndirected.png
similarity index 100%
rename from src/common/doc/functions/images/Fig5-reverseCostUndirected.png
rename to src/topology/doc/images/Fig5-reverseCostUndirected.png
diff --git a/src/common/doc/functions/images/after_node_net.png b/src/topology/doc/images/after_node_net.png
similarity index 100%
rename from src/common/doc/functions/images/after_node_net.png
rename to src/topology/doc/images/after_node_net.png
diff --git a/src/common/doc/functions/images/before_node_net.png b/src/topology/doc/images/before_node_net.png
similarity index 100%
rename from src/common/doc/functions/images/before_node_net.png
rename to src/topology/doc/images/before_node_net.png
diff --git a/src/topology/doc/pgr_analyzeGraph.rst b/src/topology/doc/pgr_analyzeGraph.rst
new file mode 100644
index 0000000..5b3eadb
--- /dev/null
+++ b/src/topology/doc/pgr_analyzeGraph.rst
@@ -0,0 +1,376 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_analyze_graph:
+
+pgr_analyzeGraph
+===============================================================================
+
+.. index:: 
+	single: pgr_analyzeGraph(text,double precision,text,text,text,text,text)
+	module: common
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_anlizeGraph`` — Analyzes the network topology.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The function returns:
+
+  - ``OK`` after the analysis has finished.
+  - ``FAIL`` when the analysis was not completed due to an error. 
+
+.. code-block:: sql
+
+	varchar pgr_analyzeGraph(text edge_table, double precision tolerance, 
+                           text the_geom:='the_geom', text id:='id',
+                           text source:='source',text target:='target',text rows_where:='true')
+
+Description
+-------------------------------------------------------------------------------
+
+.. rubric:: Prerequisites
+
+The  edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table <edge_table>_vertices_pgr that stores the vertices information.
+
+  - Use :ref:`pgr_createVerticesTable <pgr_create_vert_table>` to create the vertices table.
+  - Use :ref:`pgr_createTopology <pgr_create_topology>` to create the topology and the vertices table. 
+
+.. rubric:: Parameters
+
+The analyze graph function accepts the following parameters:
+
+:edge_table: ``text`` Network table name. (may contain the schema name as well)
+:tolerance: ``float8`` Snapping tolerance of disconnected edges. (in projection unit)
+:the_geom: ``text``  Geometry column name of the network table. Default value is ``the_geom``.  
+:id: ``text``  Primary key column name of the network table. Default value is ``id``. 
+:source: ``text`` Source column name of the network table. Default value is ``source``.
+:target: ``text``  Target column name of the network table.  Default value is ``target``. 
+:rows_where: ``text``   Condition to select  a subset or rows.  Default value is ``true`` to indicate all rows.
+
+The function returns:
+
+  - ``OK`` after the analysis has finished.
+
+    * Uses the vertices table: <edge_table>_vertices_pgr.
+    * Fills completly the ``cnt`` and ``chk`` columns of the vertices table.
+    * Returns the analysis of the section of the network defined by  ``rows_where``
+
+  - ``FAIL`` when the analysis was not completed due to an error. 
+
+    * The vertices table is not found.
+    * A required column of the Network table is not found or is not of the appropriate type.
+    * The condition is not well formed.
+    * The names of source , target or id are the same.
+    * The SRID of the geometry could not be determined.
+
+
+.. rubric:: The Vertices Table
+
+The vertices table can be created with :ref:`pgr_createVerticesTable <pgr_create_vert_table>` or :ref:`pgr_createTopology <pgr_create_topology>`
+
+The structure of the vertices table is:
+
+:id: ``bigint`` Identifier of the vertex.
+:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. 
+:chk: ``integer``  Indicator that the vertex might have a problem. 
+:ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`.
+:eout: ``integer`` Number of vertices in the edge_table that reference this vertex as outgoing. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`. 
+:the_geom: ``geometry`` Point geometry of the vertex.
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+Usage when the edge table's columns MATCH the default values:
+-------------------------------------------------------------------------------
+ 
+.. rubric:: The simplest way to use pgr_analyzeGraph is: 
+
+.. code-block:: sql
+
+	 SELECT  pgr_create_topology('edge_table',0.001);
+	 SELECT  pgr_analyzeGraph('edge_table',0.001);
+
+.. rubric:: When the arguments are given in the order described in the parameters:
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target');
+
+We get the same result as the simplest way to use the function.
+
+.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``id`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``the_geom`` is passed to the function as the id column. 
+ | ``SELECT  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target');``
+ | ERROR: Can not determine the srid of the geometry "id" in table public.edge_table
+
+.. rubric:: When using the named notation
+
+The order of the parameters do not matter:
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
+
+Parameters defined with a default value can be ommited, as long as the value matches the default:
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source');
+
+.. rubric:: Selecting rows using rows_where parameter
+
+Selecting rows based on the id. Displays the analysis a the section of the network.
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
+
+Selecting the rows where the geometry is near the geometry of row with ``id`` =5 .
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
+
+Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
+
+.. code-block:: sql
+
+        DROP TABLE IF EXISTS otherTable;
+	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ;
+	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
+
+
+
+Usage when the edge table's columns DO NOT MATCH the default values:
+-------------------------------------------------------------------------------
+ 
+For the following table
+
+.. code-block:: sql
+
+	DROP TABLE IF EXISTS mytable;
+	CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , the_geom AS mygeom FROM edge_table);
+	SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt');
+
+.. rubric:: Using positional notation: 
+
+The arguments need to be given in the order described in the parameters:
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt');
+
+.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``gid`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``mygeom`` is passed to the function as the id column.
+ | ``SELECT  pgr_analyzeGraph('mytable',0.001,'gid','mygeom','src','tgt');``
+ | ERROR: Can not determine the srid of the geometry "gid" in table public.mytable
+
+
+.. rubric:: When using the named notation
+
+The order of the parameters do not matter:
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
+
+In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.
+
+
+.. rubric:: Selecting rows using rows_where parameter
+
+Selecting rows based on the id.
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
+
+Selecting the rows WHERE the geometry is near the geometry of row with ``id`` =5 .
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
+	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
+	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
+
+Selecting the rows WHERE the geometry is near the place='myhouse' of the table ``othertable``. (note the use of quote_literal)
+
+.. code-block:: sql
+
+        DROP TABLE IF EXISTS otherTable;
+	CREATE TABLE otherTable AS  (SELECT 'myhouse'::text AS place, st_point(2.5,2.5) AS other_geom) ;
+	SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
+                 rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
+
+.. code-block:: sql
+
+	 SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
+                 rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
+
+
+
+Examples
+-------------------------------------------------------------------------------
+
+.. code-block:: sql
+
+	SELECT  pgr_create_topology('edge_table',0.001);
+	SELECT pgr_analyzeGraph('edge_table', 0.001);
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 2
+	NOTICE:                            Dead ends: 7
+	NOTICE:  Potential gaps found near dead ends: 1
+	NOTICE:               Intersections detected: 1
+	NOTICE:                      Ring geometries: 0
+	
+	 pgr_analizeGraph 
+	--------------------
+	 OK
+	(1 row)
+
+	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 0
+	NOTICE:                            Dead ends: 4
+	NOTICE:  Potential gaps found near dead ends: 0
+	NOTICE:               Intersections detected: 0
+	NOTICE:                      Ring geometries: 0
+
+	 pgr_analizeGraph 
+	--------------------
+	 OK
+	(1 row)
+
+	SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id >= 10');
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id >= 10')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 2
+	NOTICE:                            Dead ends: 8
+	NOTICE:  Potential gaps found near dead ends: 1
+	NOTICE:               Intersections detected: 1
+	NOTICE:                      Ring geometries: 0
+	
+	 pgr_analizeGraph 
+	--------------------
+	 OK
+	(1 row)
+
+	-- Simulate removal of edges
+	SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17');
+	SELECT pgr_analyzeGraph('edge_table', 0.001);
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 0
+	NOTICE:                            Dead ends: 3
+	NOTICE:  Potential gaps found near dead ends: 0
+	NOTICE:               Intersections detected: 0
+	NOTICE:                      Ring geometries: 0
+	
+	 pgr_analizeGraph 
+	--------------------
+	 OK
+	(1 row)
+    SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17');
+    NOTICE:  PROCESSING:
+    NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','id <17')
+    NOTICE:  Performing checks, pelase wait .....
+    NOTICE:  Creating Topology, Please wait...
+    NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
+    NOTICE:  Rows with NULL geometry or NULL id: 0
+    NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+    NOTICE:  ----------------------------------------------
+	
+	 pgr_analizeGraph 
+	--------------------
+	 OK
+	(1 row)
+
+    SELECT pgr_analyzeGraph('edge_table', 0.001);
+    NOTICE:  PROCESSING:
+    NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+    NOTICE:  Performing checks, pelase wait...
+    NOTICE:  Analyzing for dead ends. Please wait...
+    NOTICE:  Analyzing for gaps. Please wait...
+    NOTICE:  Analyzing for isolated edges. Please wait...
+    NOTICE:  Analyzing for ring geometries. Please wait...
+    NOTICE:  Analyzing for intersections. Please wait...
+    NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+    NOTICE:                    Isolated segments: 0
+    NOTICE:                            Dead ends: 3
+    NOTICE:  Potential gaps found near dead ends: 0
+    NOTICE:               Intersections detected: 0
+    NOTICE:                      Ring geometries: 0
+	
+	 pgr_analizeGraph 
+	--------------------
+	 OK
+	(1 row)
+                         
+
+The examples use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`topology`  for an overview of a topology for routing algorithms.
+* :ref:`pgr_analyze_oneway` to analyze directionality of the edges.
+* :ref:`pgr_createVerticesTable <pgr_create_vert_table>` to reconstruct the vertices table based on the source and target information.
+* :ref:`pgr_nodeNetwork <pgr_node_network>` to create nodes to a not noded edge table.
+
diff --git a/src/topology/doc/pgr_analyzeOneWay.rst b/src/topology/doc/pgr_analyzeOneWay.rst
new file mode 100644
index 0000000..37b0787
--- /dev/null
+++ b/src/topology/doc/pgr_analyzeOneWay.rst
@@ -0,0 +1,139 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_analyze_oneway:
+
+pgr_analyzeOneway
+===============================================================================
+
+.. index:: 
+	single: pgr_analyzeOneway(text,text[],text[],text[],text[],text,text,text,boolean)
+	module: common
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_analyzeOneway`` — Analyzes oneway Sstreets and identifies flipped segments.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+This function analyzes oneway streets in a graph and identifies any flipped segments. 
+
+.. code-block:: sql
+
+	text pgr_analyzeOneway(geom_table text, 
+			       text[] s_in_rules, text[] s_out_rules, 
+                               text[] t_in_rules, text[] t_out_rules, 
+			       text oneway='oneway', text source='source', text target='target',
+			       boolean two_way_if_null=true);
+
+
+Description
+-------------------------------------------------------------------------------
+
+The analyses of one way segments is pretty simple but can be a powerful tools to identifying some the potential problems created by setting the direction of a segment the wrong way. A node is a `source` if it has edges the exit from that node and no edges enter that node. Conversely, a node is a `sink` if all edges enter the node but none exit that node. For a `source` type node it is logically impossible to exist because no vehicle can exit the node if no vehicle and enter the node. Lik [...]
+
+So why do we care if the are not feasible? Well if the direction of an edge was reversed by mistake we could generate exactly these conditions. Think about a divided highway and on the north bound lane one segment got entered wrong or maybe a sequence of multiple segments got entered wrong or maybe this happened on a round-about. The result would be potentially a `source` and/or a `sink` node.
+
+So by counting the number of edges entering and exiting each node we can identify both `source` and `sink` nodes so that you can look at those areas of your network to make repairs and/or report the problem back to your data vendor.
+
+.. rubric:: Prerequisites
+
+The  edge table to be analyzed must contain a source column and a target column filled with id's of the vertices of the segments and the corresponding vertices table <edge_table>_vertices_pgr that stores the vertices information.
+
+  - Use :ref:`pgr_createVerticesTable <pgr_create_vert_table>` to create the vertices table.
+  - Use :ref:`pgr_createTopology <pgr_create_topology>` to create the topology and the vertices table. 
+
+.. rubric:: Parameters
+
+:edge_table: ``text`` Network table name. (may contain the schema name as well)
+:s_in_rules: ``text[]`` source node **in** rules
+:s_out_rules: ``text[]`` source node **out** rules
+:t_in_rules: ``text[]`` target node **in** rules
+:t_out_rules: ``text[]`` target node **out** rules
+:oneway: ``text`` oneway column name name of the network table. Default value is ``oneway``.
+:source: ``text`` Source column name of the network table. Default value is ``source``.
+:target: ``text``  Target column name of the network table.  Default value is ``target``. 
+:two_way_if_null: ``boolean`` flag to treat oneway NULL values as bi-directional.  Default value is ``true``.
+
+.. note:: It is strongly recommended to use the named notation. See :ref:`pgr_createVerticesTable <pgr_create_vert_table>` or :ref:`pgr_createTopology <pgr_create_topology>` for examples.
+
+
+The function returns:
+
+  - ``OK`` after the analysis has finished.
+
+    * Uses the vertices table: <edge_table>_vertices_pgr.
+    * Fills completely the ``ein`` and ``eout`` columns of the vertices table.
+
+  - ``FAIL`` when the analysis was not completed due to an error. 
+
+    * The vertices table is not found.
+    * A required column of the Network table is not found or is not of the appropriate type.
+    * The names of source , target or oneway are the same.
+
+The rules are defined as an array of text strings that if match the ``oneway`` value would be counted as ``true`` for the source or target **in** or **out** condition.
+
+.. rubric:: The Vertices Table
+
+The vertices table can be created with :ref:`pgr_createVerticesTable <pgr_create_vert_table>` or :ref:`pgr_createTopology <pgr_create_topology>`
+
+The structure of the vertices table is:
+
+:id: ``bigint`` Identifier of the vertex.
+:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. See :ref:`pgr_analyzeGgraph <pgr_analyze_graph>`.
+:chk: ``integer``  Indicator that the vertex might have a problem. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
+:ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. 
+:eout: ``integer`` Number of vertices in the edge_table that reference this vertex as outgoing.
+:the_geom: ``geometry`` Point geometry of the vertex.
+
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+.. code-block:: sql
+
+	SELECT pgr_analyzeOneway('edge_table', 
+        ARRAY['', 'B', 'TF'],
+        ARRAY['', 'B', 'FT'],
+        ARRAY['', 'B', 'FT'],
+        ARRAY['', 'B', 'TF'],
+        oneway:='dir');
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table','{"",B,TF}','{"",B,FT}','{"",B,FT}','{"",B,TF}','dir','source','target',t)
+	NOTICE:  Analyzing graph for one way street errors.
+	NOTICE:  Analysis 25% complete ...
+	NOTICE:  Analysis 50% complete ...
+	NOTICE:  Analysis 75% complete ...
+	NOTICE:  Analysis 100% complete ...
+	NOTICE:  Found 0 potential problems in directionality
+
+	pgr_analyzeoneway 
+	-------------------
+	OK
+	(1 row)
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`topology`  for an overview of a topology for routing algorithms.
+* :ref:`analytics` for an overview of the analysis of a graph.
+* :ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
+* :ref:`pgr_create_vert_table` to reconstruct the vertices table based on the source and target information.
+
diff --git a/src/topology/doc/pgr_createTopology.rst b/src/topology/doc/pgr_createTopology.rst
new file mode 100644
index 0000000..fc28baf
--- /dev/null
+++ b/src/topology/doc/pgr_createTopology.rst
@@ -0,0 +1,257 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_create_topology:
+
+pgr_createTopology
+===============================================================================
+
+.. index:: 
+	single: pgr_createTopology(text,double precision,text,text,text,text,text)
+	module: common
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_createTopology`` — Builds a network topology based on the geometry information.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The function returns:
+
+  - ``OK`` after the network topology has been built and the vertices table created.
+  - ``FAIL`` when the network topology was not built due to an error. 
+
+.. code-block:: none
+
+	varchar pgr_createTopology(text edge_table, double precision tolerance, 
+                           text the_geom:='the_geom', text id:='id',
+                           text source:='source',text target:='target',
+                           text rows_where:='true', boolean clean:=false)
+
+
+
+Description
+-------------------------------------------------------------------------------
+
+.. rubric:: Parameters
+
+The topology creation function accepts the following parameters:
+
+:edge_table: ``text`` Network table name. (may contain the schema name AS well)
+:tolerance: ``float8`` Snapping tolerance of disconnected edges. (in projection unit)
+:the_geom: ``text``  Geometry column name of the network table. Default value is ``the_geom``.  
+:id: ``text``  Primary key column name of the network table. Default value is ``id``. 
+:source: ``text`` Source column name of the network table. Default value is ``source``.
+:target: ``text``  Target column name of the network table.  Default value is ``target``. 
+:rows_where: ``text``   Condition to SELECT a subset or rows.  Default value is ``true`` to indicate
+ all rows that where ``source`` or ``target`` have a null value, otherwise the condition is used.
+:clean: ``boolean`` Clean any previous topology.  Default value is ``false``.
+
+.. warning::
+
+    The ``edge_table`` will be affected
+
+	- The ``source`` column values will change.
+	- The ``target`` column values will change.
+        - An index will be created, if it doesn't exists, to speed up the process to the following columns:
+
+	   * ``id``
+	   * ``the_geom``
+	   * ``source``
+	   * ``target``
+
+The function returns:
+
+  - ``OK`` after the network topology has been built.
+
+    * Creates a vertices table: <edge_table>_vertices_pgr.
+    * Fills ``id`` and ``the_geom`` columns of the vertices table.
+    * Fills the source and target columns of the edge table referencing the ``id`` of the vertices table.
+
+
+  - ``FAIL`` when the network topology was not built due to an error:
+
+    * A required column of the Network table is not found or is not of the appropriate type.
+    * The condition is not well formed.
+    * The names of source , target or id are the same.
+    * The SRID of the geometry could not be determined.
+
+
+.. rubric:: The Vertices Table
+
+The vertices table is a requirment of the :ref:`pgr_analyzeGraph <pgr_analyze_graph>` and the :ref:`pgr_analyzeOneway <pgr_analyze_oneway>` functions.
+
+The structure of the vertices table is:
+
+:id: ``bigint`` Identifier of the vertex.
+:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
+:chk: ``integer``  Indicator that the vertex might have a problem. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
+:ein: ``integer`` Number of vertices in the edge_table that reference this vertex AS incoming. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`.
+:eout: ``integer`` Number of vertices in the edge_table that reference this vertex AS outgoing. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`. 
+:the_geom: ``geometry`` Point geometry of the vertex.
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+
+Usage when the edge table's columns MATCH the default values:
+-------------------------------------------------------------------------------
+ 
+.. rubric:: The simplest way to use pgr_createTopology is: 
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q1
+   :end-before: --q1.1
+
+
+
+.. rubric:: When the arguments are given in the order described in the parameters:
+
+We get the same result AS the simplest way to use the function.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q2
+   :end-before: --q2.1
+
+
+.. warning::  | An error would occur when the arguments are not given in the appropriate order:
+    | In this example, the column ``id`` of the table ``ege_table`` is passed to the function as the geometry column,
+    | and the geometry column ``the_geom`` is passed to the function as the id column. 
+
+    .. literalinclude:: doc-pgr_createTopology.queries
+       :start-after: --q3
+       :end-before: --q3.1
+
+
+.. rubric:: When using the named notation
+
+Parameters defined with a default value can be omited, as long as the value matches the default
+And The order of the parameters would not matter.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q4
+   :end-before: --q4.1
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q5
+   :end-before: --q5.1
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q6
+   :end-before: --q6.1
+
+.. rubric:: Selecting rows using rows_where parameter
+
+Selecting rows based on the id.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q7
+   :end-before: --q7.1
+
+Selecting the rows where the geometry is near the geometry of row with ``id = 5``.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q8
+   :end-before: --q8.1
+
+Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q9
+   :end-before: --q9.1
+
+
+
+
+Usage when the edge table's columns DO NOT MATCH the default values:
+-------------------------------------------------------------------------------
+ 
+For the following table
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q10
+   :end-before: --q10.1
+
+.. rubric:: Using positional notation: 
+
+The arguments need to be given in the order described in the parameters.
+
+Note that this example uses clean flag. So it recreates the whole vertices table.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q11
+   :end-before: --q11.1
+
+.. warning::  | An error would occur when the arguments are not given in the appropiriate order:
+    | In this example, the column ``gid`` of the table ``mytable`` is passed to the function AS the geometry column,
+    | and the geometry column ``mygeom`` is passed to the function AS the id column.
+
+    .. literalinclude:: doc-pgr_createTopology.queries
+       :start-after: --q12
+       :end-before: --q12.1
+
+
+
+.. rubric:: When using the named notation
+
+In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.
+The order of the parameters do not matter:
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q13
+   :end-before: --q13.1
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q14
+   :end-before: --q14.1
+
+
+.. rubric:: Selecting rows using rows_where parameter
+
+Based on id:
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q15
+   :end-before: --q15.1
+
+
+Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q16
+   :end-before: --q16.1
+
+
+Examples with full output
+-------------------------------------------------------------------------------
+
+This example start a clean topology, with 5 edges, and then its incremented to the rest of the edges.
+
+.. literalinclude:: doc-pgr_createTopology.queries
+   :start-after: --q17
+   :end-before: --q17.1
+
+The example uses the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`topology` for an overview of a topology for routing algorithms.
+* :ref:`pgr_create_vert_table` to reconstruct the vertices table based on the source and target information.
+* :ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/topology/doc/pgr_createVerticesTable.rst b/src/topology/doc/pgr_createVerticesTable.rst
new file mode 100644
index 0000000..745389f
--- /dev/null
+++ b/src/topology/doc/pgr_createVerticesTable.rst
@@ -0,0 +1,267 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_create_vert_table:
+
+pgr_createVerticesTable 
+===============================================================================
+
+.. index:: 
+	single: pgr_createVerticesTable(text,text,text,text,text)
+	module: common
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_createVerticesTable`` — Reconstructs the vertices table based on the source and target information.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The function returns:
+
+  - ``OK`` after the vertices table has been reconstructed.
+  - ``FAIL`` when the vertices table was not reconstructed due to an error. 
+
+.. code-block:: sql
+
+	varchar pgr_createVerticesTable(text edge_table,  text the_geom:='the_geom'
+                           text source:='source',text target:='target',text rows_where:='true')
+
+
+
+Description
+-------------------------------------------------------------------------------
+
+.. Rubric:: Parameters
+
+The reconstruction of the vertices table  function accepts the following parameters:
+
+:edge_table: ``text`` Network table name. (may contain the schema name as well)
+:the_geom: ``text``  Geometry column name of the network table. Default value is ``the_geom``.  
+:source: ``text`` Source column name of the network table. Default value is ``source``.
+:target: ``text``  Target column name of the network table.  Default value is ``target``. 
+:rows_where: ``text``   Condition to SELECT a subset or rows.  Default value is ``true`` to indicate all rows.
+
+.. warning::
+
+    The ``edge_table`` will be affected
+
+        - An index will be created, if it doesn't exists, to speed up the process to the following columns:
+
+           * ``the_geom``
+           * ``source``
+           * ``target``
+
+The function returns:
+
+  - ``OK`` after the vertices table has been reconstructed.
+
+    * Creates a vertices table: <edge_table>_vertices_pgr.
+    * Fills ``id`` and ``the_geom`` columns of the vertices table based on the source and target columns of the edge table.
+
+  - ``FAIL`` when the vertices table was not reconstructed due to an error. 
+
+    * A required column of the Network table is not found or is not of the appropriate type.
+    * The condition is not well formed.
+    * The names of source, target are the same.
+    * The SRID of the geometry could not be determined.
+
+.. rubric:: The Vertices Table
+
+The vertices table is a requierment of the :ref:`pgr_analyzeGraph <pgr_analyze_graph>` and the :ref:`pgr_analyzeOneway <pgr_analyze_oneway>` functions.
+
+The structure of the vertices table is:
+
+:id: ``bigint`` Identifier of the vertex.
+:cnt: ``integer`` Number of vertices in the edge_table that reference this vertex. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
+:chk: ``integer``  Indicator that the vertex might have a problem. See :ref:`pgr_analyzeGraph <pgr_analyze_graph>`.
+:ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`.
+:eout: ``integer`` Number of vertices in the edge_table that reference this vertex as outgoing. See :ref:`pgr_analyzeOneway <pgr_analyze_oneway>`. 
+:the_geom: ``geometry`` Point geometry of the vertex.
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+
+Usage when the edge table's columns MATCH the default values:
+-------------------------------------------------------------------------------
+ 
+.. rubric:: The simplest way to use pgr_createVerticesTable is: 
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table');
+
+
+.. rubric:: When the arguments are given in the order described in the parameters:
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table','the_geom','source','target');
+
+We get the same result as the simplest way to use the function.
+
+.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column source column ``source`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``the_geom`` is passed to the function as the source column. 
+ | ``SELECT  pgr_createVerticesTable('edge_table','source','the_geom','target');``
+
+
+.. rubric:: When using the named notation
+
+The order of the parameters do not matter:
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table',the_geom:='the_geom',source:='source',target:='target');
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table',source:='source',target:='target',the_geom:='the_geom');
+
+Parameters defined with a default value can be omited, as long as the value matches the default:
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table',source:='source');
+
+.. rubric:: Selecting rows using rows_where parameter
+
+Selecting rows based on the id.
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='id < 10');
+
+Selecting the rows where the geometry is near the geometry of row with ``id`` =5 .
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(the_geom,0.5) FROM edge_table WHERE id=5)');
+
+Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
+
+.. code-block:: sql
+
+	DROP TABLE IF EXISTS otherTable;
+	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
+	SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)');
+
+
+
+Usage when the edge table's columns DO NOT MATCH the default values:
+-------------------------------------------------------------------------------
+ 
+For the following table
+
+.. code-block:: sql
+
+	DROP TABLE IF EXISTS mytable;
+	CREATE TABLE mytable AS (SELECT id AS gid, the_geom AS mygeom,source AS src ,target AS tgt FROM edge_table) ;
+
+.. rubric:: Using positional notation: 
+
+The arguments need to be given in the order described in the parameters:
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt');
+
+.. warning::  | An error would occur when the arguments are not given in the appropriate order: In this example, the column ``src`` of the table ``mytable`` is passed to the function as the geometry column, and the geometry column ``mygeom`` is passed to the function as the source column.
+ | ``SELECT  pgr_createVerticesTable('mytable','src','mygeom','tgt');``
+
+
+.. rubric:: When using the named notation
+
+The order of the parameters do not matter:
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable',the_geom:='mygeom',source:='src',target:='tgt');
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom');
+
+In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.
+
+
+.. rubric:: Selecting rows using rows_where parameter
+
+Selecting rows based on the gid.
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',rows_where:='gid < 10');
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
+
+Selecting the rows where the geometry is near the geometry of row with ``gid`` =5 .
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
+	                            rows_where:='the_geom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)');
+
+.. code-block:: sql
+
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
+	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE id=5)');
+
+Selecting the rows where the geometry is near the geometry of the row with ``gid`` =100 of the table ``othertable``.
+
+.. code-block:: sql
+
+	DROP TABLE IF EXISTS otherTable;
+	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
+	SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
+	                            rows_where:='the_geom && (SELECT st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)');
+
+.. code-block:: sql
+
+	SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
+	                            rows_where:='the_geom && (SELECT st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)');
+
+
+
+Examples
+-------------------------------------------------------------------------------
+
+.. code-block:: sql
+
+	SELECT pgr_createVerticesTable('edge_table');
+	NOTICE:  PROCESSING:
+    NOTICE:  pgr_createVerticesTable('edge_table','the_geom','source','target','true')
+    NOTICE:  Performing checks, pelase wait .....
+    NOTICE:  Populating public.edge_table_vertices_pgr, please wait...
+    NOTICE:    ----->   VERTICES TABLE CREATED WITH  17 VERTICES
+    NOTICE:                                         FOR   18  EDGES
+    NOTICE:    Edges with NULL geometry,source or target: 0
+    NOTICE:                              Edges processed: 18
+    NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+    NOTICE:  ----------------------------------------------
+               
+	 pgr_createVerticesTable 
+	--------------------
+	 OK
+	(1 row)
+
+
+The example uses the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`topology`  for an overview of a topology for routing algorithms.
+* :ref:`pgr_createTopology <pgr_create_topology>` to create a topology based on the geometry.
+* :ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
+* :ref:`pgr_analyze_oneway` to analyze directionality of the edges.
diff --git a/src/topology/doc/pgr_nodeNetwork.rst b/src/topology/doc/pgr_nodeNetwork.rst
new file mode 100644
index 0000000..6aa8cdc
--- /dev/null
+++ b/src/topology/doc/pgr_nodeNetwork.rst
@@ -0,0 +1,396 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_node_network:
+
+pgr_nodeNetwork
+===============================================================================
+
+.. index:: 
+	single: pgr_NodeNetwork(text,float8,text,text,text)
+	module: common
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_nodeNetwork`` - Nodes an network edge table.
+
+:Author: Nicolas Ribot
+:Copyright: Nicolas Ribot, The source code is released under the MIT-X license.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The function reads edges from a not "noded" network table and writes the "noded" edges into a new table.
+
+.. code-block:: sql
+
+    text pgr_nodenetwork(text edge_table, float8, tolerance,
+			 text  id='id', text the_geom='the_geom',text table_ending='noded'
+             text rows_where ='', boolean outall=false)
+  
+
+Description
+-------------------------------------------------------------------------------
+
+A common problem associated with bringing GIS data into pgRouting is the fact that the data is often not "noded" correctly. This will create invalid topologies, which will result in routes that are incorrect.
+
+What we mean by "noded" is that at every intersection in the road network all the edges will be broken into separate road segments. There are cases like an over-pass and under-pass intersection where you can not traverse from the over-pass to the under-pass, but this function does not have the ability to detect and accommodate those situations.
+
+This function reads the ``edge_table`` table, that has a primary key column ``id`` and geometry column named ``the_geom`` and intersect all the segments in it against all the other segments and then creates a table ``edge_table_noded``. It uses the ``tolerance`` for deciding that multiple nodes within the tolerance are considered the same node. 
+
+Parameters
+
+:edge_table: ``text`` Network table name. (may contain the schema name as well)
+:tolerance: ``float8`` tolerance for coincident points (in projection unit)dd
+:id: ``text`` Primary key column name of the network table. Default value is ``id``.
+:the_geom: ``text`` Geometry column name of the network table. Default value is ``the_geom``.
+:table_ending: ``text`` Suffix for the new table's. Default value is ``noded``.
+
+The output table will have for  ``edge_table_noded``  
+
+:id: ``bigint`` Unique identifier for the table
+:old_id: ``bigint``  Identifier of the edge in original table
+:sub_id: ``integer`` Segment number of the original edge
+:source: ``integer`` Empty source column to be used with  :ref:`pgr_create_topology` function
+:target: ``integer`` Empty target column to be used with  :ref:`pgr_create_topology` function
+:the geom: ``geometry`` Geometry column of the noded network
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+
+Example
+-------------------------------------------------------------------------------
+
+Let's create the topology for the data in :ref:`sampledata`
+
+.. code-block:: sql
+
+	SELECT pgr_createTopology('edge_table', 0.001);
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait .....
+	NOTICE:  Creating Topology, Please wait...
+	NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+	NOTICE:  Rows with NULL geometry or NULL id: 0
+	NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+	NOTICE:  ----------------------------------------------
+ 	pgr_createtopology 
+	--------------------
+ 	 OK
+	(1 row)
+	
+Now we can analyze the network.
+
+.. code-block:: sql
+
+	SELECT pgr_analyzegraph('edge_table', 0.001);
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 2
+	NOTICE:                            Dead ends: 7
+	NOTICE:  Potential gaps found near dead ends: 1
+	NOTICE:               Intersections detected: 1
+	NOTICE:                      Ring geometries: 0
+ 	pgr_analyzegraph 
+	------------------
+ 	 OK
+	(1 row)
+
+The analysis tell us that the network has a gap and and an intersection. We try to fix the problem using:
+
+.. code-block:: sql
+
+	SELECT pgr_nodeNetwork('edge_table', 0.001);
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_nodeNetwork('edge_table',0.001,'the_geom','id','noded')
+	NOTICE:  Performing checks, pelase wait .....
+	NOTICE:  Processing, pelase wait .....
+	NOTICE:    Splitted Edges: 3
+	NOTICE:   Untouched Edges: 15
+	NOTICE:       Total original Edges: 18
+	NOTICE:   Edges generated: 6
+	NOTICE:   Untouched Edges: 15
+	NOTICE:         Total New segments: 21
+	NOTICE:   New Table: public.edge_table_noded
+	NOTICE:  ----------------------------------
+ 	pgr_nodenetwork 
+	-----------------
+ 	 OK
+	(1 row)
+	
+Inspecting the generated table, we can see that edges 13,14 and 18 has been segmented
+
+.. code-block:: sql
+
+	SELECT old_id,sub_id FROM edge_table_noded ORDER BY old_id,sub_id;
+ 	 old_id | sub_id 
+	--------+--------
+  	 1      |      1
+  	 2      |      1
+  	 3      |      1
+  	 4      |      1
+  	 5      |      1
+  	 6      |      1
+  	 7      |      1
+  	 8      |      1
+  	 9      |      1
+ 	 10     |      1
+ 	 11     |      1
+ 	 12     |      1
+ 	 13     |      1
+ 	 13     |      2
+ 	 14     |      1
+ 	 14     |      2
+ 	 15     |      1
+ 	 16     |      1
+ 	 17     |      1
+ 	 18     |      1
+ 	 18     |      2
+	(21 rows)
+		
+We can create the topology of the new network
+
+.. code-block:: sql
+
+	SELECT pgr_createTopology('edge_table_noded', 0.001);
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_createTopology('edge_table_noded',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait .....
+	NOTICE:  Creating Topology, Please wait...
+	NOTICE:  -------------> TOPOLOGY CREATED FOR  21 edges
+	NOTICE:  Rows with NULL geometry or NULL id: 0
+	NOTICE:  Vertices table for table public.edge_table_noded is: public.edge_table_noded_vertices_pgr
+	NOTICE:  ----------------------------------------------
+ 	pgr_createtopology 
+	--------------------
+ 	 OK
+	(1 row)
+	
+Now let's analyze the new topology
+
+.. code-block:: sql
+
+	SELECT pgr_analyzegraph('edge_table_noded', 0.001); 
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table_noded',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 0
+	NOTICE:                            Dead ends: 6
+	NOTICE:  Potential gaps found near dead ends: 0
+	NOTICE:               Intersections detected: 0
+	NOTICE:                      Ring geometries: 0
+ 	pgr_createtopology 
+	--------------------
+ 	 OK
+	(1 row)
+
+
+Images
+-------------------------------------------------------------------------------
+
+.. only:: html
+
+	+--------------------------------------+-------------------------------------+
+	|.. Rubric:: Before Image              |.. Rubric:: After Image              |
+	|                                      |                                     |
+	|.. image:: images/before_node_net.png |.. image:: images/after_node_net.png |
+	|   :scale: 60%                        |   :scale: 60%                       |
+	|   :alt: before image                 |   :alt: after image                 |
+	|   :align: left                       |   :align: right                     |
+	+--------------------------------------+-------------------------------------+
+
+
+.. only:: latex
+
+	.. Rubric:: Before Image
+
+	.. image:: images/before_node_net.png 
+		:scale: 60%
+		:alt: before image 
+		:align: left
+
+
+	.. Rubric:: After Image
+
+	.. image:: images/after_node_net.png 
+		:scale: 60%
+		:alt: after image 
+		:align: left
+
+
+Comparing the results
+-------------------------------------------------------------------------------
+
+Comparing with the Analysis in the original edge_table, we see that.  
+
++------------------+-----------------------------------------+--------------------------------------------------------------+
+|                  |                Before                   |                        After                                 |
++==================+=========================================+==============================================================+
+|Table name        | edge_table                              | edge_table_noded                                             |
++------------------+-----------------------------------------+--------------------------------------------------------------+
+|Fields            | All original fields                     | Has only basic fields to do a topology analysis              |
++------------------+-----------------------------------------+--------------------------------------------------------------+
+|Dead ends         | - Edges with 1 dead end: 1,6,24         | Edges with 1 dead end: 1-1 ,6-1,14-2, 18-1 17-1 18-2         |
+|                  | - Edges with 2 dead ends  17,18         |                                                              |
+|                  |                                         |                                                              |
+|                  | Edge 17's right node is a dead end      |                                                              |
+|                  | because there is no other edge sharing  |                                                              |
+|                  | that same node. (cnt=1)                 |                                                              |
++------------------+-----------------------------------------+--------------------------------------------------------------+
+|Isolated segments | two isolated segments:  17 and 18 both  | No Isolated segments                                         |
+|                  | they have 2 dead ends                   |  - Edge 17 now shares a node with edges 14-1 and 14-2        |
+|                  |                                         |  - Edges 18-1 and 18-2 share a node with edges 13-1 and 13-2 |
++------------------+-----------------------------------------+--------------------------------------------------------------+
+|Gaps              | There is a gap between edge 17 and 14   | Edge 14 was segmented                                        |
+|                  | because edge 14 is near to the right    | Now edges: 14-1 14-2 17 share the same node                  |
+|                  | node of edge 17                         | The tolerance value was taken in account                     |
++------------------+-----------------------------------------+--------------------------------------------------------------+
+|Intersections     | Edges 13 and 18 were intersecting       | Edges were segmented, So, now in the interection's           |
+|                  |                                         | point there is a node and the following edges share it:      |
+|                  |                                         | 13-1 13-2 18-1 18-2                                          |
++------------------+-----------------------------------------+--------------------------------------------------------------+
+
+Now, we are going to include the segments 13-1, 13-2 14-1, 14-2 ,18-1 and 18-2 into our edge-table, copying the data for dir,cost,and reverse cost with tho following steps:
+
+   - Add a column old_id into edge_table, this column is going to keep track the id of the original edge
+   - Insert only the segmented edges, that is, the ones whose max(sub_id) >1
+ 
+.. code-block:: sql
+
+	alter table edge_table drop column if exists old_id;
+	alter table edge_table add column old_id integer;
+	insert into edge_table (old_id,dir,cost,reverse_cost,the_geom)
+   		(with
+       		segmented as (select old_id,count(*) as i from edge_table_noded group by old_id)
+   		select  segments.old_id,dir,cost,reverse_cost,segments.the_geom
+       			from edge_table as edges join edge_table_noded as segments on (edges.id = segments.old_id) 
+       			where edges.id in (select old_id from segmented where i>1) );
+
+We recreate the topology:
+
+.. code-block:: sql
+
+	SELECT pgr_createTopology('edge_table', 0.001);
+
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_createTopology('edge_table',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait .....
+	NOTICE:  Creating Topology, Please wait...
+	NOTICE:  -------------> TOPOLOGY CREATED FOR  24 edges
+	NOTICE:  Rows with NULL geometry or NULL id: 0
+	NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+	NOTICE:  ----------------------------------------------
+ 	pgr_createtopology 
+	--------------------
+ 	OK
+	(1 row)
+
+
+To get the same analysis results as the topology of edge_table_noded, we do the following query:
+
+.. code-block:: sql
+
+	SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='id not in (select old_id from edge_table where old_id is not null)');
+
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target',
+                                   'id not in (select old_id from edge_table where old_id is not null)')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 0
+	NOTICE:                            Dead ends: 6
+	NOTICE:  Potential gaps found near dead ends: 0
+	NOTICE:               Intersections detected: 0
+	NOTICE:                      Ring geometries: 0
+ 	pgr_createtopology 
+	--------------------
+ 	OK
+	(1 row)
+
+
+To get the same analysis results as the original edge_table, we do the following query:
+
+.. code-block:: sql
+
+	SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='old_id is null')
+
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','old_id is null')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 2
+	NOTICE:                            Dead ends: 7
+	NOTICE:  Potential gaps found near dead ends: 1
+	NOTICE:               Intersections detected: 1
+	NOTICE:                      Ring geometries: 0
+ 	pgr_createtopology 
+	--------------------
+ 	OK
+	(1 row)
+
+Or we can analyze everything because, maybe edge 18 is an overpass, edge 14 is an under pass and there is also a street level juction, and the same happens with edges 17 and 13.
+
+.. code-block:: sql
+
+	SELECT pgr_analyzegraph('edge_table', 0.001);
+
+	NOTICE:  PROCESSING:
+	NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+	NOTICE:  Performing checks, pelase wait...
+	NOTICE:  Analyzing for dead ends. Please wait...
+	NOTICE:  Analyzing for gaps. Please wait...
+	NOTICE:  Analyzing for isolated edges. Please wait...
+	NOTICE:  Analyzing for ring geometries. Please wait...
+	NOTICE:  Analyzing for intersections. Please wait...
+	NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+	NOTICE:                    Isolated segments: 0
+	NOTICE:                            Dead ends: 3
+	NOTICE:  Potential gaps found near dead ends: 0
+	NOTICE:               Intersections detected: 5
+	NOTICE:                      Ring geometries: 0
+ 	pgr_createtopology 
+	--------------------
+ 	OK
+	(1 row)
+
+
+See Also
+-------------------------------------------------------------------------------
+
+:ref:`topology` for an overview of a topology for routing algorithms.
+:ref:`pgr_analyze_oneway` to analyze directionality of the edges.
+:ref:`pgr_create_topology` to create a topology based on the geometry.
+:ref:`pgr_analyze_graph` to analyze the edges and vertices of the edge table.
diff --git a/src/topology/doc/topology.rst b/src/topology/doc/topology.rst
new file mode 100644
index 0000000..a3aefbb
--- /dev/null
+++ b/src/topology/doc/topology.rst
@@ -0,0 +1,33 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _topology_functions:
+
+Topology Functions
+===============================================================================
+
+The pgRouting's topology of a network, represented with an edge table with source and target attributes and a vertices table associated with it. 
+Depending on the algorithm, you can create a topology or just reconstruct the vertices table, You can analyze the topology, 
+We also provide a function to node an unoded network.
+
+  -  :ref:`pgr_create_topology` -  to create a topology based on the geometry. 
+  -  :ref:`pgr_create_vert_table` - to reconstruct the vertices table based on the source and target information.
+  -  :ref:`pgr_analyze_graph`  - to analyze the edges and vertices of the edge table.
+  -  :ref:`pgr_analyze_oneway` - to analyze directionality of the edges.
+  -  :ref:`pgr_node_network`  -to create nodes to a not noded edge table.
+
+.. toctree::
+  :hidden: 
+
+  ./pgr_createTopology
+  ./pgr_createVerticesTable
+  ./pgr_analyzeGraph
+  ./pgr_analyzeOneWay
+  ./pgr_nodeNetwork
+
diff --git a/src/topology/sql/CMakeLists.txt b/src/topology/sql/CMakeLists.txt
new file mode 100644
index 0000000..7ade88f
--- /dev/null
+++ b/src/topology/sql/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_topology.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/pgrouting_analytics.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/create_vertices_table.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/nodeNetwork.sql
+)
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/topology/sql/create_vertices_table.sql b/src/topology/sql/create_vertices_table.sql
new file mode 100644
index 0000000..69c4c00
--- /dev/null
+++ b/src/topology/sql/create_vertices_table.sql
@@ -0,0 +1,254 @@
+/*PGR-GNU*****************************************************************
+File: create_vertices_table.sql
+
+Copyright (c) 2013 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+/* 
+
+This function should not be used directly. Use assign_vertex_id instead
+Inserts a point into the vertices tablei "vname" with the srid "srid", and return an id
+of a new point or an existing point. Tolerance is the minimal distance
+between existing points and the new point to create a new point.
+
+Modified by: Vicky Vergara <vicky_vergara at hotmail,com>
+
+HISTORY
+Last changes: 2013-03-22
+2013-08-19: handling schemas
+*/
+
+
+
+/*
+.. function:: pgr_createVerticesTable(edge_table text, the_geom text, source text default 'source', target text default 'target')
+
+  Based on "source" and "target" columns creates the vetrices_pgr table for edge_table
+  Ignores rows where "source" or "target" have NULL values 
+
+  Author: Vicky Vergara <vicky_vergara at hotmail,com>
+
+ HISTORY
+    Created 2013-08-19
+*/
+
+CREATE OR REPLACE FUNCTION pgr_createverticestable(
+   edge_table text,
+   the_geom text DEFAULT 'the_geom'::text,
+   source text DEFAULT 'source'::text,
+   target text DEFAULT 'target'::text,
+    rows_where text DEFAULT 'true'::text
+)
+  RETURNS text AS
+$BODY$
+DECLARE
+    naming record;
+    sridinfo record;
+    sname text;
+    tname text;
+    tabname text;
+    vname text;
+    vertname text;
+    gname text;
+    sourcename text;
+    targetname text;
+    query text;
+    ecnt integer; 
+    srid integer;
+    sourcetype text;
+    targettype text;
+    sql text;
+    totcount integer;
+    i integer;
+    notincluded integer;
+    included integer;
+    debuglevel text;
+    dummyRec text;
+    fnName text;
+    err bool;
+
+
+BEGIN 
+  fnName = 'pgr_createVerticesTable';
+  raise notice 'PROCESSING:'; 
+  raise notice 'pgr_createVerticesTable(''%'',''%'',''%'',''%'',''%'')',edge_table,the_geom,source,target,rows_where;
+  execute 'show client_min_messages' into debuglevel;
+
+  raise notice 'Performing checks, please wait .....';
+
+  RAISE DEBUG 'Checking % exists',edge_table;
+        execute 'select * from _pgr_getTableName('|| quote_literal(edge_table)
+                                                  || ',2,' || quote_literal(fnName) ||' )' into naming;
+
+    sname=naming.sname;
+    tname=naming.tname;
+    tabname=sname||'.'||tname;
+    vname=tname||'_vertices_pgr';
+    vertname= sname||'.'||vname;
+    rows_where = ' AND ('||rows_where||')';
+  raise debug '--> Edge table exists: OK';
+   
+  raise debug 'Checking column names';
+    select * into sourcename from _pgr_getColumnName(sname, tname,source,2, fnName);
+    select * into targetname from _pgr_getColumnName(sname, tname,target,2, fnName);
+    select * into gname      from _pgr_getColumnName(sname, tname,the_geom,2, fnName);
+
+
+    err = sourcename in (targetname,gname) or  targetname=gname;
+    perform _pgr_onError(err, 2, fnName,
+        'Two columns share the same name', 'Parameter names for the_geom,source and target  must be different');
+  raise debug '--> Column names: OK';
+
+  raise debug 'Checking column types in edge table';
+    select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1, fnName);
+    select * into targettype from _pgr_getColumnType(sname,tname,targetname,1, fnName);
+
+
+    err = sourcetype not in('integer','smallint','bigint');
+    perform _pgr_onError(err, 2, fnName,
+        'Wrong type of Column source: '|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found');
+
+    err = targettype not in('integer','smallint','bigint');
+    perform _pgr_onError(err, 2, fnName,
+        'Wrong type of Column target: '|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or biginti but '||targettype||' was found');
+
+  raise debug '-->Column types:OK';
+
+  raise debug 'Checking SRID of geometry column';
+     query= 'SELECT ST_SRID(' || quote_ident(gname) || ') as srid '
+        || ' FROM ' || _pgr_quote_ident(tabname)
+        || ' WHERE ' || quote_ident(gname)
+        || ' IS NOT NULL LIMIT 1';
+     raise debug '%',query;
+     EXECUTE query INTO sridinfo;
+
+     err =  sridinfo IS NULL OR sridinfo.srid IS NULL;
+     perform _pgr_onError(err, 2, fnName,
+         'Can not determine the srid of the geometry '|| gname ||' in table '||tabname, 'Check the geometry of column '||gname);
+     srid := sridinfo.srid;
+  raise DEBUG '     --> OK';
+
+  raise debug 'Checking and creating Indices';
+     perform _pgr_createIndex(sname, tname , sourcename , 'btree'::text);
+     perform _pgr_createIndex(sname, tname , targetname , 'btree'::text);
+     perform _pgr_createIndex(sname, tname , gname , 'gist'::text);
+  raise DEBUG '-->Check and create indices: OK';
+
+     gname=quote_ident(gname);
+     sourcename=quote_ident(sourcename);
+     targetname=quote_ident(targetname);
+
+
+  BEGIN
+  raise debug 'Checking Condition';
+    -- issue #193 & issue #210 & #213
+    -- this sql is for trying out the where clause
+    -- the select * is to avoid any colum name conflicts
+    -- limit 1, just try on first record
+    -- if the where clasuse is ill formed it will be catched in the exception
+    sql = 'select * from '||_pgr_quote_ident(tabname)||' WHERE true'||rows_where ||' limit 1';
+    EXECUTE sql into dummyRec;
+    -- end 
+
+    -- if above where clasue works this one should work
+    -- any error will be catched by the exception also
+    sql = 'select count(*) from '||_pgr_quote_ident(tabname)||' WHERE (' || gname || ' IS NULL or '||
+		sourcename||' is null or '||targetname||' is null)=true '||rows_where;
+    raise debug '%',sql;
+    EXECUTE SQL  into notincluded;
+    EXCEPTION WHEN OTHERS THEN  
+         RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
+         RAISE NOTICE 'ERROR: Condition is not correct, please execute the following query to test your condition';
+         RAISE NOTICE '%',sql;
+         RETURN 'FAIL';
+  END;
+
+
+
+    
+  BEGIN
+     raise DEBUG 'initializing %',vertname;
+       execute 'select * from _pgr_getTableName('||quote_literal(vertname)||',0)' into naming;
+       IF sname=naming.sname  AND vname=naming.tname  THEN
+           execute 'TRUNCATE TABLE '||_pgr_quote_ident(vertname)||' RESTART IDENTITY';
+           execute 'SELECT DROPGEOMETRYCOLUMN('||quote_literal(sname)||','||quote_literal(vname)||','||quote_literal('the_geom')||')';
+       ELSE
+           set client_min_messages  to warning;
+       	   execute 'CREATE TABLE '||_pgr_quote_ident(vertname)||' (id bigserial PRIMARY KEY,cnt integer,chk integer,ein integer,eout integer)';
+       END IF;
+       execute 'select addGeometryColumn('||quote_literal(sname)||','||quote_literal(vname)||','||
+                quote_literal('the_geom')||','|| srid||', '||quote_literal('POINT')||', 2)';
+       execute 'CREATE INDEX '||quote_ident(vname||'_the_geom_idx')||' ON '||_pgr_quote_ident(vertname)||'  USING GIST (the_geom)';
+       execute 'set client_min_messages  to '|| debuglevel;
+       raise DEBUG  '  ------>OK'; 
+       EXCEPTION WHEN OTHERS THEN  
+         RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
+         RAISE NOTICE 'ERROR: Initializing vertex table';
+         RAISE NOTICE '%',sql;
+         RETURN 'FAIL';
+  END;       
+
+  BEGIN
+       raise notice 'Populating %, please wait...',vertname;
+       sql= 'with
+		lines as ((select distinct '||sourcename||' as id, _pgr_startpoint(st_linemerge('||gname||')) as the_geom from '||_pgr_quote_ident(tabname)||
+		                  ' where ('|| gname || ' IS NULL 
+                                    or '||sourcename||' is null 
+                                    or '||targetname||' is null)=false 
+                                     '||rows_where||')
+			union (select distinct '||targetname||' as id,_pgr_endpoint(st_linemerge('||gname||')) as the_geom from '||_pgr_quote_ident(tabname)||
+			          ' where ('|| gname || ' IS NULL 
+                                    or '||sourcename||' is null 
+                                    or '||targetname||' is null)=false
+                                     '||rows_where||'))
+		,numberedLines as (select row_number() OVER (ORDER BY id) AS i,* from lines )
+		,maxid as (select id,max(i) as maxi from numberedLines group by id)
+		insert into '||_pgr_quote_ident(vertname)||'(id,the_geom)  (select id,the_geom  from numberedLines join maxid using(id) where i=maxi order by id)';
+       RAISE debug '%',sql;
+       execute sql;
+       GET DIAGNOSTICS totcount = ROW_COUNT;
+
+       sql = 'select count(*) from '||_pgr_quote_ident(tabname)||' a, '||_pgr_quote_ident(vertname)||' b 
+            where '||sourcename||'=b.id and '|| targetname||' in (select id from '||_pgr_quote_ident(vertname)||')';
+       RAISE debug '%',sql;
+       execute sql into included;
+
+
+
+       execute 'select max(id) from '||_pgr_quote_ident(vertname) into ecnt;
+       execute 'SELECT setval('||quote_literal(vertname||'_id_seq')||','||coalesce(ecnt,1)||' , false)';
+       raise notice '  ----->   VERTICES TABLE CREATED WITH  % VERTICES', totcount;
+       raise notice '                                       FOR   %  EDGES', included+notincluded;
+       RAISE NOTICE '  Edges with NULL geometry,source or target: %',notincluded;
+       RAISE NOTICE '                            Edges processed: %',included;
+       Raise notice 'Vertices table for table % is: %',_pgr_quote_ident(tabname),_pgr_quote_ident(vertname);
+       raise notice '----------------------------------------------';
+    END;
+    
+    RETURN 'OK';
+ EXCEPTION WHEN OTHERS THEN
+   RAISE NOTICE 'Unexpected error %', SQLERRM; -- issue 210,211
+   RETURN 'FAIL';
+END;
+$BODY$
+  LANGUAGE plpgsql VOLATILE STRICT;
+
+COMMENT ON FUNCTION pgr_createVerticesTable(text,text,text,text,text) 
+IS 'args: edge_table, the_geom:=''the_geom'',source:=''source'', target:=''target'' rows_where:=''true'' - creates a vertices table based on the source and target identifiers for selected rows';
diff --git a/src/topology/sql/nodeNetwork.sql b/src/topology/sql/nodeNetwork.sql
new file mode 100644
index 0000000..a286f43
--- /dev/null
+++ b/src/topology/sql/nodeNetwork.sql
@@ -0,0 +1,289 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Author: Nicolas Ribot, 2013
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+CREATE OR REPLACE FUNCTION pgr_nodeNetwork(edge_table text, tolerance double precision, 
+			id text default 'id', the_geom text default 'the_geom', table_ending text default 'noded',
+            rows_where text DEFAULT ''::text, outall boolean DEFAULT false) RETURNS text AS
+$BODY$
+DECLARE
+	/*
+	 * Author: Nicolas Ribot, 2013
+	*/
+	p_num int := 0;
+	p_ret text := '';
+    pgis_ver_old boolean := _pgr_versionless(postgis_lib_version(), '2.1.0.0');
+    vst_line_substring text;
+    vst_line_locate_point text;
+    intab text;
+    outtab text;
+    n_pkey text;
+    n_geom text;
+    naming record;
+    sname text;
+    tname text;
+    outname text;
+    srid integer;
+    sridinfo record;
+    splits bigint;
+    touched bigint;
+    untouched bigint;
+    geomtype text;
+    debuglevel text;
+    rows_where text;
+   
+
+BEGIN
+  raise notice 'PROCESSING:'; 
+  raise notice 'pgr_nodeNetwork(''%'', %, ''%'', ''%'', ''%'', ''%'',  %)',
+    edge_table, tolerance, id,  the_geom, table_ending, rows_where, outall;
+  raise notice 'Performing checks, please wait .....';
+  execute 'show client_min_messages' into debuglevel;
+
+  BEGIN
+    RAISE DEBUG 'Checking % exists',edge_table;
+    execute 'select * from _pgr_getTableName('||quote_literal(edge_table)||',0)' into naming;
+    sname=naming.sname;
+    tname=naming.tname;
+    IF sname IS NULL OR tname IS NULL THEN
+	RAISE NOTICE '-------> % not found',edge_table;
+        RETURN 'FAIL';
+    ELSE
+	RAISE DEBUG '  -----> OK';
+    END IF;
+  
+    intab=sname||'.'||tname;
+    outname=tname||'_'||table_ending;
+    outtab= sname||'.'||outname;
+    rows_where = CASE WHEN length(rows_where) > 2 and not outall THEN ' AND (' || rows_where || ')' ELSE '' END;
+    rows_where = CASE WHEN length(rows_where) > 2 THEN ' WHERE (' || rows_where || ')' ELSE '' END;
+  END;
+
+  BEGIN 
+       raise DEBUG 'Checking id column "%" columns in  % ',id,intab;
+       EXECUTE 'select _pgr_getColumnName('||quote_literal(intab)||','||quote_literal(id)||')' INTO n_pkey;
+       IF n_pkey is NULL then
+          raise notice  'ERROR: id column "%"  not found in %',id,intab;
+          RETURN 'FAIL';
+       END IF;
+  END; 
+
+
+  BEGIN 
+       raise DEBUG 'Checking id column "%" columns in  % ',the_geom,intab;
+       EXECUTE 'select _pgr_getColumnName('||quote_literal(intab)||','||quote_literal(the_geom)||')' INTO n_geom;
+       IF n_geom is NULL then
+          raise notice  'ERROR: the_geom  column "%"  not found in %',the_geom,intab;
+          RETURN 'FAIL';
+       END IF;
+  END;
+
+  IF n_pkey=n_geom THEN
+	raise notice  'ERROR: id and the_geom columns have the same name "%" in %',n_pkey,intab;
+        RETURN 'FAIL';
+  END IF;
+ 
+  BEGIN 
+       	raise DEBUG 'Checking the SRID of the geometry "%"', n_geom;
+       	EXECUTE 'SELECT ST_SRID(' || quote_ident(n_geom) || ') as srid '
+          		|| ' FROM ' || _pgr_quote_ident(intab)
+          		|| ' WHERE ' || quote_ident(n_geom)
+          		|| ' IS NOT NULL LIMIT 1' INTO sridinfo;
+       	IF sridinfo IS NULL OR sridinfo.srid IS NULL THEN
+        	RAISE NOTICE 'ERROR: Can not determine the srid of the geometry "%" in table %', n_geom,intab;
+           	RETURN 'FAIL';
+       	END IF;
+       	srid := sridinfo.srid;
+       	raise DEBUG '  -----> SRID found %',srid;
+       	EXCEPTION WHEN OTHERS THEN
+           		RAISE NOTICE 'ERROR: Can not determine the srid of the geometry "%" in table %', n_geom,intab;
+           		RETURN 'FAIL';
+  END;
+
+    BEGIN
+      RAISE DEBUG 'Checking "%" column in % is indexed',n_pkey,intab;
+      if (_pgr_isColumnIndexed(intab,n_pkey)) then 
+	RAISE DEBUG '  ------>OK';
+      else 
+        RAISE DEBUG ' ------> Adding  index "%_%_idx".',n_pkey,intab;
+
+	set client_min_messages  to warning;
+        execute 'create  index '||tname||'_'||n_pkey||'_idx on '||_pgr_quote_ident(intab)||' using btree('||quote_ident(n_pkey)||')';
+	execute 'set client_min_messages  to '|| debuglevel;
+      END IF;
+    END;
+
+    BEGIN
+      RAISE DEBUG 'Checking "%" column in % is indexed',n_geom,intab;
+      if (_pgr_iscolumnindexed(intab,n_geom)) then 
+	RAISE DEBUG '  ------>OK';
+      else 
+        RAISE DEBUG ' ------> Adding unique index "%_%_gidx".',intab,n_geom;
+	set client_min_messages  to warning;
+        execute 'CREATE INDEX '
+            || quote_ident(tname || '_' || n_geom || '_gidx' )
+            || ' ON ' || _pgr_quote_ident(intab)
+            || ' USING gist (' || quote_ident(n_geom) || ')';
+	execute 'set client_min_messages  to '|| debuglevel;
+      END IF;
+    END;
+---------------
+    BEGIN
+       raise DEBUG 'initializing %',outtab;
+       execute 'select * from _pgr_getTableName('||quote_literal(outtab)||',0)' into naming;
+       IF sname=naming.sname  AND outname=naming.tname  THEN
+           execute 'TRUNCATE TABLE '||_pgr_quote_ident(outtab)||' RESTART IDENTITY';
+           execute 'SELECT DROPGEOMETRYCOLUMN('||quote_literal(sname)||','||quote_literal(outname)||','||quote_literal(n_geom)||')';
+       ELSE
+	   set client_min_messages  to warning;
+       	   execute 'CREATE TABLE '||_pgr_quote_ident(outtab)||' (id bigserial PRIMARY KEY,old_id integer,sub_id integer,
+								source bigint,target bigint)';
+       END IF;
+       execute 'select geometrytype('||quote_ident(n_geom)||') from  '||_pgr_quote_ident(intab)||' limit 1' into geomtype;
+       execute 'select addGeometryColumn('||quote_literal(sname)||','||quote_literal(outname)||','||
+                quote_literal(n_geom)||','|| srid||', '||quote_literal(geomtype)||', 2)';
+       execute 'CREATE INDEX '||quote_ident(outname||'_'||n_geom||'_idx')||' ON '||_pgr_quote_ident(outtab)||'  USING GIST ('||quote_ident(n_geom)||')';
+	execute 'set client_min_messages  to '|| debuglevel;
+       raise DEBUG  '  ------>OK'; 
+    END;  
+----------------
+
+
+  raise notice 'Processing, please wait .....';
+
+
+    if pgis_ver_old then
+        vst_line_substring    := 'st_line_substring';
+        vst_line_locate_point := 'st_line_locate_point';
+    else
+        vst_line_substring    := 'st_linesubstring';
+        vst_line_locate_point := 'st_linelocatepoint';
+    end if;
+
+--    -- First creates temp table with intersection points
+    p_ret = 'create temp table intergeom on commit drop as (
+        select l1.' || quote_ident(n_pkey) || ' as l1id, 
+               l2.' || quote_ident(n_pkey) || ' as l2id, 
+	       l1.' || quote_ident(n_geom) || ' as line,
+	       _pgr_startpoint(l2.' || quote_ident(n_geom) || ') as source,
+	       _pgr_endpoint(l2.' || quote_ident(n_geom) || ') as target,
+               st_intersection(l1.' || quote_ident(n_geom) || ', l2.' || quote_ident(n_geom) || ') as geom 
+        from (SELECT * FROM ' || _pgr_quote_ident(intab) || rows_where || ') as l1 
+             join (SELECT * FROM ' || _pgr_quote_ident(intab) || rows_where || ') as l2 
+             on (st_dwithin(l1.' || quote_ident(n_geom) || ', l2.' || quote_ident(n_geom) || ', ' || tolerance || '))'||
+        'where l1.' || quote_ident(n_pkey) || ' <> l2.' || quote_ident(n_pkey)||' and 
+	st_equals(_pgr_startpoint(l1.' || quote_ident(n_geom) || '),_pgr_startpoint(l2.' || quote_ident(n_geom) || '))=false and 
+	st_equals(_pgr_startpoint(l1.' || quote_ident(n_geom) || '),_pgr_endpoint(l2.' || quote_ident(n_geom) || '))=false and 
+	st_equals(_pgr_endpoint(l1.' || quote_ident(n_geom) || '),_pgr_startpoint(l2.' || quote_ident(n_geom) || '))=false and 
+	st_equals(_pgr_endpoint(l1.' || quote_ident(n_geom) || '),_pgr_endpoint(l2.' || quote_ident(n_geom) || '))=false  )';
+    raise debug '%',p_ret;	
+    EXECUTE p_ret;	
+
+    -- second temp table with locus (index of intersection point on the line)
+    -- to avoid updating the previous table
+    -- we keep only intersection points occuring onto the line, not at one of its ends
+--    drop table if exists inter_loc;
+
+--HAD TO CHANGE THIS QUERY
+ p_ret= 'create temp table inter_loc on commit drop as ( 
+        select l1id, l2id, ' || vst_line_locate_point || '(line,point) as locus from (
+        select DISTINCT l1id, l2id, line, (ST_DumpPoints(geom)).geom as point from intergeom) as foo
+        where ' || vst_line_locate_point || '(line,point)<>0 and ' || vst_line_locate_point || '(line,point)<>1)';
+--    p_ret= 'create temp table inter_loc on commit drop as ( select * from (
+--        (select l1id, l2id, ' || vst_line_locate_point || '(line,source) as locus from intergeom)
+--         union
+--        (select l1id, l2id, ' || vst_line_locate_point || '(line,target) as locus from intergeom)) as foo
+--        where locus<>0 and locus<>1)';
+    raise debug  '%',p_ret;	
+    EXECUTE p_ret;	
+
+    -- index on l1id
+    create index inter_loc_id_idx on inter_loc(l1id);
+
+    -- Then computes the intersection on the lines subset, which is much smaller than full set 
+    -- as there are very few intersection points
+
+--- outab needs to be formally created with id, old_id, subid,the_geom, source,target
+---  so it can be inmediatly be used with createTopology
+
+--   EXECUTE 'drop table if exists ' || _pgr_quote_ident(outtab);
+--   EXECUTE 'create table ' || _pgr_quote_ident(outtab) || ' as 
+     P_RET = 'insert into '||_pgr_quote_ident(outtab)||' (old_id,sub_id,'||quote_ident(n_geom)||') (  with cut_locations as (
+           select l1id as lid, locus 
+           from inter_loc
+           -- then generates start and end locus for each line that have to be cut buy a location point
+           UNION ALL
+           select i.l1id  as lid, 0 as locus
+           from inter_loc i left join ' || _pgr_quote_ident(intab) || ' b on (i.l1id = b.' || quote_ident(n_pkey) || ')
+           UNION ALL
+           select i.l1id  as lid, 1 as locus
+           from inter_loc i left join ' || _pgr_quote_ident(intab) || ' b on (i.l1id = b.' || quote_ident(n_pkey) || ')
+           order by lid, locus
+       ), 
+       -- we generate a row_number index column for each input line 
+       -- to be able to self-join the table to cut a line between two consecutive locations 
+       loc_with_idx as (
+           select lid, locus, row_number() over (partition by lid order by locus) as idx
+           from cut_locations
+       ) 
+       -- finally, each original line is cut with consecutive locations using linear referencing functions
+       select l.' || quote_ident(n_pkey) || ', loc1.idx as sub_id, ' || vst_line_substring || '(l.' || quote_ident(n_geom) || ', loc1.locus, loc2.locus) as ' || quote_ident(n_geom) || ' 
+       from loc_with_idx loc1 join loc_with_idx loc2 using (lid) join ' || _pgr_quote_ident(intab) || ' l on (l.' || quote_ident(n_pkey) || ' = loc1.lid)
+       where loc2.idx = loc1.idx+1
+           -- keeps only linestring geometries
+           and geometryType(' || vst_line_substring || '(l.' || quote_ident(n_geom) || ', loc1.locus, loc2.locus)) = ''LINESTRING'') ';
+    raise debug  '%',p_ret;	
+    EXECUTE p_ret;	
+	GET DIAGNOSTICS splits = ROW_COUNT;
+        execute 'with diff as (select distinct old_id from '||_pgr_quote_ident(outtab)||' )
+                 select count(*) from diff' into touched; 
+	-- here, it misses all original line that did not need to be cut by intersection points: these lines
+	-- are already clean
+	-- inserts them in the final result: all lines which gid is not in the res table.
+	EXECUTE 'insert into ' || _pgr_quote_ident(outtab) || ' (old_id , sub_id, ' || quote_ident(n_geom) || ')
+                ( with used as (select distinct old_id from '|| _pgr_quote_ident(outtab)||')
+		select ' ||  quote_ident(n_pkey) || ', 1 as sub_id, ' ||  quote_ident(n_geom) ||
+		' from '|| _pgr_quote_ident(intab) ||' where  '||quote_ident(n_pkey)||' not in (select * from used)' || rows_where || ')';
+	GET DIAGNOSTICS untouched = ROW_COUNT;
+
+	raise NOTICE '  Splitted Edges: %', touched;
+	raise NOTICE ' Untouched Edges: %', untouched;
+	raise NOTICE '     Total original Edges: %', touched+untouched;
+        RAISE NOTICE ' Edges generated: %', splits;
+	raise NOTICE ' Untouched Edges: %',untouched;
+	raise NOTICE '       Total New segments: %', splits+untouched;
+        RAISE NOTICE ' New Table: %', outtab;
+        RAISE NOTICE '----------------------------------';
+
+    drop table  if exists intergeom;
+    drop table if exists inter_loc;
+    RETURN 'OK';
+END;
+$BODY$
+    LANGUAGE 'plpgsql' VOLATILE STRICT COST 100;
+
+
+COMMENT ON FUNCTION pgr_nodeNetwork(text, double precision, text, text, text, text, boolean )
+ IS  'edge_table, tolerance, id:=''id'', the_geom:=''the_geom'', table_ending:=''noded'' ';
+
diff --git a/src/topology/sql/pgrouting_analytics.sql b/src/topology/sql/pgrouting_analytics.sql
new file mode 100644
index 0000000..355e703
--- /dev/null
+++ b/src/topology/sql/pgrouting_analytics.sql
@@ -0,0 +1,610 @@
+/*PGR-MIT*****************************************************************
+
+=========================
+pgRouting Graph Analytics
+=========================
+:Author: Stephen Woodbridge <woodbri at swoodbridge.com>
+:Date: $Date: 2013-03-22 20:14:00 -5000 (Fri, 22 Mar 2013) $
+:Revision: $Revision: 0000 $
+:Description: This is a collection of tools for analyzing graphs.
+It has been contributed to pgRouting by iMaptools.com.
+:Copyright: Stephen Woodbridge. This is released under the MIT-X license.
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+
+
+/*
+.. function:: pgr_analyzeGraph(edge_tab, tolerance,the_geom, source,target)
+
+   Analyzes the "edge_tab" and "edge_tab_vertices_pgr" tables and flags if
+   nodes are deadends, ie vertices_tmp.cnt=1 and identifies nodes
+   that might be disconnected because of gaps < tolerance or because of
+   zlevel errors in the data. For example:
+
+.. code-block:: sql
+
+       select pgr_analyzeGraph('mytab', 0.000002);
+
+   After the analyzing the graph, deadends are indentified by *cnt=1*
+   in the "vertices_tmp" table and potential problems are identified
+   with *chk=1*.  (Using 'source' and 'target' columns for analysis)
+
+.. code-block:: sql
+
+       select * from vertices_tmp where chk = 1;
+
+HISOTRY
+:Author: Stephen Woodbridge <woodbri at swoodbridge.com>
+:Modified: 2013/08/20 by Vicky Vergara <vicky_vergara at hotmail.com>
+
+Makes more checks:
+   checks table edge_tab exists in the schema
+   checks source and target columns exist in edge_tab
+   checks that source and target are completely populated i.e. do not have NULL values
+   checks table edge_tabVertices exist in the appropiate schema
+       if not, it creates it and populates it
+   checks 'cnt','chk' columns exist in  edge_tabVertices
+       if not, it creates them
+   checks if 'id' column of edge_tabVertices is indexed
+       if not, it creates the index
+   checks if 'source','target',the_geom columns of edge_tab are indexed
+       if not, it creates their index
+   populates cnt in edge_tabVertices  <--- changed the way it was processed, because on large tables took to long.
+					   For sure I am wrong doing this, but it gave me the same result as the original.
+   populates chk                      <--- added a notice for big tables, because it takes time
+           (edge_tab text, the_geom text, tolerance double precision)
+*/
+
+CREATE OR REPLACE FUNCTION pgr_analyzegraph(edge_table text,tolerance double precision,the_geom text default 'the_geom',id text default 'id',source text default 'source',target text default 'target',rows_where text default 'true')
+RETURNS character varying AS
+$BODY$
+
+DECLARE
+    points record;
+    seg record;
+    naming record;
+    sridinfo record;
+    srid integer;
+    ecnt integer;
+    vertname text;
+    sname text;
+    tname text;
+    vname text;
+    idname text;
+    sourcename text;
+    targetname text;
+    sourcetype text;
+    targettype text;
+    geotype text;
+    gname text;
+    tabName text;
+    flag boolean ;
+    query text;
+    selectionquery text;
+    i integer;
+    tot integer;
+    NumIsolated integer;
+    numdeadends integer;
+    numgaps integer;
+    NumCrossing integer;
+    numRings integer;
+    debuglevel text;
+
+
+
+
+BEGIN
+  raise notice 'PROCESSING:';
+  raise notice 'pgr_analyzeGraph(''%'',%,''%'',''%'',''%'',''%'',''%'')',edge_table,tolerance,the_geom,id,source,target,rows_where;
+  raise notice 'Performing checks, please wait ...';
+  execute 'show client_min_messages' into debuglevel;
+
+
+  BEGIN
+    RAISE DEBUG 'Checking % exists',edge_table;
+    execute 'select * from _pgr_getTableName('||quote_literal(edge_table)||',2)' into naming;
+    sname=naming.sname;
+    tname=naming.tname;
+    tabname=sname||'.'||tname;
+    vname=tname||'_vertices_pgr';
+    vertname= sname||'.'||vname;
+    rows_where = ' AND ('||rows_where||')';
+    raise DEBUG '     --> OK';
+/*    EXCEPTION WHEN raise_exception THEN
+      RAISE NOTICE 'ERROR: something went wrong checking the table name';
+      RETURN 'FAIL';
+*/
+  END;
+
+  BEGIN
+       raise debug 'Checking Vertices table';
+       execute 'select * from  _pgr_checkVertTab('||quote_literal(vertname) ||', ''{"id","cnt","chk"}''::text[])' into naming;
+       execute 'UPDATE '||_pgr_quote_ident(vertname)||' SET cnt=0 ,chk=0';
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking the vertices table';
+          RETURN 'FAIL';
+  END;
+
+
+
+  BEGIN
+       raise debug 'Checking column names in edge table';
+       select * into idname     from _pgr_getColumnName(sname, tname,id,2);
+       select * into sourcename from _pgr_getColumnName(sname, tname,source,2);
+       select * into targetname from _pgr_getColumnName(sname, tname,target,2);
+       select * into gname      from _pgr_getColumnName(sname, tname,the_geom,2);
+
+
+       perform _pgr_onError( sourcename in (targetname,idname,gname) or  targetname in (idname,gname) or idname=gname, 2,
+                       'pgr_analyzeGraph',  'Two columns share the same name', 'Parameter names for id,the_geom,source and target  must be different',
+                       'Column names are OK');
+
+        raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking the column names';
+          RETURN 'FAIL';
+  END;
+
+
+  BEGIN
+       raise debug 'Checking column types in edge table';
+       select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1);
+       select * into targettype from _pgr_getColumnType(sname,tname,targetname,1);
+
+       perform _pgr_onError(sourcetype not in('integer','smallint','bigint') , 2,
+                       'pgr_analyzeGraph',  'Wrong type of Column '|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found',
+                       'Type of Column '|| sourcename || ' is ' || sourcetype);
+
+       perform _pgr_onError(targettype not in('integer','smallint','bigint') , 2,
+                       'pgr_analyzeGraph',  'Wrong type of Column '|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or biginti but '||targettype||' was found',
+                       'Type of Column '|| targetname || ' is ' || targettype);
+
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking the column types';
+          RETURN 'FAIL';
+   END;
+
+   BEGIN
+       raise debug 'Checking SRID of geometry column';
+         query= 'SELECT ST_SRID(' || quote_ident(gname) || ') as srid '
+            || ' FROM ' || _pgr_quote_ident(tabname)
+            || ' WHERE ' || quote_ident(gname)
+            || ' IS NOT NULL LIMIT 1';
+         EXECUTE QUERY INTO sridinfo;
+
+         perform _pgr_onError( sridinfo IS NULL OR sridinfo.srid IS NULL,2,
+                 'Can not determine the srid of the geometry '|| gname ||' in table '||tabname, 'Check the geometry of column '||gname,
+                 'SRID of '||gname||' is '||sridinfo.srid);
+
+         IF sridinfo IS NULL OR sridinfo.srid IS NULL THEN
+             RAISE NOTICE ' Can not determine the srid of the geometry "%" in table %', the_geom,tabname;
+             RETURN 'FAIL';
+         END IF;
+         srid := sridinfo.srid;
+         raise DEBUG '     --> OK';
+         EXCEPTION WHEN OTHERS THEN
+             RAISE NOTICE 'Got %', SQLERRM;--issue 210,211,213
+             RAISE NOTICE 'ERROR: something went wrong when checking for SRID of % in table %', the_geom,tabname;
+             RETURN 'FAIL';
+    END;
+
+
+    BEGIN
+       raise debug 'Checking  indices in edge table';
+       perform _pgr_createIndex(tabname , idname , 'btree');
+       perform _pgr_createIndex(tabname , sourcename , 'btree');
+       perform _pgr_createIndex(tabname , targetname , 'btree');
+       perform _pgr_createIndex(tabname , gname , 'gist');
+
+       gname=quote_ident(gname);
+       sourcename=quote_ident(sourcename);
+       targetname=quote_ident(targetname);
+       idname=quote_ident(idname);
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking indices';
+          RETURN 'FAIL';
+    END;
+
+
+    BEGIN
+        query='select count(*) from '||_pgr_quote_ident(tabname)||' where true  '||rows_where;
+        EXECUTE query into ecnt;
+        raise DEBUG '-->Rows Where condition: OK';
+        raise DEBUG '     --> OK';
+         EXCEPTION WHEN OTHERS THEN
+            RAISE NOTICE 'Got %', SQLERRM;  --issue 210,211,213
+            RAISE NOTICE 'ERROR: Condition is not correct. Please execute the following query to test your condition';
+            RAISE NOTICE '%',query;
+            RETURN 'FAIL';
+    END;
+
+    selectionquery ='with
+           selectedRows as( (select '||sourcename||' as id from '||_pgr_quote_ident(tabname)||' where true '||rows_where||')
+                           union
+                           (select '||targetname||' as id from '||_pgr_quote_ident(tabname)||' where true '||rows_where||'))';
+
+
+
+
+
+   BEGIN
+       RAISE NOTICE 'Analyzing for dead ends. Please wait...';
+       query= 'with countingsource as (select a.'||sourcename||' as id,count(*) as cnts
+               from (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' ) a  group by a.'||sourcename||')
+                     ,countingtarget as (select a.'||targetname||' as id,count(*) as cntt
+                    from (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' ) a  group by a.'||targetname||')
+                   ,totalcount as (select id,case when cnts is null and cntt is null then 0
+                                                   when cnts is null then cntt
+                                                   when cntt is null then cnts
+                                                   else cnts+cntt end as totcnt
+                                   from ('||_pgr_quote_ident(vertname)||' as a left
+                                   join countingsource as t using(id) ) left join countingtarget using(id))
+               update '||_pgr_quote_ident(vertname)||' as a set cnt=totcnt from totalcount as b where a.id=b.id';
+       raise debug '%',query;
+       execute query;
+       query=selectionquery||'
+              SELECT count(*)  FROM '||_pgr_quote_ident(vertname)||' WHERE cnt=1 and id in (select id from selectedRows)';
+       raise debug '%',query;
+       execute query  INTO numdeadends;
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'Got %', SQLERRM;  --issue 210,211,213
+          RAISE NOTICE 'ERROR: something went wrong when analizing for dead ends';
+          RETURN 'FAIL';
+   END;
+
+
+
+    BEGIN
+          RAISE NOTICE 'Analyzing for gaps. Please wait...';
+          query = 'with
+                   buffer as (select id,st_buffer(the_geom,'||tolerance||') as buff from '||_pgr_quote_ident(vertname)||' where cnt=1)
+                   ,veryclose as (select b.id,st_crosses(a.'||gname||',b.buff) as flag
+                   from  (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' ) as a
+                   join buffer as b on (a.'||gname||'&&b.buff)
+                   where '||sourcename||'!=b.id and '||targetname||'!=b.id )
+                   update '||_pgr_quote_ident(vertname)||' set chk=1 where id in (select distinct id from veryclose where flag=true)';
+          raise debug '%' ,query;
+          execute query;
+          GET DIAGNOSTICS  numgaps= ROW_COUNT;
+          raise DEBUG '     --> OK';
+          EXCEPTION WHEN raise_exception THEN
+            RAISE NOTICE 'ERROR: something went wrong when Analyzing for gaps';
+            RETURN 'FAIL';
+    END;
+
+    BEGIN
+        RAISE NOTICE 'Analyzing for isolated edges. Please wait...';
+        query=selectionquery|| ' SELECT count(*) FROM (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||' )  as a,
+                                                 '||_pgr_quote_ident(vertname)||' as b,
+                                                 '||_pgr_quote_ident(vertname)||' as c
+                            WHERE b.id in (select id from selectedRows) and a.'||sourcename||' =b.id
+                            AND b.cnt=1 AND a.'||targetname||' =c.id
+                            AND c.cnt=1';
+        raise debug '%' ,query;
+        execute query  INTO NumIsolated;
+        raise DEBUG '     --> OK';
+        EXCEPTION WHEN raise_exception THEN
+            RAISE NOTICE 'ERROR: something went wrong when Analyzing for isolated edges';
+            RETURN 'FAIL';
+    END;
+
+    BEGIN
+        RAISE NOTICE 'Analyzing for ring geometries. Please wait...';
+        execute 'SELECT geometrytype('||gname||')  FROM '||_pgr_quote_ident(tabname) limit 1 into geotype;
+        IF (geotype='MULTILINESTRING') THEN
+            query ='SELECT count(*)  FROM '||_pgr_quote_ident(tabname)||'
+                                 WHERE true  '||rows_where||' and st_isRing(st_linemerge('||gname||'))';
+            raise debug '%' ,query;
+            execute query  INTO numRings;
+        ELSE query ='SELECT count(*)  FROM '||_pgr_quote_ident(tabname)||'
+                                  WHERE true  '||rows_where||' and st_isRing('||gname||')';
+            raise debug '%' ,query;
+            execute query  INTO numRings;
+        END IF;
+        raise DEBUG '     --> OK';
+        EXCEPTION WHEN raise_exception THEN
+            RAISE NOTICE 'ERROR: something went wrong when Analyzing for ring geometries';
+            RETURN 'FAIL';
+    END;
+
+    BEGIN
+        RAISE NOTICE 'Analyzing for intersections. Please wait...';
+        query = 'select count(*) from (select distinct case when a.'||idname||' < b.'||idname||' then a.'||idname||'
+                                                        else b.'||idname||' end,
+                                                   case when a.'||idname||' < b.'||idname||' then b.'||idname||'
+                                                        else a.'||idname||' end
+                                    FROM (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||') as a
+                                    JOIN (select * from '||_pgr_quote_ident(tabname)||' where true '||rows_where||') as b
+                                    ON (a.'|| gname||' && b.'||gname||')
+                                    WHERE a.'||idname||' != b.'||idname|| '
+                                        and (a.'||sourcename||' in (b.'||sourcename||',b.'||targetname||')
+                                              or a.'||targetname||' in (b.'||sourcename||',b.'||targetname||')) = false
+                                        and st_intersects(a.'||gname||', b.'||gname||')=true) as d ';
+        raise debug '%' ,query;
+        execute query  INTO numCrossing;
+        raise DEBUG '     --> OK';
+        EXCEPTION WHEN raise_exception THEN
+            RAISE NOTICE 'ERROR: something went wrong when Analyzing for intersections';
+            RETURN 'FAIL';
+    END;
+
+
+
+
+    RAISE NOTICE '            ANALYSIS RESULTS FOR SELECTED EDGES:';
+    RAISE NOTICE '                  Isolated segments: %', NumIsolated;
+    RAISE NOTICE '                          Dead ends: %', numdeadends;
+    RAISE NOTICE 'Potential gaps found near dead ends: %', numgaps;
+    RAISE NOTICE '             Intersections detected: %',numCrossing;
+    RAISE NOTICE '                    Ring geometries: %',numRings;
+
+
+    RETURN 'OK';
+END;
+$BODY$
+  LANGUAGE plpgsql VOLATILE STRICT;
+COMMENT ON FUNCTION pgr_analyzeGraph(text,double precision,text,text,text,text,text) IS 'args: edge_table, tolerance,the_geom:=''the_geom'',id:=''id'',source column:=''source'', target column:=''target'' rows_where:=''true'' - creates a vertices table based on the geometry for selected rows';
+
+
+
+
+
+/*
+.. function:: _pgr_analyzeOneway(tab, col, s_in_rules, s_out_rules, t_in_rules, t_out_rules)
+
+   This function analyzes oneway streets in a graph and identifies any
+   flipped segments. Basically if you count the edges coming into a node
+   and the edges exiting a node the number has to be greater than one.
+
+   * tab              - edge table name (TEXT)
+   * col              - oneway column name (TEXT)
+   * s_in_rules       - source node in rules
+   * s_out_rules      - source node out rules
+   * t_in_tules       - target node in rules
+   * t_out_rules      - target node out rules
+   * two_way_if_null  - flag to treat oneway nNULL values as by directional
+
+   After running this on a graph you can identify nodes with potential
+   problems with the following query.
+
+.. code-block:: sql
+
+       select * from vertices_tmp where in=0 or out=0;
+
+   The rules are defined as an array of text strings that if match the "col"
+   value would be counted as true for the source or target in or out condition.
+
+   Example
+   =======
+
+   Lets assume we have a table "st" of edges and a column "one_way" that
+   might have values like:
+
+   * 'FT'    - oneway from the source to the target node.
+   * 'TF'    - oneway from the target to the source node.
+   * 'B'     - two way street.
+   * ''      - empty field, assume teoway.
+   * <NULL>  - NULL field, use two_way_if_null flag.
+
+   Then we could form the following query to analyze the oneway streets for
+   errors.
+
+.. code-block:: sql
+
+   select _pgr_analyzeOneway('st', 'one_way',
+        ARRAY['', 'B', 'TF'],
+        ARRAY['', 'B', 'FT'],
+        ARRAY['', 'B', 'FT'],
+        ARRAY['', 'B', 'TF'],
+        true);
+
+   -- now we can see the problem nodes
+   select * from vertices_tmp where ein=0 or eout=0;
+
+   -- and the problem edges connected to those nodes
+   select gid
+
+     from st a, vertices_tmp b
+    where a.source=b.id and ein=0 or eout=0
+   union
+   select gid
+     from st a, vertices_tmp b
+    where a.target=b.id and ein=0 or eout=0;
+
+Typically these problems are generated by a break in the network, the
+oneway direction set wrong, maybe an error releted to zlevels or
+a network that is not properly noded.
+
+*/
+
+CREATE OR REPLACE FUNCTION pgr_analyzeOneway(
+   edge_table text,
+   s_in_rules TEXT[],
+   s_out_rules TEXT[],
+   t_in_rules TEXT[],
+   t_out_rules TEXT[],
+   two_way_if_null boolean default true,
+   oneway text default 'oneway',
+   source text default 'source',
+   target text default 'target')
+  RETURNS text AS
+$BODY$
+
+
+DECLARE
+    rule text;
+    ecnt integer;
+    instr text;
+    naming record;
+    sname text;
+    tname text;
+    tabname text;
+    vname text;
+    owname text;
+    sourcename text;
+    targetname text;
+    sourcetype text;
+    targettype text;
+    vertname text;
+    debuglevel text;
+
+
+BEGIN
+  raise notice 'PROCESSING:';
+  raise notice 'pgr_analyzeOneway(''%'',''%'',''%'',''%'',''%'',''%'',''%'',''%'',%)',
+		edge_table, s_in_rules , s_out_rules, t_in_rules, t_out_rules, oneway, source ,target,two_way_if_null ;
+  execute 'show client_min_messages' into debuglevel;
+
+  BEGIN
+    RAISE DEBUG 'Checking % exists',edge_table;
+    execute 'select * from _pgr_getTableName('||quote_literal(edge_table)||',2)' into naming;
+    sname=naming.sname;
+    tname=naming.tname;
+    tabname=sname||'.'||tname;
+    vname=tname||'_vertices_pgr';
+    vertname= sname||'.'||vname;
+    raise DEBUG '     --> OK';
+    EXCEPTION WHEN raise_exception THEN
+      RAISE NOTICE 'ERROR: something went wrong checking the table name';
+      RETURN 'FAIL';
+  END;
+
+  BEGIN
+       raise debug 'Checking Vertices table';
+       execute 'select * from  _pgr_checkVertTab('||quote_literal(vertname) ||', ''{"id","ein","eout"}''::text[])' into naming;
+       execute 'UPDATE '||_pgr_quote_ident(vertname)||' SET eout=0 ,ein=0';
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking the vertices table';
+          RETURN 'FAIL';
+  END;
+
+
+  BEGIN
+       raise debug 'Checking column names in edge table';
+       select * into sourcename from _pgr_getColumnName(sname, tname,source,2);
+       select * into targetname from _pgr_getColumnName(sname, tname,target,2);
+       select * into owname from _pgr_getColumnName(sname, tname,oneway,2);
+
+
+       perform _pgr_onError( sourcename in (targetname,owname) or  targetname=owname, 2,
+                       '_pgr_createToplogy',  'Two columns share the same name', 'Parameter names for oneway,source and target  must be different',
+                       'Column names are OK');
+
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking the column names';
+          RETURN 'FAIL';
+  END;
+
+  BEGIN
+       raise debug 'Checking column types in edge table';
+       select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1);
+       select * into targettype from _pgr_getColumnType(sname,tname,targetname,1);
+
+
+       perform _pgr_onError(sourcetype not in('integer','smallint','bigint') , 2,
+                       '_pgr_createTopology',  'Wrong type of Column '|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found',
+                       'Type of Column '|| sourcename || ' is ' || sourcetype);
+
+       perform _pgr_onError(targettype not in('integer','smallint','bigint') , 2,
+                       '_pgr_createTopology',  'Wrong type of Column '|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or biginti but '||targettype||' was found',
+                       'Type of Column '|| targetname || ' is ' || targettype);
+
+       raise DEBUG '     --> OK';
+       EXCEPTION WHEN raise_exception THEN
+          RAISE NOTICE 'ERROR: something went wrong checking the column types';
+          RETURN 'FAIL';
+   END;
+
+
+
+    RAISE NOTICE 'Analyzing graph for one way street errors.';
+
+    rule := CASE WHEN two_way_if_null
+            THEN owname || ' IS NULL OR '
+            ELSE '' END;
+
+    instr := '''' || array_to_string(s_in_rules, ''',''') || '''';
+       EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set ein=coalesce(ein,0)+b.cnt
+      from (
+         select '|| sourcename ||', count(*) as cnt
+           from '|| tabname ||'
+          where '|| rule || owname ||' in ('|| instr ||')
+          group by '|| sourcename ||' ) b
+     where a.id=b.'|| sourcename;
+
+    RAISE NOTICE 'Analysis 25%% complete ...';
+
+    instr := '''' || array_to_string(t_in_rules, ''',''') || '''';
+    EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set ein=coalesce(ein,0)+b.cnt
+        from (
+         select '|| targetname ||', count(*) as cnt
+           from '|| tabname ||'
+          where '|| rule || owname ||' in ('|| instr ||')
+          group by '|| targetname ||' ) b
+        where a.id=b.'|| targetname;
+
+    RAISE NOTICE 'Analysis 50%% complete ...';
+
+    instr := '''' || array_to_string(s_out_rules, ''',''') || '''';
+    EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set eout=coalesce(eout,0)+b.cnt
+        from (
+         select '|| sourcename ||', count(*) as cnt
+           from '|| tabname ||'
+          where '|| rule || owname ||' in ('|| instr ||')
+          group by '|| sourcename ||' ) b
+        where a.id=b.'|| sourcename;
+    RAISE NOTICE 'Analysis 75%% complete ...';
+
+    instr := '''' || array_to_string(t_out_rules, ''',''') || '''';
+    EXECUTE 'update '||_pgr_quote_ident(vertname)||' a set eout=coalesce(eout,0)+b.cnt
+        from (
+         select '|| targetname ||', count(*) as cnt
+           from '|| tabname ||'
+          where '|| rule || owname ||' in ('|| instr ||')
+          group by '|| targetname ||' ) b
+        where a.id=b.'|| targetname;
+
+    RAISE NOTICE 'Analysis 100%% complete ...';
+
+    EXECUTE 'SELECT count(*)  FROM '||_pgr_quote_ident(vertname)||' WHERE ein=0 or eout=0' INTO ecnt;
+
+    RAISE NOTICE 'Found % potential problems in directionality' ,ecnt;
+
+    RETURN 'OK';
+
+END;
+$BODY$
+  LANGUAGE plpgsql VOLATILE STRICT;
+
+COMMENT ON FUNCTION pgr_analyzeOneway(text,TEXT[],TEXT[], TEXT[],TEXT[],boolean,text,text,text)
+IS 'args:edge_table , s_in_rules , s_out_rules, t_in_rules , t_out_rules, two_way_if_null:= true, oneway:=''oneway'',source:= ''source'',target:=''target'' - Analizes the directionality of the edges based on the rules';
+
diff --git a/src/topology/sql/pgrouting_topology.sql b/src/topology/sql/pgrouting_topology.sql
new file mode 100644
index 0000000..e241b1b
--- /dev/null
+++ b/src/topology/sql/pgrouting_topology.sql
@@ -0,0 +1,289 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Author: Christian Gonzalez
+Author: Stephen Woodbridge <woodbri at imaptools.com>
+Author: Vicky Vergara <vicky_vergara at hotmail,com>
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+/*
+.. function:: _pgr_createtopology(edge_table, tolerance,the_geom,id,source,target,rows_where)
+
+Based on the geometry:
+Fill the source and target column for all lines.
+All line end points within a distance less than tolerance, are assigned the same id
+
+Author: Christian Gonzalez <christian.gonzalez at sigis.com.ve>
+Author: Stephen Woodbridge <woodbri at imaptools.com>
+Modified by: Vicky Vergara <vicky_vergara at hotmail,com>
+
+HISTORY
+Last changes: 2013-03-22
+2013-08-19:  handling schemas
+2014-july: fixes issue 211
+*/
+
+CREATE OR REPLACE FUNCTION pgr_createtopology(edge_table text, tolerance double precision, 
+		   the_geom text default 'the_geom', id text default 'id',
+		   source text default 'source', target text default 'target',rows_where text default 'true',
+		   clean boolean default FALSE)
+RETURNS VARCHAR AS
+$BODY$
+
+DECLARE
+    points record;
+    sridinfo record;
+    source_id bigint;
+    target_id bigint;
+    totcount bigint;
+    rowcount bigint;
+    srid integer;
+    sql text;
+    sname text;
+    tname text;
+    tabname text;
+    vname text;
+    vertname text;
+    gname text;
+    idname text;
+    sourcename text;
+    targetname text;
+    notincluded integer;
+    i integer;
+    naming record;
+    info record;
+    flag boolean;
+    query text;
+    idtype text;
+    gtype text;
+    sourcetype text;
+    targettype text;
+    debuglevel text;
+    dummyRec text;
+    fnName text;
+    err bool;
+    msgKind int;
+    emptied BOOLEAN;
+
+BEGIN
+    msgKind = 1; -- notice
+    fnName = 'pgr_createTopology';
+    raise notice 'PROCESSING:'; 
+    raise notice 'pgr_createTopology(''%'', %, ''%'', ''%'', ''%'', ''%'', rows_where := ''%'', clean := %)',edge_table,tolerance,the_geom,id,source,target,rows_where, clean;
+    execute 'show client_min_messages' into debuglevel;
+
+
+    raise notice 'Performing checks, please wait .....';
+
+        execute 'select * from _pgr_getTableName('|| quote_literal(edge_table)
+                                                  || ',2,' || quote_literal(fnName) ||' )' into naming;
+        sname=naming.sname;
+        tname=naming.tname;
+        tabname=sname||'.'||tname;
+        vname=tname||'_vertices_pgr';
+        vertname= sname||'.'||vname;
+        rows_where = ' AND ('||rows_where||')'; 
+      raise DEBUG '     --> OK';
+
+
+      raise debug 'Checking column names in edge table';
+        select * into idname     from _pgr_getColumnName(sname, tname,id,2,fnName);
+        select * into sourcename from _pgr_getColumnName(sname, tname,source,2,fnName);
+        select * into targetname from _pgr_getColumnName(sname, tname,target,2,fnName);
+        select * into gname      from _pgr_getColumnName(sname, tname,the_geom,2,fnName);
+
+
+        err = sourcename in (targetname,idname,gname) or  targetname in (idname,gname) or idname=gname;
+        perform _pgr_onError( err, 2, fnName,
+               'Two columns share the same name', 'Parameter names for id,the_geom,source and target  must be different',
+	       'Column names are OK');
+
+      raise DEBUG '     --> OK';
+
+      raise debug 'Checking column types in edge table';
+        select * into sourcetype from _pgr_getColumnType(sname,tname,sourcename,1, fnName);
+        select * into targettype from _pgr_getColumnType(sname,tname,targetname,1, fnName);
+        select * into idtype from _pgr_getColumnType(sname,tname,idname,1, fnName);
+
+        err = idtype not in('integer','smallint','bigint');
+        perform _pgr_onError(err, 2, fnName,
+	       'Wrong type of Column id:'|| idname, ' Expected type of '|| idname || ' is integer,smallint or bigint but '||idtype||' was found');
+
+        err = sourcetype not in('integer','smallint','bigint');
+        perform _pgr_onError(err, 2, fnName,
+	       'Wrong type of Column source:'|| sourcename, ' Expected type of '|| sourcename || ' is integer,smallint or bigint but '||sourcetype||' was found');
+
+        err = targettype not in('integer','smallint','bigint');
+        perform _pgr_onError(err, 2, fnName,
+	       'Wrong type of Column target:'|| targetname, ' Expected type of '|| targetname || ' is integer,smallint or bigint but '||targettype||' was found');
+
+      raise DEBUG '     --> OK';
+
+      raise debug 'Checking SRID of geometry column';
+         query= 'SELECT ST_SRID(' || quote_ident(gname) || ') as srid '
+            || ' FROM ' || _pgr_quote_ident(tabname)
+            || ' WHERE ' || quote_ident(gname)
+            || ' IS NOT NULL LIMIT 1';
+         raise debug '%',query;
+         EXECUTE query INTO sridinfo;
+
+         err =  sridinfo IS NULL OR sridinfo.srid IS NULL;
+         perform _pgr_onError(err, 2, fnName,
+	     'Can not determine the srid of the geometry '|| gname ||' in table '||tabname, 'Check the geometry of column '||gname);
+
+         srid := sridinfo.srid;
+      raise DEBUG '     --> OK';
+
+      raise debug 'Checking and creating indices in edge table';
+        perform _pgr_createIndex(sname, tname , idname , 'btree'::text);
+        perform _pgr_createIndex(sname, tname , sourcename , 'btree'::text);
+        perform _pgr_createIndex(sname, tname , targetname , 'btree'::text);
+        perform _pgr_createIndex(sname, tname , gname , 'gist'::text);
+
+        gname=quote_ident(gname);
+        idname=quote_ident(idname);
+        sourcename=quote_ident(sourcename);
+        targetname=quote_ident(targetname);
+      raise DEBUG '     --> OK';
+
+
+
+
+
+    BEGIN 
+        -- issue #193 & issue #210 & #213
+        -- this sql is for trying out the where clause
+        -- the select * is to avoid any colum name conflicts
+        -- limit 1, just try on first record
+        -- if the where clasuse is ill formed it will be catched in the exception
+        sql = 'select * from '||_pgr_quote_ident(tabname)||' WHERE true'||rows_where ||' limit 1';
+        EXECUTE sql into dummyRec;
+        -- end 
+
+        -- if above where clasue works this one should work
+        -- any error will be catched by the exception also
+        sql = 'select count(*) from '||_pgr_quote_ident(tabname)||' WHERE (' || gname || ' IS NOT NULL AND '||
+	    idname||' IS NOT NULL)=false '||rows_where;
+        EXECUTE SQL  into notincluded;
+
+        if clean then 
+            raise debug 'Cleaning previous Topology ';
+               execute 'UPDATE ' || _pgr_quote_ident(tabname) ||
+               ' SET '||sourcename||' = NULL,'||targetname||' = NULL'; 
+        else 
+            raise debug 'Creating topology for edges with non assigned topology';
+            if rows_where=' AND (true)' then
+                rows_where=  ' and ('||quote_ident(sourcename)||' is null or '||quote_ident(targetname)||' is  null)'; 
+            end if;
+        end if;
+        -- my thoery is that the select Count(*) will never go thru here
+        EXCEPTION WHEN OTHERS THEN  
+             RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
+             RAISE NOTICE 'ERROR: Condition is not correct, please execute the following query to test your condition'; 
+             RAISE NOTICE '%',sql;
+             RETURN 'FAIL'; 
+    END;    
+
+    BEGIN
+         raise DEBUG 'initializing %',vertname;
+         execute 'select * from _pgr_getTableName('||quote_literal(vertname)
+                                                  || ',0,' || quote_literal(fnName) ||' )' into naming;
+         emptied = false;
+         set client_min_messages  to warning;
+         IF sname=naming.sname AND vname=naming.tname  THEN
+            if clean then 
+                execute 'TRUNCATE TABLE '||_pgr_quote_ident(vertname)||' RESTART IDENTITY';
+                execute 'SELECT DROPGEOMETRYCOLUMN('||quote_literal(sname)||','||quote_literal(vname)||','||quote_literal('the_geom')||')';
+                emptied = true;
+            end if;
+         ELSE -- table doesnt exist
+            execute 'CREATE TABLE '||_pgr_quote_ident(vertname)||' (id bigserial PRIMARY KEY,cnt integer,chk integer,ein integer,eout integer)';
+            emptied = true;
+         END IF;
+         IF (emptied) THEN
+             execute 'select addGeometryColumn('||quote_literal(sname)||','||quote_literal(vname)||','||
+	         quote_literal('the_geom')||','|| srid||', '||quote_literal('POINT')||', 2)';
+             perform _pgr_createIndex(vertname , 'the_geom'::text , 'gist'::text);
+         END IF;
+         execute 'select * from  _pgr_checkVertTab('||quote_literal(vertname) ||', ''{"id"}''::text[])' into naming;
+         execute 'set client_min_messages  to '|| debuglevel;
+         raise DEBUG  '  ------>OK'; 
+         EXCEPTION WHEN OTHERS THEN  
+             RAISE NOTICE 'Got %', SQLERRM; -- issue 210,211
+             RAISE NOTICE 'ERROR: something went wrong when initializing the verties table';
+             RETURN 'FAIL'; 
+    END;       
+
+
+
+    raise notice 'Creating Topology, Please wait...';
+        rowcount := 0;
+        FOR points IN EXECUTE 'SELECT ' || idname || '::bigint AS id,'
+            || ' _pgr_StartPoint(' || gname || ') AS source,'
+            || ' _pgr_EndPoint('   || gname || ') AS target'
+            || ' FROM '  || _pgr_quote_ident(tabname)
+            || ' WHERE ' || gname || ' IS NOT NULL AND ' || idname||' IS NOT NULL '||rows_where
+        LOOP
+
+            rowcount := rowcount + 1;
+            IF rowcount % 1000 = 0 THEN
+                RAISE NOTICE '% edges processed', rowcount;
+            END IF;
+
+
+            source_id := _pgr_pointToId(points.source, tolerance,vertname,srid);
+            target_id := _pgr_pointToId(points.target, tolerance,vertname,srid);
+            BEGIN                         
+                sql := 'UPDATE ' || _pgr_quote_ident(tabname) || 
+                    ' SET '||sourcename||' = '|| source_id::text || ','||targetname||' = ' || target_id::text || 
+                    ' WHERE ' || idname || ' =  ' || points.id::text;
+
+                IF sql IS NULL THEN
+                    RAISE NOTICE 'WARNING: UPDATE % SET source = %, target = % WHERE % = % ', tabname, source_id::text, target_id::text, idname,  points.id::text;
+                ELSE
+                    EXECUTE sql;
+                END IF;
+                EXCEPTION WHEN OTHERS THEN 
+                    RAISE NOTICE '%', SQLERRM;
+                    RAISE NOTICE '%',sql;
+                    RETURN 'FAIL'; 
+            end;
+        END LOOP;
+        raise notice '-------------> TOPOLOGY CREATED FOR  % edges', rowcount;
+        RAISE NOTICE 'Rows with NULL geometry or NULL id: %',notincluded;
+        Raise notice 'Vertices table for table % is: %',_pgr_quote_ident(tabname), _pgr_quote_ident(vertname);
+        raise notice '----------------------------------------------';
+
+    RETURN 'OK';
+ EXCEPTION WHEN OTHERS THEN
+   RAISE NOTICE 'Unexpected error %', SQLERRM; -- issue 210,211
+   RETURN 'FAIL';
+END;
+
+
+$BODY$
+LANGUAGE plpgsql VOLATILE STRICT;
+COMMENT ON FUNCTION pgr_createTopology(text, double precision,text,text,text,text,text,boolean) 
+IS 'args: edge_table,tolerance, the_geom:=''the_geom'',source:=''source'', target:=''target'',rows_where:=''true'' - fills columns source and target in the geometry table and creates a vertices table for selected rows';
+
+
+
+
diff --git a/doc/test/analyzeOneway-any.result b/src/topology/test/analyzeOneway-any.result
similarity index 100%
rename from doc/test/analyzeOneway-any.result
rename to src/topology/test/analyzeOneway-any.result
diff --git a/src/topology/test/analyzeOneway-any.test.sql b/src/topology/test/analyzeOneway-any.test.sql
new file mode 100644
index 0000000..75f67ae
--- /dev/null
+++ b/src/topology/test/analyzeOneway-any.test.sql
@@ -0,0 +1,11 @@
+BEGIN;
+---------------------------------------------------------------------------------------
+--            pgr_analyzeOneway
+---------------------------------------------------------------------------------------
+SELECT pgr_analyzeOneway('edge_table',
+ARRAY['', 'B', 'TF'],
+ARRAY['', 'B', 'FT'],
+ARRAY['', 'B', 'FT'],
+ARRAY['', 'B', 'TF'],
+oneway:='dir');
+ROLLBACK;
diff --git a/doc/test/createVertTab-any.result b/src/topology/test/createVertTab-any.result
similarity index 100%
rename from doc/test/createVertTab-any.result
rename to src/topology/test/createVertTab-any.result
diff --git a/src/topology/test/createVertTab-any.test.sql b/src/topology/test/createVertTab-any.test.sql
new file mode 100644
index 0000000..7a14412
--- /dev/null
+++ b/src/topology/test/createVertTab-any.test.sql
@@ -0,0 +1,40 @@
+BEGIN;
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--                  PGR_createVerticesTable
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+
+--    SELECT pgr_createTopology('edge_table',0.001);
+	 SELECT  pgr_createVerticesTable('edge_table');
+	 SELECT  pgr_createVerticesTable('edge_table','the_geom','source','target');
+	-- SELECT  pgr_createVerticesTable('edge_table','source','the_geom','target');
+	 SELECT  pgr_createVerticesTable('edge_table',the_geom:='the_geom',source:='source',target:='target');
+	 SELECT  pgr_createVerticesTable('edge_table',source:='source',target:='target',the_geom:='the_geom');
+	 SELECT  pgr_createVerticesTable('edge_table',source:='source');
+	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='id < 10');
+	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(the_geom,0.5) FROM edge_table WHERE id=5)');
+	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
+	 SELECT  pgr_createVerticesTable('edge_table',rows_where:='the_geom && (select st_buffer(other_geom,0.5) FROM otherTable WHERE gid=100)');
+	CREATE TABLE mytable AS (SELECT id AS gid, the_geom AS mygeom,source AS src ,target AS tgt FROM edge_table) ;
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt');
+	-- SELECT  pgr_createVerticesTable('mytable','src','mygeom','tgt');
+	 SELECT  pgr_createVerticesTable('mytable',the_geom:='mygeom',source:='src',target:='tgt');
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom');
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',rows_where:='gid < 10');
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
+	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)');
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
+	                            rows_where:='mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)');
+	DROP TABLE IF EXISTS otherTable;
+	CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ; 
+	 SELECT  pgr_createVerticesTable('mytable','mygeom','src','tgt',
+	                            rows_where:='mygeom && (SELECT st_buffer(other_geom,0.5) FROM otherTable WHERE gid=100)');
+	 SELECT  pgr_createVerticesTable('mytable',source:='src',target:='tgt',the_geom:='mygeom',
+	                            rows_where:='mygeom && (SELECT st_buffer(other_geom,0.5) FROM otherTable WHERE gid=100)');
+
+-------------------------------------
+	SELECT pgr_createVerticesTable('edge_table');
+
+ROLLBACK;
diff --git a/src/topology/test/doc-pgr_analyzeGraph.result b/src/topology/test/doc-pgr_analyzeGraph.result
new file mode 100644
index 0000000..5e7f4d2
--- /dev/null
+++ b/src/topology/test/doc-pgr_analyzeGraph.result
@@ -0,0 +1,378 @@
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := t)
+ NOTICE:  Performing checks, please wait.....
+ NOTICE:  Creating Topology, Please wait...
+ NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+ NOTICE:  Rows with NULL geometry or NULL id: 0
+ NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+ NOTICE:  ----------------------------------------------
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Got function st_srid(bigint) does not exist
+ NOTICE:  ERROR: something went wrong when checking for SRID of id in table public.edge_table
+FAIL
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 4
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 5
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 10
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where := 'true', clean := t)
+ NOTICE:  Performing checks, please wait .....
+ NOTICE:  Creating Topology, Please wait...
+ NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+ NOTICE:  Rows with NULL geometry or NULL id: 0
+ NOTICE:  Vertices table for table public.mytable is: public.mytable_vertices_pgr
+ NOTICE:  ----------------------------------------------
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.0001,'gid','mygeom','src','tgt','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Got function st_srid(bigint) does not exist
+ NOTICE:  ERROR: something went wrong when checking for SRID of gid in table public.mytable
+FAIL
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 4
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','gid < 10')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 4
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 1
+ NOTICE:                            Dead ends: 5
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 1
+ NOTICE:                            Dead ends: 5
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='myhouse')')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 10
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt','mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='myhouse')')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 10
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := t)
+ NOTICE:  Performing checks, please wait .....
+ NOTICE:  Creating Topology, Please wait...
+ NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+ NOTICE:  Rows with NULL geometry or NULL id: 0
+ NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+ NOTICE:  ----------------------------------------------
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 7
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 10')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 4
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id >= 10')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 2
+ NOTICE:                            Dead ends: 8
+ NOTICE:  Potential gaps found near dead ends: 1
+ NOTICE:               Intersections detected: 1
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id < 17')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 3
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'id <17', clean := t)
+ NOTICE:  Performing checks, please wait .....
+ NOTICE:  Creating Topology, Please wait...
+ NOTICE:  -------------> TOPOLOGY CREATED FOR  16 edges
+ NOTICE:  Rows with NULL geometry or NULL id: 0
+ NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+ NOTICE:  ----------------------------------------------
+OK
+ NOTICE:  PROCESSING:
+ NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+ NOTICE:  Performing checks, please wait...
+ NOTICE:  Analyzing for dead ends. Please wait...
+ NOTICE:  Analyzing for gaps. Please wait...
+ NOTICE:  Analyzing for isolated edges. Please wait...
+ NOTICE:  Analyzing for ring geometries. Please wait...
+ NOTICE:  Analyzing for intersections. Please wait...
+ NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+ NOTICE:                    Isolated segments: 0
+ NOTICE:                            Dead ends: 3
+ NOTICE:  Potential gaps found near dead ends: 0
+ NOTICE:               Intersections detected: 0
+ NOTICE:                      Ring geometries: 0
+OK
diff --git a/src/topology/test/doc-pgr_analyzeGraph.test.sql b/src/topology/test/doc-pgr_analyzeGraph.test.sql
new file mode 100644
index 0000000..92f54dd
--- /dev/null
+++ b/src/topology/test/doc-pgr_analyzeGraph.test.sql
@@ -0,0 +1,51 @@
+
+BEGIN;
+
+
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+    --              PGR_analyzegraph
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+
+    SELECT  pgr_createTopology('edge_table',0.001, clean := true);
+    SELECT  pgr_analyzeGraph('edge_table',0.001);
+    SELECT  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,'id','the_geom','source','target');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,the_geom:='the_geom',id:='id',source:='source',target:='target');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source',id:='id',target:='target',the_geom:='the_geom');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,source:='source');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(the_geom,0.05) FROM edge_table WHERE id=5)');
+    CREATE TABLE otherTable AS  (SELECT 100 AS gid, st_point(2.5,2.5) AS other_geom) ;
+    SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='the_geom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE gid=100)');
+    CREATE TABLE mytable AS (SELECT id AS gid, source AS src ,target AS tgt , the_geom AS mygeom FROM edge_table);
+    SELECT pgr_createTopology('mytable',0.001,'mygeom','gid','src','tgt', clean := true);
+    SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt');
+    SELECT  pgr_analyzeGraph('mytable',0.0001,'gid','mygeom','src','tgt');
+    SELECT  pgr_analyzeGraph('mytable',0.001,the_geom:='mygeom',id:='gid',source:='src',target:='tgt');
+    SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom');
+    SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',rows_where:='gid < 10');
+    SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',rows_where:='gid < 10');
+    SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
+        rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
+    SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
+        rows_where:='mygeom && (SELECT st_buffer(mygeom,1) FROM mytable WHERE gid=5)');
+    DROP TABLE IF EXISTS otherTable;
+    CREATE TABLE otherTable AS  (SELECT 'myhouse'::text AS place, st_point(2.5,2.5) AS other_geom) ;
+    SELECT  pgr_analyzeGraph('mytable',0.001,'mygeom','gid','src','tgt',
+        rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
+    SELECT  pgr_analyzeGraph('mytable',0.001,source:='src',id:='gid',target:='tgt',the_geom:='mygeom',
+        rows_where:='mygeom && (SELECT st_buffer(other_geom,1) FROM otherTable WHERE place='||quote_literal('myhouse')||')');
+    --------------------
+    SELECT  pgr_createTopology('edge_table',0.001, clean := true);
+    SELECT pgr_analyzeGraph('edge_table', 0.001);
+    SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 10');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id >= 10');
+    SELECT  pgr_analyzeGraph('edge_table',0.001,rows_where:='id < 17');
+
+    -- Simulate removal of edges
+    SELECT pgr_createTopology('edge_table', 0.001,rows_where:='id <17', clean := true);
+    SELECT pgr_analyzeGraph('edge_table', 0.001);
+
+    ROLLBACK;
diff --git a/src/topology/test/doc-pgr_createTopology.result b/src/topology/test/doc-pgr_createTopology.result
new file mode 100644
index 0000000..f2fd0e4
--- /dev/null
+++ b/src/topology/test/doc-pgr_createTopology.result
@@ -0,0 +1,97 @@
+--q1
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+--q1.1
+--q2
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+--q2.1
+--q3
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'id', 'the_geom', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  ----> PGR ERROR in pgr_createTopology: Wrong type of Column id:the_geom
+NOTICE:  Unexpected error raise_exception
+FAIL
+--q3.1
+--q4
+OK
+--q4.1
+--q5
+OK
+--q5.1
+--q6
+OK
+--q6.1
+--q7
+OK
+--q7.1
+--q8
+OK
+--q8.1
+--q9
+OK
+--q9.1
+--q10
+--q10.1
+--q11
+OK
+--q11.1
+--q12
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('mytable', 0.001, 'gid', 'mygeom', 'src', 'tgt', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  ----> PGR ERROR in pgr_createTopology: Wrong type of Column id:mygeom
+NOTICE:  Unexpected error raise_exception
+FAIL
+--q12.1
+--q13
+OK
+--q13.1
+--q14
+OK
+--q14.1
+--q15
+OK
+OK
+OK
+OK
+--q15.1
+--q16
+OK
+OK
+--q16.1
+--q17
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'id < 6', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  5 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  13 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+--q17.1
diff --git a/src/topology/test/doc-pgr_createTopology.test.sql b/src/topology/test/doc-pgr_createTopology.test.sql
new file mode 100644
index 0000000..4f3660c
--- /dev/null
+++ b/src/topology/test/doc-pgr_createTopology.test.sql
@@ -0,0 +1,117 @@
+BEGIN;
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+    --                pgr_createTopology
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+\set VERBOSITY terse
+
+    SET client_min_messages TO NOTICE;
+    DROP TABLE edge_table_vertices_pgr;
+    UPDATE edge_table SET source = NULL,  target = NULL;
+    \echo --q1
+    SELECT  pgr_createTopology('edge_table', 0.001);
+    \echo --q1.1
+
+    DROP TABLE edge_table_vertices_pgr;
+    UPDATE edge_table SET source = NULL,  target = NULL;
+    \echo --q2
+    SELECT  pgr_createTopology('edge_table', 0.001,
+        'the_geom', 'id', 'source', 'target');
+    \echo --q2.1
+
+    SET client_min_messages TO NOTICE;
+    \echo --q3
+    SELECT  pgr_createTopology('edge_table', 0.001,
+        'id', 'the_geom');
+    \echo --q3.1
+
+    SET client_min_messages TO WARNING;
+    DROP TABLE edge_table_vertices_pgr;
+    UPDATE edge_table SET source = NULL,  target = NULL;
+    \echo --q4
+    SELECT  pgr_createTopology('edge_table', 0.001,
+        the_geom:='the_geom', id:='id', source:='source', target:='target');
+    \echo --q4.1
+
+    DROP TABLE edge_table_vertices_pgr;
+    UPDATE edge_table SET source = NULL,  target = NULL;
+    \echo --q5
+    SELECT  pgr_createTopology('edge_table', 0.001,
+        source:='source', id:='id', target:='target', the_geom:='the_geom');
+    \echo --q5.1
+
+    DROP TABLE edge_table_vertices_pgr;
+    UPDATE edge_table SET source = NULL,  target = NULL;
+    \echo --q6
+    SELECT  pgr_createTopology('edge_table', 0.001, source:='source');
+    \echo --q6.1
+
+    \echo --q7
+    SELECT  pgr_createTopology('edge_table', 0.001, rows_where:='id < 10');
+    \echo --q7.1
+
+    \echo --q8
+    SELECT  pgr_createTopology('edge_table', 0.001,
+        rows_where:='the_geom && (SELECT st_buffer(the_geom, 0.05) FROM edge_table WHERE id=5)');
+    \echo --q8.1
+
+    \echo --q9
+    CREATE TABLE otherTable AS  (SELECT 100 AS gid,  st_point(2.5, 2.5) AS other_geom);
+    SELECT  pgr_createTopology('edge_table', 0.001,
+        rows_where:='the_geom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)');
+    \echo --q9.1
+
+    -- THE NEXT SECTION
+
+    \echo --q10
+    CREATE TABLE mytable AS (SELECT id AS gid,  the_geom AS mygeom, source AS src , target AS tgt FROM edge_table) ;
+    \echo --q10.1
+
+    \echo --q11
+    SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', clean := TRUE);
+    \echo --q11.1
+
+    DROP TABLE mytable_vertices_pgr;
+    UPDATE mytable SET src = NULL,  tgt = NULL;
+    SET client_min_messages TO NOTICE;
+    \echo --q12
+    SELECT  pgr_createTopology('mytable', 0.001, 'gid', 'mygeom', 'src', 'tgt');
+    \echo --q12.1
+    SET client_min_messages TO WARNING;
+
+    \echo --q13
+    SELECT  pgr_createTopology('mytable', 0.001, the_geom:='mygeom', id:='gid', source:='src', target:='tgt');
+    \echo --q13.1
+
+    DROP TABLE mytable_vertices_pgr;
+    UPDATE mytable SET src = NULL,  tgt = NULL;
+    \echo --q14
+    SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom');
+    \echo --q14.1
+
+    \echo --q15
+    SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', rows_where:='gid < 10');
+    SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', rows_where:='gid < 10');
+    SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', 
+        rows_where:='mygeom && (SELECT st_buffer(mygeom, 1) FROM mytable WHERE gid=5)');
+    SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', 
+        rows_where:='mygeom && (SELECT st_buffer(mygeom, 1) FROM mytable WHERE gid=5)');
+    \echo --q15.1
+
+    \echo --q16
+    SELECT  pgr_createTopology('mytable', 0.001, 'mygeom', 'gid', 'src', 'tgt', 
+        rows_where:='mygeom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)');
+    SELECT  pgr_createTopology('mytable', 0.001, source:='src', id:='gid', target:='tgt', the_geom:='mygeom', 
+        rows_where:='mygeom && (SELECT st_buffer(other_geom, 1) FROM otherTable WHERE gid=100)');
+    \echo --q16.1
+
+    -------------------------------------------------------------------------------
+    SET client_min_messages TO NOTICE;
+    \echo --q17
+    SELECT pgr_createTopology('edge_table',  0.001, rows_where:='id < 6', clean := true);
+    SELECT pgr_createTopology('edge_table',  0.001);
+    \echo --q17.1
+    ROLLBACK;	
diff --git a/src/topology/test/nodeNetwork-any.result b/src/topology/test/nodeNetwork-any.result
new file mode 100644
index 0000000..8558bed
--- /dev/null
+++ b/src/topology/test/nodeNetwork-any.result
@@ -0,0 +1,136 @@
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := t)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  18 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_nodeNetwork('edge_table', 0.001, 'id', 'the_geom', 'noded', '<NULL>',  f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Processing, please wait .....
+NOTICE:    Splitted Edges: 2
+NOTICE:   Untouched Edges: 16
+NOTICE:       Total original Edges: 18
+NOTICE:   Edges generated: 4
+NOTICE:   Untouched Edges: 16
+NOTICE:         Total New segments: 20
+NOTICE:   New Table: public.edge_table_noded
+NOTICE:  ----------------------------------
+OK
+1|1
+2|1
+3|1
+4|1
+5|1
+6|1
+7|1
+8|1
+9|1
+10|1
+11|1
+12|1
+13|1
+13|2
+14|1
+15|1
+16|1
+17|1
+18|1
+18|2
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table_noded', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  20 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table_noded is: public.edge_table_noded_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table_noded',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 1
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+OK
+NOTICE:  column "old_id" of relation "edge_table" does not exist, skipping
+NOTICE:  PROCESSING:
+NOTICE:  pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
+NOTICE:  Performing checks, please wait .....
+NOTICE:  Creating Topology, Please wait...
+NOTICE:  -------------> TOPOLOGY CREATED FOR  4 edges
+NOTICE:  Rows with NULL geometry or NULL id: 0
+NOTICE:  Vertices table for table public.edge_table is: public.edge_table_vertices_pgr
+NOTICE:  ----------------------------------------------
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','id not in (select old_id from edge_table where old_id is not null)')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 1
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 0
+NOTICE:                      Ring geometries: 0
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','old_id is null')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 2
+NOTICE:                            Dead ends: 7
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 1
+NOTICE:                      Ring geometries: 0
+OK
+NOTICE:  PROCESSING:
+NOTICE:  pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
+NOTICE:  Performing checks, please wait ...
+NOTICE:  Analyzing for dead ends. Please wait...
+NOTICE:  Analyzing for gaps. Please wait...
+NOTICE:  Analyzing for isolated edges. Please wait...
+NOTICE:  Analyzing for ring geometries. Please wait...
+NOTICE:  Analyzing for intersections. Please wait...
+NOTICE:              ANALYSIS RESULTS FOR SELECTED EDGES:
+NOTICE:                    Isolated segments: 1
+NOTICE:                            Dead ends: 5
+NOTICE:  Potential gaps found near dead ends: 1
+NOTICE:               Intersections detected: 5
+NOTICE:                      Ring geometries: 0
+OK
diff --git a/src/topology/test/nodeNetwork-any.test.sql b/src/topology/test/nodeNetwork-any.test.sql
new file mode 100644
index 0000000..883c960
--- /dev/null
+++ b/src/topology/test/nodeNetwork-any.test.sql
@@ -0,0 +1,25 @@
+BEGIN;
+--                pgr_nodeNetwork
+--------------------------------------------------------------------------------
+
+SELECT pgr_createTopology('edge_table', 0.001, clean := TRUE);
+SELECT pgr_analyzegraph('edge_table', 0.001);
+SELECT pgr_nodeNetwork('edge_table', 0.001);
+SELECT old_id,sub_id FROM edge_table_noded ORDER BY old_id,sub_id;
+SELECT pgr_createTopology('edge_table_noded', 0.001);
+SELECT pgr_analyzegraph('edge_table_noded', 0.001);
+alter table edge_table drop column if exists old_id;
+alter table edge_table add column old_id integer;
+insert into edge_table (old_id,dir,cost,reverse_cost,the_geom)
+   (with
+       segmented as (select old_id,count(*) as i from edge_table_noded group by old_id)
+   select  segments.old_id,dir,cost,reverse_cost,segments.the_geom
+       from edge_table as edges join edge_table_noded as segments on (edges.id = segments.old_id) 
+       where edges.id in (select old_id from segmented where i>1) );
+
+SELECT pgr_createTopology('edge_table', 0.001);
+SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='id not in (select old_id from edge_table where old_id is not null)');
+SELECT pgr_analyzegraph('edge_table', 0.001,rows_where:='old_id is null');
+SELECT pgr_analyzegraph('edge_table', 0.001);
+
+ROLLBACK;
diff --git a/src/topology/test/pgtap/analyzeGraph.test.sql b/src/topology/test/pgtap/analyzeGraph.test.sql
new file mode 100644
index 0000000..b9dcf4e
--- /dev/null
+++ b/src/topology/test/pgtap/analyzeGraph.test.sql
@@ -0,0 +1,38 @@
+
+
+
+\i setup.sql
+SET client_min_messages TO WARNING;
+
+SELECT plan(4);
+
+
+SELECT pgr_analyzegraph('edge_table', 0.000001);
+
+
+SELECT is((SELECT count(*)::INTEGER cnt FROM edge_table_vertices_pgr WHERE chk = 1), 1, '1: One vertex has a problem');
+SELECT is((SELECT id::INTEGER FROM edge_table_vertices_pgr WHERE chk = 1), 15, '2: vertex #15 has the problem');
+
+PREPARE q1 AS
+SELECT cnt, count(*) AS M  FROM edge_table_vertices_pgr GROUP BY cnt ORDER BY cnt;
+
+PREPARE vals AS
+VALUES (1, 7), (2,3), (3,5), (4,2);
+SELECT set_eq('q1', 'vals', '3: (N,M) M vertices referenced by N edges') ;
+
+SELECT * FROM edge_table_vertices_pgr order by id;
+
+SELECT * FROM TODO_START();
+
+PREPARE q3 AS
+SELECT pgr_analyzegraph('edge_table', 0.000001);
+
+PREPARE stats AS
+VALUES (2,7,1,1,0);
+
+SELECT set_eq('q3','stats', '4: pgr_createVerticesTable: Instead of returning OK, return the expected statistics');
+
+SELECT * FROM TODO_END();
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/topology/test/pgtap/analyzeOneWay.test.sql b/src/topology/test/pgtap/analyzeOneWay.test.sql
new file mode 100644
index 0000000..fdc5176
--- /dev/null
+++ b/src/topology/test/pgtap/analyzeOneWay.test.sql
@@ -0,0 +1,29 @@
+
+
+\i setup.sql
+SET client_min_messages TO WARNING;
+
+SELECT plan(2);
+
+SELECT pgr_analyzeOneway('edge_table', 
+    ARRAY['', 'B', 'TF'],
+    ARRAY['', 'B', 'FT'],
+    ARRAY['', 'B', 'FT'],
+    ARRAY['', 'B', 'TF'],
+    oneway:='dir');
+
+prepare q1 AS
+SELECT ein, count(*) FROM edge_table_vertices_pgr GROUP BY ein ORDER BY ein;
+prepare q2 AS
+SELECT eout, count(*) FROM edge_table_vertices_pgr GROUP BY eout ORDER BY eout;
+
+PREPARE vals1 AS
+VALUES (1,9), (2,4), (3,3), (4,1);
+PREPARE vals2 AS
+VALUES (1,9), (2,4), (3,3), (4,1);
+
+SELECT set_eq('q1', 'vals1', '3: (N,M) M vertices have N incomming edges') ;
+SELECT set_eq('q2', 'vals2', '3: (N,M) M vertices have N outgoing edges') ;
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/topology/test/pgtap/createTopology.test.sql b/src/topology/test/pgtap/createTopology.test.sql
new file mode 100644
index 0000000..81c1fbd
--- /dev/null
+++ b/src/topology/test/pgtap/createTopology.test.sql
@@ -0,0 +1,288 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+\i setup.sql
+\set VERBOSITY 'terse'
+
+SELECT * INTO edges2 FROM edge_table;
+UPDATE edges2 SET source = NULL, target = NULL;
+
+SELECT plan(108);
+
+
+-- The following should be OK
+-- (Just checking variations of the names)
+SET client_min_messages = WARNING;
+
+
+SELECT is(pgr_createTopology('edges2', 0.000001), 'OK', '1');
+PREPARE q1 AS
+SELECT count(*) FROM public.edges2_vertices_pgr;
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, 'the_geom', 'id', clean:=true) , 'OK', '2');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'The_Geom', 'id', clean:=true) , 'OK', '3');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'Id', clean:=true) , 'OK', '4');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'The_geom', 'Id', clean:=true) , 'OK', '5');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, 'The_geom', 'Id', clean:=true) , 'OK', '6');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','source', clean:=true) , 'OK', '7');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','Source', clean:=true) , 'OK', '8');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','source','target', clean:=true) , 'OK', '9');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',rows_where:='id < 15', clean:=true) , 'OK', '10');
+SELECT results_eq('q1', ARRAY[13]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',source:='source', clean:=true) , 'OK', '11');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',target:='target',rows_where:='id < 15 and id > 5', clean:=true) , 'OK', '12');
+SELECT results_eq('q1', ARRAY[9]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+-- the following tests should FAIL
+
+SELECT is(pgr_createTopology('edges22', 0.000001, 'the_geom', 'id', clean:=true) , 'FAIL', '13');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'geom', 'id', clean:=true) , 'FAIL', '13.1');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'gid', clean:=true) , 'FAIL', '13.2');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','sourc', clean:=true) , 'FAIL', '13.3');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',target:='source', clean:=true) , 'FAIL', '13.4');
+SELECT is(pgr_createTopology('edges2', 0.000001, id:='id',source:='the_geom', clean:=true) , 'FAIL', '13.5');
+SELECT is(pgr_createTopology('edges2', 0.000001, id:='id',target:='the_geom', clean:=true) , 'FAIL', '13.6');
+
+-- Testing with table with a similar name
+
+SELECT * INTO "Edges2" FROM edges2;
+
+-- The following should be OK
+
+SELECT is(pgr_createTopology('Edges2', 0.000001,id:='id', clean:=true) , 'OK', '14');
+PREPARE q2 AS
+SELECT count(*) FROM public."Edges2_vertices_pgr";
+SELECT results_eq('q2', ARRAY[17]::BIGINT[]);
+DROP TABLE public."Edges2_vertices_pgr";
+
+UPDATE "Edges2" set the_geom = NULL WHERE id = 5;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, id:= 'id', clean:=true) , 'OK', '15');
+SELECT results_eq('q2', ARRAY[17]::BIGINT[]);
+DROP TABLE public."Edges2_vertices_pgr";
+
+UPDATE "Edges2" set id=NULL WHERE id=7;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, id:= 'id', clean:=true) , 'OK', '16');
+SELECT results_eq('q2', ARRAY[17]::BIGINT[]);
+DROP TABLE public."Edges2_vertices_pgr";
+
+CREATE SCHEMA myschema;
+SET search_path TO myschema, public;
+
+-- reaching tables when located in another schema
+-- the following should be OK
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, id:='id', clean:=true) , 'OK', '17.0');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.Edges2', 0.000001, 'the_geom', 'id', clean:=true) , 'OK', '17.1');
+SELECT results_eq('q2', ARRAY[17]::BIGINT[]);
+DROP TABLE public."Edges2_vertices_pgr";
+
+SELECT is(pgr_createTopology('Public.edges2', 0.000001, 'The_Geom', 'id', clean:=true) , 'OK', '17.2');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'Id', clean:=true) , 'OK', '17.3');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'The_geom', 'Id', clean:=true) , 'OK', '17.4');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('PUBLIC.Edges2', 0.000001, 'The_geom', 'Id', clean:=true) , 'OK', '17.5');
+SELECT results_eq('q2', ARRAY[17]::BIGINT[]);
+DROP TABLE public."Edges2_vertices_pgr";
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id','source', clean:=true) , 'OK', '17.6');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id','Source', clean:=true) , 'OK', '17.7');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id','source','target', clean:=true) , 'OK', '17.8');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id',rows_where:='id<15', clean:=true) , 'OK', '17.9');
+SELECT results_eq('q1', ARRAY[13]::BIGINT[], '17.9');
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id',source:='source', clean:=true) , 'OK', '17.10');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id',target:='target', rows_where:='id<15', clean:=true) , 'OK', '17.11');
+SELECT results_eq('q1', ARRAY[13]::BIGINT[], '17.11');
+DROP TABLE public.edges2_vertices_pgr;
+
+
+-- the following tests should fail
+
+SELECT is(pgr_createTopology('public.edges22', 0.000001, 'the_geom', 'id', clean:=true) , 'FAIL', '18.0');
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'geom', 'id', clean:=true) , 'FAIL', '18.1');
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'gid', clean:=true) , 'FAIL', '18.2');
+SELECT is(pgr_createTopology('public.Edges2', 0.000001, 'the_geom', 'id', 'sourc', clean:=true) , 'FAIL', '18.3');
+SELECT is(pgr_createTopology('public.edges2', 0.000001, 'the_geom', 'id', target:= 'source', clean:=true) , 'FAIL', '18.4');
+SELECT is(pgr_createTopology('public.edges2', 0.000001, id:='id', source:='the_geom', clean:=true) , 'FAIL', '18.5');
+SELECT is(pgr_createTopology('public.edges2', 0.000001, id:='id', target:='the_geom', clean:=true) , 'FAIL', '18.6');
+
+-- creating tables with similar names in myschema
+
+SELECT * into edges2 from public.edges2;
+SELECT * into "Edges2" from public."Edges2";
+
+-- The following should be OK
+
+SELECT is(pgr_createTopology('edges2', 0.000001, id:='id', clean:=true) , 'OK', '19.0');
+PREPARE q3 AS
+SELECT count(*) FROM myschema.edges2_vertices_pgr;
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, 'the_geom', 'id', clean:=true) , 'OK', '19.1');
+PREPARE q4 AS
+SELECT count(*) FROM myschema."Edges2_vertices_pgr";
+SELECT results_eq('q4', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema."Edges2_vertices_pgr";
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'The_Geom', 'id', clean:=true) , 'OK', '19.2');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'Id', clean:=true) , 'OK', '19.3');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'The_geom', 'Id', clean:=true) , 'OK', '19.4');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, 'The_geom', 'Id', clean:=true) , 'OK', '19.5');
+SELECT results_eq('q4', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema."Edges2_vertices_pgr";
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','source', clean:=true) , 'OK', '19.6');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','Source', clean:=true) , 'OK', '19.7');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','source','target', clean:=true) , 'OK', '19.8');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',rows_where:='id<15', clean:=true) , 'OK', '19.9');
+SELECT results_eq('q3', ARRAY[13]::BIGINT[], '19.9');
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',source:='source', clean:=true) , 'OK', '19.10');
+SELECT results_eq('q3', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',target:='target',rows_where:='id<15', clean:=true) , 'OK', '19.11');
+SELECT results_eq('q3', ARRAY[13]::BIGINT[], '19.11');
+DROP TABLE myschema.edges2_vertices_pgr;
+
+
+-- the following tests should FAIL
+
+SELECT is(pgr_createTopology('edges22', 0.000001, 'the_geom', 'id', clean:=true) , 'FAIL', '10.20');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'geom', 'id', clean:=true) , 'FAIL', '20.1');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'gid', clean:=true) , 'FAIL', '20.2');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id','sourc', clean:=true) , 'FAIL', '20.3');
+SELECT is(pgr_createTopology('edges2', 0.000001, 'the_geom', 'id',target:='source', clean:=true) , 'FAIL', '20.4');
+SELECT is(pgr_createTopology('edges2', 0.000001, id:='id',source:='the_geom', clean:=true) , 'FAIL', '20.5');
+SELECT is(pgr_createTopology('edges2', 0.000001, id:='id',target:='the_geom', clean:=true) , 'FAIL', '20.6');
+
+--Test of the rows_where clause
+
+
+-- The following should be OK
+SELECT is(pgr_createTopology('edges2', 0.000001, id:= 'id',rows_where:='id<15', clean:=true) , 'OK', '21.0');
+SELECT results_eq('q3', ARRAY[13]::BIGINT[], '21.0');
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, id:= 'id',rows_where:='id<15 and id>5', clean:=true) , 'OK', '21.1');
+SELECT results_eq('q4', ARRAY[9]::BIGINT[], '21.1');
+DROP TABLE myschema."Edges2_vertices_pgr";
+
+SELECT is(pgr_createTopology('Edges2', 0.000001, id:= 'id',rows_where:=' the_geom && (select st_buffer(the_geom,0.0001) as buffer from "Edges2" WHERE id=6)', clean:=true) , 'OK', '21.2');
+SELECT results_eq('q4', ARRAY[2]::BIGINT[], '21.2');
+DROP TABLE myschema."Edges2_vertices_pgr";
+
+
+-- The following should FAIL (working on myschema)
+
+SELECT is(pgr_createTopology('edges2', 0.000001, id:= 'id',rows_where:='id<', clean:=true) , 'FAIL', '22.0');
+SELECT is(pgr_createTopology('Edges2', 0.000001, id:= 'id',rows_where:='id<15 and ed>5', clean:=true) , 'FAIL', '22.1');
+SELECT is(pgr_createTopology('Edges2', 0.000001, id:= 'id',rows_where:=' the_geom && (select st_buffer(the_geom,0.0001 as buffer from "Edges2" WHERE id=6)', clean:=true) , 'FAIL', '22.2');
+
+-- BIG TABLE TEST TAKES TIME
+--CREATE table bigtable ( id bigserial PRIMARY KEY, source smallint,target smallint);
+--SELECT AddGeometryColumn( 'bigtable', 'the_geom', 0, 'LINESTRING',2);
+--insert into bigtable (the_geom) ( SELECT ST_MakeLine(ST_MakePoint(random()*1000,random()*1000), ST_MakePoint(random()*1000,random()*1000))
+--from (SELECT * FROM generate_series(1,20000) AS id) AS x) ;
+--SELECT 66, pgr_createTopology('bigtable', 0.000001);
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/topology/test/pgtap/createVerticesTable.test.sql b/src/topology/test/pgtap/createVerticesTable.test.sql
new file mode 100644
index 0000000..89a944b
--- /dev/null
+++ b/src/topology/test/pgtap/createVerticesTable.test.sql
@@ -0,0 +1,254 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write TO the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+\i setup.sql
+
+SELECT PLAN(95);
+
+SET client_min_messages = WARNING;
+
+SELECT * INTO edges2 FROM edge_table;
+
+-- The following should be OK
+
+SELECT pgr_createTopology('edges2',0.00001, id:='id', clean := true);
+PREPARE q1 AS
+SELECT count(*) FROM public.edges2_vertices_pgr;
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+
+SELECT is(pgr_createVerticesTable('edges2'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('Edges2', 'the_geom'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'The_Geom'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'The_geom'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('Edges2', 'The_geom'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','source'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','Source'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','source','target'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',rows_where:='id<15'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[13]::BIGINT[], '1.2');
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',source:='source'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',target:='target',rows_where:='id<15 and id>5'), 'OK', '1');
+SELECT results_eq('q1', ARRAY[9]::BIGINT[], '1.3');
+DROP TABLE public.edges2_vertices_pgr;
+
+
+-- the following tests should FAIL
+
+SELECT is(pgr_createVerticesTable('edges22', 'the_geom'), 'FAIL', '2');
+SELECT is(pgr_createVerticesTable('edges2', 'geom'), 'FAIL', '2');
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom', 'gid'), 'FAIL', '2');
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','sourc'), 'FAIL', '2');
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',target:='source'), 'FAIL', '2');
+SELECT is(pgr_createVerticesTable('edges2', source:='the_geom'), 'FAIL', '2');
+SELECT is(pgr_createVerticesTable('edges2', target:='the_geom'), 'FAIL', '2');
+
+-- Testing with table with a similar name
+
+SELECT * INTO "Edges2" from edges2;
+
+-- TODO The following should be OK BUT ARE FAILING
+
+SELECT * FROM TODO_START('For some reson the index name is not set up correctly');
+SELECT is(pgr_createVerticesTable('Edges2'), 'FAIL', '3');
+UPDATE "Edges2" set the_geom = NULL where id=5;
+
+SELECT is(pgr_createVerticesTable('Edges2'), 'FAIL', '3');
+
+UPDATE "Edges2" set source = NULL where id=7;
+SELECT is(pgr_createVerticesTable('Edges2'), 'FAIL', '3');
+SELECT * FROM TODO_END();
+
+create schema myschema;
+SET search_path TO myschema,public;
+
+-- reaching tables when located in another schema
+-- the following should be OK
+
+SELECT is(pgr_createVerticesTable('public.edges2') ,'OK','36');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+/*THIS ONE*/
+SELECT is(pgr_createVerticesTable('public.Edges2', 'the_geom'), 'FAIL','38');
+
+SELECT is(pgr_createVerticesTable('Public.edges2', 'The_Geom'), 'OK','39');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'The_geom'), 'OK','41');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('PUBLIC.Edges2', 'The_geom'), 'FAIL','43');
+/*THIS ONE*/
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom','source'), 'OK','4');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom','Source'), 'OK','4');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom','source','target'), 'OK','4');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom',rows_where:='id<15'), 'OK','4');
+SELECT results_eq('q1', ARRAY[13]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom',source:='source'), 'OK','4');
+SELECT results_eq('q1', ARRAY[17]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom',target:='target',rows_where:='id<15'), 'OK','54');
+SELECT results_eq('q1', ARRAY[13]::BIGINT[]);
+DROP TABLE public.edges2_vertices_pgr;
+
+
+-- the following tests should fail
+set client_min_messages TO warning;
+
+SELECT is(pgr_createVerticesTable('public.edges22', 'the_geom'), 'FAIL', '55');
+SELECT is(pgr_createVerticesTable('public.edges2', 'geom'), 'FAIL', '4');
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom', 'gid'), 'FAIL', '4');
+SELECT is(pgr_createVerticesTable('public.Edges2', 'the_geom','sourc'), 'FAIL', '4');
+SELECT is(pgr_createVerticesTable('public.edges2', 'the_geom',target:='source'), 'FAIL', '4');
+SELECT is(pgr_createVerticesTable('public.edges2',source:='the_geom'), 'FAIL', '4');
+SELECT is(pgr_createVerticesTable('public.edges2', target:='the_geom'), 'FAIL', '61');
+
+-- creating tables with similar names in myschema
+
+SELECT * INTO edges2 from public.edges2;
+SELECT * INTO "Edges2" from public."Edges2";
+
+-- The following should be OK
+
+
+SELECT is(pgr_createVerticesTable('edges2') ,'OK','62');
+PREPARE q10 AS
+SELECT count(*) FROM myschema.edges2_vertices_pgr;
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+/*THIS ONE*/
+SELECT is(pgr_createVerticesTable('Edges2', 'the_geom'), 'FAIL','60');
+
+SELECT is(pgr_createVerticesTable('edges2', 'The_Geom'), 'OK','60');
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'The_geom'), 'OK','60');
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('Edges2', 'The_geom'), 'FAIL','60');
+/*THIS ONE*/
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','source'), 'OK','70');
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','Source'), 'OK','70');
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','source','target'), 'OK','70');
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',rows_where:='id<15'), 'OK','70');
+SELECT results_eq('q10', ARRAY[13]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',source:='source'), 'OK','80');
+SELECT results_eq('q10', ARRAY[17]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',target:='target',rows_where:='id<15'), 'OK','80');
+SELECT results_eq('q10', ARRAY[13]::BIGINT[]);
+DROP TABLE myschema.edges2_vertices_pgr;
+
+-- the following tests should FAIL
+
+SELECT is(pgr_createVerticesTable('edges22', 'the_geom'), 'FAIL', '5');
+SELECT is(pgr_createVerticesTable('edges2', 'geom'), 'FAIL', '5');
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom', 'gid'), 'FAIL', '5');
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom','sourc'), 'FAIL', '5');
+SELECT is(pgr_createVerticesTable('edges2', 'the_geom',target:='source'), 'FAIL', '5');
+SELECT is(pgr_createVerticesTable('edges2', source:='the_geom'), 'FAIL', '5');
+SELECT is(pgr_createVerticesTable('edges2', target:='the_geom'), 'FAIL', '89');
+
+--Test of the rows_where  clause
+
+
+-- The following should be OK
+SELECT is(pgr_createVerticesTable('edges2', rows_where:='id<15'), 'OK', '90');
+SELECT is(pgr_createVerticesTable('Edges2', rows_where:='id<15 and id>5'), 'OK', '90');
+SELECT is(pgr_createVerticesTable('Edges2', rows_where:=' the_geom && (select st_buffer(the_geom,0.0001) as buffer from "Edges2"
+where id=6)') , 'OK', '90');
+
+-- The following should FAIL (working on myschema)
+
+SELECT is(pgr_createVerticesTable('edges2',rows_where:='id<'), 'FAIL', '90');
+SELECT is(pgr_createVerticesTable('Edges2', rows_where:='id<15 and ed>5'), 'FAIL', '90');
+SELECT is(pgr_createVerticesTable('Edges2', rows_where:=' the_geom && (select st_buffer(the_geom,0.0001 as buffer from "Edges2" where id=6)'), 'FAIL', '90');
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/topology/test/pgtap/incrementalCreateTopology.test.sql b/src/topology/test/pgtap/incrementalCreateTopology.test.sql
new file mode 100644
index 0000000..a4d9131
--- /dev/null
+++ b/src/topology/test/pgtap/incrementalCreateTopology.test.sql
@@ -0,0 +1,80 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+BEGIN;
+
+SET client_min_messages TO warning;
+SELECT PLAN(31);
+
+SELECT * INTO incr_table FROM edge_table WHERE id < 9;
+UPDATE incr_table SET source = NULL, target = NULL;                                -- unknown
+SELECT is((SELECT count(*)::INTEGER FROM incr_table), 8, 'initial table has 8 edges');
+
+
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 8, '8 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 8, '8 edges are missing target');
+SELECT hasnt_table('incr_table_vertices_pgr', 'incr_table_vertices_pgr table does not exist');
+
+SELECT is((SELECT pgr_createTopology('incr_table',0.0001)), 'OK','OK Creating the topology');
+SELECT has_table('incr_table_vertices_pgr', 'incr_table_vertices_pgr table now exist');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 0, '0 edges are missing target');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table_vertices_pgr), 8, 'Now we have 8 vertices');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table_vertices_pgr WHERE cnt is NULL), 8, '8 vertices are missing cnt');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table_vertices_pgr WHERE chk is NULL), 8, '8 vertices are missing chk');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table_vertices_pgr WHERE ein is NULL), 8, '8 vertices are missing ein');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table_vertices_pgr WHERE eout is NULL), 8, '8 vertices are missing eout');
+
+INSERT INTO incr_table(id, dir, cost, reverse_cost, x1, y1, x2, y2, the_geom) 
+SELECT  id, dir, cost, reverse_cost, x1, y1, x2, y2, the_geom FROM edge_table WHERE id >= 9;
+SELECT is((SELECT count(*)::INTEGER FROM incr_table), 18, 'After inserting table has 18 edges');
+
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 10, '10 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 10, '10 edges are missing target');
+-- 10 edges must be updated the rest is untouched
+SELECT is((SELECT pgr_createTopology('incr_table',0.0001,clean:=false)), 'OK', 'OK Creating the topology'); 
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 0, '0 edges are missing target');
+
+
+-- 12 edges have 'B' the rest is wiped
+SELECT is((SELECT pgr_createTopology('incr_table',0.0001,rows_where:='dir=''B''',clean:=true)), 'OK', 'OK Creating the topology'); 
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 6, '6 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 6, '6 edges are missing target');
+
+-- 6 edges must be processed, the rest is untouched
+SELECT is((SELECT pgr_createTopology('incr_table',0.0001,clean:=false)), 'OK', 'OK Creating the topology'); 
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 0, '0 edges are missing target');
+
+--12 edgedds have 'B' the rest is untouched
+SELECT is((SELECT pgr_createTopology('incr_table',0.0001,rows_where:='dir=''B''',clean:=false)), 'OK', 'OK Creating the topology'); 
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 0, '0 edges are missing target');
+
+
+SELECT is((SELECT pgr_createTopology('incr_table',0.0001,rows_where:='dir=''B''')), 'OK', 'OK Creating the topology'); 
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM incr_table WHERE target is NULL), 0, '0 edges are missing target');
+
+SELECT finish();
+ROLLBACK;
diff --git a/src/topology/test/pgtap/nodeNetwork.test.sql b/src/topology/test/pgtap/nodeNetwork.test.sql
new file mode 100644
index 0000000..7684f97
--- /dev/null
+++ b/src/topology/test/pgtap/nodeNetwork.test.sql
@@ -0,0 +1,126 @@
+\i setup.sql
+
+-- node the network
+-- create 4x4 grid of overlapping lines horizontal and vertical
+-- set the even numbered ones with dir='FT' and the odd ones 'TF'
+
+SELECT plan(41);
+
+SET client_min_messages = WARNING;
+CREATE TABLE original (
+      id serial NOT NULL primary key,
+      dir text
+);
+
+SELECT addgeometrycolumn('original', 'the_geom', ST_SRID('POINT(0 0)'::geometry) , 'LINESTRING', 2);
+
+-- creating the grid geometry
+INSERT INTO original (dir, the_geom)
+    SELECT case when s1%2=0 THEN 'FT' ELSE 'TF' END, st_astext(st_makeline(st_makepoint(1,s1), st_makepoint(6,s1))) FROM (SELECT generate_series(2,5) AS s1) AS foo
+    UNION ALL
+    SELECT case when s1%2=0 THEN 'FT' ELSE 'TF' END, st_astext(st_makeline(st_makepoint(s1,1), st_makepoint(s1,6))) FROM (select generate_series(2,5) AS s1) AS foo;
+
+
+SELECT is((SELECT count(*)::INTEGER FROM original), 8, 'we have 8 original edges');
+SELECT pgr_nodenetwork('original', 0.000001);
+SELECT is((SELECT count(*)::INTEGER FROM original_noded), 40, 'Now we have 40 edges');
+PREPARE q1 AS
+SELECT old_id, count(*) FROM original_noded GROUP BY old_id ORDER BY old_id;
+prepare vals1 AS
+VALUES (1,5),(2,5),(3,5),(4,5),(5,5),(6,5),(7,5),(8,5);
+SELECT set_eq('q1', 'vals1',
+    'For each original edge we have now 5 subedges');
+
+
+SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE source is NULL), 40, '40 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE target is NULL), 40, '40 edges are missing target');
+SELECT hasnt_table('original_noded_vertices_pgr', 'original_noded_vertices_pgr table does not exist');
+SELECT pgr_createtopology('original_noded', 0.000001);
+SELECT has_table('original_noded_vertices_pgr', 'original_noded_vertices_pgr table now exist');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded WHERE target is NULL), 0, '0 edges are missing target');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr), 32, 'Now we have 32 vertices');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE cnt is NULL), 32, '32 vertices are missing cnt');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE chk is NULL), 32, '32 vertices are missing chk');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE ein is NULL), 32, '32 vertices are missing ein');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE eout is NULL), 32, '32 vertices are missing eout');
+
+
+SELECT pgr_analyzegraph('original_noded',  0.000001);
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE cnt is NULL), 0, '0 vertices are missing cnt');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE chk is NULL), 0, '0 vertices are missing chk');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE ein is NULL), 32, '32 vertices are missing ein');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE eout is NULL), 32, '32 vertices are missing eout');
+SELECT is((SELECT count(*)::INTEGER FROM original_noded_vertices_pgr WHERE chk = 0), 32, 'In 32 vertices chk=0 aka have no problem');
+PREPARE q2 AS
+SELECT cnt, count(*) AS M  FROM original_noded_vertices_pgr GROUP BY cnt ORDER BY cnt;
+PREPARE vals2 AS
+VALUES (1,16), (4,16);
+SELECT set_eq('q2', 'vals2',
+        '(N,16) 16 vertices referenced by N edges');
+
+
+-- create a new TABLE and merge attribute FROM original and noded
+-- INTO TABLE noded
+
+create TABLE noded (
+  gid serial NOT NULL primary key,
+  id INTEGER,
+  dir text,
+  source INTEGER,
+  target INTEGER,
+  cost FLOAT,
+  reverse_cost FLOAT
+ );
+
+SELECT addgeometrycolumn('noded', 'the_geom', ST_SRID('POINT(0 0)'::geometry) , 'LINESTRING', 2);
+
+INSERT INTO noded(id, dir, the_geom)
+ SELECT a.old_id, b.dir, a.the_geom
+   FROM original_noded a, original b
+  WHERE a.old_id=b.id;
+
+SELECT is((SELECT count(*)::INTEGER FROM noded), 40, 'Now we have 40 edges');
+SELECT is(
+(SELECT DISTINCT count(*)::INTEGER FROM original GROUP BY dir),
+ 4, '4 is the count of different TF and FT in original') ;
+SELECT is(
+(SELECT DISTINCT count(*)::INTEGER FROM noded GROUP BY dir),
+ 20, '20 is the count of different TF and FT in noded (4*5)') ;
+
+
+SELECT is((SELECT count(*)::INTEGER FROM noded WHERE source is NULL), 40, '40 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM noded WHERE target is NULL), 40, '40 edges are missing target');
+SELECT hasnt_table('noded_vertices_pgr', 'noded_vertices_pgr table does not exist');
+SELECT pgr_createtopology('noded', 0.000001,id:='gid');
+SELECT has_table('noded_vertices_pgr', 'noded_vertices_pgr table now exist');
+SELECT is((SELECT count(*)::INTEGER FROM noded WHERE source is NULL), 0, '0 edges are missing source');
+SELECT is((SELECT count(*)::INTEGER FROM noded WHERE target is NULL), 0, '0 edges are missing target');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr), 32, 'Now we have 32 vertices');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE cnt is NULL), 32, '32 vertices are missing cnt');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE chk is NULL), 32, '32 vertices are missing chk');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE ein is NULL), 32, '32 vertices are missing ein');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE eout is NULL), 32, '32 vertices are missing eout');
+
+
+SELECT pgr_analyzegraph('noded', 0.000001,id:='gid');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE cnt is NULL), 0, '0 vertices are missing cnt');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE chk is NULL), 0, '0 vertices are missing chk');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE ein is NULL), 32, '32 vertices are missing ein');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE eout is NULL), 32, '32 vertices are missing eout');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE chk = 0), 32, 'In 32 vertices chk=0 aka have no problem');
+
+SELECT pgr_analyzeoneway('noded',
+    ARRAY['', 'B', 'TF'],
+    ARRAY['', 'B', 'FT'],
+    ARRAY['', 'B', 'FT'],
+    ARRAY['', 'B', 'TF'],
+    oneway:='dir');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE ein is NULL), 0, '0 vertices are missing ein');
+SELECT is((SELECT count(*)::INTEGER FROM noded_vertices_pgr WHERE eout is NULL), 0, '0 vertices are missing eout');
+
+
+SELECT finish();
+ROLLBACK;
+
+
diff --git a/src/topology/test/test.conf b/src/topology/test/test.conf
new file mode 100644
index 0000000..395b590
--- /dev/null
+++ b/src/topology/test/test.conf
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+    'any' => {
+        'comment' => 'pgr_createTopology, pgr_analyzegraph, and pgr_analyzeOneway tests for any versions.',
+        'data' => [ ],
+        'tests' => [qw( 
+            analyzeOneway-any
+            createVertTab-any
+            doc-pgr_createTopology
+            doc-pgr_analyzeGraph
+            nodeNetwork-any
+            )],
+
+        'documentation' => [qw(
+            doc-pgr_analyzeGraph
+            doc-pgr_createTopology
+            )],
+
+        'dummyStorage' => [qw(
+            )]
+
+    },
+# 'vpg-vpgis' => {}, # for version specific tests
+# '8-1' => {}, # for pg 8.x and postgis 1.x
+# '9.2-2.1' => {}, # for pg 9.2 and postgis 2.1
+);
+
+1;
diff --git a/src/trsp/doc/doc-trsp.queries b/src/trsp/doc/doc-trsp.queries
new file mode 100644
index 0000000..33a91c1
--- /dev/null
+++ b/src/trsp/doc/doc-trsp.queries
@@ -0,0 +1,113 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_trsp(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        7, 12, false, false
+    );
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   7 |   6 |    1
+   1 |   8 |   7 |    1
+   2 |   5 |   8 |    1
+   3 |   6 |   9 |    1
+   4 |   9 |  15 |    1
+   5 |  12 |  -1 |    0
+(6 rows)
+
+--q2
+--q3
+SELECT * FROM pgr_trsp(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        2, 7, false, false,
+        'SELECT to_cost, target_id,
+        from_edge || coalesce('','' || via_path, '''') AS via_path
+        FROM restrictions'
+    );
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   2 |   4 |    1
+   1 |   5 |  10 |    1
+   2 |  10 |  12 |    1
+   3 |  11 |  11 |    1
+   4 |   6 |   8 |    1
+   5 |   5 |   7 |    1
+   6 |   8 |   6 |    1
+   7 |   7 |  -1 |    0
+(8 rows)
+
+SELECT * FROM pgr_trsp(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        7, 11, false, false,
+        'SELECT to_cost, target_id,
+        from_edge || coalesce('','' || via_path, '''') AS via_path
+        FROM restrictions'
+    );
+ seq | id1 | id2 | cost 
+-----+-----+-----+------
+   0 |   7 |   6 |    1
+   1 |   8 |   7 |    1
+   2 |   5 |   8 |    1
+   3 |   6 |   9 |    1
+   4 |   9 |  15 |    1
+   5 |  12 |  13 |    1
+   6 |  11 |  -1 |    0
+(7 rows)
+
+--q4
+SELECT * FROM pgr_trspViaVertices(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        ARRAY[2,7,11]::INTEGER[],     
+        false,  false,  
+        'SELECT to_cost, target_id, from_edge ||
+        coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+ seq | id1 | id2 | id3 | cost 
+-----+-----+-----+-----+------
+   1 |   1 |   2 |   4 |    1
+   2 |   1 |   5 |  10 |    1
+   3 |   1 |  10 |  12 |    1
+   4 |   1 |  11 |  11 |    1
+   5 |   1 |   6 |   8 |    1
+   6 |   1 |   5 |   7 |    1
+   7 |   1 |   8 |   6 |    1
+   8 |   2 |   7 |   6 |    1
+   9 |   2 |   8 |   7 |    1
+  10 |   2 |   5 |   8 |    1
+  11 |   2 |   6 |   9 |    1
+  12 |   2 |   9 |  15 |    1
+  13 |   2 |  12 |  13 |    1
+  14 |   2 |  11 |  -1 |    0
+(14 rows)
+
+--q5
+SELECT * FROM pgr_trspViaEdges(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost,
+        reverse_cost FROM edge_table',
+        ARRAY[2,7,11]::INTEGER[],           
+        ARRAY[0.5, 0.5, 0.5]::FLOAT[],     
+        true,  
+        true,  
+        'SELECT to_cost, target_id, FROM_edge ||
+        coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+ seq | id1 | id2 | id3 | cost 
+-----+-----+-----+-----+------
+   1 |   1 |  -1 |   2 |  0.5
+   2 |   1 |   2 |   4 |    1
+   3 |   1 |   5 |   8 |    1
+   4 |   1 |   6 |   9 |    1
+   5 |   1 |   9 |  16 |    1
+   6 |   1 |   4 |   3 |    1
+   7 |   1 |   3 |   5 |    1
+   8 |   1 |   6 |   8 |    1
+   9 |   1 |   5 |   7 |    1
+  10 |   2 |   5 |   8 |    1
+  11 |   2 |   6 |   9 |    1
+  12 |   2 |   9 |  16 |    1
+  13 |   2 |   4 |   3 |    1
+  14 |   2 |   3 |   5 |    1
+  15 |   2 |   6 |  11 |  0.5
+(15 rows)
+
+--q6
+ROLLBACK;
+ROLLBACK
diff --git a/src/trsp/doc/index.rst b/src/trsp/doc/index.rst
deleted file mode 100644
index 28528bc..0000000
--- a/src/trsp/doc/index.rst
+++ /dev/null
@@ -1,302 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _trsp:
-
-pgr_trsp - Turn Restriction Shortest Path (TRSP)
-===============================================================================
-
-.. index:: 
-	single: pgr_trsp(text,integer,integer,boolean,boolean)
-	single: pgr_trsp(text,integer,integer,boolean,boolean,text)
-	single: pgr_trspViaVertices(text,integer,double precision,integer,double precision,boolean,boolean)
-	single: pgr_trspViaEdges(text,integer,double precision,integer,double precision,boolean,boolean,text)
-	module: trsp
-
-Name
--------------------------------------------------------------------------------
-
-``pgr_trsp`` — Returns the shortest path with support for turn restrictions.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The turn restricted shorthest path (TRSP) is a shortest path algorithm that can optionally take into account complicated turn restrictions like those found in real work navigable road networks. Performamnce wise it is nearly as fast as the A* search but has many additional features like it works with edges rather than the nodes of the network. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-	pgr_costResult[] pgr_trsp(sql text, source integer, target integer,
-                    directed boolean, has_rcost boolean [,restrict_sql text]);
-
-
-.. code-block:: sql
-
-	pgr_costResult[] pgr_trsp(sql text, source_edge integer, source_pos float8, 
-	                target_edge integer, target_pos float8,
-                    directed boolean, has_rcost boolean [,restrict_sql text]);
-
-.. code-block:: sql
-
-    pgr_costResult3[] pgr_trspViaVertices(sql text, vids integer[],
-                    directed boolean, has_reverse_cost boolean
-                    [, turn_restrict_sql text]);
-
-.. code-block:: sql
-
-     pgr_costResult3[] pgr_trspViaEdges(sql text, eids integer[], pcts float8[],
-                    directed boolean, has_reverse_cost boolean
-                    [, turn_restrict_sql text]);
-
-Description
--------------------------------------------------------------------------------
-
-The Turn Restricted Shortest Path algorithm (TRSP) is similar to the :ref:`shooting_star` in that you can specify turn restrictions.
-
-The TRSP setup is mostly the same as :ref:`Dijkstra shortest path <pgr_dijkstra>` with the addition of an optional turn restriction table. This provides an easy way of adding turn restrictions to a road network by placing them in a separate table.
-
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT id, source, target, cost, [,reverse_cost] FROM edge_table
-
-
-	:id: ``int4`` identifier of the edge
-	:source: ``int4`` identifier of the source vertex
-	:target: ``int4`` identifier of the target vertex
-	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:source: ``int4`` **NODE id** of the start point
-:target: ``int4`` **NODE id** of the end point
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-:restrict_sql: (optional) a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT to_cost, target_id, via_path FROM restrictions
-
-	:to_cost: ``float8`` turn restriction cost
-	:target_id: ``int4`` target id
-	:via_path: ``text`` commar seperated list of edges in the reverse order of ``rule``
-
-Another variant of TRSP allows to specify **EDGE id** of source and target together with a fraction to interpolate the position:
-
-:source_edge: ``int4`` **EDGE id** of the start edge
-:source_pos: ``float8`` fraction of 1 defines the position on the start edge
-:target_edge: ``int4`` **EDGE id** of the end edge 
-:target_pos: ``float8`` fraction of 1 defines the position on the end edge
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   node ID
-:id2:   edge ID (``-1`` for the last row)
-:cost:  cost to traverse from ``id1`` using ``id2``
-
-.. rubric:: History
-
-* New in version 2.0.0
-
-Support for Vias
---------------------------------------------------------------------
-
-.. warning:: The Support for Vias functions are prototypes. Not all corner cases are being considered.
-
-
-We also have support for vias where you can say generate a from A to B to C, etc. We support both methods above only you pass an array of vertices or and array of edges and percentage position along the edge in two arrays.
-
-
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT id, source, target, cost, [,reverse_cost] FROM edge_table
-
-
-	:id: ``int4`` identifier of the edge
-	:source: ``int4`` identifier of the source vertex
-	:target: ``int4`` identifier of the target vertex
-	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
-	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
-
-:vids: ``int4[]`` An ordered array of **NODE id** the path will go through from start to end.
-:directed: ``true`` if the graph is directed
-:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
-
-:restrict_sql: (optional) a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT to_cost, target_id, via_path FROM restrictions
-
-	:to_cost: ``float8`` turn restriction cost
-	:target_id: ``int4`` target id
-	:via_path: ``text`` commar seperated list of edges in the reverse order of ``rule``
-
-Another variant of TRSP allows to specify **EDGE id** together with a fraction to interpolate the position:
-
-:eids: ``int4`` An ordered array of **EDGE id** that the path has to traverse
-:pcts: ``float8`` An array of fractional positions along the respective edges in ``eids``, where 0.0 is the start of the edge and 1.0 is the end of the eadge.
-
-Returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   route ID
-:id2:   node ID
-:id3:   edge ID (``-1`` for the last row)
-:cost:  cost to traverse from ``id2`` using ``id3``
-
-
-.. rubric:: History
-
-* Via Support prototypes new in version 2.1.0
-
-Examples
--------------------------------------------------------------------------------
-
-* Without turn restrictions
-
-.. code-block:: sql
-
-	SELECT seq, id1 AS node, id2 AS edge, cost 
-		FROM pgr_trsp(
-			'SELECT id, source, target, cost FROM edge_table',
-			7, 12, false, false
-		);
-
-	seq | node | edge | cost 
-	----+------+------+------
-	  0 |    7 |    6 |    1
-	  1 |    8 |    7 |    1
-	  2 |    5 |    8 |    1
-	  3 |    6 |   11 |    1
-	  4 |   11 |   13 |    1
-	  5 |   12 |   -1 |    0
-	(6 rows)
-
-
-* With turn restrictions
-  
-Turn restrictions require additional information, which can be stored in a separate table:
-
-.. code-block:: sql
-
-	CREATE TABLE restrictions (
-	    rid serial,
-	    to_cost double precision,
-	    to_edge integer,
-	    from_edge integer,
-	    via text
-	);
-
-	INSERT INTO restrictions VALUES (1,100,7,4,null);
-	INSERT INTO restrictions VALUES (2,4,8,3,5);
-	INSERT INTO restrictions VALUES (3,100,9,16,null);
-
-Then a query with turn restrictions is created as:
-
-.. code-block:: sql
-
-	SELECT seq, id1 AS node, id2 AS edge, cost 
-		FROM pgr_trsp(
-			'SELECT id, source, target, cost FROM edge_table',
-			7, 12, false, false, 
-			'SELECT to_cost, to_edge AS target_id,
-                   from_edge || coalesce('','' || via, '''') AS via_path
-               FROM restrictions'
-		);
-
-	 seq | node | edge | cost 
-	-----+------+------+------
-	   0 |    7 |    6 |    1
-	   1 |    8 |    7 |    1
-	   2 |    5 |    8 |    1
-	   3 |    6 |   11 |    1
-	   4 |   11 |   13 |    1
-	   5 |   12 |   -1 |    0
-	(6 rows)
-
-An example query using vertex ids and via points:
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_trspViaVertices(
-        'SELECT id, source::INTEGER, target::INTEGER, cost,
-            reverse_cost FROM edge_table',
-        ARRAY[1,8,13,5]::INTEGER[],     
-        true,  
-        true,  
-        
-        'SELECT to_cost, to_edge AS target_id, FROM_edge ||
-            coalesce('',''||via,'''') AS via_path FROM restrictions');
-
-     seq | id1 | id2 | id3 | cost 
-    -----+-----+-----+-----+------
-       1 |   1 |   1 |   1 |    1
-       2 |   1 |   2 |   4 |    1
-       3 |   1 |   5 |   8 |    1
-       4 |   1 |   6 |   9 |    1
-       5 |   1 |   9 |  16 |    1
-       6 |   1 |   4 |   3 |    1
-       7 |   1 |   3 |   5 |    1
-       8 |   1 |   6 |   8 |    1
-       9 |   1 |   5 |   7 |    1
-      10 |   2 |   8 |   7 |    1
-      11 |   2 |   5 |  10 |    1
-      12 |   2 |  10 |  14 |    1
-      13 |   3 |  13 |  14 |    1
-      14 |   3 |  10 |  10 |    1
-      15 |   3 |   5 |  -1 |    0
-    (15 rows)
-
-
-
-An example query using edge ids and vias:
-
-.. code-block:: sql
-
-    SELECT * FROM pgr_trspViaEdges(
-        'SELECT id, source::INTEGER, target::INTEGER,cost,
-             reverse_cost FROM edge_table',
-        ARRAY[1,11,6]::INTEGER[],           
-        ARRAY[0.5, 0.5, 0.5]::FLOAT8[],     
-        true,  
-        true,  
-        
-        'SELECT to_cost, to_edge AS target_id, FROM_edge ||
-            coalesce('',''||via,'''') AS via_path FROM restrictions');
-
-     seq | id1 | id2 | id3 | cost 
-    -----+-----+-----+-----+------
-       1 |   1 |  -1 |   1 |  0.5
-       2 |   1 |   2 |   4 |    1
-       3 |   1 |   5 |   8 |    1
-       4 |   1 |   6 |  11 |    1
-       5 |   2 |  11 |  13 |    1
-       6 |   2 |  12 |  15 |    1
-       7 |   2 |   9 |   9 |    1
-       8 |   2 |   6 |   8 |    1
-       9 |   2 |   5 |   7 |    1
-      10 |   2 |   8 |   6 |  0.5
-    (10 rows)
-
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
diff --git a/src/trsp/doc/pgr_trsp.rst b/src/trsp/doc/pgr_trsp.rst
new file mode 100644
index 0000000..e878509
--- /dev/null
+++ b/src/trsp/doc/pgr_trsp.rst
@@ -0,0 +1,205 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _trsp:
+
+pgr_trsp - Turn Restriction Shortest Path (TRSP)
+===============================================================================
+
+.. index:: 
+	single: pgr_trsp(text,integer,integer,boolean,boolean)
+	single: pgr_trsp(text,integer,integer,boolean,boolean,text)
+	single: pgr_trspViaVertices(text,integer,double precision,integer,double precision,boolean,boolean)
+	single: pgr_trspViaEdges(text,integer,double precision,integer,double precision,boolean,boolean,text)
+	module: trsp
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_trsp`` — Returns the shortest path with support for turn restrictions.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The turn restricted shorthest path (TRSP) is a shortest path algorithm that can optionally take into account complicated turn restrictions like those found in real work navigable road networks. Performamnce wise it is nearly as fast as the A* search but has many additional features like it works with edges rather than the nodes of the network. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+	pgr_costResult[] pgr_trsp(sql text, source integer, target integer,
+                    directed boolean, has_rcost boolean [,restrict_sql text]);
+
+
+.. code-block:: sql
+
+	pgr_costResult[] pgr_trsp(sql text, source_edge integer, source_pos float8, 
+	                target_edge integer, target_pos float8,
+                    directed boolean, has_rcost boolean [,restrict_sql text]);
+
+.. code-block:: sql
+
+    pgr_costResult3[] pgr_trspViaVertices(sql text, vids integer[],
+                    directed boolean, has_rcost boolean
+                    [, turn_restrict_sql text]);
+
+.. code-block:: sql
+
+     pgr_costResult3[] pgr_trspViaEdges(sql text, eids integer[], pcts float8[],
+                    directed boolean, has_rcost boolean
+                    [, turn_restrict_sql text]);
+
+Description
+-------------------------------------------------------------------------------
+
+The Turn Restricted Shortest Path algorithm (TRSP) is similar to the :ref:`shooting_star` in that you can specify turn restrictions.
+
+The TRSP setup is mostly the same as :ref:`Dijkstra shortest path <pgr_dijkstra>` with the addition of an optional turn restriction table. This provides an easy way of adding turn restrictions to a road network by placing them in a separate table.
+
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT id, source, target, cost, [,reverse_cost] FROM edge_table
+
+
+	:id: ``int4`` identifier of the edge
+	:source: ``int4`` identifier of the source vertex
+	:target: ``int4`` identifier of the target vertex
+	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:source: ``int4`` **NODE id** of the start point
+:target: ``int4`` **NODE id** of the end point
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+:restrict_sql: (optional) a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT to_cost, target_id, via_path FROM restrictions
+
+	:to_cost: ``float8`` turn restriction cost
+	:target_id: ``int4`` target id
+	:via_path: ``text`` commar seperated list of edges in the reverse order of ``rule``
+
+Another variant of TRSP allows to specify **EDGE id** of source and target together with a fraction to interpolate the position:
+
+:source_edge: ``int4`` **EDGE id** of the start edge
+:source_pos: ``float8`` fraction of 1 defines the position on the start edge
+:target_edge: ``int4`` **EDGE id** of the end edge 
+:target_pos: ``float8`` fraction of 1 defines the position on the end edge
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   node ID
+:id2:   edge ID (``-1`` for the last row)
+:cost:  cost to traverse from ``id1`` using ``id2``
+
+.. rubric:: History
+
+* New in version 2.0.0
+
+Support for Vias
+--------------------------------------------------------------------
+
+.. warning:: The Support for Vias functions are prototypes. Not all corner cases are being considered.
+
+
+We also have support for vias where you can say generate a from A to B to C, etc. We support both methods above only you pass an array of vertices or and array of edges and percentage position along the edge in two arrays.
+
+
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT id, source, target, cost, [,reverse_cost] FROM edge_table
+
+
+	:id: ``int4`` identifier of the edge
+	:source: ``int4`` identifier of the source vertex
+	:target: ``int4`` identifier of the target vertex
+	:cost: ``float8`` value, of the edge traversal cost. A negative cost will prevent the edge from being inserted in the graph.
+	:reverse_cost: (optional) the cost for the reverse traversal of the edge. This is only used when the ``directed`` and ``has_rcost`` parameters are ``true`` (see the above remark about negative costs).
+
+:vids: ``int4[]`` An ordered array of **NODE id** the path will go through from start to end.
+:directed: ``true`` if the graph is directed
+:has_rcost: if ``true``, the ``reverse_cost`` column of the SQL generated set of rows will be used for the cost of the traversal of the edge in the opposite direction.
+
+:restrict_sql: (optional) a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT to_cost, target_id, via_path FROM restrictions
+
+	:to_cost: ``float8`` turn restriction cost
+	:target_id: ``int4`` target id
+	:via_path: ``text`` commar seperated list of edges in the reverse order of ``rule``
+
+Another variant of TRSP allows to specify **EDGE id** together with a fraction to interpolate the position:
+
+:eids: ``int4`` An ordered array of **EDGE id** that the path has to traverse
+:pcts: ``float8`` An array of fractional positions along the respective edges in ``eids``, where 0.0 is the start of the edge and 1.0 is the end of the eadge.
+
+Returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   route ID
+:id2:   node ID
+:id3:   edge ID (``-1`` for the last row)
+:cost:  cost to traverse from ``id2`` using ``id3``
+
+
+.. rubric:: History
+
+* Via Support prototypes new in version 2.1.0
+
+Examples
+-------------------------------------------------------------------------------
+
+**Without turn restrictions**
+
+.. literalinclude:: doc-trsp.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+**With turn restrictions**
+
+Then a query with turn restrictions is created as:
+
+.. literalinclude:: doc-trsp.queries
+   :start-after: --q3
+   :end-before: --q4
+
+
+An example query using vertex ids and via points:
+
+.. literalinclude:: doc-trsp.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+An example query using edge ids and vias:
+
+.. literalinclude:: doc-trsp.queries
+   :start-after: --q5
+   :end-before: --q6
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
diff --git a/src/trsp/sql/CMakeLists.txt b/src/trsp/sql/CMakeLists.txt
index 41d44e4..195bd9e 100644
--- a/src/trsp/sql/CMakeLists.txt
+++ b/src/trsp/sql/CMakeLists.txt
@@ -1,7 +1,9 @@
 # Append in local scope
 list(APPEND PACKAGE_SQL_FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/routing_trsp.sql
-    ${CMAKE_CURRENT_SOURCE_DIR}/routing_trsp_vias.sql
+    #${CMAKE_CURRENT_SOURCE_DIR}/routing_trsp.sql
+    #${CMAKE_CURRENT_SOURCE_DIR}/routing_trsp_vias.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/vias_trsp_V2.2.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/trsp_V2.2.sql
     )
 
 # set in parent scope
diff --git a/src/trsp/sql/routing_trsp.sql b/src/trsp/sql/routing_trsp.sql
index 62e0088..7a06c1c 100644
--- a/src/trsp/sql/routing_trsp.sql
+++ b/src/trsp/sql/routing_trsp.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 -----------------------------------------------------------------------
 -- Core function for time_dependent_shortest_path computation
 -- See README for description
@@ -13,7 +35,7 @@ CREATE OR REPLACE FUNCTION pgr_trsp(
         has_reverse_cost boolean, 
         turn_restrict_sql text DEFAULT null)
         RETURNS SETOF pgr_costResult
-        AS '$libdir/librouting-2.1', 'turn_restrict_shortest_path_vertex'
+        AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'turn_restrict_shortest_path_vertex'
         LANGUAGE 'c' IMMUTABLE;
 
 CREATE OR REPLACE FUNCTION pgr_trsp(
@@ -26,6 +48,6 @@ CREATE OR REPLACE FUNCTION pgr_trsp(
         has_reverse_cost boolean, 
         turn_restrict_sql text DEFAULT null)
         RETURNS SETOF pgr_costResult
-        AS '$libdir/librouting-2.1', 'turn_restrict_shortest_path_edge'
+        AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'turn_restrict_shortest_path_edge'
         LANGUAGE 'c' IMMUTABLE;
 
diff --git a/src/trsp/sql/routing_trsp_vias.sql b/src/trsp/sql/routing_trsp_vias.sql
index 76473c7..3b48df0 100644
--- a/src/trsp/sql/routing_trsp_vias.sql
+++ b/src/trsp/sql/routing_trsp_vias.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 create or replace function pgr_trspViaVertices(sql text, vids integer[], directed boolean, has_reverse_cost boolean, turn_restrict_sql text DEFAULT NULL::text)
     RETURNS SETOF pgr_costresult3 AS
 $body$
@@ -147,7 +169,7 @@ create or replace function pgr_trsp(sql text, vids integer[], directed boolean,
     RETURNS SETOF pgr_costresult AS
 $body$
 begin
-    return query select seq, id2 as id1, id3 as id2, cost from pgr_trspVia( sql, vids, directed, has_reverse_cost, turn_restrict_sql);
+    return query select seq, id2 as id1, id3 as id2, cost from pgr_trspViaVertices( sql, vids, directed, has_reverse_cost, turn_restrict_sql);
 end;
 $body$
     language plpgsql stable
@@ -160,7 +182,7 @@ create or replace function pgr_trsp(sql text, eids integer[], pcts float8[], dir
     RETURNS SETOF pgr_costresult AS
 $body$
 begin
-    return query select seq, id2 as id1, id3 as id2, cost from pgr_trspVia(sql, eids, pcts, directed, has_reverse_cost, turn_restrict_sql);
+    return query select seq, id2 as id1, id3 as id2, cost from pgr_trspViaEdges(sql, eids, pcts, directed, has_reverse_cost, turn_restrict_sql);
 end;
 $body$
     language plpgsql stable
diff --git a/src/trsp/sql/trsp_V2.2.sql b/src/trsp/sql/trsp_V2.2.sql
new file mode 100644
index 0000000..8b5b9b9
--- /dev/null
+++ b/src/trsp/sql/trsp_V2.2.sql
@@ -0,0 +1,162 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+-----------------------------------------------------------------------
+-- Core function for time_dependent_shortest_path computation
+-- See README for description
+-----------------------------------------------------------------------
+--TODO - Do we need to add another sql text for the query on time-dependent-weights table?
+--     - For now just checking with static data, so the query is similar to shortest_paths.
+
+CREATE OR REPLACE FUNCTION _pgr_trsp(
+    sql text, 
+    source_vid integer, 
+    target_vid integer, 
+    directed boolean, 
+    has_reverse_cost boolean, 
+    turn_restrict_sql text DEFAULT null)
+RETURNS SETOF pgr_costResult
+AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'turn_restrict_shortest_path_vertex'
+LANGUAGE 'c' IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION pgr_trsp(
+    sql text, 
+    source_eid integer, 
+    source_pos float8,
+    target_eid integer,
+    target_pos float8,
+    directed boolean, 
+    has_reverse_cost boolean, 
+    turn_restrict_sql text DEFAULT null)
+RETURNS SETOF pgr_costResult
+AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'turn_restrict_shortest_path_edge'
+LANGUAGE 'c' IMMUTABLE;
+
+
+
+
+/*  pgr_trsp    VERTEX
+
+ - if size of restrictions_sql  is Zero or no restrictions_sql are given
+     then call to pgr_dijkstra is made
+
+ - because it reads the data wrong, when there is a reverse_cost column:
+   - put all data costs in one cost column and
+   - a call is made to trsp without only the positive values
+*/
+CREATE OR REPLACE FUNCTION pgr_trsp(
+    edges_sql TEXT,
+    start_vid INTEGER,
+    end_vid INTEGER,
+    directed BOOLEAN,
+    has_rcost BOOLEAN,
+    restrictions_sql TEXT DEFAULT NULL)
+RETURNS SETOF pgr_costResult AS 
+$BODY$
+DECLARE
+has_reverse BOOLEAN;
+new_sql TEXT;
+trsp_sql TEXT;
+BEGIN
+    has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);
+
+    new_sql := edges_sql;
+    IF (has_reverse != has_rcost) THEN  -- user contradiction
+        IF (has_reverse) THEN  -- it has reverse_cost but user don't want it.
+            -- to be on the safe side because it reads the data wrong, sending only postitive values
+            new_sql := 
+            'WITH old_sql AS (' || edges_sql || ')' ||
+            '   SELECT id, source, target, cost FROM old_sql';
+        ELSE -- it does not have reverse_cost but user want's it
+            RAISE EXCEPTION 'Error, reverse_cost is used, but query did''t return ''reverse_cost'' column'
+            USING ERRCODE := 'XX000';
+        END IF;
+    END IF;
+
+    IF (restrictions_sql IS NULL OR length(restrictions_sql) = 0) THEN
+        -- no restrictions then its a dijkstra
+        RETURN query SELECT seq-1 AS seq, node::INTEGER AS id1, edge::INTEGER AS id2, cost
+        FROM pgr_dijkstra(new_sql, start_vid, end_vid, directed);
+        RETURN;
+    END IF;
+
+    RETURN query SELECT * FROM _pgr_trsp(new_sql, start_vid, end_vid, directed, has_rcost, restrictions_sql);
+    RETURN;
+
+
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+
+/* pgr_trspVia Vertices
+ - if size of restrictions_sql  is Zero or no restrictions_sql are given
+     then call to pgr_dijkstra is made
+
+ - because it reads the data wrong, when there is a reverse_cost column:
+   - put all data costs in one cost column and
+   - a call is made to trspViaVertices without only the positive values
+*/
+CREATE OR REPLACE FUNCTION pgr_trspViaVertices(
+    edges_sql TEXT,
+    via_vids ANYARRAY,
+    directed BOOLEAN,
+    has_rcost BOOLEAN,
+    restrictions_sql TEXT DEFAULT NULL)
+RETURNS SETOF pgr_costResult3 AS 
+$BODY$
+DECLARE
+has_reverse BOOLEAN;
+new_sql TEXT;
+BEGIN
+
+    has_reverse =_pgr_parameter_check('dijkstra', edges_sql, false);
+
+    new_sql := edges_sql;
+    IF (has_reverse != has_rcost) THEN  -- user contradiction
+        IF (has_reverse) THEN  -- it has reverse_cost but user don't want it.
+            new_sql := 
+               'WITH old_sql AS (' || edges_sql || ')' ||
+                '   SELECT id, source, target, cost FROM old_sql';
+        ELSE -- it does not have reverse_cost but user want's it
+            RAISE EXCEPTION 'Error, reverse_cost is used, but query did''t return ''reverse_cost'' column'
+            USING ERRCODE := 'XX000';
+        END IF;
+    END IF;
+
+    IF (restrictions_sql IS NULL OR length(restrictions_sql) = 0) THEN
+        RETURN query SELECT (row_number() over())::INTEGER, path_id:: INTEGER, node::INTEGER,
+            (CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost
+            FROM pgr_dijkstraVia(new_sql, via_vids, directed, strict:=true) WHERE edge != -1;
+        RETURN;
+    END IF;
+   
+
+    -- make the call without contradiction from part of the user
+    RETURN query SELECT * FROM _pgr_trspViaVertices(new_sql, via_vids, directed, has_rcost, restrictions_sql);
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
diff --git a/src/trsp/sql/vias_trsp_V2.2.sql b/src/trsp/sql/vias_trsp_V2.2.sql
new file mode 100644
index 0000000..db9d0d9
--- /dev/null
+++ b/src/trsp/sql/vias_trsp_V2.2.sql
@@ -0,0 +1,217 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+create or replace function _pgr_trspViaVertices(sql text, vids integer[], directed boolean, has_rcost boolean, turn_restrict_sql text DEFAULT NULL::text)
+    RETURNS SETOF pgr_costresult3 AS
+$body$
+/*
+ *  pgr_trsp(sql text, vids integer[], directed boolean, has_reverse_cost boolean, turn_restrict_sql text DEFAULT NULL::text)
+ *
+ *  Compute TRSP with via points. We compute the path between vids[i] and vids[i+1] and chain the results together.
+ *
+ *  NOTE: this is a prototype function, we can gain a lot of efficiencies by implementing this in C/C++
+ *
+*/
+declare
+    i integer;
+    rr pgr_costresult3;
+    lrr pgr_costresult3;
+    lrra boolean := false;
+    seq integer := 0;
+    seq2 integer := 0;
+    has_reverse BOOLEAN;
+    edges_sql TEXT;
+
+begin
+    has_reverse =_pgr_parameter_check('dijkstra', sql, false);
+    edges_sql = sql;
+    IF (has_reverse != has_rcost) THEN
+        IF (has_reverse) THEN
+            edges_sql = 'SELECT id, source, target, cost FROM (' || sql || ') a';
+        ELSE
+            raise EXCEPTION 'has_rcost set to true but reverse_cost not found';
+        END IF;
+    END IF;
+
+
+
+    -- loop through each pair of vids and compute the path
+    for i in 1 .. array_length(vids, 1)-1 loop
+        seq2 := seq2 + 1;
+        for rr in select a.seq, seq2 as id1, a.id1 as id2, a.id2 as id3, a.cost
+                    from pgr_trsp(edges_sql, vids[i], vids[i+1], directed, has_rcost, turn_restrict_sql) as a loop
+            -- filter out the individual path ends except the last one
+            -- we might not want to do this so we can know where the via points are in the path result
+            -- but this needs more thought
+            --raise notice 'rr: %', rr;
+            if rr.id3 = -1 then
+                lrr := rr;
+                lrra := true;
+            else
+                seq := seq + 1;
+                rr.seq := seq;
+                return next rr;
+            end if;
+        end loop;
+    end loop;
+
+    if lrra then
+        seq := seq + 1;
+        lrr.seq := seq;
+        return next lrr;
+    end if;
+    return;
+end;
+$body$
+    language plpgsql stable
+    cost 100
+    rows 1000;
+
+
+
+
+----------------------------------------------------------------------------------------------------------
+
+create or replace function pgr_trspViaEdges(sql text, eids integer[], pcts float8[], directed boolean, has_rcost boolean, turn_restrict_sql text DEFAULT NULL::text)
+    RETURNS SETOF pgr_costresult3 AS
+$body$
+/*
+ *  pgr_trsp(sql text, eids integer[], pcts float8[], directed boolean, has_reverse_cost boolean, turn_restrict_sql text DEFAULT NULL::text)
+ *
+ *  Compute TRSP with edge_ids and pposition along edge. We compute the path between eids[i], pcts[i] and eids[i+1], pcts[i+1]
+ *  and chain the results together.
+ *
+ *  NOTE: this is a prototype function, we can gain a lot of efficiencies by implementing this in C/C++
+ *
+*/
+declare
+    i integer;
+    rr pgr_costresult3;
+    lrr pgr_costresult3;
+    first boolean := true;
+    seq integer := 0;
+    seq2 integer :=0;
+    has_reverse BOOLEAN;
+    edges_sql TEXT;
+
+begin
+    has_reverse =_pgr_parameter_check('dijkstra', sql, false);
+    edges_sql = sql;
+    IF (has_reverse != has_rcost) THEN
+        IF (has_reverse) THEN
+            edges_sql = 'SELECT id, source, target, cost FROM (' || sql || ') a';
+        ELSE
+            raise EXCEPTION 'has_rcost set to true but reverse_cost not found';
+        END IF;
+    END IF;
+
+    if array_length(eids, 1) != array_length(pcts, 1) then
+        raise exception 'The length of arrays eids and pcts must be the same!';
+    end if;
+
+    -- loop through each pair of vids and compute the path
+    for i in 1 .. array_length(eids, 1)-1 loop
+        seq2 := seq2 + 1;
+        for rr in select a.seq, seq2 as id1, a.id1 as id2, a.id2 as id3, a.cost
+                    from pgr_trsp(edges_sql,
+                                  eids[i], pcts[i],
+                                  eids[i+1], pcts[i+1],
+                                  directed,
+                                  has_reverse,
+                                  turn_restrict_sql) as a loop
+            -- combine intermediate via costs when cost is split across
+            -- two parts of a segment because it stops it and
+            -- restarts the next leg also on it
+            -- we might not want to do this so we can know where the via points are in the path result
+            -- but this needs more thought
+            --
+            -- there are multiple condition we have to deal with
+            -- between the end of one leg and start of the next
+            -- 1. same vertex_id. edge_id=-1; drop record with edge_id=-1
+            -- means: path ends on vertex
+            -- NOTICE:  rr: (19,1,44570022,-1,0)
+            -- NOTICE:  rr: (0,2,44570022,1768045,2.89691196717448)
+            -- 2. vertex_id=-1; sum cost components
+            -- means: path end/starts with the segment
+            -- NOTICE:  rr: (11,2,44569628,1775909,9.32885885148532)
+            -- NOTICE:  rr: (0,3,-1,1775909,0.771386350984395)
+
+            --raise notice 'rr: %', rr;
+            if first then
+                lrr := rr;
+                first := false;
+            else
+                if lrr.id3 = -1 then
+                    lrr := rr;
+                elsif lrr.id3 = rr.id3 then
+                    lrr.cost := lrr.cost + rr.cost;
+                    if rr.id2 = -1 then
+                        rr.id2 := lrr.id2;
+                    end if;
+                else
+                    seq := seq + 1;
+                    lrr.seq := seq;
+                    return next lrr;
+                    lrr := rr;
+                end if;
+            end if;
+        end loop;
+    end loop;
+
+    seq := seq + 1;
+    lrr.seq := seq;
+    return next lrr;
+    return;
+end;
+$body$
+    language plpgsql stable
+    cost 100
+    rows 1000;
+
+
+----------------------------------------------------------------------------------------------------------
+/*this via functions are not documented they will be deleted on 2.2
+
+create or replace function pgr_trsp(sql text, vids integer[], directed boolean, has_reverse_cost boolean, turn_restrict_sql text DEFAULT NULL::text)
+    RETURNS SETOF pgr_costresult AS
+$body$
+begin
+    return query select seq, id2 as id1, id3 as id2, cost from pgr_trspVia( sql, vids, directed, has_reverse_cost, turn_restrict_sql);
+end;
+$body$
+    language plpgsql stable
+    cost 100
+    rows 1000;
+
+
+
+create or replace function pgr_trsp(sql text, eids integer[], pcts float8[], directed boolean, has_reverse_cost boolean, turn_restrict_sql text DEFAULT NULL::text)
+    RETURNS SETOF pgr_costresult AS
+$body$
+begin
+    return query select seq, id2 as id1, id3 as id2, cost from pgr_trspVia(sql, eids, pcts, directed, has_reverse_cost, turn_restrict_sql);
+end;
+$body$
+    language plpgsql stable
+    cost 100
+    rows 1000;
+*/
diff --git a/src/trsp/src/CMakeLists.txt b/src/trsp/src/CMakeLists.txt
index bd61d64..316f6a1 100644
--- a/src/trsp/src/CMakeLists.txt
+++ b/src/trsp/src/CMakeLists.txt
@@ -1 +1,5 @@
-add_library(trsp OBJECT trsp.h trsp.c utils.h GraphDefinition.h trsp_core.cpp GraphDefinition.cpp)
+add_library(trsp OBJECT 
+    trsp.c
+    trsp_core.cpp
+    GraphDefinition.cpp)
+
diff --git a/src/trsp/src/GraphDefinition.cpp b/src/trsp/src/GraphDefinition.cpp
old mode 100755
new mode 100644
index 3b91d4b..3b95141
--- a/src/trsp/src/GraphDefinition.cpp
+++ b/src/trsp/src/GraphDefinition.cpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 
 #ifdef __MINGW32__
 #include <winsock2.h>
@@ -5,31 +27,35 @@
 #endif
 
 
+#include <sstream>
 #include "GraphDefinition.h"
 
 // -------------------------------------------------------------------------
-GraphDefinition::GraphDefinition(void)
-{
-    m_lStartEdgeId = -1;
-    m_lEndEdgeId = 0;
-    m_dStartpart = 0.0;
-    m_dEndPart = 0.0;
-    m_dCost = NULL;
-    m_bIsturnRestrictOn = false;
-    m_bIsGraphConstructed = false;
-    parent = NULL;
-    init();
-}
+GraphDefinition::GraphDefinition(
+        edge_t *edges,
+        unsigned int edge_count,
+        bool directed,
+        bool has_rcost) :
+    m_lStartEdgeId(-1),
+    m_lEndEdgeId(0),
+    m_dStartpart(0.0),
+    m_dEndPart(0.0),
+    m_edge_count(edge_count),
+    m_bIsturnRestrictOn(false),
+    m_bIsGraphConstructed(false) {
+        m_dCost.clear();
+        parent.clear();
+        init();
+        construct_graph(edges, has_rcost, directed);
+        m_bIsGraphConstructed = true;
+    }
 
 // -------------------------------------------------------------------------
-GraphDefinition::~GraphDefinition(void)
-{
-}
+GraphDefinition::~GraphDefinition(void) { }
 
 
 // -------------------------------------------------------------------------
-void GraphDefinition::init()
-{
+void GraphDefinition::init() {
     max_edge_id = 0;
     max_node_id = 0;
     isStartVirtual = false;
@@ -38,33 +64,26 @@ void GraphDefinition::init()
 
 
 // -------------------------------------------------------------------------
-void GraphDefinition::deleteall()
-{
-    std::vector<GraphEdgeInfo*>::iterator it;
-    for(it  = m_vecEdgeVector.begin(); it != m_vecEdgeVector.end(); it++){
-        delete *it;
-    }
+
+void GraphDefinition::deleteall() {
     m_vecEdgeVector.clear();
 
-    delete [] parent;
-    delete [] m_dCost;
+    parent.clear();
+    m_dCost.clear();
 }
 
 
+
+
 // -------------------------------------------------------------------------
-double GraphDefinition::construct_path(int ed_id, int v_pos)
-{
-    if(parent[ed_id].ed_ind[v_pos] == -1)
-    {
+double GraphDefinition::construct_path(int64_t ed_id, int64_t v_pos) {
+    if(parent[ed_id].ed_ind[v_pos] == -1) {
         path_element_t pelement;
-        GraphEdgeInfo* cur_edge = m_vecEdgeVector[ed_id];
-        if(v_pos == 0)
-        {
+        GraphEdgeInfo* cur_edge = &m_vecEdgeVector[ed_id];
+        if(v_pos == 0) {
             pelement.vertex_id = cur_edge->m_lStartNode;
             pelement.cost = cur_edge->m_dCost;
-        }
-        else
-        {
+        } else {
             pelement.vertex_id = cur_edge->m_lEndNode;
             pelement.cost = cur_edge->m_dReverseCost;
         }
@@ -75,15 +94,12 @@ double GraphDefinition::construct_path(int ed_id, int v_pos)
     }
     double ret = construct_path(parent[ed_id].ed_ind[v_pos], parent[ed_id].v_pos[v_pos]);
     path_element_t pelement;
-    GraphEdgeInfo* cur_edge = m_vecEdgeVector[ed_id];
-    if(v_pos == 0)
-    {
+    GraphEdgeInfo* cur_edge = &m_vecEdgeVector[ed_id];
+    if(v_pos == 0) {
         pelement.vertex_id = cur_edge->m_lStartNode;
         pelement.cost = m_dCost[ed_id].endCost - ret;// cur_edge.m_dCost;
         ret = m_dCost[ed_id].endCost;
-    }
-    else
-    {
+    } else {
         pelement.vertex_id = cur_edge->m_lEndNode;
         pelement.cost = m_dCost[ed_id].startCost - ret;
         ret = m_dCost[ed_id].startCost;
@@ -98,44 +114,36 @@ double GraphDefinition::construct_path(int ed_id, int v_pos)
 
 // -------------------------------------------------------------------------
 double GraphDefinition::getRestrictionCost(
-    int edge_ind,
-    GraphEdgeInfo& new_edge,
-    bool isStart)
-{
+        int64_t edge_ind,
+        GraphEdgeInfo& new_edge,
+        bool isStart) {
     double cost = 0.0;
-    int edge_id = new_edge.m_lEdgeID;
-    if(m_ruleTable.find(edge_id) == m_ruleTable.end())
-    {    
+    auto edge_id = new_edge.m_lEdgeID;
+    if(m_ruleTable.find(edge_id) == m_ruleTable.end()) {    
         return(0.0);
     }
     std::vector<Rule> vecRules = m_ruleTable[edge_id];
-    int ruleIndex;
-    int totalRule = vecRules.size();
-    int st_edge_ind = edge_ind;
-    for(ruleIndex = 0; ruleIndex < totalRule; ruleIndex++)
-    {
+    auto totalRule = vecRules.size();
+    auto st_edge_ind = edge_ind;
+    for(size_t ruleIndex = 0; ruleIndex < totalRule; ruleIndex++) {
         bool flag = true;
-        int total_edge = vecRules[ruleIndex].precedencelist.size();
-        int i;
-        int v_pos = (isStart?0:1);
+        auto total_edge = vecRules[ruleIndex].precedencelist.size();
+        int64_t v_pos = (isStart?0:1);
         edge_ind = st_edge_ind;
-        for(i = 0; i < total_edge; i++)
-        {
-            if(edge_ind == -1)
-            {
+        for(size_t i = 0; i < total_edge; i++) {
+            if(edge_ind == -1) {
                 flag = false;
                 break;
             }
-            if(vecRules[ruleIndex].precedencelist[i] != m_vecEdgeVector[edge_ind]->m_lEdgeID)
-            {
+            if(vecRules[ruleIndex].precedencelist[i] != m_vecEdgeVector[edge_ind].m_lEdgeID) {
                 flag = false;
                 break;
             }
-            int parent_ind = parent[edge_ind].ed_ind[v_pos];
+            auto parent_ind = parent[edge_ind].ed_ind[v_pos];
             v_pos = parent[edge_ind].v_pos[v_pos];
             edge_ind = parent_ind;
         }
-        if(flag)
+        if(flag) 
             cost += vecRules[ruleIndex].cost;
     }
     return cost;
@@ -144,60 +152,52 @@ double GraphDefinition::getRestrictionCost(
 
 // -------------------------------------------------------------------------
 void GraphDefinition::explore(
-    int cur_node,
-    GraphEdgeInfo& cur_edge,
-    bool isStart,
-    LongVector &vecIndex,
-    std::priority_queue<PDP, std::vector<PDP>,
-    std::greater<PDP> > &que)
-{
+        int64_t cur_node,
+        GraphEdgeInfo &cur_edge,
+        bool isStart,
+        LongVector &vecIndex,
+        std::priority_queue<PDP, std::vector<PDP>,
+        std::greater<PDP> > &que) {
     unsigned int i;
     double extCost = 0.0;
-    GraphEdgeInfo* new_edge;
+    GraphEdgeInfo new_edge;
     // int new_node;
     double totalCost;
-    for(i = 0; i < vecIndex.size(); i++)
-    {
+    for(i = 0; i < vecIndex.size(); i++) {
         new_edge = m_vecEdgeVector[vecIndex[i]];
         extCost = 0.0;
-        if(m_bIsturnRestrictOn)
-        {
-            extCost = getRestrictionCost(cur_edge.m_lEdgeIndex, *new_edge, isStart);
+        if(m_bIsturnRestrictOn) {
+            extCost = getRestrictionCost(cur_edge.m_lEdgeIndex, new_edge, isStart);
         }
-        if(new_edge->m_lStartNode == cur_node)
-        {
-            if(new_edge->m_dCost >= 0.0)
-            {
+        if(new_edge.m_lStartNode == cur_node) {
+            if(new_edge.m_dCost >= 0.0) {
                 //new_node = new_edge->m_lEndNode;
-                
+
                 if(isStart)
-                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].endCost + new_edge->m_dCost + extCost;
+                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].endCost + new_edge.m_dCost + extCost;
                 else
-                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].startCost + new_edge->m_dCost + extCost;
-                if(totalCost < m_dCost[vecIndex[i]].endCost)
-                {
+                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].startCost + new_edge.m_dCost + extCost;
+                if(totalCost < m_dCost[vecIndex[i]].endCost) {
                     m_dCost[vecIndex[i]].endCost = totalCost;
-                    parent[new_edge->m_lEdgeIndex].v_pos[0] = (isStart?0:1);
-                    parent[new_edge->m_lEdgeIndex].ed_ind[0] = cur_edge.m_lEdgeIndex;
-                    que.push(std::make_pair(totalCost, std::make_pair(new_edge->m_lEdgeIndex, true)));
+                    parent[new_edge.m_lEdgeIndex].v_pos[0] = (isStart?0:1);
+                    parent[new_edge.m_lEdgeIndex].ed_ind[0] = cur_edge.m_lEdgeIndex;
+                    que.push(std::make_pair(totalCost, std::make_pair(new_edge.m_lEdgeIndex, true)));
                 }
             }
-        }
-        else
-        {
-            if(new_edge->m_dReverseCost >= 0.0)
+        } else {
+            if(new_edge.m_dReverseCost >= 0.0)
             {
                 // new_node = new_edge->m_lStartNode;
                 if(isStart)
-                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].endCost + new_edge->m_dReverseCost + extCost;
+                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].endCost + new_edge.m_dReverseCost + extCost;
                 else
-                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].startCost + new_edge->m_dReverseCost + extCost;
+                    totalCost = m_dCost[cur_edge.m_lEdgeIndex].startCost + new_edge.m_dReverseCost + extCost;
                 if(totalCost < m_dCost[vecIndex[i]].startCost)
                 {
                     m_dCost[vecIndex[i]].startCost = totalCost;
-                    parent[new_edge->m_lEdgeIndex].v_pos[1] = (isStart?0:1);
-                    parent[new_edge->m_lEdgeIndex].ed_ind[1] = cur_edge.m_lEdgeIndex;
-                    que.push(std::make_pair(totalCost, std::make_pair(new_edge->m_lEdgeIndex, false)));
+                    parent[new_edge.m_lEdgeIndex].v_pos[1] = (isStart?0:1);
+                    parent[new_edge.m_lEdgeIndex].ed_ind[1] = cur_edge.m_lEdgeIndex;
+                    que.push(std::make_pair(totalCost, std::make_pair(new_edge.m_lEdgeIndex, false)));
                 }
             }
         }
@@ -205,211 +205,15 @@ void GraphDefinition::explore(
 }
 
 
-// -------------------------------------------------------------------------
-int GraphDefinition::multi_dijkstra(
-    edge_t *edges,
-    unsigned int edge_count,
-    std::vector<int> vertices,
-    bool directed,
-    bool has_reverse_cost, 
-    path_element_t **path,
-    int *path_count,
-    char **err_msg,
-    std::vector<PDVI> &ruleList)
-{
-    construct_graph(edges, edge_count, has_reverse_cost, directed);
-    if(ruleList.size() > 0)
-    {
-    m_ruleTable.clear();
-    int total_rule = ruleList.size();
-    int i;
-    LongVector vecsource;
-    // int kk;
-    for(i = 0; i < total_rule; i++)
-    {
-        Rule rule;
-        rule.cost = ruleList[i].first;
-        int j;
-        int seq_cnt = ruleList[i].second.size();
-        for(j = 1; j < seq_cnt; j++)
-        {
-            rule.precedencelist.push_back(ruleList[i].second[j]);
-        }
-        int dest_edge_id = ruleList[i].second[0];
-        if(m_ruleTable.find(dest_edge_id) != m_ruleTable.end())
-        {
-            m_ruleTable[dest_edge_id].push_back(rule);
-        }
-        else
-        {
-            std::vector<Rule> temprules;
-            temprules.clear();
-            temprules.push_back(rule);
-            m_ruleTable.insert(std::make_pair(dest_edge_id, temprules));
-        }
-    }
-    
-    m_bIsturnRestrictOn = true;
-    }
-    parent = new PARENT_PATH[edge_count + 1];
-    m_dCost = new CostHolder[edge_count + 1];
-    m_vecPath.clear();
-    int i;
-    int total_vertices = vertices.size();
-    for(i = 0; i < total_vertices - 1; i++)
-    {
-    int ret = my_dijkstra(vertices[i], vertices[i + 1], edge_count, err_msg);
-    if(ret < 0)
-    {
-        deleteall();
-        return -1;
-    }
-    }
-
-    *path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
-    *path_count = m_vecPath.size();
-
-    for(i = 0; i < *path_count; i++)
-    {
-    (*path)[i].vertex_id = m_vecPath[i].vertex_id;
-    (*path)[i].edge_id = m_vecPath[i].edge_id;
-    (*path)[i].cost = m_vecPath[i].cost;
-    }
-    deleteall();
-    return 0;
-}
-
 
 // -------------------------------------------------------------------------
-int GraphDefinition::my_dijkstra(int start_vertex, int end_vertex, unsigned int edge_count, char **err_msg)
+    void
+GraphDefinition::add_virtual_vertices(int start_edge_id, double start_part, int end_edge_id, double end_part,
+        int64_t &start_vertex, int64_t &end_vertex)
 {
-    if(!m_bIsGraphConstructed)
-    {
-    *err_msg = (char *)"Graph not Ready!";
-    return -1;
-    }
-    unsigned int i;
-    for(i = 0; i <= edge_count; i++)
-    {
-    m_dCost[i].startCost = 1e15;
-    m_dCost[i].endCost = 1e15;
-    }
-
-    if(m_mapNodeId2Edge.find(start_vertex) == m_mapNodeId2Edge.end())
-    {
-    *err_msg = (char *)"Source Not Found";
-    deleteall();
-    return -1;
-    }
-
-    if(m_mapNodeId2Edge.find(end_vertex) == m_mapNodeId2Edge.end())
-    {
-    *err_msg = (char *)"Destination Not Found";
-    deleteall();
-    return -1;
-    }
-
-    std::priority_queue<PDP, std::vector<PDP>, std::greater<PDP> > que;
-    LongVector vecsource = m_mapNodeId2Edge[start_vertex];
-    GraphEdgeInfo* cur_edge = NULL;
-
-    for(i = 0; i < vecsource.size(); i++)
-    {
-    cur_edge = m_vecEdgeVector[vecsource[i]];
-    if(cur_edge->m_lStartNode == start_vertex)
-    {
-        if(cur_edge->m_dCost >= 0.0)
-        {
-        m_dCost[cur_edge->m_lEdgeIndex].endCost= cur_edge->m_dCost;
-        parent[cur_edge->m_lEdgeIndex].v_pos[0] = -1;
-        parent[cur_edge->m_lEdgeIndex].ed_ind[0] = -1;
-        que.push(std::make_pair(cur_edge->m_dCost, std::make_pair(cur_edge->m_lEdgeIndex, true)));
-        }
-    }
-    else
-    {
-        if(cur_edge->m_dReverseCost >= 0.0)
-        {
-        m_dCost[cur_edge->m_lEdgeIndex].startCost = cur_edge->m_dReverseCost;
-        parent[cur_edge->m_lEdgeIndex].v_pos[1] = -1;
-        parent[cur_edge->m_lEdgeIndex].ed_ind[1] = -1;
-        que.push(std::make_pair(cur_edge->m_dReverseCost, std::make_pair(cur_edge->m_lEdgeIndex, false)));
-        }
-    }
-    }
-    
-    // int new_node;
-    int cur_node = -1;
-
-    while(!que.empty())
-    {
-    PDP cur_pos = que.top();
-    que.pop();
-    int cured_index = cur_pos.second.first;
-    cur_edge = m_vecEdgeVector[cured_index];
-    //GraphEdgeInfo* new_edge;
-
-    if(cur_pos.second.second)      // explore edges connected to end node
-    {
-        cur_node = cur_edge->m_lEndNode;
-        if(cur_edge->m_dCost < 0.0)
-        continue;
-        if(cur_node == end_vertex)
-        break;
-        explore(cur_node, *cur_edge, true, cur_edge->m_vecEndConnedtedEdge, que);
-    }
-    else        // explore edges connected to start node
-    {
-        cur_node = cur_edge->m_lStartNode;
-        if(cur_edge->m_dReverseCost < 0.0)
-        continue;
-        if(cur_node == end_vertex)
-        break;
-        explore(cur_node, *cur_edge, false, cur_edge->m_vecStartConnectedEdge, que);
-    }
-    }
-    if(cur_node != end_vertex)
-    {
-    *err_msg = (char *)"Path Not Found";
-    deleteall();
-    return -1;
-    }
-    else
-    {
-    // double total_cost;  //set but not used
-    if(cur_node == cur_edge->m_lStartNode)
-    {
-        // total_cost = m_dCost[cur_edge->m_lEdgeIndex].startCost;
-        construct_path(cur_edge->m_lEdgeIndex, 1);
-    }
-    else
-    {
-        // total_cost = m_dCost[cur_edge->m_lEdgeIndex].endCost;
-        construct_path(cur_edge->m_lEdgeIndex, 0);
-    }
-    path_element_t pelement;
-    pelement.vertex_id = end_vertex;
-    pelement.edge_id = -1;
-    pelement.cost = 0.0;
-    m_vecPath.push_back(pelement);
-    }
-    return 0;
-}
-
-
-// -------------------------------------------------------------------------
-int GraphDefinition::my_dijkstra(edge_t *edges, unsigned int edge_count, int start_edge_id, double start_part, int end_edge_id, double end_part, bool directed, bool has_reverse_cost,
-                path_element_t **path, int *path_count, char **err_msg, std::vector<PDVI> &ruleList)
-{
-    if(!m_bIsGraphConstructed)
-    {
-        init();
-        construct_graph(edges, edge_count, has_reverse_cost, directed);
-        m_bIsGraphConstructed = true;
-    }
-    GraphEdgeInfo* start_edge_info = m_vecEdgeVector[m_mapEdgeId2Index[start_edge_id]];
+    GraphEdgeInfo *start_edge_info = &m_vecEdgeVector[m_mapEdgeId2Index[start_edge_id]];
     edge_t start_edge;
-    int start_vertex, end_vertex;
+    //int start_vertex, end_vertex;
     m_dStartpart = start_part;
     m_dEndPart = end_part;
     m_lStartEdgeId = start_edge_id;
@@ -438,7 +242,7 @@ int GraphDefinition::my_dijkstra(edge_t *edges, unsigned int edge_count, int sta
             start_edge.target = start_edge_info->m_lEndNode;
             start_edge.cost = (1.0 - start_part) * start_edge_info->m_dCost;
             addEdge(start_edge);
-            edge_count++;
+            m_edge_count++;
         }
         if(start_edge_info->m_dReverseCost >= 0.0)
         {
@@ -447,13 +251,13 @@ int GraphDefinition::my_dijkstra(edge_t *edges, unsigned int edge_count, int sta
             start_edge.target = start_edge_info->m_lStartNode;
             start_edge.cost = start_part * start_edge_info->m_dReverseCost;
             addEdge(start_edge);
-            edge_count++;
+            m_edge_count++;
         }
     }
 
-    GraphEdgeInfo* end_edge_info = m_vecEdgeVector[m_mapEdgeId2Index[end_edge_id]];
+    GraphEdgeInfo *end_edge_info = &m_vecEdgeVector[m_mapEdgeId2Index[end_edge_id]];
     edge_t end_edge;
-    
+
     if(end_part == 0.0)
     {
         end_vertex = end_edge_info->m_lStartNode;
@@ -477,7 +281,7 @@ int GraphDefinition::my_dijkstra(edge_t *edges, unsigned int edge_count, int sta
             end_edge.source = end_edge_info->m_lStartNode;
             end_edge.cost = end_part * end_edge_info->m_dCost;
             addEdge(end_edge);
-            edge_count++;
+            m_edge_count++;
         }
         if(end_edge_info->m_dReverseCost >= 0.0)
         {
@@ -485,120 +289,98 @@ int GraphDefinition::my_dijkstra(edge_t *edges, unsigned int edge_count, int sta
             end_edge.id = max_edge_id + 1;
             end_edge.cost = (1.0 - end_part) * end_edge_info->m_dReverseCost;
             addEdge(end_edge);
-            edge_count++;
+            m_edge_count++;
         }
     }
-
-    return(my_dijkstra(edges, edge_count, start_vertex, end_vertex, directed, has_reverse_cost, path, path_count, err_msg, ruleList));
+    //edge_count = m_edge_count;
 }
 
 
 // -------------------------------------------------------------------------
-int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int start_vertex, int end_vertex, bool directed, bool has_reverse_cost,
-                                  path_element_t **path, int *path_count, char **err_msg, std::vector<PDVI> &ruleList)
-{
+    void
+GraphDefinition::set_restrictions(
+        int64_t start_vertex,
+        int64_t end_vertex,
+        std::vector<PDVI> &ruleList) {
     m_ruleTable.clear();
-    int total_rule = ruleList.size();
-    int i;
+    auto total_rule = ruleList.size();
     LongVector vecsource;
     unsigned int kk;
-    for(i = 0; i < total_rule; i++)
+    for(size_t i = 0; i < total_rule; i++)
     {
         Rule rule;
         rule.cost = ruleList[i].first;
-        int j;
-        int seq_cnt = ruleList[i].second.size();
-        for(j = 1; j < seq_cnt; j++)
-        {
+        auto seq_cnt = ruleList[i].second.size();
+        for(size_t j = 1; j < seq_cnt; j++) {
             rule.precedencelist.push_back(ruleList[i].second[j]);
         }
-        int dest_edge_id = ruleList[i].second[0];
-        if(m_ruleTable.find(dest_edge_id) != m_ruleTable.end())
-        {
+        auto dest_edge_id = ruleList[i].second[0];
+        if(m_ruleTable.find(dest_edge_id) != m_ruleTable.end()) {
             m_ruleTable[dest_edge_id].push_back(rule);
-        }
-        else
-        {
+        } else {
             std::vector<Rule> temprules;
             temprules.clear();
             temprules.push_back(rule);
             m_ruleTable.insert(std::make_pair(dest_edge_id, temprules));
         }
-    
-        if(isStartVirtual)
-        {
-            if(seq_cnt == 2 && ruleList[i].second[1] == m_lStartEdgeId)
-            {
+
+        if(isStartVirtual) {
+            if(seq_cnt == 2 && ruleList[i].second[1] == m_lStartEdgeId) {
                 vecsource = m_mapNodeId2Edge[start_vertex];
-                for(kk = 0; kk < vecsource.size(); kk++)
-                {
+                for(kk = 0; kk < vecsource.size(); kk++) {
                     rule.precedencelist.clear();
-                    rule.precedencelist.push_back(m_vecEdgeVector[vecsource[kk]]->m_lEdgeID);
+                    rule.precedencelist.push_back(m_vecEdgeVector[vecsource[kk]].m_lEdgeID);
                     m_ruleTable[dest_edge_id].push_back(rule);
                 }
             }
         }
     }
-    if(isEndVirtual)
-    {
-        if(m_ruleTable.find(m_lEndEdgeId) != m_ruleTable.end())
-        {
+    if(isEndVirtual) {
+        if(m_ruleTable.find(m_lEndEdgeId) != m_ruleTable.end()) {
             std::vector<Rule> tmpRules = m_ruleTable[m_lEndEdgeId];
             vecsource = m_mapNodeId2Edge[end_vertex];
-            for(kk = 0; kk < vecsource.size(); kk++)
-            {
-                m_ruleTable.insert(std::make_pair(m_vecEdgeVector[vecsource[kk]]->m_lEdgeID, tmpRules));
+            for(kk = 0; kk < vecsource.size(); kk++) {
+                m_ruleTable.insert(std::make_pair(m_vecEdgeVector[vecsource[kk]].m_lEdgeID, tmpRules));
             }
         }
     }
     m_bIsturnRestrictOn = true;
-    return(my_dijkstra(edges, edge_count, start_vertex, end_vertex, directed, has_reverse_cost, path, path_count, err_msg));
 }
 
-
+// THIS ONE IS THE DIJKSTRA
 // -------------------------------------------------------------------------
-int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int start_vertex, int end_vertex, bool directed, bool has_reverse_cost,
-                path_element_t **path, int *path_count, char **err_msg)
-{
-    if(!m_bIsGraphConstructed)
-    {
-        init();
-        construct_graph(edges, edge_count, has_reverse_cost, directed);
-        m_bIsGraphConstructed = true;
-    }
-    
+int GraphDefinition:: my_dijkstra(int64_t start_vertex, int64_t end_vertex,
+        path_element_t **path, size_t *path_count,
+        std::ostringstream &log) {
+
     std::priority_queue<PDP, std::vector<PDP>, std::greater<PDP> > que;
-    parent = new PARENT_PATH[edge_count + 1];
-    m_dCost = new CostHolder[edge_count + 1];
+    parent.resize(m_edge_count + 1);
+    m_dCost.resize(m_edge_count + 1);
     m_vecPath.clear();
 
-    unsigned int i;
-    for(i = 0; i <= edge_count; i++)
-    {
-        m_dCost[i].startCost = 1e15;
-        m_dCost[i].endCost = 1e15;
+    for (auto &dcost : m_dCost) {
+        dcost.startCost = 1e15;
+        dcost.endCost = 1e15;
     }
-    
+
     if(m_mapNodeId2Edge.find(start_vertex) == m_mapNodeId2Edge.end())
     {
-        *err_msg = (char *)"Source Not Found";
-        deleteall();
+        log << "Source Not Found";
         return -1;
     }
 
     if(m_mapNodeId2Edge.find(end_vertex) == m_mapNodeId2Edge.end())
     {
-        *err_msg = (char *)"Destination Not Found";
-        deleteall();
+        log << "Destination Not Found";
         return -1;
     }
 
     LongVector vecsource = m_mapNodeId2Edge[start_vertex];
-    GraphEdgeInfo* cur_edge = NULL;
+    GraphEdgeInfo *cur_edge = NULL;
 
-    for(i = 0; i < vecsource.size(); i++)
+    for (auto &s : vecsource)
     {
-        cur_edge = m_vecEdgeVector[vecsource[i]];
+        GraphEdgeInfo *cur_edge = &m_vecEdgeVector[s];
         if(cur_edge->m_lStartNode == start_vertex)
         {
             if(cur_edge->m_dCost >= 0.0)
@@ -608,9 +390,7 @@ int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int st
                 parent[cur_edge->m_lEdgeIndex].ed_ind[0] = -1;
                 que.push(std::make_pair(cur_edge->m_dCost, std::make_pair(cur_edge->m_lEdgeIndex, true)));
             }
-        }
-        else
-        {
+        } else {
             if(cur_edge->m_dReverseCost >= 0.0)
             {
                 m_dCost[cur_edge->m_lEdgeIndex].startCost = cur_edge->m_dReverseCost;
@@ -620,32 +400,25 @@ int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int st
             }
         }
     }
-    //parent[start_vertex].v_id = -1;
-    //parent[start_vertex].ed_id = -1;
-    //m_dCost[start_vertex] = 0.0;
 
-    // int new_node;
-    int cur_node = -1;
+    int64_t cur_node = -1;
 
-    while(!que.empty())
-    {
+    while(!que.empty()) {
         PDP cur_pos = que.top();
         que.pop();
         int cured_index = cur_pos.second.first;
-        cur_edge = m_vecEdgeVector[cured_index];
-        //GraphEdgeInfo* new_edge;
+        cur_edge = &m_vecEdgeVector[cured_index];
 
-        if(cur_pos.second.second)      // explore edges connected to end node
-        {
+        if(cur_pos.second.second) {
+            // explore edges connected to end node
             cur_node = cur_edge->m_lEndNode;
             if(cur_edge->m_dCost < 0.0)
                 continue;
             if(cur_node == end_vertex)
                 break;
             explore(cur_node, *cur_edge, true, cur_edge->m_vecEndConnedtedEdge, que);
-        }
-        else        // explore edges connected to start node
-        {
+        } else {
+            // explore edges connected to start node
             cur_node = cur_edge->m_lStartNode;
             if(cur_edge->m_dReverseCost < 0.0)
                 continue;
@@ -654,29 +427,22 @@ int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int st
             explore(cur_node, *cur_edge, false, cur_edge->m_vecStartConnectedEdge, que);
         }
     }
-    if(cur_node != end_vertex)
-    {
-        if(m_lStartEdgeId == m_lEndEdgeId)
-        {
-            if(get_single_cost(1000.0, path, path_count))
-            {
+    if(cur_node != end_vertex) {
+        if(m_lStartEdgeId == m_lEndEdgeId) {
+            if(get_single_cost(1000.0, path, path_count)) {
                 return 0;
             }
         }
-        *err_msg = (char *)"Path Not Found";
-        deleteall();
-        return -1;
-    }
-    else
-    {
+        log << "Path Not Found";
+        *path=NULL;
+        path_count=0;
+        return 0;
+    } else {
         double total_cost;
-        if(cur_node == cur_edge->m_lStartNode)
-        {
+        if(cur_node == cur_edge->m_lStartNode) {
             total_cost = m_dCost[cur_edge->m_lEdgeIndex].startCost;
             construct_path(cur_edge->m_lEdgeIndex, 1);
-        }
-        else
-        {
+        } else {
             total_cost = m_dCost[cur_edge->m_lEdgeIndex].endCost;
             construct_path(cur_edge->m_lEdgeIndex, 0);
         }
@@ -693,11 +459,11 @@ int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int st
                 return 0;
             }
         }
-        
+
         *path = (path_element_t *) malloc(sizeof(path_element_t) * (m_vecPath.size() + 1));
         *path_count = m_vecPath.size();
 
-        for(int i = 0; i < *path_count; i++)
+        for(size_t i = 0; i < *path_count; i++)
         {
             (*path)[i].vertex_id = m_vecPath[i].vertex_id;
             (*path)[i].edge_id = m_vecPath[i].edge_id;
@@ -714,15 +480,14 @@ int GraphDefinition:: my_dijkstra(edge_t *edges, unsigned int edge_count, int st
             (*path)[*path_count - 1].edge_id = m_lEndEdgeId;
         }
     }
-    deleteall();
     return 0;
 }
 
 
 // -------------------------------------------------------------------------
-bool GraphDefinition::get_single_cost(double total_cost, path_element_t **path, int *path_count)
+bool GraphDefinition::get_single_cost(double total_cost, path_element_t **path, size_t *path_count)
 {
-    GraphEdgeInfo* start_edge_info = m_vecEdgeVector[m_mapEdgeId2Index[m_lStartEdgeId]];
+    GraphEdgeInfo *start_edge_info = &m_vecEdgeVector[m_mapEdgeId2Index[m_lStartEdgeId]];
     if(m_dEndPart >= m_dStartpart)
     {
         if(start_edge_info->m_dCost >= 0.0 && start_edge_info->m_dCost * (m_dEndPart - m_dStartpart) <= total_cost)
@@ -750,27 +515,51 @@ bool GraphDefinition::get_single_cost(double total_cost, path_element_t **path,
         }
     }
     return false;
-    
+
 }
 
 
 // -------------------------------------------------------------------------
-bool GraphDefinition::construct_graph(edge_t* edges, int edge_count, bool has_reverse_cost, bool directed)
-{
-    int i;
-    for(i = 0; i < edge_count; i++)
-    {
-        if(!has_reverse_cost)
-        {
-        if(directed)
-        {
+bool GraphDefinition::construct_graph(edge_t* edges, bool has_reverse_cost, bool directed) {
+    unsigned int i;
+    for(i = 0; i < m_edge_count; i++) {
+
+        /*
+         *  has_reverse_cost but cost is negative
+         *    - flip the record
+         *    - After this: cost is positive unless reverse_cost was also negative
+         */
+        if (has_reverse_cost) {
+            if (edges[i].cost < 0) {
+                auto tmp_v = edges[i].source;
+                edges[i].source = edges[i].target;
+                edges[i].target = tmp_v;
+                edges[i].cost = edges[i].reverse_cost;
+                edges[i].reverse_cost = -1.0;
+            }
+        }
+
+        /*
+         * all data in the reverse_cost column must be ignored
+         */
+        if (!has_reverse_cost) {
             edges[i].reverse_cost = -1.0;
         }
-        else
-        {
+
+        /* 
+         * when the graph is undirected:
+         * both colummns must have the same smallest positive value
+         */
+        if (!directed && !has_reverse_cost) {
             edges[i].reverse_cost = edges[i].cost;
+        } else if (!directed && has_reverse_cost) {
+            if (edges[i].reverse_cost < 0) {
+                edges[i].reverse_cost = edges[i].cost;
+            } else {
+                edges[i].reverse_cost = std::min(edges[i].reverse_cost, edges[i].cost);
+            }
         }
-        }
+
         addEdge(edges[i]);
     }
     m_bIsGraphConstructed = true;
@@ -824,30 +613,26 @@ bool GraphDefinition::addEdge(edge_t edgeIn)
     if(itMap != m_mapEdgeId2Index.end())    
         return false;
 
-    
-    GraphEdgeInfo* newEdge = new GraphEdgeInfo();
-    newEdge->m_vecStartConnectedEdge.clear();
-    newEdge->m_vecEndConnedtedEdge.clear();
-    newEdge->m_vecRestrictedEdge.clear();
-    newEdge->m_lEdgeID = edgeIn.id;
-    newEdge->m_lEdgeIndex = m_vecEdgeVector.size();    
-    newEdge->m_lStartNode = edgeIn.source;
-    newEdge->m_lEndNode = edgeIn.target;
-    newEdge->m_dCost = edgeIn.cost;
-    newEdge->m_dReverseCost = edgeIn.reverse_cost;
-
-    if(edgeIn.id > max_edge_id)
-    {
+
+    GraphEdgeInfo newEdge(edgeIn.id, m_vecEdgeVector.size(),
+            edgeIn.source, edgeIn.target,edgeIn.cost, edgeIn.reverse_cost);
+    newEdge.m_vecStartConnectedEdge.clear();
+    newEdge.m_vecEndConnedtedEdge.clear();
+    newEdge.m_vecRestrictedEdge.clear();
+    newEdge.m_lEdgeID = edgeIn.id;
+    newEdge.m_lEdgeIndex = m_vecEdgeVector.size();    
+    newEdge.m_lStartNode = edgeIn.source;
+    newEdge.m_lEndNode = edgeIn.target;
+    newEdge.m_dCost = edgeIn.cost;
+    newEdge.m_dReverseCost = edgeIn.reverse_cost;
+    if(edgeIn.id > max_edge_id) {
         max_edge_id = edgeIn.id;
     }
 
-    if(newEdge->m_lStartNode > max_node_id)
-    {
-        max_node_id = newEdge->m_lStartNode;
+    if(newEdge.m_lStartNode > max_node_id) { max_node_id = newEdge.m_lStartNode;
     }
-    if(newEdge->m_lEndNode > max_node_id)
-    {
-        max_node_id = newEdge->m_lEndNode;
+
+    if(newEdge.m_lEndNode > max_node_id) { max_node_id = newEdge.m_lEndNode;
     }
 
     //Searching the start node for connectivity
@@ -861,7 +646,7 @@ bool GraphDefinition::addEdge(edge_t edgeIn)
         for(lEdgeIndex = 0; lEdgeIndex < lEdgeCount; lEdgeIndex++)
         {
             long lEdge = itNodeMap->second.at(lEdgeIndex);    
-            connectEdge(*newEdge, *m_vecEdgeVector[lEdge], true);
+            connectEdge(newEdge, m_vecEdgeVector[lEdge], true);
         }
     }
 
@@ -877,19 +662,19 @@ bool GraphDefinition::addEdge(edge_t edgeIn)
         for(lEdgeIndex = 0; lEdgeIndex < lEdgeCount; lEdgeIndex++)
         {
             long lEdge = itNodeMap->second.at(lEdgeIndex);    
-            connectEdge(*newEdge, *m_vecEdgeVector[lEdge], false);
+            connectEdge(newEdge, m_vecEdgeVector[lEdge], false);
         }
     }
 
 
 
     //Add this node and edge into the data structure
-    m_mapNodeId2Edge[edgeIn.source].push_back(newEdge->m_lEdgeIndex);
-    m_mapNodeId2Edge[edgeIn.target].push_back(newEdge->m_lEdgeIndex);
+    m_mapNodeId2Edge[edgeIn.source].push_back(newEdge.m_lEdgeIndex);
+    m_mapNodeId2Edge[edgeIn.target].push_back(newEdge.m_lEdgeIndex);
 
 
     //Adding edge to the list
-    m_mapEdgeId2Index.insert(std::make_pair(newEdge->m_lEdgeID, m_vecEdgeVector.size()));
+    m_mapEdgeId2Index.insert(std::make_pair(newEdge.m_lEdgeID, m_vecEdgeVector.size()));
     m_vecEdgeVector.push_back(newEdge);
 
     //
diff --git a/src/trsp/src/GraphDefinition.h b/src/trsp/src/GraphDefinition.h
index 96fb156..3aad411 100644
--- a/src/trsp/src/GraphDefinition.h
+++ b/src/trsp/src/GraphDefinition.h
@@ -1,157 +1,160 @@
-#ifndef GRAPHDEFINITION_H
-#define GRAPHDEFINITION_H
-
-#include <vector>
-#include <map>
-#include <queue>
-#include <string>
-#include <stdlib.h>
-#include <iostream>
-
-#include "trsp.h"
-
-//using namespace std;
-
-typedef std::vector<long> LongVector;
-typedef std::vector<LongVector> VectorOfLongVector;
-typedef std::pair<int, bool> PIB;
-typedef std::pair<double, PIB> PDP;
-typedef std::pair<double, std::vector<int> > PDVI;
-
-/*
-typedef struct edge 
-{
-    int id;
-    int source;
-    int target;
-    double cost;
-    double reverse_cost;
-} edge_t;
-
-typedef struct path_element 
-{
-    int vertex_id;
-    int edge_id;
-    double cost;
-}path_element_t;
-*/
-
-typedef struct{
-    int ed_ind[2];
-    int v_pos[2];
-} PARENT_PATH;
-
-typedef struct{
-    double cost;
-    std::vector<int> precedencelist;
-} Rule;
-
-typedef struct{
-    double startCost, endCost;
-} CostHolder;
-
-typedef std::map<int, std::vector<Rule> > RuleTable;
-
-
-
-class GraphEdgeInfo
-{
-public:
-    long m_lEdgeID;
-    long m_lEdgeIndex;
-    short m_sDirection;
-    double m_dCost;
-    double m_dReverseCost;
-    LongVector m_vecStartConnectedEdge;
-    LongVector m_vecEndConnedtedEdge;
-    //LongVector m_vecConnectedNode;
-    bool m_bIsLeadingRestrictedEdge;
-    VectorOfLongVector m_vecRestrictedEdge;
-
-    long m_lStartNode;
-    long m_lEndNode;
-};
-
-
-
-
-typedef std::vector<GraphEdgeInfo*> GraphEdgeVector;
-typedef std::map<long,LongVector> Long2LongVectorMap;
-typedef std::map<long,long> Long2LongMap;
-
-
-
-
-class GraphDefinition
-{
-public:
-    GraphDefinition(void);
-    ~GraphDefinition(void);
-
-    int my_dijkstra(int start_vertex, int end_vertex,
-                    unsigned int edge_count, char** err_msg);
-
-    int my_dijkstra(edge_t *edges, unsigned int edge_count,
-                    int start_vertex, int end_vertex,
-                    bool directed, bool has_reverse_cost,
-                    path_element_t **path, int *path_count,
-                    char **err_msg);
-
-    int my_dijkstra(edge_t *edges, unsigned int edge_count,
-                    int start_vertex, int end_vertex,
-                    bool directed, bool has_reverse_cost,
-                    path_element_t **path, int *path_count,
-                    char **err_msg,
-                    std::vector<PDVI> &ruleList);
-
-    int my_dijkstra(edge_t *edges, unsigned int edge_count,
-                    int start_edge, double start_part,
-                    int end_edge, double end_part,
-                    bool directed, bool has_reverse_cost,
-                    path_element_t **path, int *path_count,
-                    char **err_msg,
-                    std::vector<PDVI> &ruleList);
-
-    int multi_dijkstra(edge_t *edges, unsigned int edge_count,
-                       std::vector<int> vertices,
-                       bool directed, bool has_reverse_cost,
-                       path_element_t **path, int *path_count,
-                       char **err_msg,
-                       std::vector<PDVI> &ruleList);
-
-    bool construct_graph(edge_t *edges, int edge_count,
-                         bool has_reverse_cost, bool directed);
-
-
-private:
-    double construct_path(int ed_id, int v_pos);
-    void explore(int cur_node, GraphEdgeInfo& cur_edge, bool isStart, LongVector &vecIndex, std::priority_queue<PDP, std::vector<PDP>, std::greater<PDP> > &que);
-    double getRestrictionCost(int cur_node, GraphEdgeInfo& new_edge, bool isStart);
-    bool addEdge(edge edgeIn);
-    bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo& secondEdge, bool bIsStartNodeSame);
-    bool get_single_cost(double total_cost, path_element_t **path, int *path_count);
-    void init();
-    void deleteall();
-
-private:
-    GraphEdgeVector m_vecEdgeVector;
-    Long2LongMap m_mapEdgeId2Index;
-    Long2LongVectorMap m_mapNodeId2Edge;
-    int max_node_id;
-    int max_edge_id;
-    int m_lStartEdgeId;
-    int m_lEndEdgeId;
-    double m_dStartpart;
-    double m_dEndPart;
-    bool isStartVirtual;
-    bool isEndVirtual;
-    
-    std::vector <path_element_t> m_vecPath;
-    PARENT_PATH *parent;
-    CostHolder *m_dCost;
-    RuleTable m_ruleTable;
-    bool m_bIsturnRestrictOn;
-    bool m_bIsGraphConstructed;
-};
-
-#endif
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+#ifndef GRAPHDEFINITION_H
+#define GRAPHDEFINITION_H
+
+#include <vector>
+#include <map>
+#include <queue>
+
+#include <sstream>
+#include "trsp.h"
+
+
+typedef std::pair<double, std::vector<int64_t> > PDVI;
+
+
+class GraphDefinition {
+    typedef std::vector<long> LongVector;
+    typedef std::vector<LongVector> VectorOfLongVector;
+    typedef std::pair<int, bool> PIB;
+    typedef std::pair<double, PIB> PDP;
+    typedef struct{
+        int64_t ed_ind[2];
+        int64_t v_pos[2];
+    } PARENT_PATH;
+
+    typedef struct{
+        double cost;
+        std::vector<int64_t> precedencelist;
+    } Rule;
+
+    typedef struct{
+        double startCost, endCost;
+    } CostHolder;
+
+    typedef std::map<int64_t, std::vector<Rule> > RuleTable;
+
+
+
+    class GraphEdgeInfo {
+     public:
+         GraphEdgeInfo() = default;
+         GraphEdgeInfo(int64_t eid, int64_t index, int64_t node1, int64_t node2, double cost, double reverse_cost) :
+             m_lEdgeID(eid), m_lEdgeIndex(index), m_lStartNode(node1), m_lEndNode(node2),
+             m_dCost(cost), m_dReverseCost(reverse_cost) {
+                 m_vecStartConnectedEdge.clear();
+                 m_vecEndConnedtedEdge.clear();
+                 m_vecRestrictedEdge.clear();
+             }
+
+
+     public:
+         long m_lEdgeID;
+         long m_lEdgeIndex;
+         long m_lStartNode;
+         long m_lEndNode;
+         double m_dCost;
+         double m_dReverseCost;
+         short m_sDirection;
+         LongVector m_vecStartConnectedEdge;
+         LongVector m_vecEndConnedtedEdge;
+         //LongVector m_vecConnectedNode;
+         bool m_bIsLeadingRestrictedEdge;
+         VectorOfLongVector m_vecRestrictedEdge;
+
+    };
+
+
+    typedef std::vector<GraphEdgeInfo> GraphEdgeVector;
+    typedef std::map<long,LongVector> Long2LongVectorMap;
+    typedef std::map<long,long> Long2LongMap;
+
+
+
+
+ public:
+    ~GraphDefinition(void);
+    GraphDefinition(
+            edge_t *edges,
+            unsigned int edge_count,
+            bool directed, 
+            bool has_rcost);
+
+
+    int my_dijkstra(
+            int64_t start_vertex, int64_t end_vertex,
+            path_element_t **path, size_t *path_count,
+            std::ostringstream &log);
+
+    void set_restrictions(
+            int64_t start_vertex,
+            int64_t end_vertex,
+            std::vector<PDVI> &ruleList);
+
+    void add_virtual_vertices(
+            int start_edge, double start_part,
+            int end_edge, double end_part,
+            int64_t &start_vertex, int64_t &end_vertex);
+
+
+    bool construct_graph(
+            edge_t *edges,
+            bool has_rcost,
+            bool directed);
+
+
+ private:
+    double construct_path(int64_t ed_id, int64_t v_pos);
+    void explore(int64_t cur_node, GraphEdgeInfo& cur_edge, bool isStart, LongVector &vecIndex, std::priority_queue<PDP, std::vector<PDP>, std::greater<PDP> > &que);
+    double getRestrictionCost(int64_t cur_node, GraphEdgeInfo &new_edge, bool isStart);
+    bool addEdge(edge_t edgeIn);
+    bool connectEdge(GraphEdgeInfo& firstEdge, GraphEdgeInfo &secondEdge, bool bIsStartNodeSame);
+    bool get_single_cost(double total_cost, path_element_t **path, size_t *path_count);
+    void init();
+    void deleteall();
+
+ private:
+    GraphEdgeVector m_vecEdgeVector;
+    Long2LongMap m_mapEdgeId2Index;
+    Long2LongVectorMap m_mapNodeId2Edge;
+    int64_t max_node_id;
+    int64_t max_edge_id;
+    int m_lStartEdgeId;
+    int m_lEndEdgeId;
+    double m_dStartpart;
+    double m_dEndPart;
+    bool isStartVirtual;
+    bool isEndVirtual;
+
+    unsigned int m_edge_count;
+
+    std::vector <path_element_t> m_vecPath;
+    std::vector < PARENT_PATH > parent;
+    std::vector < CostHolder > m_dCost;
+    RuleTable m_ruleTable;
+    bool m_bIsturnRestrictOn;
+    bool m_bIsGraphConstructed;
+};
+
+#endif
diff --git a/src/trsp/src/trsp.c b/src/trsp/src/trsp.c
index 3f2c62f..6b14f12 100644
--- a/src/trsp/src/trsp.c
+++ b/src/trsp/src/trsp.c
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #include "postgres.h"
 #include "executor/spi.h"
 #include "funcapi.h"
@@ -12,825 +34,462 @@
 Datum turn_restrict_shortest_path_vertex(PG_FUNCTION_ARGS);
 Datum turn_restrict_shortest_path_edge(PG_FUNCTION_ARGS);
 
-#undef DEBUG
-//#define DEBUG 1
+// #define DEBUG 
+#include "../../common/src/debug_macro.h"
+#include "../../common/src/pgr_types.h"
+#include "../../common/src/postgres_connection.h"
+#include "../../common/src/edges_input.h"
+#include "../../common/src/restrictions_input.h"
 
+
+static int compute_trsp(
+        char* edges_sql,
+        int dovertex,
+        int start_id,
+        double start_pos,
+        int end_id,
+        double end_pos,
+        bool directed, 
+        bool has_reverse_cost,
+        char *restrict_sql,
+        path_element_t **path,
+        size_t *path_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load edges");
+    pgr_edge_t *edges = NULL;
+    size_t total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+    PGR_DBG("Total %ld edges", total_tuples);
+
+    PGR_DBG("Load restrictions");
+    restrict_t *restricts = NULL;
+    size_t total_restrict_tuples = 0;
+    if (restrict_sql == NULL) {
+        PGR_DBG("Sql for restrictions is null.");
+    } else {
+        pgr_get_restriction_data(restrict_sql, &restricts, &total_restrict_tuples);
+    }
 #ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
+    int t1;
+    for (t1=0; t1<total_restrict_tuples; t1++) {
+        PGR_DBG("restricts: %.2f, %ld, %ld, %ld, %ld, %ld, %ld", restricts[t1].to_cost,
+                restricts[t1].target_id, restricts[t1].via[0], restricts[t1].via[1], restricts[t1].via[2], restricts[t1].via[3], restricts[t1].via[4]);
+    }
 #endif
+    PGR_DBG("Total %ld restriction", total_restrict_tuples);
 
-// The number of tuples to fetch from the SPI cursor at each iteration
-#define TUPLIMIT 1000
 
-//#ifdef PG_MODULE_MAGIC
-//PG_MODULE_MAGIC;
-//#endif
 
-typedef struct edge_columns
-{
-  int id;
-  int source;
-  int target;
-  int cost;
-  int reverse_cost;
-} edge_columns_t;
-
-typedef struct restrict_columns
-{
-  int target_id;
-  int via_path;
-  int to_cost;
-} restrict_columns_t;
-
-
-
-static char *
-text2char(text *in)
-{
-  char *out = palloc(VARSIZE(in));
+    int v_max_id=0;
+    int v_min_id=INT_MAX;
 
-  memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-  out[VARSIZE(in) - VARHDRSZ] = '\0';
-  return out;
-}
+    /* track if start and end are both in edge tuples */
+    int s_count = 0;
+    int t_count = 0;
 
-static int
-finish(int code, int ret)
-{
-  DBG("In finish, trying to disconnect from spi %d",ret);
-  code = SPI_finish();
-  if (code  != SPI_OK_FINISH )
-  {
-    elog(ERROR,"couldn't disconnect from SPI");
-    return -1 ;
-  }			
-  return ret;
-}
-
-/*
- * This function fetches the resturction columns from an SPITupleTable..
- *
-*/
-static int
-fetch_restrict_columns(SPITupleTable *tuptable,
-                       restrict_columns_t *restrict_columns)
-{
-  restrict_columns->target_id = SPI_fnumber(SPI_tuptable->tupdesc, "target_id");
-  restrict_columns->via_path = SPI_fnumber(SPI_tuptable->tupdesc, "via_path");
-  restrict_columns->to_cost =  SPI_fnumber(SPI_tuptable->tupdesc, "to_cost");
-  if (restrict_columns->target_id == SPI_ERROR_NOATTRIBUTE ||
-      restrict_columns->via_path == SPI_ERROR_NOATTRIBUTE ||
-      restrict_columns->to_cost == SPI_ERROR_NOATTRIBUTE) {
-    elog(ERROR, "Error, restriction query must return columns "
-        "'target_id', 'via_path' and 'to_cost'");
-    return -1;
-  }
-
-  if (SPI_gettypeid(SPI_tuptable->tupdesc, restrict_columns->target_id) != INT4OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, restrict_columns->via_path) != TEXTOID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, restrict_columns->to_cost) != FLOAT8OID) {
-    elog(ERROR, "Error, restriction columns 'target_id' must be of type int4, 'via_path' must be of type text, 'to_cost' must be of type float8");
-    return -1;
-  }
-
-  return 0;
-}
+    char *err_msg;
+    int ret = -1;
+    register int z;
 
-/*
- * This function fetches the edge columns from the SPITupleTable.
- * 
-*/ 
-static int
-fetch_edge_columns(SPITupleTable *tuptable, edge_columns_t *edge_columns, 
-                   bool has_reverse_cost)
-{
-  edge_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
-  edge_columns->source = SPI_fnumber(SPI_tuptable->tupdesc, "source");
-  edge_columns->target = SPI_fnumber(SPI_tuptable->tupdesc, "target");
-  edge_columns->cost = SPI_fnumber(SPI_tuptable->tupdesc, "cost");
-  if (edge_columns->id == SPI_ERROR_NOATTRIBUTE ||
-      edge_columns->source == SPI_ERROR_NOATTRIBUTE ||
-      edge_columns->target == SPI_ERROR_NOATTRIBUTE ||
-      edge_columns->cost == SPI_ERROR_NOATTRIBUTE) 
-    {
-      elog(ERROR, "Error, query must return columns "
-           "'id', 'source', 'target' and 'cost'");
-      return -1;
-    }
+    PGR_DBG("start turn_restrict_shortest_path\n");
 
-  if (SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->source) != INT4OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->target) != INT4OID ||
-      SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->cost) != FLOAT8OID) 
-    {
-      elog(ERROR, "Error, columns 'source', 'target' must be of type int4, 'cost' must be of type float8");
-      return -1;
+    if (start_id == end_id) {
+        PGR_DBG("Starting vertex and Ending Vertex are equal");
+        *path = NULL;
+        return 0;
     }
 
-  DBG("columns: id %i source %i target %i cost %i", 
-      edge_columns->id, edge_columns->source, 
-      edge_columns->target, edge_columns->cost);
 
-  if (has_reverse_cost)
-    {
-      edge_columns->reverse_cost = SPI_fnumber(SPI_tuptable->tupdesc, 
-                                               "reverse_cost");
+    //defining min and max vertex id
 
-      if (edge_columns->reverse_cost == SPI_ERROR_NOATTRIBUTE) 
-        {
-          elog(ERROR, "Error, reverse_cost is used, but query did't return "
-               "'reverse_cost' column");
-          return -1;
-        }
+    PGR_DBG("Total %i edge tuples", total_tuples);
 
-      if (SPI_gettypeid(SPI_tuptable->tupdesc, edge_columns->reverse_cost) 
-          != FLOAT8OID) 
-        {
-          elog(ERROR, "Error, columns 'reverse_cost' must be of type float8");
-          return -1;
-        }
+    for(z=0; z<total_tuples; z++) {
+        if(edges[z].source<v_min_id)
+            v_min_id=(int)edges[z].source;
 
-      DBG("columns: reverse_cost cost %i", edge_columns->reverse_cost);
-    }
-    
-  return 0;
-}
-
-/*
- * To fetch a edge from Tuple.
- * 
- */
- 
-static void
-fetch_edge(HeapTuple *tuple, TupleDesc *tupdesc, 
-           edge_columns_t *edge_columns, edge_t *target_edge)
-{
-  Datum binval;
-  bool isnull;
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->id, &isnull);
-  if (isnull)
-    elog(ERROR, "id contains a null value");
-  target_edge->id = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->source, &isnull);
-  if (isnull)
-    elog(ERROR, "source contains a null value");
-  target_edge->source = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->target, &isnull);
-  if (isnull)
-    elog(ERROR, "target contains a null value");
-  target_edge->target = DatumGetInt32(binval);
-
-  binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->cost, &isnull);
-  if (isnull)
-    elog(ERROR, "cost contains a null value");
-  target_edge->cost = DatumGetFloat8(binval);
-
-  if (edge_columns->reverse_cost != -1) 
-    {
-      binval = SPI_getbinval(*tuple, *tupdesc, edge_columns->reverse_cost, 
-                             &isnull);
-      if (isnull)
-        elog(ERROR, "reverse_cost contains a null value");
-      target_edge->reverse_cost =  DatumGetFloat8(binval);
-    }
-
-  /*
-  DBG("edge: %i, %i, %i, %f, %f", target_edge->id, target_edge->source,
-    target_edge->target, target_edge->cost, target_edge->reverse_cost);
-  */
-}
+        if(edges[z].source>v_max_id)
+            v_max_id=(int)edges[z].source;
 
+        if(edges[z].target<v_min_id)
+            v_min_id=(int)edges[z].target;
 
-/*
- * To fetch a edge from Tuple.
- * 
- */
- 
-static void
-fetch_restrict(HeapTuple *tuple, TupleDesc *tupdesc, 
-           restrict_columns_t *restrict_columns, restrict_t *rest)
-{
-  Datum binval;
-  bool isnull;
-  int t;
+        if(edges[z].target>v_max_id)
+            v_max_id=(int)edges[z].target;      
 
-  for(t=0; t<MAX_RULE_LENGTH;++t)
-    rest->via[t] = -1;
+        //PGR_DBG("%i <-> %i", v_min_id, v_max_id);
 
-  binval = SPI_getbinval(*tuple, *tupdesc, restrict_columns->target_id, &isnull);
-  if (isnull)
-    elog(ERROR, "target_id contains a null value");
-  rest->target_id = DatumGetInt32(binval);
+    }
 
-  binval = SPI_getbinval(*tuple, *tupdesc, restrict_columns->to_cost, &isnull);
-  if (isnull)
-    elog(ERROR, "to_cost contains a null value");
-  rest->to_cost = DatumGetFloat8(binval);
-  char *str = DatumGetCString(SPI_getvalue(*tuple, *tupdesc, restrict_columns->via_path));
+    //::::::::::::::::::::::::::::::::::::  
+    //:: reducing vertex id (renumbering)
+    //::::::::::::::::::::::::::::::::::::
+    for(z=0; z<total_tuples; z++) {
+        //check if edges[] contains source and target
+        if (dovertex) {
+            if(edges[z].source == start_id || edges[z].target == start_id)
+                ++s_count;
+            if(edges[z].source == end_id || edges[z].target == end_id)
+                ++t_count;
+        }
+        else {
+            if(edges[z].id == start_id)
+                ++s_count;
+            if(edges[z].id == end_id)
+                ++t_count;
+        }
 
-  //DBG("restriction: %f, %i, %s", rest->to_cost, rest->target_id, str);
+        edges[z].source-=v_min_id;
+        edges[z].target-=v_min_id;
+        edges[z].cost = edges[z].cost;
+        //PGR_DBG("edgeID: %i SRc:%i - %i, cost: %f", edges[z].id,edges[z].source, edges[z].target,edges[z].cost);      
 
-  if (str != NULL) {
-    char* pch = NULL;
-    int ci = 0;
+    }
 
-    pch = (char *)strtok (str," ,");
+    PGR_DBG("Min vertex id: %i , Max vid: %i",v_min_id,v_max_id);
+    PGR_DBG("Total %ld edge tuples", total_tuples);
 
-    while (pch != NULL && ci < MAX_RULE_LENGTH)
-    {
-      rest->via[ci] = atoi(pch);
-      //DBG("    rest->via[%i]=%i", ci, rest->via[ci]);
-      ci++;
-      pch = (char *)strtok (NULL, " ,");
+    if(s_count == 0) {
+        elog(ERROR, "Start id was not found.");
+        return -1;
     }
-  }
-
-}
 
+    if(t_count == 0) {
+        elog(ERROR, "Target id was not found.");
+        return -1;
+    }
 
+    if (dovertex) {
+        start_id -= v_min_id;
+        end_id   -= v_min_id;
+    }
 
-static int compute_trsp(
-    char* sql,
-    int dovertex,
-    int start_id,
-    double start_pos,
-    int end_id,
-    double end_pos,
-    bool directed, 
-    bool has_reverse_cost,
-    char* restrict_sql,
-    path_element_t **path,
-    int *path_count) 
-{
 
-  int SPIcode;
-  SPIPlanPtr SPIplan;
-  Portal SPIportal;
-  bool moredata = TRUE;
-  int ntuples;
-
-  edge_t *edges = NULL;
-  int total_tuples = 0;
-#ifndef _MSC_VER
-  edge_columns_t edge_columns = {.id= -1, .source= -1, .target= -1, 
-                                 .cost= -1, .reverse_cost= -1};
-#else // _MSC_VER
-  edge_columns_t edge_columns = {-1, -1, -1, -1, -1};
-#endif //_MSC_VER
-  restrict_t *restricts = NULL;
-  int total_restrict_tuples = 0;
-  restrict_columns_t restrict_columns = {.target_id= -1, .via_path= -1,
-                                 .to_cost= -1};
-  int v_max_id=0;
-  int v_min_id=INT_MAX;
-
-  /* track if start and end are both in edge tuples */
-  int s_count = 0;
-  int t_count = 0;
-
-  char *err_msg;
-  int ret = -1;
-  register int z;
-
-  DBG("start turn_restrict_shortest_path\n");
-        
-  SPIcode = SPI_connect();
-  if (SPIcode  != SPI_OK_CONNECT) {
-      elog(ERROR, "turn_restrict_shortest_path: couldn't open a connection to SPI");
-      return -1;
-  }
-
-  SPIplan = SPI_prepare(sql, 0, NULL);
-  if (SPIplan  == NULL) {
-      elog(ERROR, "turn_restrict_shortest_path: couldn't create query plan via SPI");
-      return -1;
-  }
-
-  if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-      elog(ERROR, "turn_restrict_shortest_path: SPI_cursor_open('%s') returns NULL", sql);
-      return -1;
-  }
-
-  while (moredata == TRUE) {
-      //DBG("calling SPI_cursor_fetch");
-      SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-      if (SPI_tuptable == NULL) {
-          elog(ERROR, "SPI_tuptable is NULL");
-          return finish(SPIcode, -1);
-      }
-
-      if (edge_columns.id == -1) {
-          if (fetch_edge_columns(SPI_tuptable, &edge_columns, 
-                                 has_reverse_cost) == -1)
-	        return finish(SPIcode, ret);
-      }
-
-      ntuples = SPI_processed;
-
-      //DBG("Reading edges: %i - %i", total_tuples, total_tuples+ntuples);
-
-      total_tuples += ntuples;
-
-      if (ntuples > 0) {
-          if (!edges)
-            edges = palloc(total_tuples * sizeof(edge_t));
-          else
-            edges = repalloc(edges, total_tuples * sizeof(edge_t));
-
-          if (edges == NULL) {
-              elog(ERROR, "Out of memory");
-              return finish(SPIcode, ret);	  
-          }
-
-          int t;
-          SPITupleTable *tuptable = SPI_tuptable;
-          TupleDesc tupdesc = SPI_tuptable->tupdesc;
-                
-          for (t = 0; t < ntuples; t++) {
-              //if (t%100 == 0) { DBG("    t: %i", t); }
-              HeapTuple tuple = tuptable->vals[t];
-              fetch_edge(&tuple, &tupdesc, &edge_columns, 
-                         &edges[total_tuples - ntuples + t]);
-          }
-          //DBG("calling SPI_freetuptable");
-          SPI_freetuptable(tuptable);
-          //DBG("back from SPI_freetuptable");
-      } 
-      else {
-          moredata = FALSE;
-      }
-  }
-  SPI_cursor_close(SPIportal);
-
-  //defining min and max vertex id
-      
-  //DBG("Total %i edge tuples", total_tuples);
-    
-  for(z=0; z<total_tuples; z++) {
-    if(edges[z].source<v_min_id)
-      v_min_id=edges[z].source;
-  
-    if(edges[z].source>v_max_id)
-      v_max_id=edges[z].source;
-		            
-    if(edges[z].target<v_min_id)
-      v_min_id=edges[z].target;
-
-    if(edges[z].target>v_max_id)
-      v_max_id=edges[z].target;      
-								        
-    //DBG("%i <-> %i", v_min_id, v_max_id);
-							
-  }
-	
-  //::::::::::::::::::::::::::::::::::::  
-  //:: reducing vertex id (renumbering)
-  //::::::::::::::::::::::::::::::::::::
-  for(z=0; z<total_tuples; z++) {
-    //check if edges[] contains source and target
     if (dovertex) {
-        if(edges[z].source == start_id || edges[z].target == start_id)
-          ++s_count;
-        if(edges[z].source == end_id || edges[z].target == end_id)
-          ++t_count;
+        PGR_DBG("Calling trsp_node_wrapper\n");
+        ret = trsp_node_wrapper(edges, total_tuples, 
+                restricts, total_restrict_tuples,
+                start_id, end_id,
+                directed, has_reverse_cost,
+                path, path_count, &err_msg);
     }
     else {
-        if(edges[z].id == start_id)
-          ++s_count;
-        if(edges[z].id == end_id)
-          ++t_count;
+        PGR_DBG("Calling trsp_edge_wrapper\n");
+        ret = trsp_edge_wrapper(edges, total_tuples, 
+                restricts, total_restrict_tuples,
+                start_id, start_pos, end_id, end_pos,
+                directed, has_reverse_cost,
+                path, path_count, &err_msg);
     }
 
-    edges[z].source-=v_min_id;
-    edges[z].target-=v_min_id;
-    edges[z].cost = edges[z].cost;
-    //DBG("edgeID: %i SRc:%i - %i, cost: %f", edges[z].id,edges[z].source, edges[z].target,edges[z].cost);      
-    
-  }
-
-  DBG("Min vertex id: %i , Max vid: %i",v_min_id,v_max_id);
-  DBG("Total %i edge tuples", total_tuples);
-
-  if(s_count == 0) {
-    elog(ERROR, "Start id was not found.");
-    return -1;
-  }
-      
-  if(t_count == 0) {
-    elog(ERROR, "Target id was not found.");
-    return -1;
-  }
-  
-  if (dovertex) {
-      start_id -= v_min_id;
-      end_id   -= v_min_id;
-  }
-  
-  DBG("Fetching restriction tuples\n");
-        
-  if (restrict_sql == NULL) {
-      DBG("Sql for restrictions is null.");
-  }
-  else {
-      SPIplan = SPI_prepare(restrict_sql, 0, NULL);
-      if (SPIplan  == NULL) {
-          elog(ERROR, "turn_restrict_shortest_path: couldn't create query plan via SPI");
-          return -1;
-      }
-
-      if ((SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL) {
-          elog(ERROR, "turn_restrict_shortest_path: SPI_cursor_open('%s') returns NULL", restrict_sql);
-          return -1;
-      }
-
-      moredata = TRUE;
-      while (moredata == TRUE) {
-          SPI_cursor_fetch(SPIportal, TRUE, TUPLIMIT);
-
-          if (restrict_columns.target_id == -1) {
-              if (fetch_restrict_columns(SPI_tuptable, &restrict_columns) == -1) {
-                DBG("fetch_restrict_columns failed!");
-                return finish(SPIcode, ret);
-              }
-          }
-
-          ntuples = SPI_processed;
-          total_restrict_tuples += ntuples;
-
-          //DBG("Reading Restrictions: %i", total_restrict_tuples);
-
-          if (ntuples > 0) {
-              if (!restricts)
-                restricts = palloc(total_restrict_tuples * sizeof(restrict_t));
-              else
-                restricts = repalloc(restricts, total_restrict_tuples * sizeof(restrict_t));
-
-              if (restricts == NULL) {
-                  elog(ERROR, "Out of memory");
-                  return finish(SPIcode, ret);
-              }
-
-              int t;
-              SPITupleTable *tuptable = SPI_tuptable;
-              TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-              for (t = 0; t < ntuples; t++) {
-                  HeapTuple tuple = tuptable->vals[t];
-                  fetch_restrict(&tuple, &tupdesc, &restrict_columns,
-                             &restricts[total_restrict_tuples - ntuples + t]);
-              }
-              SPI_freetuptable(tuptable);
-          }
-          else {
-              moredata = FALSE;
-          }
-      }
-      SPI_cursor_close(SPIportal);
-
-  }
-
-#ifdef DEBUG_OFF
-    int t;
-    for (t=0; t<total_restrict_tuples; t++) {
-        DBG("restricts: %.2f, %i, %i, %i, %i, %i, %i", restricts[t].to_cost, restricts[t].target_id, restricts[t].via[0], restricts[t].via[1], restricts[t].via[2], restricts[t].via[3], restricts[t].via[4]);
+    PGR_DBG("Message received from inside:");
+    PGR_DBG("%s",err_msg);
+
+    //PGR_DBG("SIZE %i\n",*path_count);
+
+    //::::::::::::::::::::::::::::::::
+    //:: restoring original vertex id
+    //::::::::::::::::::::::::::::::::
+    for(z=0;z<*path_count;z++) {
+        //PGR_DBG("vetex %i\n",(*path)[z].vertex_id);
+        if (z || (*path)[z].vertex_id != -1)
+            (*path)[z].vertex_id+=v_min_id;
     }
-#endif
 
-  DBG("Total %i restriction tuples", total_restrict_tuples);
-
-  if (dovertex) {
-      DBG("Calling trsp_node_wrapper\n");
-      /** hack always returns 0 -1 when installed on EDB VC++ 64-bit without this **/
-      #if defined(__MINGW64__) 
-        elog(NOTICE,"Calling trsp_node_wrapper\n");
-      #endif
-      ret = trsp_node_wrapper(edges, total_tuples, 
-                        restricts, total_restrict_tuples,
-                        start_id, end_id,
-                        directed, has_reverse_cost,
-                        path, path_count, &err_msg);
-  }
-  else {
-      DBG("Calling trsp_edge_wrapper\n");
-      ret = trsp_edge_wrapper(edges, total_tuples, 
-                        restricts, total_restrict_tuples,
-                        start_id, start_pos, end_id, end_pos,
-                        directed, has_reverse_cost,
-                        path, path_count, &err_msg);
-  }
-
-  DBG("Message received from inside:");
-  DBG("%s",err_msg);
-
-  //DBG("SIZE %i\n",*path_count);
-
-  //::::::::::::::::::::::::::::::::
-  //:: restoring original vertex id
-  //::::::::::::::::::::::::::::::::
-  for(z=0;z<*path_count;z++) {
-    //DBG("vetex %i\n",(*path)[z].vertex_id);
-    if (z || (*path)[z].vertex_id != -1)
-        (*path)[z].vertex_id+=v_min_id;
-  }
-
-  DBG("ret = %i\n", ret);
-
-  DBG("*path_count = %i\n", *path_count);
-
-  if (ret < 0)
+    PGR_DBG("ret = %i\n", ret);
+
+    PGR_DBG("*path_count = %i\n", *path_count);
+
+    if (ret < 0)
     {
-      //elog(ERROR, "Error computing path: %s", err_msg);
-      ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), 
-        errmsg("Error computing path: %s", err_msg)));
+        //elog(ERROR, "Error computing path: %s", err_msg);
+        ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), 
+                    errmsg("Error computing path: %s", err_msg)));
     } 
-    
-  return finish(SPIcode, ret);
+
+    pgr_SPI_finish();
+    return 0;
 }
 
 
 
 PG_FUNCTION_INFO_V1(turn_restrict_shortest_path_vertex);
-Datum
+    Datum
 turn_restrict_shortest_path_vertex(PG_FUNCTION_ARGS)
 {
-	
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  path_element_t      *path;
-  char *               sql;
 
+    FuncCallContext     *funcctx;
+    uint32_t                  call_cntr;
+    uint32_t                  max_calls;
+    TupleDesc            tuple_desc;
+    path_element_t      *path;
+    char *               sql;
 
-  // stuff done only on the first call of the function 
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
 
-      int ret = -1;
-      if (ret == -1) {}; // to avoid warning set but not used
+    // stuff done only on the first call of the function 
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        size_t path_count = 0;
 
-      int i;
+        int ret = -1;
+        if (ret == -1) {}; // to avoid warning set but not used
 
-      // create a function context for cross-call persistence
-      funcctx = SRF_FIRSTCALL_INIT();
+        int i;
 
-      // switch to memory context appropriate for multiple function calls
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+        // create a function context for cross-call persistence
+        funcctx = SRF_FIRSTCALL_INIT();
 
-      // verify that the first 5 args are not NULL
-      for (i=0; i<5; i++)
-        if(PG_ARGISNULL(i)) {
-            elog(ERROR, "turn_restrict_shortest_path(): Argument %i may not be NULL", i+1);
-        }
-      
-      if (PG_ARGISNULL(5))
-        sql = NULL;
-      else {
-        sql = text2char(PG_GETARG_TEXT_P(5));
-        if (strlen(sql) == 0)
+        // switch to memory context appropriate for multiple function calls
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+        // verify that the first 5 args are not NULL
+        for (i=0; i<5; i++)
+            if(PG_ARGISNULL(i)) {
+                elog(ERROR, "turn_restrict_shortest_path(): Argument %i may not be NULL", i+1);
+            }
+
+        if (PG_ARGISNULL(5))
             sql = NULL;
-      }
+        else {
+            sql = pgr_text2char(PG_GETARG_TEXT_P(5));
+            if (strlen(sql) == 0)
+                sql = NULL;
+        }
 
-	  DBG("Calling compute_trsp");
+        PGR_DBG("Calling compute_trsp");
 
 
-      ret =
+        ret =
 
- compute_trsp(text2char(PG_GETARG_TEXT_P(0)),
-                                   1, // do vertex
-                                   PG_GETARG_INT32(1),
-                                   0.5,
-                                   PG_GETARG_INT32(2),
-                                   0.5,
-                                   PG_GETARG_BOOL(3),
-                                   PG_GETARG_BOOL(4), 
-                                   sql,
-                                   &path, &path_count);
+            compute_trsp(pgr_text2char(PG_GETARG_TEXT_P(0)),
+                    1, // do vertex
+                    PG_GETARG_INT32(1),
+                    0.5,
+                    PG_GETARG_INT32(2),
+                    0.5,
+                    PG_GETARG_BOOL(3),
+                    PG_GETARG_BOOL(4), 
+                    sql,
+                    &path, &path_count);
 #ifdef DEBUG
-	double total_cost = 0;
-      DBG("Ret is %i", ret);
-      if (ret >= 0) 
+        double total_cost = 0;
+        PGR_DBG("Ret is %i", ret);
+        if (ret >= 0) 
         {
-          int i;
-          for (i = 0; i < path_count; i++) 
+            int i;
+            for (i = 0; i < path_count; i++) 
             {
-         //     DBG("Step %i vertex_id  %i ", i, path[i].vertex_id);
-           //   DBG("        edge_id    %i ", path[i].edge_id);
-             // DBG("        cost       %f ", path[i].cost);
-              total_cost+=path[i].cost;
+                //     PGR_DBG("Step %i vertex_id  %i ", i, path[i].vertex_id);
+                //   PGR_DBG("        edge_id    %i ", path[i].edge_id);
+                // PGR_DBG("        cost       %f ", path[i].cost);
+                total_cost+=path[i].cost;
             }
         }
-        DBG("Total cost is: %f",total_cost);
+        PGR_DBG("Total cost is: %f",total_cost);
 #endif
 
-      // total number of tuples to be returned 
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = path;
+        // total number of tuples to be returned 
+        funcctx->max_calls = (uint32_t)path_count;
+        funcctx->user_fctx = path;
 
-      funcctx->tuple_desc = 
-        BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
+        funcctx->tuple_desc = 
+            BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
 
-      MemoryContextSwitchTo(oldcontext);
+        MemoryContextSwitchTo(oldcontext);
     }
 
-  // stuff done on every call of the function 
-  funcctx = SRF_PERCALL_SETUP();
+    // stuff done on every call of the function 
+    funcctx = SRF_PERCALL_SETUP();
 
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  path = (path_element_t*) funcctx->user_fctx;
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    path = (path_element_t*) funcctx->user_fctx;
 
-  if (call_cntr < max_calls)    // do when there is more left to send 
+    if (call_cntr < max_calls)    // do when there is more left to send 
     {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(4 * sizeof(Datum));
-      nulls = palloc(4 * sizeof(char));
-
-      values[0] = Int32GetDatum(call_cntr);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(path[call_cntr].vertex_id);
-      nulls[1] = ' ';
-      values[2] = Int32GetDatum(path[call_cntr].edge_id);
-      nulls[2] = ' ';
-      values[3] = Float8GetDatum(path[call_cntr].cost);
-      nulls[3] = ' ';
-		      
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      // make the tuple into a datum 
-      result = HeapTupleGetDatum(tuple);
-
-      // clean up (this is not really necessary) 
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
+        HeapTuple    tuple;
+        Datum        result;
+        Datum *values;
+        char* nulls;
+
+        values = palloc(4 * sizeof(Datum));
+        nulls = palloc(4 * sizeof(char));
+
+        values[0] = Int32GetDatum(call_cntr);
+        nulls[0] = ' ';
+        values[1] = Int32GetDatum(path[call_cntr].vertex_id);
+        nulls[1] = ' ';
+        values[2] = Int32GetDatum(path[call_cntr].edge_id);
+        nulls[2] = ' ';
+        values[3] = Float8GetDatum(path[call_cntr].cost);
+        nulls[3] = ' ';
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+
+        // make the tuple into a datum 
+        result = HeapTupleGetDatum(tuple);
+
+        // clean up (this is not really necessary) 
+        pfree(values);
+        pfree(nulls);
+
+        SRF_RETURN_NEXT(funcctx, result);
     }
-  else    // do when there is no more left 
+    else    // do when there is no more left 
     {
-      DBG("Going to free path");
-      if (path) free(path);
-      SRF_RETURN_DONE(funcctx);
+        PGR_DBG("Going to free path");
+        if (path) free(path);
+        SRF_RETURN_DONE(funcctx);
     }
 }
 
 PG_FUNCTION_INFO_V1(turn_restrict_shortest_path_edge);
-Datum
+    Datum
 turn_restrict_shortest_path_edge(PG_FUNCTION_ARGS)
 {
-	
-  FuncCallContext     *funcctx;
-  int                  call_cntr;
-  int                  max_calls;
-  TupleDesc            tuple_desc;
-  path_element_t      *path;
-  char *               sql;
-
-  // stuff done only on the first call of the function 
-  if (SRF_IS_FIRSTCALL()) {
-      MemoryContext   oldcontext;
-      int path_count = 0;
+
+    FuncCallContext     *funcctx;
+    uint32_t                  call_cntr;
+    uint32_t                  max_calls;
+    TupleDesc            tuple_desc;
+    path_element_t      *path;
+    char *               sql;
+
+    // stuff done only on the first call of the function 
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        size_t path_count = 0;
 #ifdef DEBUG
-      int ret = -1;
+        int ret = -1;
 #endif
-      int i;
-      double s_pos;
-      double e_pos;
+        int i;
+        double s_pos;
+        double e_pos;
+
+        // create a function context for cross-call persistence
+        funcctx = SRF_FIRSTCALL_INIT();
 
-      // create a function context for cross-call persistence
-      funcctx = SRF_FIRSTCALL_INIT();
+        // switch to memory context appropriate for multiple function calls
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+        // verify that the first 5 args are not NULL
+        for (i=0; i<7; i++) {
+            if(i==2 || i==4) continue;
+            if(PG_ARGISNULL(i)) {
+                elog(ERROR, "turn_restrict_shortest_path(): Argument %i may not be NULL", i+1);
+            }
+        }
 
-      // switch to memory context appropriate for multiple function calls
-      oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+        if (PG_ARGISNULL(2))
+            s_pos = 0.5;
+        else {
+            s_pos = PG_GETARG_FLOAT8(2);
+            if (s_pos < 0.0) s_pos = 0.5;
+            if (s_pos > 1.0) s_pos = 0.5;
+        }
 
-      // verify that the first 5 args are not NULL
-      for (i=0; i<7; i++) {
-        if(i==2 || i==4) continue;
-        if(PG_ARGISNULL(i)) {
-            elog(ERROR, "turn_restrict_shortest_path(): Argument %i may not be NULL", i+1);
+        if (PG_ARGISNULL(4))
+            e_pos = 0.5;
+        else {
+            e_pos = PG_GETARG_FLOAT8(4);
+            if (e_pos < 0.0) e_pos = 0.5;
+            if (e_pos > 1.0) e_pos = 0.5;
         }
-      }
-
-      if (PG_ARGISNULL(2))
-        s_pos = 0.5;
-      else {
-        s_pos = PG_GETARG_FLOAT8(2);
-        if (s_pos < 0.0) s_pos = 0.5;
-        if (s_pos > 1.0) s_pos = 0.5;
-      }
-      
-      if (PG_ARGISNULL(4))
-        e_pos = 0.5;
-      else {
-        e_pos = PG_GETARG_FLOAT8(4);
-        if (e_pos < 0.0) e_pos = 0.5;
-        if (e_pos > 1.0) e_pos = 0.5;
-      }
-      
-      if (PG_ARGISNULL(7))
-        sql = NULL;
-      else {
-        sql = text2char(PG_GETARG_TEXT_P(7));
-        if (strlen(sql) == 0)
+
+        if (PG_ARGISNULL(7))
             sql = NULL;
-      }
+        else {
+            sql = pgr_text2char(PG_GETARG_TEXT_P(7));
+            if (strlen(sql) == 0)
+                sql = NULL;
+        }
 
-	  DBG("Calling compute_trsp");
+        PGR_DBG("Calling compute_trsp");
 
 #ifdef DEBUG
-      ret =
+        ret =
 #endif
-         compute_trsp(text2char(PG_GETARG_TEXT_P(0)),
-                                   0,  //sdo edge
-                                   PG_GETARG_INT32(1),
-                                   s_pos,
-                                   PG_GETARG_INT32(3),
-                                   e_pos,
-                                   PG_GETARG_BOOL(5),
-                                   PG_GETARG_BOOL(6), 
-                                   sql,
-                                   &path, &path_count);
+            compute_trsp(pgr_text2char(PG_GETARG_TEXT_P(0)),
+                    0,  //sdo edge
+                    PG_GETARG_INT32(1),
+                    s_pos,
+                    PG_GETARG_INT32(3),
+                    e_pos,
+                    PG_GETARG_BOOL(5),
+                    PG_GETARG_BOOL(6), 
+                    sql,
+                    &path, &path_count);
 #ifdef DEBUG
-	double total_cost = 0;
-      DBG("Ret is %i", ret);
-      if (ret >= 0) 
+        double total_cost = 0;
+        PGR_DBG("Ret is %i", ret);
+        if (ret >= 0) 
         {
-          int i;
-          for (i = 0; i < path_count; i++) 
+            int i;
+            for (i = 0; i < path_count; i++) 
             {
-         //     DBG("Step %i vertex_id  %i ", i, path[i].vertex_id);
-           //   DBG("        edge_id    %i ", path[i].edge_id);
-             // DBG("        cost       %f ", path[i].cost);
-              total_cost+=path[i].cost;
+                //     PGR_DBG("Step %i vertex_id  %i ", i, path[i].vertex_id);
+                //   PGR_DBG("        edge_id    %i ", path[i].edge_id);
+                // PGR_DBG("        cost       %f ", path[i].cost);
+                total_cost+=path[i].cost;
             }
         }
-        DBG("Total cost is: %f",total_cost);
+        PGR_DBG("Total cost is: %f",total_cost);
 #endif
 
-      // total number of tuples to be returned 
-      funcctx->max_calls = path_count;
-      funcctx->user_fctx = path;
+        // total number of tuples to be returned 
+        funcctx->max_calls = (uint32_t)path_count;
+        funcctx->user_fctx = path;
 
-      funcctx->tuple_desc = 
-        BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
+        funcctx->tuple_desc = 
+            BlessTupleDesc(RelationNameGetTupleDesc("pgr_costResult"));
 
-      MemoryContextSwitchTo(oldcontext);
+        MemoryContextSwitchTo(oldcontext);
     }
 
-  // stuff done on every call of the function 
-  funcctx = SRF_PERCALL_SETUP();
+    // stuff done on every call of the function 
+    funcctx = SRF_PERCALL_SETUP();
 
-  call_cntr = funcctx->call_cntr;
-  max_calls = funcctx->max_calls;
-  tuple_desc = funcctx->tuple_desc;
-  path = (path_element_t*) funcctx->user_fctx;
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    path = (path_element_t*) funcctx->user_fctx;
 
-  if (call_cntr < max_calls)    // do when there is more left to send 
+    if (call_cntr < max_calls)    // do when there is more left to send 
     {
-      HeapTuple    tuple;
-      Datum        result;
-      Datum *values;
-      char* nulls;
-
-      values = palloc(4 * sizeof(Datum));
-      nulls = palloc(4 * sizeof(char));
-
-      values[0] = Int32GetDatum(call_cntr);
-      nulls[0] = ' ';
-      values[1] = Int32GetDatum(path[call_cntr].vertex_id);
-      nulls[1] = ' ';
-      values[2] = Int32GetDatum(path[call_cntr].edge_id);
-      nulls[2] = ' ';
-      values[3] = Float8GetDatum(path[call_cntr].cost);
-      nulls[3] = ' ';
-		      
-      tuple = heap_formtuple(tuple_desc, values, nulls);
-
-      // make the tuple into a datum 
-      result = HeapTupleGetDatum(tuple);
-
-      // clean up (this is not really necessary) 
-      pfree(values);
-      pfree(nulls);
-
-      SRF_RETURN_NEXT(funcctx, result);
+        HeapTuple    tuple;
+        Datum        result;
+        Datum *values;
+        char* nulls;
+
+        values = palloc(4 * sizeof(Datum));
+        nulls = palloc(4 * sizeof(char));
+
+        values[0] = Int32GetDatum(call_cntr);
+        nulls[0] = ' ';
+        values[1] = Int32GetDatum(path[call_cntr].vertex_id);
+        nulls[1] = ' ';
+        values[2] = Int32GetDatum(path[call_cntr].edge_id);
+        nulls[2] = ' ';
+        values[3] = Float8GetDatum(path[call_cntr].cost);
+        nulls[3] = ' ';
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+
+        // make the tuple into a datum 
+        result = HeapTupleGetDatum(tuple);
+
+        // clean up (this is not really necessary) 
+        pfree(values);
+        pfree(nulls);
+
+        SRF_RETURN_NEXT(funcctx, result);
     }
-  else    // do when there is no more left 
+    else    // do when there is no more left 
     {
-      DBG("Going to free path");
-      if (path) free(path);
-      SRF_RETURN_DONE(funcctx);
+        PGR_DBG("Going to free path");
+        if (path) free(path);
+        SRF_RETURN_DONE(funcctx);
     }
 }
diff --git a/src/trsp/src/trsp.h b/src/trsp/src/trsp.h
index 0948655..775c8e2 100644
--- a/src/trsp/src/trsp.h
+++ b/src/trsp/src/trsp.h
@@ -1,40 +1,35 @@
-/*
- * Shortest path with turn restrictions algorithm for PostgreSQL
- *
+/*PGR-GNU*****************************************************************
+
  * Copyright (c) 2011 Stephen Woodbridge
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
  
 #ifndef _TRSP_H
 #define _TRSP_H
 
 #define MAX_RULE_LENGTH 5
 
-#include "postgres.h"
-
-typedef struct edge
-{
-    int id;
-    int source;
-    int target;
-    float8 cost;
-    float8 reverse_cost;
-} edge_t;
+#include "../../common/src/pgr_types.h"
+typedef pgr_edge_t edge_t;
+typedef Restrict_t restrict_t;
 
+#if 0
 typedef struct restrict_struct
 {
 		int target_id;
@@ -42,50 +37,38 @@ typedef struct restrict_struct
         int via[MAX_RULE_LENGTH];
 } 
 restrict_t;
-
-typedef struct path_element 
-{
-    int vertex_id;
-    int edge_id;
-    float8 cost;
-} path_element_t;
+#endif
 
 #ifdef __cplusplus
-extern "C"
+extern "C" {
 #endif
 
 int trsp_node_wrapper(
-			edge_t *edges, 
-			unsigned int edge_count, 
-			restrict_t *restricts, 
-			int restrict_count,
+			edge_t *edges,         size_t edge_count, 
+			restrict_t *restricts, size_t restrict_count,
 			int start_vertex, 
 			int end_vertex,
 		    bool directed, 
 		    bool has_reverse_cost,
-            path_element_t **path, 
-            int *path_count, 
+            path_element_t **path, size_t *path_count, 
             char **err_msg
             );
 
-#ifdef __cplusplus
-extern "C"
-#endif
 
 int trsp_edge_wrapper(
-			edge_t *edges, 
-			unsigned int edge_count, 
-			restrict_t *restricts, 
-			int restrict_count,
+			edge_t *edges, size_t edge_count, 
+			restrict_t *restricts, size_t restrict_count,
 			int start_edge, 
             double start_pos,
 			int end_edge,
             double end_pos,
 		    bool directed, 
 		    bool has_reverse_cost,
-            path_element_t **path, 
-            int *path_count, 
+            path_element_t **path, size_t *path_count, 
             char **err_msg
             );
+#ifdef __cplusplus
+}
+#endif
 
 #endif
diff --git a/src/trsp/src/trsp_core.cpp b/src/trsp/src/trsp_core.cpp
index 21801c5..5677706 100644
--- a/src/trsp/src/trsp_core.cpp
+++ b/src/trsp/src/trsp_core.cpp
@@ -1,34 +1,54 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #ifdef __MINGW32__
 #include <winsock2.h>
 #include <windows.h>
 #endif
 
+#include <string.h>
+#include <sstream>
 #include "GraphDefinition.h"
-#include "utils.h"
 
 
 int trsp_node_wrapper(
-    edge_t *edges,
-    unsigned int edge_count,
-    restrict_t *restricts,
-    int restrict_count,
+    edge_t *edges,         size_t edge_count,
+    restrict_t *restricts, size_t restrict_count,
     int start_vertex,
     int end_vertex,
     bool directed,
     bool has_reverse_cost,
-    path_element_t **path,
-    int *path_count,
-    char **err_msg
-    )
-{
+    path_element_t **path, size_t *path_count,
+    char **err_msg) {
+
+    std::ostringstream log;
     try {
 
         std::vector<PDVI> ruleTable;
 
-        int i, j;
+        int j;
         ruleTable.clear();
-        for (i=0; i<restrict_count; i++) {
-            std::vector<int> seq;
+        for (size_t i=0; i<restrict_count; i++) {
+            std::vector<int64_t> seq;
             seq.clear();
             seq.push_back(restricts[i].target_id);
             for(j = 0; j<MAX_RULE_LENGTH && restricts[i].via[j]>-1; j++)
@@ -38,8 +58,9 @@ int trsp_node_wrapper(
             ruleTable.push_back(make_pair(restricts[i].to_cost, seq));
         }
 
-        GraphDefinition gdef;
-        int res = gdef.my_dijkstra(edges, edge_count, start_vertex, end_vertex, directed, has_reverse_cost, path, path_count, err_msg, ruleTable);
+        GraphDefinition gdef(edges, static_cast<unsigned int>(edge_count), directed, has_reverse_cost);
+        gdef.set_restrictions(start_vertex, end_vertex, ruleTable);
+        int res = gdef.my_dijkstra(start_vertex, end_vertex, path, path_count, log);
 
 
         if (res < 0)
@@ -48,39 +69,37 @@ int trsp_node_wrapper(
             return EXIT_SUCCESS;
     }
     catch(std::exception& e) {
-        *err_msg = (char *) e.what();
+        log << e.what();
+        *err_msg = strdup(log.str().c_str());
         return -1;
     }
     catch(...) {
-        *err_msg = (char *) "Caught unknown exception!";
+        log << "Caught unknown exception!";
+        *err_msg = strdup(log.str().c_str());
         return -1;
     }
 }
 
 int trsp_edge_wrapper(
-    edge_t *edges,
-    unsigned int edge_count,
-    restrict_t *restricts,
-    int restrict_count,
+    edge_t *edges,          size_t edge_count,
+    restrict_t *restricts,  size_t restrict_count,
     int start_edge,
     double start_pos,
     int end_edge,
     double end_pos,
     bool directed,
     bool has_reverse_cost,
-    path_element_t **path,
-    int *path_count,
-    char **err_msg
-    )
-{
+    path_element_t **path, size_t *path_count,
+    char **err_msg) {
+    std::ostringstream log;
     try {
 
         std::vector<PDVI> ruleTable;
 
-        int i, j;
+        int j;
         ruleTable.clear();
-        for (i=0; i<restrict_count; i++) {
-            std::vector<int> seq;
+        for (size_t i=0; i<restrict_count; i++) {
+            std::vector<int64_t> seq;
             seq.clear();
             seq.push_back(restricts[i].target_id);
             for(j = 0; j<MAX_RULE_LENGTH && restricts[i].via[j]>-1; j++)
@@ -90,8 +109,17 @@ int trsp_edge_wrapper(
             ruleTable.push_back(make_pair(restricts[i].to_cost, seq));
         }
 
-        GraphDefinition gdef;
-        int res = gdef.my_dijkstra(edges, edge_count, start_edge, start_pos, end_edge, end_pos, directed, has_reverse_cost, path, path_count, err_msg, ruleTable);
+        GraphDefinition gdef(edges, static_cast<unsigned int>(edge_count), directed, has_reverse_cost);
+
+        int64_t start_vertex = 0;
+        int64_t end_vertex = 0;
+        gdef.add_virtual_vertices(
+                start_edge, start_pos,
+                end_edge, end_pos,
+                start_vertex, end_vertex);
+
+        gdef.set_restrictions(start_vertex, end_vertex, ruleTable);
+        int res = gdef.my_dijkstra(start_vertex, end_vertex, path, path_count, log);
 
 
         if (res < 0)
@@ -100,11 +128,13 @@ int trsp_edge_wrapper(
             return EXIT_SUCCESS;
     }
     catch(std::exception& e) {
-        *err_msg = (char *) e.what();
+        log << e.what();
+        *err_msg = strdup(log.str().c_str());
         return -1;
     }
     catch(...) {
-        *err_msg = (char *) "Caught unknown exception!";
+        log << "Caught unknown exception!";
+        *err_msg = strdup(log.str().c_str());
         return -1;
     }
 }
diff --git a/src/trsp/src/utils.h b/src/trsp/src/utils.h
deleted file mode 100644
index 6e97dcd..0000000
--- a/src/trsp/src/utils.h
+++ /dev/null
@@ -1,106 +0,0 @@
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <string>
-#include <map>
-#include <vector>
-#include <queue>
-#include <iostream>
-
-
-
-
-typedef std::vector<long> LongVector;
-typedef std::vector<int> IntVector;
-typedef std::vector<double> DoubleVector;
-typedef std::vector<std::string> StringVector;
-
-
-class StringOperation
-{
-	
-public:
-	
-	static std::string TRIMWHITESPACE(std::string strInput)
-	{
-		std::string strOut = strInput;
-		std::string strWht = " \f\n\r\t\v";	
-
-		strOut.erase(0,strOut.find_first_not_of(strWht));
-		strOut.erase(strOut.find_last_not_of(strWht) + 1);
-		return strOut;
-	};
-};
-
-class StringTokenizer
-{
-public:
-	StringTokenizer()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		vecTokens.clear();
-		strInput = "";
-	}
-
-	bool parse(std::string strInput, std::string chDelim)
-	{
-		size_t iStartPos = 0;
-		while(true)	
-		{
-			size_t iPos = strInput.find(chDelim[0],iStartPos);
-			if(iPos != std::string::npos)
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos,iPos - iStartPos);
-				vecTokens.push_back(strToken);
-				iStartPos = iPos + 1;
-			}
-			else if(iPos == std::string::npos && strInput.length() > 0 )
-			{
-				std::string strToken;
-				strToken = strInput.substr(iStartPos, strInput.length() - iStartPos);
-				if(strToken.length() > 0)
-					vecTokens.push_back(strToken);
-				break;
-			}		
-			else 
-				break;
-
-		}		
-		return true;
-	}
-
-	size_t getTokenCount() 
-	{
-		return vecTokens.size();
-	}
-
-	bool getToken(std::string& strToken, long iTokenIndex)
-	{
-		long lTokenCount = vecTokens.size();
-		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
-		{
-			strToken = vecTokens[iTokenIndex];
-			return true;
-		}
-		return false;
-	}
-
-	bool getTokens(StringVector& vecTokensRef)
-	{
-		vecTokensRef = vecTokens;
-		return true;
-	}
-
-private:
-	std::string strInput;
-	StringVector vecTokens;
-	
-};
-
-#endif
diff --git a/src/trsp/test/CMakeLists.txt b/src/trsp/test/CMakeLists.txt
deleted file mode 100644
index e69de29..0000000
diff --git a/src/trsp/test/doc-trsp.result b/src/trsp/test/doc-trsp.result
new file mode 100644
index 0000000..8c07191
--- /dev/null
+++ b/src/trsp/test/doc-trsp.result
@@ -0,0 +1,56 @@
+--q1
+0|7|6|1
+1|8|7|1
+2|5|8|1
+3|6|9|1
+4|9|15|1
+5|12|-1|0
+--q2
+--q3
+0|2|4|1
+1|5|10|1
+2|10|12|1
+3|11|11|1
+4|6|8|1
+5|5|7|1
+6|8|6|1
+7|7|-1|0
+0|7|6|1
+1|8|7|1
+2|5|8|1
+3|6|9|1
+4|9|15|1
+5|12|13|1
+6|11|-1|0
+--q4
+1|1|2|4|1
+2|1|5|10|1
+3|1|10|12|1
+4|1|11|11|1
+5|1|6|8|1
+6|1|5|7|1
+7|1|8|6|1
+8|2|7|6|1
+9|2|8|7|1
+10|2|5|8|1
+11|2|6|9|1
+12|2|9|15|1
+13|2|12|13|1
+14|2|11|-1|0
+--q5
+1|1|-1|2|0.5
+2|1|2|4|1
+3|1|5|8|1
+4|1|6|9|1
+5|1|9|16|1
+6|1|4|3|1
+7|1|3|5|1
+8|1|6|8|1
+9|1|5|7|1
+10|2|5|8|1
+11|2|6|9|1
+12|2|9|16|1
+13|2|4|3|1
+14|2|3|5|1
+15|2|6|11|0.5
+--q6
diff --git a/src/trsp/test/doc-trsp.test.sql b/src/trsp/test/doc-trsp.test.sql
new file mode 100644
index 0000000..6d50122
--- /dev/null
+++ b/src/trsp/test/doc-trsp.test.sql
@@ -0,0 +1,56 @@
+
+
+BEGIN;
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+    --              PGR_pgr_trsp
+    ------------------------------------------------------------------------------------------------------
+    ------------------------------------------------------------------------------------------------------
+
+\echo --q1
+    SELECT * FROM pgr_trsp(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        7, 12, false, false
+    );
+
+\echo --q2
+
+\echo --q3
+    SELECT * FROM pgr_trsp(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        2, 7, false, false,
+        'SELECT to_cost, target_id,
+        from_edge || coalesce('','' || via_path, '''') AS via_path
+        FROM restrictions'
+    );
+    SELECT * FROM pgr_trsp(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        7, 11, false, false,
+        'SELECT to_cost, target_id,
+        from_edge || coalesce('','' || via_path, '''') AS via_path
+        FROM restrictions'
+    );
+
+
+\echo --q4
+    SELECT * FROM pgr_trspViaVertices(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table',
+        ARRAY[2,7,11]::INTEGER[],     
+        false,  false,  
+        'SELECT to_cost, target_id, from_edge ||
+        coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+
+
+\echo --q5
+    SELECT * FROM pgr_trspViaEdges(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost,
+        reverse_cost FROM edge_table',
+        ARRAY[2,7,11]::INTEGER[],           
+        ARRAY[0.5, 0.5, 0.5]::FLOAT[],     
+        true,  
+        true,  
+        'SELECT to_cost, target_id, FROM_edge ||
+        coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+    
+\echo --q6
+    ROLLBACK;
diff --git a/src/trsp/test/pgtap/blank-restrictions-compare-dijkstra.test.sql b/src/trsp/test/pgtap/blank-restrictions-compare-dijkstra.test.sql
new file mode 100644
index 0000000..850ae89
--- /dev/null
+++ b/src/trsp/test/pgtap/blank-restrictions-compare-dijkstra.test.sql
@@ -0,0 +1,52 @@
+\i setup.sql
+
+SELECT plan(1296);
+
+
+create or REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+dijkstra_sql TEXT;
+turnRestricted_sql TEXT;
+inner_sql1 TEXT;
+inner_sql2 TEXT;
+k integer;
+directed TEXT;
+msg TEXT;
+blank TEXT;
+BEGIN
+    directed = 'Undirected';
+    blank := quote_literal('');
+    IF flag THEN directed = 'Directed'; END IF;
+        k := 1;
+        inner_sql1 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table ORDER BY id');
+        inner_sql2 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table ORDER BY id');
+        FOR i IN 1.. cant LOOP
+            FOR j IN 1..cant LOOP
+                dijkstra_sql := 'SELECT seq-1, node::integer, edge::integer, cost
+                FROM pgr_dijkstra( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ')';
+                turnRestricted_sql := 'SELECT * from pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ', true, ' || blank || ')';
+                msg := k || ' ' || directed || ', with reverse_cost: from '  || i || ' to ' || j;
+                RETURN query SELECT set_eq(dijkstra_sql, turnRestricted_sql, msg);
+                k := k + 1;
+                dijkstra_sql := 'SELECT seq-1, node::integer, edge::integer, cost
+                FROM pgr_dijkstra( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ')';
+                turnRestricted_sql := 'SELECT * from pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ', false, ' || blank || ')';
+                msg := k || ' ' || directed || ', no reverse_cost: from '  || i || ' to ' || j;
+                RETURN query SELECT set_eq(dijkstra_sql, turnRestricted_sql, msg);
+                k := k + 1;
+        END LOOP;
+    END LOOP;
+END
+$BODY$
+language plpgsql;
+
+SELECT * from foo(18, true);
+SELECT * from foo(18, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/pgtap/emptyset-from-i-to-i.test.sql b/src/trsp/test/pgtap/emptyset-from-i-to-i.test.sql
new file mode 100644
index 0000000..9714af2
--- /dev/null
+++ b/src/trsp/test/pgtap/emptyset-from-i-to-i.test.sql
@@ -0,0 +1,84 @@
+\i setup.sql
+
+    SELECT plan(144);
+
+
+    create or REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+    RETURNS SETOF TEXT AS
+    $BODY$
+    DECLARE
+    trsp_sql TEXT;
+    inner_sql1 TEXT;
+    inner_sql2 TEXT;
+    k integer;
+    directed TEXT;
+    msg TEXT;
+    BEGIN
+        directed = 'Undirected';
+        IF flag THEN directed = 'Directed'; END IF;
+        k := 1;
+        inner_sql1 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table ORDER BY id');
+        inner_sql2 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table ORDER BY id');
+        FOR i IN 1.. cant LOOP
+                trsp_sql := 'SELECT * from pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || i || ', ' || flag || ', true)';
+                msg := k || ' ' || directed || ', with reverse_cost and saying we use it: from '  || i || ' to ' || i;
+                BEGIN
+                    execute trsp_sql;
+                    RETURN query SELECT is_empty(trsp_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        IF (i < 18) THEN
+                            RETURN query SELECT throws_ok(trsp_sql,'38001','Error computing path: Path Not Found', msg);
+                        ELSE
+                            RETURN query SELECT throws_ok(trsp_sql,'XX000','Start id was not found.', msg);
+                        END IF;
+                END;
+                k := k + 1;
+
+
+                trsp_sql := 'SELECT * from pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || i || ', ' || flag || ', false)';
+                msg := k || ' ' || directed || ', with reverse_cost and saying we dont use it: from '  || i || ' to ' || i;
+                BEGIN
+                    execute trsp_sql;
+                    RETURN query SELECT is_empty(trsp_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        IF (i < 18) THEN
+                            RETURN query SELECT throws_ok(trsp_sql,'38001','Error computing path: Path Not Found', msg);
+                        ELSE
+                            RETURN query SELECT throws_ok(trsp_sql,'XX000','Start id was not found.', msg);
+                        END IF;
+                END;
+                k := k + 1;
+
+                trsp_sql := 'SELECT * from pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || i || ', ' || flag || ', false)';
+                msg := k || ' ' || directed || ', No reverse_cost and saying we dont use it: from '  || i || ' to ' || i;
+                BEGIN
+                    execute trsp_sql;
+                    RETURN query SELECT is_empty(trsp_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        IF (i < 18) THEN
+                            RETURN query SELECT throws_ok(trsp_sql,'38001','Error computing path: Path Not Found', msg);
+                        ELSE
+                            RETURN query SELECT throws_ok(trsp_sql,'XX000','Start id was not found.', msg);
+                        END IF;
+                END;
+                k := k + 1;
+
+                /* contradictory imposible to solve input */
+                trsp_sql := 'SELECT * from pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || i || ', ' || flag || ', true)';
+                msg := k || ' ' || directed || ', No reverse_cost and saying we use it: from '  || i || ' to ' || i;
+                RETURN query SELECT throws_ok(trsp_sql,'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column', msg);
+                k := k + 1;
+
+        END LOOP;
+    END
+    $BODY$
+    language plpgsql;
+
+SELECT * from foo(18, true);
+SELECT * from foo(18, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/pgtap/from1to3.test.sql b/src/trsp/test/pgtap/from1to3.test.sql
new file mode 100644
index 0000000..adeae94
--- /dev/null
+++ b/src/trsp/test/pgtap/from1to3.test.sql
@@ -0,0 +1,96 @@
+\i setup.sql
+
+SELECT plan(7);
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+PREPARE q1 AS
+SELECT * from pgr_trsp(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+    1, 1,
+    true, true);
+
+PREPARE q2 AS
+SELECT * from pgr_trsp(
+    'select  id::INTEGER, source::BIGINT, target::INTEGER, cost, reverse_cost from edge_table',
+    1, 3,
+    true, true);
+
+PREPARE q21 AS
+SELECT seq, id1, id2, cost::text from pgr_trsp(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 3,
+    true, true);
+
+PREPARE q22 AS
+SELECT seq-1, node::INTEGER, edge::INTEGER, cost::text from pgr_dijkstra(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 3, true);
+
+PREPARE q31 AS
+SELECT seq, id1, id2, cost::text from pgr_trsp(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 3,
+    true, true,
+    'select 8::INTEGER as target_id, ''4''::TEXT as via_path,  100.2::FLOAT to_cost');
+
+PREPARE q32 AS
+SELECT (row_number() over() -1)::INTEGER, node::INTEGER, 
+(CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+FROM pgr_dijkstraVia(
+    'select  id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[1, 10, 12, 4, 3],
+    true) where edge != -1;
+
+
+SELECT is_empty('q1', '1: Directed: No path from 1 to 1');
+SELECT throws_ok('q2','XX000',
+    'Error, columns ''source'', ''target'' must be of type int4, ''cost'' must be of type float8',
+    '2: Directed: No path from 1 to 1');
+SELECT set_eq('q21','q22','3: Directed: without retrictions returns the same as pgr_dijkstra');
+SELECT set_eq('q31','q32','4: Directed: with retrictions returns expected path');
+
+
+
+
+PREPARE q41 AS
+SELECT * from pgr_trsp(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 1,
+    FALSE, true);
+
+PREPARE q51 AS
+SELECT seq, id1, id2, cost::text from pgr_trsp(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 3,
+    FALSE, true);
+
+PREPARE q52 AS
+SELECT seq-1, node::INTEGER, edge::INTEGER, cost::text from pgr_dijkstra(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 3, FALSE);
+
+PREPARE q61 AS
+SELECT seq, id1, id2, cost::text from pgr_trsp(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 3,
+    FALSE, true,
+    'select 8::INTEGER as target_id, ''4''::TEXT as via_path,  100.2::FLOAT to_cost');
+
+PREPARE q62 AS
+SELECT (row_number() over() -1)::INTEGER, node::INTEGER, 
+(CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+FROM pgr_dijkstraVia(
+    'select  id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+    ARRAY[1, 2, 3],
+    FALSE) where edge != -1;
+
+
+SELECT is_empty('q41', '5: Undirected: No path from 1 to 1');
+SELECT set_eq('q51','q52','6: Undirected: without retrictions returns the same as pgr_dijkstra');
+SELECT set_eq('q61','q62','7: Undirected: with retrictions returns expected path');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK
diff --git a/src/trsp/test/pgtap/from3to4-directed.test.sql b/src/trsp/test/pgtap/from3to4-directed.test.sql
new file mode 100644
index 0000000..ebb5a94
--- /dev/null
+++ b/src/trsp/test/pgtap/from3to4-directed.test.sql
@@ -0,0 +1,50 @@
+\i setup.sql
+
+SELECT plan(3);
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+PREPARE q1 AS
+SELECT * from pgr_trsp(
+    'select id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    1, 1,
+    true, true);
+
+PREPARE q21 AS
+SELECT seq, id1, id2, cost::text from pgr_trsp(
+    'select id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost from edge_table',
+    3, 4,
+    true, true);
+
+PREPARE q22 AS
+SELECT seq-1, node::INTEGER, edge::INTEGER, cost::text from pgr_dijkstra(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    3, 4, true);
+
+PREPARE q31 AS
+SELECT seq, id1, id2, cost::text from pgr_trsp(
+    'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+    3, 4,
+    true, true,
+    'select 9::INTEGER as target_id, ''5''::TEXT as via_path,  100.2::FLOAT to_cost');
+
+PREPARE q32 AS
+SELECT (row_number() over() -1)::INTEGER, node::INTEGER, 
+(CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+FROM pgr_dijkstraVia(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[3, 2, 4],
+    true) where edge != -1;
+
+
+SELECT is_empty('q1', '1: No path from 1 to 1');
+SELECT set_eq('q21','q22','2: without retrictions returns the same as pgr_dijkstra');
+SELECT set_eq('q31','q32','3: with retrictions returns expected path');
+
+-- Finish the tests and clean up.
+
+SELECT * FROM finish();
+
+
+ROLLBACK
diff --git a/src/trsp/test/pgtap/no-restrictions-compare-dijkstra-directed.test.sql b/src/trsp/test/pgtap/no-restrictions-compare-dijkstra-directed.test.sql
new file mode 100644
index 0000000..77712d0
--- /dev/null
+++ b/src/trsp/test/pgtap/no-restrictions-compare-dijkstra-directed.test.sql
@@ -0,0 +1,100 @@
+
+
+\i setup.sql
+
+SELECT plan(1224);
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+CREATE OR REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+dijkstra_sql TEXT;
+trsp_sql TEXT;
+inner_sql1 TEXT;
+inner_sql2 TEXT;
+k integer;
+directed TEXT;
+msg TEXT;
+BEGIN
+    directed = 'Undirected';
+    IF flag THEN directed = 'Directed'; END IF;
+        k := 1;
+        inner_sql1 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table ORDER BY id');
+        inner_sql2 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table ORDER BY id');
+        FOR i IN 1.. cant LOOP
+            FOR j IN 1..cant LOOP
+
+                -- this special case is tested on the other test
+                CONTINUE WHEN i = j;
+
+                -- test when there is reverse cost and its marked as being used
+                -- VS dijkstra autodetected has reverse cost
+                dijkstra_sql := 'SELECT seq-1, node::integer, edge::integer, cost::text
+                FROM pgr_dijkstra( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ')';
+                trsp_sql := 'SELECT seq, id1, id2, cost::text from pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ', true)';
+                msg := k || '-1 ' || directed || ', with reverse_cost, marked as being used: from '  || i || ' to ' || j;
+                BEGIN
+                    EXECUTE trsp_sql;
+
+                    -- This should happen allways even when its being corrected
+                    RETURN query SELECT set_eq(trsp_sql, dijkstra_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        msg := k || '-1 ' || directed || ', with reverse_cost, marked as being used: from '  || i || ' to ' || j;
+                        RETURN query SELECT is_empty(dijkstra_sql, msg);
+            END;
+
+            -- test when there is reverse cost and its marked NOT being used
+            -- VS dijkstra autodetected DOES NOT have reverse cost
+            dijkstra_sql := 'SELECT seq-1, node::integer, edge::integer, cost::text
+            FROM pgr_dijkstra( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ')';
+            trsp_sql := 'SELECT seq, id1, id2, cost::text from pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ', FALSE)';
+            msg := k || '-2 ' || directed || ', with reverse_cost, marked as NOT being used: from '  || i || ' to ' || j;
+            BEGIN
+                EXECUTE trsp_sql;
+
+                -- This should happen allways even when its being corrected
+                RETURN query SELECT set_eq(trsp_sql, dijkstra_sql, msg);
+                EXCEPTION WHEN OTHERS THEN
+                    RETURN query SELECT is_empty(dijkstra_sql, msg);
+            END;
+
+            -- test when there is NO reverse cost and its marked NOT being used
+            -- VS dijkstra autodetected DOES NOT have reverse cost
+            dijkstra_sql := 'SELECT seq-1, node::integer, edge::integer, cost::text
+            FROM pgr_dijkstra( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ')';
+            trsp_sql := 'SELECT seq, id1, id2, cost::text from pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ', FALSE)';
+            msg := k || '-3 ' || directed || ', NO reverse_cost, marked as NOT being used: from '  || i || ' to ' || j;
+            BEGIN
+                EXECUTE trsp_sql;
+
+                -- This should happen allways even when its being corrected
+                RETURN query SELECT set_eq(trsp_sql, dijkstra_sql, msg);
+
+                EXCEPTION WHEN OTHERS THEN
+                    RETURN query SELECT is_empty(dijkstra_sql, msg);
+            END;
+
+            -- test when there is NO reverse cost and its marked  AS being used
+            -- Uncomparable with dijstra because dijstra uses what is given as input
+            trsp_sql := 'SELECT * from pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ', TRUE)';
+            msg := k || '-4 ' || directed || ', NO reverse_cost, marked as NOT being used: from '  || i || ' to ' || j;
+            RETURN query SELECT throws_ok(trsp_sql,'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column', msg);
+            k := k + 1;
+
+        END LOOP;
+    END LOOP;
+END
+$BODY$
+language plpgsql;
+
+SELECT * from foo(18, true);
+--SELECT * from foo(18, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/pgtap/no-restrictions-compare-dijkstra-undirected.test.sql b/src/trsp/test/pgtap/no-restrictions-compare-dijkstra-undirected.test.sql
new file mode 100644
index 0000000..fd634bc
--- /dev/null
+++ b/src/trsp/test/pgtap/no-restrictions-compare-dijkstra-undirected.test.sql
@@ -0,0 +1,98 @@
+
+\i setup.sql
+
+    SELECT plan(1224);
+
+    UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+    CREATE OR REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+    RETURNS SETOF TEXT AS
+    $BODY$
+    DECLARE
+    dijkstra_sql TEXT;
+    trsp_sql TEXT;
+    inner_sql1 TEXT;
+    inner_sql2 TEXT;
+    k INTEGER;
+    directed TEXT;
+    msg TEXT;
+    BEGIN
+        directed = 'Undirected';
+        IF flag THEN directed = 'Directed'; END IF;
+        k := 1;
+        inner_sql1 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost FROM edge_table ORDER BY id');
+        inner_sql2 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost FROM edge_table ORDER BY id');
+        FOR i IN 1.. cant LOOP
+            FOR j IN 1..cant LOOP
+
+                -- this special case is tested on the other test
+                CONTINUE WHEN i = j;
+
+                -- test when there is reverse cost and its marked as being used
+                -- VS dijkstra autodetected has reverse cost
+                dijkstra_sql := 'SELECT seq-1, node::INTEGER, edge::INTEGER, cost::TEXT
+                    FROM pgr_dijkstra( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ')';
+                trsp_sql := 'SELECT seq, id1, id2, cost::TEXT FROM pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ', true)';
+                msg := k || '-1 ' || directed || ', with reverse_cost, marked as being used: FROM '  || i || ' to ' || j;
+                BEGIN
+                    EXECUTE trsp_sql;
+
+                    -- This should happen allways even when its being corrected
+                    RETURN query SELECT set_eq(trsp_sql, dijkstra_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        RETURN query SELECT is_empty(dijkstra_sql, msg);
+                END;
+
+                -- test when there is reverse cost and its marked NOT being used
+                -- VS dijkstra autodetected DOES NOT have reverse cost
+                dijkstra_sql := 'SELECT seq-1, node::INTEGER, edge::INTEGER, cost::TEXT
+                    FROM pgr_dijkstra( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ')';
+                trsp_sql := 'SELECT seq, id1, id2, cost::TEXT FROM pgr_trsp( ' || inner_sql1 || ', ' || i || ', ' || j || ', ' || flag || ', FALSE)';
+                msg := k || '-2 ' || directed || ', with reverse_cost, marked as NOT being used: FROM '  || i || ' to ' || j;
+                BEGIN
+                    EXECUTE trsp_sql;
+
+                    -- This should happen allways even when its being corrected
+                    RETURN query SELECT set_eq(trsp_sql, dijkstra_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        RETURN query SELECT is_empty(dijkstra_sql, msg);
+                END;
+
+                -- test when there is NO reverse cost and its marked NOT being used
+                -- VS dijkstra autodetected DOES NOT have reverse cost
+                dijkstra_sql := 'SELECT seq-1, node::INTEGER, edge::INTEGER, cost::TEXT
+                    FROM pgr_dijkstra( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ')';
+                trsp_sql := 'SELECT seq, id1, id2, cost::TEXT FROM pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ', FALSE)';
+                msg := k || '-3 ' || directed || ', NO reverse_cost, marked as NOT being used: FROM '  || i || ' to ' || j;
+                BEGIN
+                    EXECUTE trsp_sql;
+
+                    -- This should happen allways even when its being corrected
+                    RETURN query SELECT set_eq(trsp_sql, dijkstra_sql, msg);
+
+                    EXCEPTION WHEN OTHERS THEN
+                        RETURN query SELECT is_empty(dijkstra_sql, msg);
+                END;
+
+                -- test when there is NO reverse cost and its marked  AS being used
+                -- Uncomparable with dijstra because dijstra uses what is given as input
+                trsp_sql := 'SELECT * FROM pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ', TRUE)';
+                msg := k || '-4 ' || directed || ', NO reverse_cost, marked as NOT being used: FROM '  || i || ' to ' || j;
+                RETURN query SELECT throws_ok(trsp_sql,'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column', msg);
+                k := k + 1;
+
+            END LOOP;
+        END LOOP;
+    END
+$BODY$
+language plpgsql;
+
+--SELECT * FROM foo(18, true);
+SELECT * FROM foo(18, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/pgtap/trsp-any-00.test.sql b/src/trsp/test/pgtap/trsp-any-00.test.sql
new file mode 100644
index 0000000..717a94f
--- /dev/null
+++ b/src/trsp/test/pgtap/trsp-any-00.test.sql
@@ -0,0 +1,28 @@
+\i setup.sql
+
+SELECT plan(1);
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+PREPARE q1 AS
+SELECT seq, id1, id2, cost::TEXT FROM pgr_trsp(
+    'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+    1,     -- edge_id for start
+    0.5,   -- midpoint of edge
+    6,     -- edge_id of route end
+    0.5,   -- midpoint of edge
+    true,  -- directed graph?
+    true,  -- has_reverse_cost?
+    null); -- no turn restrictions
+
+
+PREPARE q2 AS
+SELECT seq-1, node::INTEGER, edge::INTEGER, cost::TEXT FROM _pgr_withPointsVia(
+    'select id, source, target, cost, reverse_cost from edge_table',
+    ARRAY[1, 6],
+    ARRAY[0.5, 0.5]) WHERE edge != -2;
+
+SELECT set_eq('q2', 'q1', 'No turn restriction from 1 to 5 returns same as pgr_withPointsVia');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/trsp/test/pgtap/trsp-any-01.test.sql b/src/trsp/test/pgtap/trsp-any-01.test.sql
new file mode 100644
index 0000000..7c40d13
--- /dev/null
+++ b/src/trsp/test/pgtap/trsp-any-01.test.sql
@@ -0,0 +1,24 @@
+\i setup.sql 
+    SELECT plan(1);
+
+    UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+    prepare q1 AS
+    SELECT seq, id1, id2, cost::TEXT FROM pgr_trsp(
+        'select id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table',
+        1,     -- node_id of start
+        5,     -- node_id of end
+        true,  -- directed graph?
+        true,  -- has_reverse_cost?
+        null); -- no turn restrictions
+
+    prepare q2 AS 
+    SELECT seq-1, node::INTEGER, edge::INTEGER, cost::TEXT FROM pgr_dijkstra(
+        'select id, source, target, cost, reverse_cost from edge_table',
+        1, 5);
+
+    SELECT set_eq('q2', 'q1', 'No turn restriction from 1 to 5 returns same as dijkstra');
+
+    -- Finish the tests and clean up.
+    SELECT * FROM finish();
+    ROLLBACK;
diff --git a/src/trsp/test/pgtap/trsp-issue244.test.sql b/src/trsp/test/pgtap/trsp-issue244.test.sql
new file mode 100644
index 0000000..7d71d9c
--- /dev/null
+++ b/src/trsp/test/pgtap/trsp-issue244.test.sql
@@ -0,0 +1,66 @@
+
+\i setup.sql
+
+
+CREATE TABLE edge_table_i244 (
+    id serial,
+    dir character varying,
+    source integer,
+    target integer,
+    cost double precision,
+    reverse_cost double precision,
+    x1 double precision,
+    y1 double precision,
+    x2 double precision,
+    y2 double precision,
+    the_geom geometry
+);
+
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,0, 2,1);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1, 2,1, 3,1);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1, 3,1, 4,1);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,1, 2,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 3,1, 3,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 0,2, 1,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 1,2, 2,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,2, 3,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 3,2, 4,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,2, 2,3);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 3,2, 3,3);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 2,3, 3,3);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 3,3, 4,3);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,3, 2,4);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 4,2, 4,3);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 4,1, 4,2);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 0.5,3.5, 1.999999999999,3.5);
+INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 3.5,2.3, 3.5,4);
+
+UPDATE edge_table_i244 SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
+dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B' -- both ways
+WHEN (cost>0 and reverse_cost<0) THEN 'FT' -- direction of the LINESSTRING
+WHEN (cost<0 and reverse_cost>0) THEN 'TF' -- reverse direction
+ELSE '' END;
+
+SET client_min_messages TO WARNING;
+SELECT pgr_createTopology('edge_table_i244',0.001);
+SET client_min_messages TO NOTICE;
+
+
+SELECT plan(1);
+
+PREPARE q1 AS
+SELECT seq, id1, id2, cost::text FROM pgr_trsp('SELECT id, source, target, cost FROM edge_table_i244',7, 12, FALSE, false);
+
+PREPARE q2 AS
+(SELECT seq-1, node::INTEGER, edge::INTEGER, cost::text
+    FROM pgr_dijkstra('SELECT id, source, target, cost FROM edge_table_i244 order by id',7, 12, FALSE))
+UNION ALL
+(SELECT seq-1, node::INTEGER, edge::INTEGER, cost::text
+    FROM pgr_dijkstra('SELECT id, source, target, cost FROM edge_table_i244 order by source',7, 12, FALSE));
+
+SELECT bag_has('q2', 'q1', 'path found');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/pgtap/viaV-no-restrictions-compare-dijkstra-directed.test.sql b/src/trsp/test/pgtap/viaV-no-restrictions-compare-dijkstra-directed.test.sql
new file mode 100644
index 0000000..27d09c9
--- /dev/null
+++ b/src/trsp/test/pgtap/viaV-no-restrictions-compare-dijkstra-directed.test.sql
@@ -0,0 +1,98 @@
+
+
+
+\i setup.sql
+
+SELECT plan(1156);
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+CREATE OR REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+dijkstraVia_sql TEXT;
+trsp_sql TEXT;
+inner_sql1 TEXT;
+inner_sql2 TEXT;
+k INTEGER;
+directed TEXT;
+msg TEXT;
+BEGIN
+    directed = 'Undirected';
+    IF flag THEN directed = 'Directed'; END IF;
+        k := 1;
+        inner_sql1 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table ORDER BY id');
+        inner_sql2 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table ORDER BY id');
+        FOR i IN 1.. cant LOOP
+            FOR j IN 1..cant LOOP
+
+                -- test when there is reverse cost and its marked as being used
+                -- VS dijkstraVia autodetected has reverse cost
+                dijkstraVia_sql := 'SELECT (row_number() over())::INTEGER, path_id::INTEGER, node::INTEGER, 
+                (CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+                FROM pgr_dijkstraVia( ' || inner_sql1 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', TRUE) WHERE edge != -1';
+                trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql1 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', TRUE)';
+
+                msg := k || '-1 ' || directed || ', with reverse_cost, marked as being used: from 1 to '  || i || ' to ' || j;
+                BEGIN
+                    EXECUTE trsp_sql;
+
+                    -- This should happen allways even when its being corrected
+                    RETURN query SELECT set_eq(trsp_sql, dijkstraVia_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        RETURN query SELECT is_empty(dijkstraVia_sql, msg);
+            END;
+
+            -- test when there is reverse cost and its marked NOT being used
+            -- VS dijkstraVia autodetected DOES NOT have reverse cost
+            dijkstraVia_sql := 'SELECT (row_number() over())::INTEGER, path_id::INTEGER, node::INTEGER, 
+            (CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+            FROM pgr_dijkstraVia( ' || inner_sql2 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', TRUE) WHERE edge != -1';
+            trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql1 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', FALSE)';
+            msg := k || '-2 ' || directed || ', with reverse_cost, marked as NOT being used: from 1 to '  || i || ' to ' || j;
+            BEGIN
+                EXECUTE trsp_sql;
+
+                -- This should happen allways even when its being corrected
+                RETURN query SELECT set_eq(trsp_sql, dijkstraVia_sql, msg);
+                EXCEPTION WHEN OTHERS THEN
+                    RETURN query SELECT is_empty(dijkstraVia_sql, msg);
+            END;
+
+            -- test when there is NO reverse cost and its marked NOT being used
+            -- VS dijkstraVia autodetected DOES NOT have reverse cost (same as previous)
+            trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql2 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', FALSE)';
+            msg := k || '-3 ' || directed || ', NO reverse_cost, marked as NOT being used: from 1 to '  || i || ' to ' || j;
+            BEGIN
+                EXECUTE trsp_sql;
+
+                -- This should happen allways even when its being corrected
+                RETURN query SELECT set_eq(trsp_sql, dijkstraVia_sql, msg);
+
+                EXCEPTION WHEN OTHERS THEN
+                    RETURN query SELECT is_empty(dijkstraVia_sql, msg);
+            END;
+            -- test when there is NO reverse cost and its marked  AS being used
+            -- Uncomparable with dijkstraViaViaVertex because dijstra uses what is given as input
+            trsp_sql := 'SELECT * from pgr_trsp( ' || inner_sql2 || ', ' || i || ', ' || j || ', ' || flag || ', TRUE)';
+            msg := k || '-4 ' || directed || ', NO reverse_cost, marked as NOT being used: from 1 to '  || i || ' to ' || j;
+            RETURN query SELECT throws_ok(trsp_sql,'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column', msg);
+
+            k := k + 1;
+
+        END LOOP;
+    END LOOP;
+END
+$BODY$
+language plpgsql;
+
+SELECT * from foo(17, true);
+--SELECT * from foo(18, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/pgtap/viaV-no-restrictions-compare-dijkstra-undirected.test.sql b/src/trsp/test/pgtap/viaV-no-restrictions-compare-dijkstra-undirected.test.sql
new file mode 100644
index 0000000..2191cd5
--- /dev/null
+++ b/src/trsp/test/pgtap/viaV-no-restrictions-compare-dijkstra-undirected.test.sql
@@ -0,0 +1,100 @@
+
+\i setup.sql
+
+SELECT plan(1156);
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
+
+CREATE OR REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true )
+RETURNS SETOF TEXT AS
+$BODY$
+DECLARE
+dijkstraVia_sql TEXT;
+trsp_sql TEXT;
+inner_sql1 TEXT;
+inner_sql2 TEXT;
+k INTEGER;
+directed TEXT;
+msg TEXT;
+BEGIN
+    directed = 'Undirected';
+    IF flag THEN directed = 'Directed'; END IF;
+        k := 1;
+        inner_sql1 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost, reverse_cost from edge_table ORDER BY id');
+        inner_sql2 = quote_literal('SELECT id::INTEGER, source::INTEGER, target::INTEGER, cost from edge_table ORDER BY id');
+        FOR i IN 1.. cant LOOP
+            FOR j IN 1..cant LOOP
+
+
+                -- test when there is reverse cost and its marked as being used
+                -- VS dijkstraVia autodetected has reverse cost
+                dijkstraVia_sql := 'SELECT (row_number() over())::INTEGER, path_id::INTEGER, node::INTEGER, 
+                (CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+                FROM pgr_dijkstraVia( ' || inner_sql1 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', strict:=TRUE) WHERE edge != -1';
+                trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql1 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', TRUE)';
+
+                msg := k || '-1 ' || directed || ', with reverse_cost, marked as being used: from 1 to '  || i || ' to ' || j;
+                BEGIN
+                    PERFORM trsp_sql;
+
+                    -- This should happen allways even when its being corrected
+                    RETURN query SELECT set_eq(trsp_sql, dijkstraVia_sql, msg);
+                    EXCEPTION WHEN OTHERS THEN
+                        RETURN query SELECT is_empty(dijkstraVia_sql, msg);
+            END;
+
+            -- test when there is reverse cost and its marked NOT being used
+            -- VS dijkstraVia autodetected DOES NOT have reverse cost
+            dijkstraVia_sql := 'SELECT (row_number() over())::INTEGER, path_id::INTEGER, node::INTEGER, 
+            (CASE WHEN edge = -2 THEN -1 ELSE edge END)::INTEGER, cost::text
+            FROM pgr_dijkstraVia( ' || inner_sql2 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', strict:=TRUE) WHERE edge != -1';
+            trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql1 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', FALSE)';
+            msg := k || '-2 ' || directed || ', with reverse_cost, marked as NOT being used: from 1 to '  || i || ' to ' || j;
+            BEGIN
+                EXECUTE trsp_sql;
+
+                -- This should happen allways even when its being corrected
+                RETURN query SELECT set_eq(trsp_sql, dijkstraVia_sql, msg);
+                EXCEPTION WHEN OTHERS THEN
+                    RETURN query SELECT is_empty(dijkstraVia_sql, msg);
+            END;
+
+
+            -- test when there is NO reverse cost and its marked NOT being used
+            -- VS dijkstraVia autodetected DOES NOT have reverse cost (same as previous)
+            trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql2 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', FALSE)';
+            msg := k || '-3 ' || directed || ', NO reverse_cost, marked as NOT being used: from 1 to '  || i || ' to ' || j;
+            BEGIN
+                EXECUTE trsp_sql;
+
+                -- This should happen allways even when its being corrected
+                RETURN query SELECT set_eq(trsp_sql, dijkstraVia_sql, msg);
+
+                EXCEPTION WHEN OTHERS THEN
+                    RETURN query SELECT is_empty(dijkstraVia_sql, msg);
+            END;
+
+
+            -- test when there is NO reverse cost and its marked  AS being used
+            -- Uncomparable with dijkstraViaViaVertex because dijstra uses what is given as input
+            trsp_sql := 'SELECT seq, id1, id2, id3, cost::text from pgr_trspViaVertices( ' || inner_sql2 || ', ARRAY[1, ' || i || ', ' || j || '], ' || flag || ', TRUE)';
+            msg := k || '-4 ' || directed || ', NO reverse_cost, marked as NOT being used: from 1 to '  || i || ' to ' || j;
+            RETURN query SELECT throws_ok(trsp_sql,'XX000','Error, reverse_cost is used, but query did''t return ''reverse_cost'' column', msg);
+
+
+            k := k + 1;
+
+        END LOOP;
+    END LOOP;
+END
+$BODY$
+language plpgsql;
+
+SELECT * from foo(17, false);
+
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
+
diff --git a/src/trsp/test/test.conf b/src/trsp/test/test.conf
index 720778f..10b9eaf 100644
--- a/src/trsp/test/test.conf
+++ b/src/trsp/test/test.conf
@@ -3,9 +3,17 @@
 %main::tests = (
     'any' => {
         'comment' => 'TRSP test for any versions.',
-        'data' => ['trsp-any-00.data', 'trsp-issue244.data'],
-        'tests' => [qw(trsp-any-00 trsp-any-01 trsp-any-02 trsp-any-03 trsp_vias-any-04 trsp-issue244)]
-        },
+        'data' => ['trsp-issue244.data'],
+        'tests' => [qw(
+            doc-trsp
+            trsp-any-02 
+            trsp_vias-any-04 
+            )],
+        'documentation' => [qw(
+            doc-trsp
+            )]
+    },
+
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
 #    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
diff --git a/src/trsp/test/trsp-any-00.data b/src/trsp/test/trsp-any-00.data
deleted file mode 100644
index 0b883d6..0000000
--- a/src/trsp/test/trsp-any-00.data
+++ /dev/null
@@ -1,212 +0,0 @@
-BEGIN;
---
--- PostgreSQL database dump
---
-
-SET client_encoding = 'UTF8';
-SET standard_conforming_strings = off;
-SET check_function_bodies = false;
-SET client_min_messages = warning;
-SET escape_string_warning = off;
-
-SET search_path = public, pg_catalog;
-
-SET default_tablespace = '';
-
-SET default_with_oids = false;
-
---
--- Name: edges1; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS edges1 CASCADE;
-
-CREATE TABLE edges1 (
-    eid integer NOT NULL,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    to_cost double precision,
-    rule text,
-    the_geom geometry,
-    CONSTRAINT enforce_dims_the_geom CHECK ((st_ndims(the_geom) = 2)),
-    CONSTRAINT enforce_geotype_the_geom CHECK (((geometrytype(the_geom) = 'LINESTRING'::text) OR (the_geom IS NULL)))
---    , CONSTRAINT enforce_srid_the_geom CHECK ((st_srid(the_geom) = (0)))
-);
-
-
---
--- Name: restrictions1; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS restrictions1 CASCADE;
-
-CREATE TABLE restrictions1 (
-    rid integer NOT NULL,
-    to_cost double precision,
-    teid integer,
-    feid integer,
-    via text
-);
-
-
---
--- Name: restrictions1_rid_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE restrictions1_rid_seq
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
--- Name: restrictions1_rid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE restrictions1_rid_seq OWNED BY restrictions1.rid;
-
-
---
--- Name: restrictions1_rid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
---
-
-SELECT pg_catalog.setval('restrictions1_rid_seq', 1, true);
-
-
---
--- Name: restrictions1a; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-DROP TABLE IF EXISTS restrictions1a CASCADE;
-
-CREATE TABLE restrictions1a (
-    rid integer,
-    to_cost double precision,
-    teid integer,
-    feid integer,
-    via text
-);
-
-
---
--- Name: rid; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE restrictions1 ALTER COLUMN rid SET DEFAULT nextval('restrictions1_rid_seq'::regclass);
-
-
---
--- Data for Name: edges1; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY edges1 (eid, dir, source, target, cost, reverse_cost, x1, y1, x2, y2, to_cost, rule, the_geom) FROM stdin WITH NULL '__NULL__';
-1	B	1	2	1	1	2	0	2	1	__NULL__	__NULL__	010200000002000000000000000000004000000000000000000000000000000040000000000000F03F
-2	TF	2	3	-1	1	2	1	3	1	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F0000000000000840000000000000F03F
-3	TF	3	4	-1	1	3	1	4	1	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F0000000000001040000000000000F03F
-4	B	2	7	1	1	2	1	2	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000F03F00000000000000400000000000000040
-5	FT	3	8	1	-1	3	1	3	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000F03F00000000000008400000000000000040
-6	B	5	6	1	1	0	2	1	2	__NULL__	__NULL__	01020000000200000000000000000000000000000000000040000000000000F03F0000000000000040
-7	B	6	7	1	1	1	2	2	2	__NULL__	__NULL__	010200000002000000000000000000F03F000000000000004000000000000000400000000000000040
-8	B	7	8	1	1	2	2	3	2	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000008400000000000000040
-9	B	8	9	1	1	3	2	4	2	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000010400000000000000040
-10	B	7	10	1	1	2	2	2	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000004000000000000000400000000000000840
-11	FT	8	11	1	-1	3	2	3	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000004000000000000008400000000000000840
-12	FT	10	11	1	-1	2	3	3	3	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000008400000000000000840
-13	FT	11	12	1	-1	3	3	4	3	__NULL__	__NULL__	0102000000020000000000000000000840000000000000084000000000000010400000000000000840
-14	B	10	13	1	1	2	3	2	4	__NULL__	__NULL__	0102000000020000000000000000000040000000000000084000000000000000400000000000001040
-15	B	9	12	1	1	4	2	4	3	__NULL__	__NULL__	0102000000020000000000000000001040000000000000004000000000000010400000000000000840
-16	B	4	9	1	1	4	1	4	2	__NULL__	__NULL__	0102000000020000000000000000001040000000000000F03F00000000000010400000000000000040
-\.
-
-
---
--- Data for Name: restrictions1; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY restrictions1 (rid, to_cost, teid, feid, via) FROM stdin WITH NULL '__NULL__';
-1	100	7	4	__NULL__
-2	4	8	3	5
-3	100	9	16	__NULL__
-\.
-
-
---
--- Data for Name: restrictions1a; Type: TABLE DATA; Schema: public; Owner: -
---
-
-COPY restrictions1a (rid, to_cost, teid, feid, via) FROM stdin WITH NULL '__NULL__';
-1	100	7	4	__NULL__
-\.
-
-
---
--- Name: edges1_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY edges1
-    ADD CONSTRAINT edges1_pkey PRIMARY KEY (eid);
-
-
---
--- Name: restrictions1_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
---
-
-ALTER TABLE ONLY restrictions1
-    ADD CONSTRAINT restrictions1_pkey PRIMARY KEY (rid);
-
-
---
--- PostgreSQL database dump complete
---
-COMMIT;
-
-/*
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- edge_id for start
-    0.5,   -- midpoint of edge
-    6,     -- edge_id of route end
-    0.5,   -- midpoint of edge
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    null); -- no turn restrictions
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- node_id of start
-    5,     -- node_id of end
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    null); -- no turn restrictions
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,    -- edge_id for start
-    0.5,  -- midpoint of edge
-    6,    -- edge_id of route end
-    0.5,  -- midpoint of edge
-    true, -- directed graph?
-    true, -- has_reverse_cost?
-              -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-
-select * from turn_restrict_shortest_path(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- node_id of start
-    5,     -- node_id of end
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-               -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-
-*/
-
diff --git a/src/trsp/test/trsp-any-00.result b/src/trsp/test/trsp-any-00.result
deleted file mode 100644
index 43e7383..0000000
--- a/src/trsp/test/trsp-any-00.result
+++ /dev/null
@@ -1,4 +0,0 @@
-0|-1|1|0.5
-1|2|4|1
-2|7|7|1
-3|6|6|0.5
diff --git a/src/trsp/test/trsp-any-00.test.sql b/src/trsp/test/trsp-any-00.test.sql
deleted file mode 100644
index 0fac80a..0000000
--- a/src/trsp/test/trsp-any-00.test.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-select * from pgr_trsp(
-    'select eid as id, source::integer, target::integer, cost, reverse_cost from edges1',
-    1,     -- edge_id for start
-    0.5,   -- midpoint of edge
-    6,     -- edge_id of route end
-    0.5,   -- midpoint of edge
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    null); -- no turn restrictions
diff --git a/src/trsp/test/trsp-any-01.result b/src/trsp/test/trsp-any-01.result
deleted file mode 100644
index dc5f501..0000000
--- a/src/trsp/test/trsp-any-01.result
+++ /dev/null
@@ -1,5 +0,0 @@
-0|1|1|1
-1|2|4|1
-2|7|7|1
-3|6|6|1
-4|5|-1|0
diff --git a/src/trsp/test/trsp-any-01.test.sql b/src/trsp/test/trsp-any-01.test.sql
deleted file mode 100644
index f812f5a..0000000
--- a/src/trsp/test/trsp-any-01.test.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-set log_min_messages='NOTICE';  /** hack to force EDB to log so uses hack elog for test **/
-select * from pgr_trsp(
-    'select eid as id, source::integer, target::integer, cost, reverse_cost from edges1',
-    1,     -- node_id of start
-    5,     -- node_id of end
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    null); -- no turn restrictions
diff --git a/src/trsp/test/trsp-any-02.result b/src/trsp/test/trsp-any-02.result
index 5197cb7..eb82435 100644
--- a/src/trsp/test/trsp-any-02.result
+++ b/src/trsp/test/trsp-any-02.result
@@ -1,10 +1,10 @@
-0|-1|1|0.5
-1|2|4|1
-2|7|8|1
-3|8|9|1
-4|9|16|1
-5|4|3|1
-6|3|5|1
-7|8|8|1
-8|7|7|1
-9|6|6|0.5
+0|-1|1|0.5005
+1|2|4|1.016
+2|5|8|1.064
+3|6|9|1.081
+4|9|16|1.256
+5|4|3|1.009
+6|3|5|1.025
+7|6|8|1.064
+8|5|7|1.049
+9|8|6|0.518000000000001
diff --git a/src/trsp/test/trsp-any-02.test.sql b/src/trsp/test/trsp-any-02.test.sql
index aa3cc38..405237e 100644
--- a/src/trsp/test/trsp-any-02.test.sql
+++ b/src/trsp/test/trsp-any-02.test.sql
@@ -1,10 +1,30 @@
+BEGIN;
+
+CREATE TABLE restrictions2 (
+    rid integer NOT NULL,
+    to_cost double precision,
+    teid integer,
+    feid integer,
+    via text
+);
+
+COPY restrictions2 (rid, to_cost, teid, feid, via) FROM stdin WITH NULL '__NULL__' DELIMITER ',';
+1,100,7,4,__NULL__
+2,4,8,3,5
+3,100,9,16,__NULL__
+\.
+
+UPDATE edge_table SET cost = cost + 0.001 * id * id, reverse_cost = reverse_cost + 0.001 * id * id;
+
 select * from pgr_trsp(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
+    'select id, source::integer, target::integer,cost, reverse_cost from edge_table ORDER BY ID',
     1,    -- edge_id for start
     0.5,  -- midpoint of edge
     6,    -- edge_id of route end
     0.5,  -- midpoint of edge
     true, -- directed graph?
     true, -- has_reverse_cost?
-              -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
+    -- include the turn restrictions
+    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions2');
+
+ROLLBACK;
diff --git a/src/trsp/test/trsp-any-03.result b/src/trsp/test/trsp-any-03.result
deleted file mode 100644
index 2d8260d..0000000
--- a/src/trsp/test/trsp-any-03.result
+++ /dev/null
@@ -1,11 +0,0 @@
-0|1|1|1
-1|2|4|1
-2|7|8|1
-3|8|9|1
-4|9|16|1
-5|4|3|1
-6|3|5|1
-7|8|8|1
-8|7|7|1
-9|6|6|1
-10|5|-1|0
diff --git a/src/trsp/test/trsp-any-03.test.sql b/src/trsp/test/trsp-any-03.test.sql
deleted file mode 100644
index 5f66fe1..0000000
--- a/src/trsp/test/trsp-any-03.test.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-set log_min_messages='NOTICE';  /** hack to force EDB to log so uses hack elog for test **/
-select * from pgr_trsp(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    1,     -- node_id of start
-    5,     -- node_id of end
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-               -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
diff --git a/src/trsp/test/trsp-issue244.data b/src/trsp/test/trsp-issue244.data
deleted file mode 100644
index 73cc764..0000000
--- a/src/trsp/test/trsp-issue244.data
+++ /dev/null
@@ -1,42 +0,0 @@
-DROP TABLE IF EXISTS edge_table_i244 CASCADE;
-CREATE TABLE edge_table_i244 (
-    id serial,
-    dir character varying,
-    source integer,
-    target integer,
-    cost double precision,
-    reverse_cost double precision,
-    x1 double precision,
-    y1 double precision,
-    x2 double precision,
-    y2 double precision,
-    the_geom geometry
-);
-
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,0, 2,1);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1, 2,1, 3,1);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1, 3,1, 4,1);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,1, 2,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 3,1, 3,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 0,2, 1,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 1,2, 2,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,2, 3,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 3,2, 4,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,2, 2,3);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 3,2, 3,3);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 2,3, 3,3);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1, 3,3, 4,3);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 2,3, 2,4);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 4,2, 4,3);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 4,1, 4,2);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 0.5,3.5, 1.999999999999,3.5);
-INSERT INTO edge_table_i244 (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1, 3.5,2.3, 3.5,4);
-
-UPDATE edge_table_i244 SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
-dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B' -- both ways
-WHEN (cost>0 and reverse_cost<0) THEN 'FT' -- direction of the LINESSTRING
-WHEN (cost<0 and reverse_cost>0) THEN 'TF' -- reverse direction 
-ELSE '' END;
-
-SELECT pgr_createTopology('edge_table_i244',0.001);
-
diff --git a/src/trsp/test/trsp-issue244.result b/src/trsp/test/trsp-issue244.result
deleted file mode 100644
index c40aaa7..0000000
--- a/src/trsp/test/trsp-issue244.result
+++ /dev/null
@@ -1,6 +0,0 @@
-0|7|6|1
-1|8|7|1
-2|5|8|1
-3|6|11|1
-4|11|13|1
-5|12|-1|0
diff --git a/src/trsp/test/trsp-issue244.test.sql b/src/trsp/test/trsp-issue244.test.sql
deleted file mode 100644
index a780bc0..0000000
--- a/src/trsp/test/trsp-issue244.test.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-set log_min_messages='NOTICE';  /** hack to force EDB to log so uses hack elog for test **/
-SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_trsp('SELECT id, source, target, cost FROM edge_table_i244',7, 12, false, false);
diff --git a/src/trsp/test/trsp_vias-any-04.result b/src/trsp/test/trsp_vias-any-04.result
index 4d0737d..d5438f6 100644
--- a/src/trsp/test/trsp_vias-any-04.result
+++ b/src/trsp/test/trsp_vias-any-04.result
@@ -1,45 +1,66 @@
-1|1|1|1|1
-2|1|2|4|1
-3|1|7|8|1
-4|2|8|8|1
-5|2|7|10|1
-6|2|10|14|1
-7|3|13|14|1
-8|3|10|10|1
-9|3|7|7|1
-10|3|6|6|1
-11|3|5|-1|0
+1|1|2|4|1
+2|1|5|8|1
+3|1|6|9|1
+4|1|9|16|1
+5|1|4|3|1
+6|1|3|5|1
+7|1|6|8|1
+8|1|5|7|1
+9|1|8|6|1
+10|2|7|6|1
+11|2|8|7|1
+12|2|5|8|1
+13|2|6|9|1
+14|2|9|16|1
+15|2|4|3|1
+16|2|3|5|1
+17|2|6|11|1
+18|2|11|-1|0
 ---------------------------
-1|1|-1|1|0.5
-2|1|2|4|1
-3|1|7|8|1
-4|1|8|11|1
-5|2|11|13|1
-6|2|12|15|1
-7|2|9|9|1
-8|2|8|8|1
-9|2|7|7|1
-10|2|6|6|0.5
+1|1|-1|4|0.5
+2|1|5|8|1
+3|1|6|9|1
+4|1|9|16|1
+5|1|4|3|1
+6|1|3|5|1
+7|1|6|8|1
+8|1|5|7|1
+9|1|8|6|1
+10|2|8|7|1
+11|2|5|8|1
+12|2|6|9|1
+13|2|9|16|1
+14|2|4|3|1
+15|2|3|5|1
+16|2|6|11|0.5
 ---------------------------
 1|1|-1|1|0.5
 2|1|2|4|1
-3|1|7|8|1
-4|1|8|11|1
-5|2|11|13|1
-6|2|12|15|1
-7|2|9|9|1
-8|2|8|8|1
-9|2|7|7|1
-10|2|6|6|0.5
+3|1|5|8|1
+4|1|6|9|1
+5|1|9|16|1
+6|1|4|3|1
+7|1|3|5|1
+8|1|6|11|1
+9|2|11|13|1
+10|2|12|15|1
+11|2|9|9|1
+12|2|6|8|1
+13|2|5|7|1
+14|2|8|6|0.5
 ---------------------------
 1|1|-1|1|0.5
 2|1|2|4|1
-3|1|7|8|1
-4|1|8|11|1
-5|2|11|13|1
-6|2|12|15|1
-7|2|9|9|1
-8|2|8|8|1
-9|2|7|7|1
-10|2|6|6|0.5
+3|1|5|8|1
+4|1|6|9|1
+5|1|9|16|1
+6|1|4|3|1
+7|1|3|5|1
+8|1|6|11|1
+9|2|11|13|1
+10|2|12|15|1
+11|2|9|9|1
+12|2|6|8|1
+13|2|5|7|1
+14|2|8|6|0.5
 ---------------------------
diff --git a/src/trsp/test/trsp_vias-any-04.test.sql b/src/trsp/test/trsp_vias-any-04.test.sql
index 6630fa9..e151a3e 100644
--- a/src/trsp/test/trsp_vias-any-04.test.sql
+++ b/src/trsp/test/trsp_vias-any-04.test.sql
@@ -1,40 +1,63 @@
-set client_min_messages = NOTICE;
-
-select * from pgr_trspViaVertices(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    ARRAY[1,8,13,5]::integer[],     -- array of vids
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-
-\echo '---------------------------'
-select * from pgr_trspViaEdges(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    ARRAY[1,11,6]::integer[],           -- array of eids
-    ARRAY[0.5, 0.5, 0.5]::float8[],     -- array of pcts
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-\echo '---------------------------'
-select * from pgr_trspViaEdges(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    ARRAY[1,11,6]::integer[],           -- array of eids
-    ARRAY[0.5, 0.5, 0.5]::float8[],     -- array of pcts
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-\echo '---------------------------'
-select * from pgr_trspViaEdges(
-    'select eid as id, source::integer, target::integer,cost, reverse_cost from edges1',
-    ARRAY[1,11,6]::integer[],           -- array of eids
-    ARRAY[0.5, 0.5, 0.5]::float8[],     -- array of pcts
-    true,  -- directed graph?
-    true,  -- has_reverse_cost?
-    -- include the turn restrictions
-    'select to_cost, teid as target_id, feid||coalesce('',''||via,'''') as via_path from restrictions1');
-\echo '---------------------------'
-
-set client_min_messages = DEBUG;
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License AS published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+BEGIN;
+
+
+    SELECT * FROM pgr_trspViaVertices(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost FROM edge_table',
+        ARRAY[2, 7, 11]::INTEGER[],     -- array of vids
+        true,  -- directed graph?
+        true,  -- has_reverse_cost?
+        -- include the turn restrictions
+        'SELECT to_cost, target_id, from_edge||coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+
+    \echo '---------------------------'
+    SELECT * FROM pgr_trspViaEdges(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost FROM edge_table',
+        ARRAY[4,6,11]::INTEGER[],           -- array of eids
+        ARRAY[0.5, 0.5, 0.5]::float8[],     -- array of pcts
+        true,  -- directed graph?
+        true,  -- has_reverse_cost?
+        -- include the turn restrictions
+        'SELECT to_cost, target_id, from_edge||coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+    \echo '---------------------------'
+    SELECT * FROM pgr_trspViaEdges(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost FROM edge_table',
+        ARRAY[1,11,6]::INTEGER[],           -- array of eids
+        ARRAY[0.5, 0.5, 0.5]::float8[],     -- array of pcts
+        true,  -- directed graph?
+        true,  -- has_reverse_cost?
+        -- include the turn restrictions
+        'SELECT to_cost, target_id, from_edge||coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+    \echo '---------------------------'
+    SELECT * FROM pgr_trspViaEdges(
+        'SELECT id::INTEGER, source::INTEGER, target::INTEGER,cost, reverse_cost FROM edge_table',
+        ARRAY[1,11,6]::INTEGER[],           -- array of eids
+        ARRAY[0.5, 0.5, 0.5]::float8[],     -- array of pcts
+        true,  -- directed graph?
+        true,  -- has_reverse_cost?
+        -- include the turn restrictions
+        'SELECT to_cost, target_id, from_edge||coalesce('',''||via_path,'''') AS via_path FROM restrictions');
+    \echo '---------------------------'
+    ROLLBACK;
diff --git a/src/trsp/tester/issue191-bad-m1.h b/src/trsp/tester/issue191-bad-m1.h
index 869965b..e42b26c 100644
--- a/src/trsp/tester/issue191-bad-m1.h
+++ b/src/trsp/tester/issue191-bad-m1.h
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #define NEDGE 22573
 
 static edge_t edges[NEDGE] = {
diff --git a/src/trsp/tester/issue191-bad.h b/src/trsp/tester/issue191-bad.h
index 4893a4f..398904c 100644
--- a/src/trsp/tester/issue191-bad.h
+++ b/src/trsp/tester/issue191-bad.h
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #define NEDGE 22573
 
 static edge_t edges[NEDGE] = {
diff --git a/src/trsp/tester/issue191-good.h b/src/trsp/tester/issue191-good.h
index 4a59ff6..d2365fd 100644
--- a/src/trsp/tester/issue191-good.h
+++ b/src/trsp/tester/issue191-good.h
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #define NEDGE 22574
 
 static edge_t edges[NEDGE] = {
diff --git a/src/trsp/tester/postgres.h b/src/trsp/tester/postgres.h
index 8bf71df..3840e7f 100644
--- a/src/trsp/tester/postgres.h
+++ b/src/trsp/tester/postgres.h
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 typedef double float8;
diff --git a/src/trsp/tester/testit.cpp b/src/trsp/tester/testit.cpp
index 47f92b2..263a8f5 100644
--- a/src/trsp/tester/testit.cpp
+++ b/src/trsp/tester/testit.cpp
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 #include <stdio.h>
 #include <vector>
 
diff --git a/src/tsp/doc/index.rst b/src/tsp/doc/index.rst
deleted file mode 100644
index 651d37a..0000000
--- a/src/tsp/doc/index.rst
+++ /dev/null
@@ -1,234 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_tsp:
-
-pgr_tsp - Traveling Sales Person
-===============================================================================
-
-.. index:: 
-	single: pgr_tsp(sql text, start_id integer)
-    single: pgr_tsp(sql text, start_id integer, end_id integer)
-    single: pgr_tsp(matrix float[][], start integer)
-    single: pgr_tsp(matrix float[][], start integer, end integer)
-    single: pgr_makeDistanceMatrix(sqlin text)
-
-Name
--------------------------------------------------------------------------------
-
-* ``pgr_tsp`` - Returns the best route from a start node via a list of nodes.
-* ``pgr_tsp`` - Returns the best route order when passed a disance matrix.
-* ``pgr_makeDistanceMatrix`` - Returns a Eucleadian distance Matrix from the points provided in the sql result.
-
-
-Synopsis
--------------------------------------------------------------------------------
-
-The travelling salesman problem (TSP) or travelling salesperson problem asks the following question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? This algoritm uses simulated annealing to return a high quality approximate solution. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
-
-.. code-block:: sql
-
-	pgr_costResult[] pgr_tsp(sql text, start_id integer);
-	pgr_costResult[] pgr_tsp(sql text, start_id integer, end_id integer);
-
-
-Returns a set of (seq integer, id1 integer, id2 integer, cost float8) that is the best order to visit the nodes in the matrix. ``id1`` is the index into the distance matrix. ``id2`` is the point id from the sql.
-
-If no ``end_id`` is supplied or it is -1 or equal to the start_id then the TSP result is assumed to be a circluar loop returning back to the start. If ``end_id`` is supplied then the route is assumed to start and end the the designated ids. 
-
-.. code-block:: sql
-
-    record[] pgr_tsp(matrix float[][], start integer)
-    record[] pgr_tsp(matrix float[][], start integer, end integer)
-
-
-Description
--------------------------------------------------------------------------------
-
-.. rubric:: With Euclidean distances
-
-The TSP solver is based on ordering the points using straight line (euclidean) distance [#f0]_ between nodes. The implementation is using an approximation algorithm that is very fast. It is not an exact solution, but it is guaranteed that a solution is returned after certain number of iterations.
-
-:sql: a SQL query, which should return a set of rows with the following columns:
-
-	.. code-block:: sql
-
-		SELECT id, x, y FROM vertex_table
-
-	:id: ``int4`` identifier of the vertex
-	:x: ``float8`` x-coordinate
-	:y: ``float8`` y-coordinate
-
-:start_id: ``int4`` id of the start point
-:end_id: ``int4`` id of the end point, This is *OPTIONAL*, if include the route is optimized from start to end, otherwise it is assumed that the start and the end are the same point.
-
-
-The function returns set of :ref:`type_cost_result`:
-
-:seq:   row sequence
-:id1:   internal index to the distance matric
-:id2:   ``id`` of the node
-:cost:  cost to traverse from the current node to the next node.
-
-.. rubric:: Create a distance matrix
-
-For users that need a distance matrix we have a simple function that takes SQL in ``sql`` as described above and returns a record with ``dmatrix`` and ``ids``.
-
-    .. code-block:: sql
-    
-        SELECT dmatrix, ids from pgr_makeDistanceMatrix('SELECT id, x, y FROM vertex_table');
-
-The function returns a record of ``dmatrix``, ``ids``:
-
-:dmatrix: ``float8[][]`` a symeteric Euclidean distance matrix based on ``sql``.
-:ids: ``integer[]`` an array of ids as they are ordered in the distance matrix.
-
-
-.. rubric:: With distance matrix
-
-For users, that do not want to use Euclidean distances, we also provode the ability to pass a distance matrix that we will solve and return an ordered list of nodes for the best order to visit each. It is up to the user to fully populate the distance matrix. 
-
-:matrix: ``float[][]`` distance matrix of points
-:start: ``int4`` index of the start point
-:end: ``int4`` (optional) index of the end node
-
-The ``end`` node is an optional parameter, you can just leave it out if you want a loop where the ``start`` is the depot and the route returns back to the depot. If you include the ``end`` parameter, we optimize the path from ``start`` to ``end`` and minimize the distance of the route while include the remaining points.
-
-The distance matrix is a multidimensional `PostgreSQL array type <http://www.postgresql.org/docs/9.1/static/arrays.html>`_ that must be ``N x N`` in size. 
-
-The result will be N records of ``[ seq, id ]``:
-
-:seq: row sequence
-:id: index into the matrix
-
-
-.. rubric:: Footnotes
-
-.. [#f0] There was some thought given to pre-calculating the driving distances between the nodes using Dijkstra, but then I read a paper (unfortunately I don't remember who wrote it), where it was proved that the quality of TSP with euclidean distance is only slightly worse than one with real distance in case of normal city layout. In case of very sparse network or rivers and bridges it becomes more inaccurate, but still wholly satisfactory. Of course it is nice to have exact solution, b [...]
-
-
-.. rubric:: History
-
-* Renamed in version 2.0.0
-* GAUL dependency removed in version 2.0.0
-
-
-Examples
--------------------------------------------------------------------------------
-
-* Using SQL parameter (all points from the table, atarting from 6 and ending at 5). We have listed two queries in this example, the first might vary from system to system because there are multiple equivalent answers. The second query should be stable in that the length optimal route should be the same regardless of order.
-
-.. code-block:: sql
-
-    SELECT seq, id1, id2, round(cost::numeric, 2) AS cost
-      FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
-
-     seq | id1 | id2 | cost
-    -----+-----+-----+------
-       0 |   5 |   6 | 1.00
-       1 |   6 |   7 | 1.00
-       2 |   7 |   8 | 1.41
-       3 |   1 |   2 | 1.00
-       4 |   0 |   1 | 1.41
-       5 |   2 |   3 | 1.00
-       6 |   3 |   4 | 1.00
-       7 |   8 |   9 | 1.00
-       8 |  11 |  12 | 1.00
-       9 |  10 |  11 | 1.41
-      10 |  12 |  13 | 1.00
-      11 |   9 |  10 | 2.24
-      12 |   4 |   5 | 1.00
-    (13 rows)
-
-    SELECT round(sum(cost)::numeric, 4) as cost
-   FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
-
-      cost
-    ---------
-     15.4787
-    (1 row)
-
-
-
-* Using distance matrix (A loop starting from 1)
-
-When using just the start node you are getting a loop that starts with 1, in this case, and travels through the other nodes and is implied to return to the start node from the last one in the list. Since this is a circle there are at least two possible paths, one clockwise and one counter-clockwise that will have the same length and be equall valid. So in the following example it is also possible to get back a sequence of ids = {1,0,3,2} instead of the {1,2,3,0} sequence listed below.
-
-.. code-block:: sql
-
-	SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1);
-
-	 seq | id 
-	-----+----
-	   0 |  1
-	   1 |  2
-	   2 |  3
-	   3 |  0
-	(4 rows)
-
-* Using distance matrix (Starting from 1, ending at 2)
-
-.. code-block:: sql
-
-	SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1,2);
-
-	 seq | id 
-	-----+----
-	   0 |  1
-	   1 |  0
-	   2 |  3
-	   3 |  2
-	(4 rows)
-
-* Using the vertices table edge_table_vertices_pgr generated by :ref:`pgr_create_topology`. Again we have two queries where the first might vary and the second is based on the overal path length.
-
-.. code-block:: sql
-
-	SELECT seq, id1, id2, round(cost::numeric, 2) AS cost
-   FROM pgr_tsp('SELECT id::integer, st_x(the_geom) as x,st_x(the_geom) as y FROM edge_table_vertices_pgr  ORDER BY id', 6, 5);
-
-     seq | id1 | id2 | cost
-    -----+-----+-----+------
-       0 |   5 |   6 | 0.00
-       1 |  10 |  11 | 0.00
-       2 |   2 |   3 | 1.41
-       3 |   3 |   4 | 0.00
-       4 |  11 |  12 | 0.00
-       5 |   8 |   9 | 0.71
-       6 |  15 |  16 | 0.00
-       7 |  16 |  17 | 2.12
-       8 |   1 |   2 | 0.00
-       9 |  14 |  15 | 1.41
-      10 |   7 |   8 | 1.41
-      11 |   6 |   7 | 0.71
-      12 |  13 |  14 | 2.12
-      13 |   0 |   1 | 0.00
-      14 |   9 |  10 | 0.00
-      15 |  12 |  13 | 0.00
-      16 |   4 |   5 | 1.41
-    (17 rows)
-
-    SELECT round(sum(cost)::numeric, 4) as cost
-       FROM pgr_tsp('SELECT id::integer, st_x(the_geom) as x,st_x(the_geom) as y FROM edge_table_vertices_pgr  ORDER BY id', 6, 5);
-
-      cost
-    ---------
-     11.3137
-    (1 row)
-
-
-The queries use the :ref:`sampledata` network.
-
-
-See Also
--------------------------------------------------------------------------------
-
-* :ref:`type_cost_result`
-* http://en.wikipedia.org/wiki/Traveling_salesman_problem
-* http://en.wikipedia.org/wiki/Simulated_annealing
diff --git a/src/tsp/doc/pgr_tsp.rst b/src/tsp/doc/pgr_tsp.rst
new file mode 100644
index 0000000..3ccf08f
--- /dev/null
+++ b/src/tsp/doc/pgr_tsp.rst
@@ -0,0 +1,246 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_tsp:
+
+pgr_tsp - Traveling Sales Person
+===============================================================================
+
+.. index:: 
+	single: pgr_tsp(sql text, start_id integer)
+    single: pgr_tsp(sql text, start_id integer, end_id integer)
+    single: pgr_tsp(matrix float[][], start integer)
+    single: pgr_tsp(matrix float[][], start integer, end integer)
+    single: pgr_makeDistanceMatrix(sqlin text)
+
+Name
+-------------------------------------------------------------------------------
+
+* ``pgr_tsp`` - Returns the best route from a start node via a list of nodes.
+* ``pgr_tsp`` - Returns the best route order when passed a disance matrix.
+* ``pgr_makeDistanceMatrix`` - Returns a Eucleadian distance Matrix from the points provided in the sql result.
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+The travelling salesman problem (TSP) or travelling salesperson problem asks the following question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? This algoritm uses simulated annealing to return a high quality approximate solution. Returns a set of :ref:`pgr_costResult <type_cost_result>` (seq, id1, id2, cost) rows, that make up a path.
+
+.. code-block:: sql
+
+	pgr_costResult[] pgr_tsp(sql text, start_id integer);
+	pgr_costResult[] pgr_tsp(sql text, start_id integer, end_id integer);
+
+
+Returns a set of (seq integer, id1 integer, id2 integer, cost float8) that is the best order to visit the nodes in the matrix. ``id1`` is the index into the distance matrix. ``id2`` is the point id from the sql.
+
+If no ``end_id`` is supplied or it is -1 or equal to the start_id then the TSP result is assumed to be a circluar loop returning back to the start. If ``end_id`` is supplied then the route is assumed to start and end the the designated ids. 
+
+.. code-block:: sql
+
+    record[] pgr_tsp(matrix float[][], start integer)
+    record[] pgr_tsp(matrix float[][], start integer, end integer)
+
+
+Description
+-------------------------------------------------------------------------------
+
+.. rubric:: With Euclidean distances
+
+The TSP solver is based on ordering the points using straight line (euclidean) distance [#f0]_ between nodes. The implementation is using an approximation algorithm that is very fast. It is not an exact solution, but it is guaranteed that a solution is returned after certain number of iterations.
+
+:sql: a SQL query, which should return a set of rows with the following columns:
+
+	.. code-block:: sql
+
+		SELECT id, x, y FROM vertex_table
+
+	:id: ``int4`` identifier of the vertex
+	:x: ``float8`` x-coordinate
+	:y: ``float8`` y-coordinate
+
+:start_id: ``int4`` id of the start point
+:end_id: ``int4`` id of the end point, This is *OPTIONAL*, if include the route is optimized from start to end, otherwise it is assumed that the start and the end are the same point.
+
+
+The function returns set of :ref:`type_cost_result`:
+
+:seq:   row sequence
+:id1:   internal index to the distance matric
+:id2:   ``id`` of the node
+:cost:  cost to traverse from the current node to the next node.
+
+.. rubric:: Create a distance matrix
+
+For users that need a distance matrix we have a simple function that takes SQL in ``sql`` as described above and returns a record with ``dmatrix`` and ``ids``.
+
+    .. code-block:: sql
+    
+        SELECT dmatrix, ids from pgr_makeDistanceMatrix('SELECT id, x, y FROM vertex_table');
+
+The function returns a record of ``dmatrix``, ``ids``:
+
+:dmatrix: ``float8[][]`` a symeteric Euclidean distance matrix based on ``sql``.
+:ids: ``integer[]`` an array of ids as they are ordered in the distance matrix.
+
+
+.. rubric:: With distance matrix
+
+For users, that do not want to use Euclidean distances, we also provode the ability to pass a distance matrix that we will solve and return an ordered list of nodes for the best order to visit each. It is up to the user to fully populate the distance matrix. 
+
+:matrix: ``float[][]`` distance matrix of points
+:start: ``int4`` index of the start point
+:end: ``int4`` (optional) index of the end node
+
+The ``end`` node is an optional parameter, you can just leave it out if you want a loop where the ``start`` is the depot and the route returns back to the depot. If you include the ``end`` parameter, we optimize the path from ``start`` to ``end`` and minimize the distance of the route while include the remaining points.
+
+The distance matrix is a multidimensional `PostgreSQL array type <http://www.postgresql.org/docs/9.1/static/arrays.html>`_ that must be ``N x N`` in size. 
+
+The result will be N records of ``[ seq, id ]``:
+
+:seq: row sequence
+:id: index into the matrix
+
+
+.. rubric:: Footnotes
+
+.. [#f0] There was some thought given to pre-calculating the driving distances between the nodes using Dijkstra, but then I read a paper (unfortunately I don't remember who wrote it), where it was proved that the quality of TSP with euclidean distance is only slightly worse than one with real distance in case of normal city layout. In case of very sparse network or rivers and bridges it becomes more inaccurate, but still wholly satisfactory. Of course it is nice to have exact solution, b [...]
+
+
+.. rubric:: History
+
+* Renamed in version 2.0.0
+* GAUL dependency removed in version 2.0.0
+
+
+Examples
+-------------------------------------------------------------------------------
+
+* Using SQL parameter (all points from the table, atarting from 6 and ending at 5). We have listed two queries in this example, the first might vary from system to system because there are multiple equivalent answers. The second query should be stable in that the length optimal route should be the same regardless of order.
+
+
+
+.. code-block:: sql
+
+    CREATE TABLE vertex_table (
+        id serial,
+        x double precision,
+        y double precision
+    );
+
+    INSERT INTO vertex_table VALUES
+    (1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
+    (8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
+
+    SELECT seq, id1, id2, round(cost::numeric, 2) AS cost
+      FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
+
+     seq | id1 | id2 | cost
+    -----+-----+-----+------
+       0 |   5 |   6 | 1.00
+       1 |   6 |   7 | 1.00
+       2 |   7 |   8 | 1.41
+       3 |   1 |   2 | 1.00
+       4 |   0 |   1 | 1.41
+       5 |   2 |   3 | 1.00
+       6 |   3 |   4 | 1.00
+       7 |   8 |   9 | 1.00
+       8 |  11 |  12 | 1.00
+       9 |  10 |  11 | 1.41
+      10 |  12 |  13 | 1.00
+      11 |   9 |  10 | 2.24
+      12 |   4 |   5 | 1.00
+    (13 rows)
+
+    SELECT round(sum(cost)::numeric, 4) as cost
+   FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
+
+      cost
+    ---------
+     15.4787
+    (1 row)
+
+
+
+* Using distance matrix (A loop starting from 1)
+
+When using just the start node you are getting a loop that starts with 1, in this case, and travels through the other nodes and is implied to return to the start node from the last one in the list. Since this is a circle there are at least two possible paths, one clockwise and one counter-clockwise that will have the same length and be equall valid. So in the following example it is also possible to get back a sequence of ids = {1,0,3,2} instead of the {1,2,3,0} sequence listed below.
+
+.. code-block:: sql
+
+	SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1);
+
+	 seq | id 
+	-----+----
+	   0 |  1
+	   1 |  2
+	   2 |  3
+	   3 |  0
+	(4 rows)
+
+* Using distance matrix (Starting from 1, ending at 2)
+
+.. code-block:: sql
+
+	SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1,2);
+
+	 seq | id 
+	-----+----
+	   0 |  1
+	   1 |  0
+	   2 |  3
+	   3 |  2
+	(4 rows)
+
+* Using the vertices table edge_table_vertices_pgr generated by :ref:`pgr_create_topology`. Again we have two queries where the first might vary and the second is based on the overal path length.
+
+.. code-block:: sql
+
+	SELECT seq, id1, id2, round(cost::numeric, 2) AS cost
+   FROM pgr_tsp('SELECT id::integer, st_x(the_geom) as x,st_x(the_geom) as y FROM edge_table_vertices_pgr  ORDER BY id', 6, 5);
+
+     seq | id1 | id2 | cost
+    -----+-----+-----+------
+       0 |   5 |   6 | 0.00
+       1 |  10 |  11 | 0.00
+       2 |   2 |   3 | 1.41
+       3 |   3 |   4 | 0.00
+       4 |  11 |  12 | 0.00
+       5 |   8 |   9 | 0.71
+       6 |  15 |  16 | 0.00
+       7 |  16 |  17 | 2.12
+       8 |   1 |   2 | 0.00
+       9 |  14 |  15 | 1.41
+      10 |   7 |   8 | 1.41
+      11 |   6 |   7 | 0.71
+      12 |  13 |  14 | 2.12
+      13 |   0 |   1 | 0.00
+      14 |   9 |  10 | 0.00
+      15 |  12 |  13 | 0.00
+      16 |   4 |   5 | 1.41
+    (17 rows)
+
+    SELECT round(sum(cost)::numeric, 4) as cost
+       FROM pgr_tsp('SELECT id::integer, st_x(the_geom) as x,st_x(the_geom) as y FROM edge_table_vertices_pgr  ORDER BY id', 6, 5);
+
+      cost
+    ---------
+     11.3137
+    (1 row)
+
+
+The queries use the :ref:`sampledata` network.
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`type_cost_result`
+* http://en.wikipedia.org/wiki/Traveling_salesman_problem
+* http://en.wikipedia.org/wiki/Simulated_annealing
diff --git a/src/tsp/sql/routing_tsp.sql b/src/tsp/sql/routing_tsp.sql
index 730cf0c..913f4a3 100644
--- a/src/tsp/sql/routing_tsp.sql
+++ b/src/tsp/sql/routing_tsp.sql
@@ -1,8 +1,34 @@
+/*PGR-MIT*****************************************************************
+
 --
 -- Copyright (c) 2013 Stephen Woodbridge
 --
 -- This files is released under an MIT-X license.
---
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 
 -----------------------------------------------------------------------
@@ -19,5 +45,5 @@ CREATE OR REPLACE FUNCTION pgr_tsp(matrix float8[][], startpt integer, endpt int
 
 --CREATE OR REPLACE FUNCTION pgr_tsp(matrix float8[][], startpt integer, OUT seq integer, OUT id integer)
     RETURNS SETOF record
-    AS '$libdir/librouting-2.1', 'tsp_matrix'
+    AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'tsp_matrix'
     LANGUAGE c IMMUTABLE STRICT;
diff --git a/src/tsp/sql/routing_tsp_wrappers.sql b/src/tsp/sql/routing_tsp_wrappers.sql
index b698f6b..b21025b 100644
--- a/src/tsp/sql/routing_tsp_wrappers.sql
+++ b/src/tsp/sql/routing_tsp_wrappers.sql
@@ -1,12 +1,40 @@
+/*PGR-MIT*****************************************************************
+
 --
 -- Copyright (c) 2013 Stephen Woodbridge
 --
 -- This files is released under an MIT-X license.
---
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 
 
-create or replace function pgr_makeDistanceMatrix(sqlin text, OUT dmatrix double precision[], OUT ids integer[])
+create or replace function _pgr_makeDistanceMatrix(sqlin text, OUT dmatrix double precision[], OUT ids integer[])
   as
 $body$
 declare
@@ -45,7 +73,7 @@ declare
 begin
 
     return query with dm  as (
-        select * from pgr_makeDistanceMatrix( sql )
+        select * from _pgr_makeDistanceMatrix( sql )
     ),
     ids as (
         select (row_number() over (order by id asc))-1 as rnum, id
diff --git a/src/tsp/sql/xyd_tsp.sql b/src/tsp/sql/xyd_tsp.sql
new file mode 100644
index 0000000..475deb4
--- /dev/null
+++ b/src/tsp/sql/xyd_tsp.sql
@@ -0,0 +1,11 @@
+
+CREATE OR REPLACE FUNCTION pgr_tsp(distance_sql TEXT, start_id BIGINT,
+    end_id BIGINT DEFAULT -1,
+    OUT seq integer,
+    OUT node integer,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+
+    RETURNS SETOF record
+    AS '$libdir/${PGROUTING_LIBRARY_NAME}', 'xyd_tsp'
+    LANGUAGE c IMMUTABLE VOLATILE;
diff --git a/src/tsp/src/CMakeLists.txt b/src/tsp/src/CMakeLists.txt
index 8dd7193..44d037b 100644
--- a/src/tsp/src/CMakeLists.txt
+++ b/src/tsp/src/CMakeLists.txt
@@ -1,34 +1,12 @@
 ADD_LIBRARY(tsp OBJECT
-      tsp2.c 
-      tsplib.c
-)
+    tsp2.c 
+    tsplib.c
 
+    #distances_input.c
+    #xyd_tsp.c
 
-#set(LIBRARY_OUTPUT_PATH ../../../lib/)
+    #tsp_driver.cpp
+    #pgr_tsp.cpp
+    #Dmatrix.cpp
+    )
 
-#include_directories(${PGROUTING_INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR})
-#if(WIN32)
-    #include_directories(${POSTGRESQL_INCLUDE_DIR}/port/win32)
-#endif(WIN32)
-
-#if(APPLE)
-    #set(LIBRARY_MODE_TARGET "MODULE")
-#else(APPLE)
-    #set(LIBRARY_MODE_TARGET "SHARED")
-#endif(APPLE)
-
-#add_library(routing_tsp ${LIBRARY_MODE_TARGET} tsp2.c tsp.h tsplib.c)
-
-#if(WIN32)
-  #if(MSVC)
-    #set_target_properties(routing_tsp PROPERTIES COMPILE_FLAGS "-DHAVE_GETHOSTNAME")
-  #endif(MSVC)
-#endif(WIN32)
-
-#if(APPLE)
-    #set_target_properties(routing_tsp
-        #PROPERTIES
-        #LINK_FLAGS "-bundle_loader ${POSTGRESQL_EXECUTABLE} -bundle")
-#endif(APPLE)
-
-#install(TARGETS routing_tsp DESTINATION ${LIBRARY_INSTALL_PATH})
diff --git a/src/tsp/src/Dmatrix.cpp b/src/tsp/src/Dmatrix.cpp
new file mode 100644
index 0000000..35e8416
--- /dev/null
+++ b/src/tsp/src/Dmatrix.cpp
@@ -0,0 +1,181 @@
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <algorithm>
+#include <vector>
+#include "./Dmatrix.hpp"
+
+
+
+double
+Dmatrix::pathCost(const Ids &path) const {
+    double len = 0;
+    if (path.empty()) return len;
+    auto prev_id = path.front();
+    for (const auto &id : path) {
+        if (id == path.front()) continue;
+        if (costs[prev_id][id] == std::numeric_limits<double>::max())
+            return std::numeric_limits<double>::max();
+        len += costs[prev_id][id];
+        prev_id = id;
+    }
+    len += costs[prev_id][ids.front()];
+    return len;
+}
+
+
+
+double
+Dmatrix::max() const {
+    double maxd(0);
+    for (const auto &row : costs) {
+        auto row_max = std::max_element(row.begin(),row.end());
+        maxd = maxd < *row_max? *row_max : maxd;
+    }
+    return maxd;
+}
+
+void
+Dmatrix::set_ids(const std::vector < Matrix_cell_t > &data_costs) {
+    ids.reserve(data_costs.size() * 2);
+    for (const auto &cost : data_costs) {
+        ids.push_back(cost.from_vid);
+        ids.push_back(cost.to_vid);
+    }
+    std::sort(ids.begin(), ids.end());
+    auto last = std::unique(ids.begin(), ids.end());
+    ids.erase(last, ids.end());
+    /*
+     * freeing up unused space
+     */
+    ids.shrink_to_fit();
+}
+
+size_t
+Dmatrix::get_index(int64_t id) const {
+    auto pos = std::lower_bound(ids.begin(), ids.end(), id);
+    return pos - ids.begin();
+}
+
+int64_t
+Dmatrix::get_id(size_t id) const{
+    return ids[id];
+}
+
+/*
+ * Transforms the input data to a matrix
+ */
+Dmatrix::Dmatrix(const std::vector < Matrix_cell_t > &data_costs) {
+    set_ids(data_costs);
+    costs.resize(ids.size());
+    for (auto &row : costs) {
+        row.resize(ids.size());
+        for (auto &cell : row) {
+            cell = std::numeric_limits<double>::max();
+        }
+    }
+    for (const auto &data : data_costs) {
+        costs[get_index(data.from_vid)][get_index(data.to_vid)] = data.cost;
+    }
+
+    for (size_t i = 0; i < costs.size(); ++i) {
+        costs[i][i] = 0;
+    }
+}
+
+bool
+Dmatrix::has_no_infinity() const {
+    for (const auto &row : costs) {
+        for (const auto &val : row) {
+            if (val == std::numeric_limits<double>::max()) return false;
+        }
+    }
+    return true;
+}
+
+
+bool
+Dmatrix::obeys_triangle_inequality() const {
+    /*
+     * Triangle Inequality Theorem.
+     *  The sum of the lengths of any two sides of a triangle is greater than the length of the third side.
+     *  NOTE: can also be equal for streets
+     * costs[i][k] != inf
+     * costs[i][k] <= costs[i][j] + costs[j][k] 
+     */
+    for (size_t i = 0; i < costs.size(); ++i) {
+        for (size_t j = 0; j < costs.size(); ++j) {
+            for (size_t k = 0; k < costs.size(); ++k) {
+                if (costs[i][k] <= (costs[i][j] + costs[j][k])) return false;
+            }
+        }
+    }
+    return true;
+}
+
+bool
+Dmatrix::is_symetric() const{
+    for (size_t i = 0; i < costs.size(); ++i) {
+        for (size_t j = 0; j < costs.size(); ++j) {
+            if (costs[i][j] != costs[j][i]) return false;
+        }
+    }
+    return true;
+}
+
+
+Dmatrix
+Dmatrix::get_symetric() const {
+    double sum(0);
+    for (const auto &row : costs) {
+        for (const auto &cell : row) {
+            sum += cell;
+        }
+    }
+    if (is_symetric()) return *this; 
+    Dmatrix new_costs;
+    new_costs.costs.resize(costs.size() * 2);
+    for (auto &row : new_costs.costs) {
+        row.resize(costs.size() * 2);
+        for (auto &cell : row) {
+            cell = std::numeric_limits<double>::max();
+        }
+    }
+
+    /*
+     * Matrix cuadrants
+     *   A= inf           B= transposed original
+     *   C=original       D= inf
+     *
+     *   B & C "semi" diagonals are 0
+     */
+    for (size_t i = 0; i < costs.size(); ++i) {
+        for (size_t j = 0; j < costs.size(); ++j) {
+            /*
+             *  A & D
+             */
+            new_costs[i][j] = 
+                new_costs[i + costs.size()][j + costs.size()] = 
+                std::numeric_limits<double>::max();
+
+            /*
+             * B
+             */
+            new_costs[i + costs.size()][j] =
+                i == j? costs[i][j] : 0;
+
+            /*
+             * C
+             */
+            new_costs[i][j + costs.size()] =
+                i == j? costs[j][i] : 0;
+        }
+    }
+    new_costs.ids = ids;
+    new_costs.ids.insert(new_costs.ids.end(), ids.begin(), ids.end());
+
+    return new_costs;
+}
diff --git a/src/tsp/src/Dmatrix.hpp b/src/tsp/src/Dmatrix.hpp
new file mode 100644
index 0000000..1dccc0c
--- /dev/null
+++ b/src/tsp/src/Dmatrix.hpp
@@ -0,0 +1,39 @@
+
+#pragma once
+
+
+#include "../../common/src/pgr_types.h"
+
+
+#include <vector>
+
+
+
+class Dmatrix {
+ public:
+    typedef std::vector < std::vector < double > > Costs;
+    typedef std::vector < int64_t > Ids;
+
+    Dmatrix() = default;
+    Dmatrix(const std::vector < Matrix_cell_t > &data_costs);
+
+    bool has_no_infinity() const;
+
+    bool obeys_triangle_inequality() const;
+    bool is_symetric() const;
+
+    Dmatrix get_symetric() const; 
+
+    void set_ids(const std::vector<matrix_cell> &data_costs);
+
+    size_t get_index(int64_t id) const;
+    int64_t get_id (size_t id) const;
+    size_t size() const {return ids.size();};
+    double max() const;
+    double pathCost(const Ids &path) const;
+    std::vector< double >& operator[] (size_t i) {return costs[i];}
+
+    Costs costs;
+    Ids ids;
+};
+
diff --git a/src/tsp/src/OBSOLETE/tsp.c b/src/tsp/src/OBSOLETE/tsp.c
index 3fb49ea..8422861 100644
--- a/src/tsp/src/OBSOLETE/tsp.c
+++ b/src/tsp/src/OBSOLETE/tsp.c
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 /*
  * Traveling Salesman Problem solution algorithm for PostgreSQL
  *
diff --git a/src/tsp/src/distances_input.c b/src/tsp/src/distances_input.c
new file mode 100644
index 0000000..01a8989
--- /dev/null
+++ b/src/tsp/src/distances_input.c
@@ -0,0 +1,130 @@
+/*PGR-GNU*****************************************************************
+File: distances_input.c
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+// #define DEBUG
+#include "./debug_macro.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/get_check_data.h"
+#include "./distances_input.h"
+
+
+
+static
+void pgr_fetch_distance(
+        HeapTuple *tuple,
+        TupleDesc *tupdesc,
+        Column_info_t info[3],
+        Matrix_cell_t *distance) {
+
+    distance->from_vid = pgr_SPI_getBigInt(tuple, tupdesc,  info[0]);
+    distance->to_vid = pgr_SPI_getBigInt(tuple, tupdesc,  info[1]);
+    distance->cost = pgr_SPI_getFloat8(tuple, tupdesc, info[2]);
+}
+
+/*!
+ * bigint start_vid,
+ * bigint end_vid,
+ * float agg_cost,
+ */
+void pgr_get_distances(
+        char *sql,
+        Matrix_cell_t **distances,
+        size_t *total_distances) {
+
+    const int tuple_limit = 1000000;
+
+    size_t ntuples;
+    size_t total_tuples = 0;
+
+    Column_info_t info[3];
+
+    int i;
+    for (i = 0; i < 3; ++i) {
+        info[i].colNumber = -1;
+        info[i].type = 0;
+        info[i].strict = true;
+        info[i].eType = ANY_INTEGER;
+    }
+    info[0].name = strdup("start_vid");
+    info[1].name = strdup("end_vid");
+    info[2].name = strdup("agg_cost");
+
+    info[2].eType = ANY_NUMERICAL;
+
+
+    void *SPIplan;
+    SPIplan = pgr_SPI_prepare(sql);
+
+    Portal SPIportal;
+    SPIportal = pgr_SPI_cursor_open(SPIplan);
+
+
+    bool moredata = TRUE;
+    (*total_distances) = total_tuples;
+
+    while (moredata == TRUE) {
+        SPI_cursor_fetch(SPIportal, TRUE, tuple_limit);
+        if (total_tuples == 0)
+            pgr_fetch_column_info(info, 5);
+
+        ntuples = SPI_processed;
+        total_tuples += ntuples;
+
+        if (ntuples > 0) {
+            if ((*distances) == NULL)
+                (*distances) = (Matrix_cell_t *)palloc0(total_tuples * sizeof(Matrix_cell_t));
+            else
+                (*distances) = (Matrix_cell_t *)repalloc((*distances), total_tuples * sizeof(Matrix_cell_t));
+
+            if ((*distances) == NULL) {
+                elog(ERROR, "Out of memory");
+            }
+
+            SPITupleTable *tuptable = SPI_tuptable;
+            TupleDesc tupdesc = SPI_tuptable->tupdesc;
+            PGR_DBG("processing %d edge tupĺes", ntuples);
+
+            size_t t;
+            for (t = 0; t < ntuples; t++) {
+                HeapTuple tuple = tuptable->vals[t];
+                pgr_fetch_distance(&tuple, &tupdesc, info,
+                        &(*distances)[total_tuples - ntuples + t]);
+            }
+            SPI_freetuptable(tuptable);
+        } else {
+            moredata = FALSE;
+        }
+    }
+
+
+    if (total_tuples == 0) {
+        (*total_distances) = 0;
+        PGR_DBG("NO distances");
+        return;
+    }
+
+    (*total_distances) = total_tuples;
+    PGR_DBG("Finish reading %ld edges, %ld", total_tuples, (*total_distances));
+}
diff --git a/src/tsp/src/distances_input.h b/src/tsp/src/distances_input.h
new file mode 100644
index 0000000..b5401ea
--- /dev/null
+++ b/src/tsp/src/distances_input.h
@@ -0,0 +1,37 @@
+/*PGR-GNU*****************************************************************
+File: distances_input.h
+
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+/*!
+  bigint start_vid,
+  bigint end_vid,
+  float agg_cost,
+  */
+void pgr_get_distances(
+        char *sql,
+        Matrix_cell_t **distaces,
+        size_t *total_distances);
diff --git a/src/tsp/src/pgr_tsp.cpp b/src/tsp/src/pgr_tsp.cpp
new file mode 100644
index 0000000..204e0f8
--- /dev/null
+++ b/src/tsp/src/pgr_tsp.cpp
@@ -0,0 +1,381 @@
+/*PGR-GNU*****************************************************************
+ * File: tsp_driver.cpp
+ *
+ * Generated with Template by:
+ * Copyright (c) 2015 pgRouting developers
+ * Mail: project at pgrouting.org
+ *
+ * Function's developer:
+ * Copyright (c) 2015 Celia Virginia Vergara Castillo
+ * Mail: vicky_vergara at hotmail.com
+ *
+ * ------
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *  ********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+
+#include <vector>
+#include <algorithm>
+
+#include "../../common/src/pgr_types.h"
+#include "./pgr_tsp.hpp"
+
+
+
+static
+size_t
+rand(size_t n) {
+    return static_cast< size_t >(std::rand() * n);
+}
+
+
+static
+size_t
+succ(size_t i, size_t n) {
+    return static_cast<size_t>((i + 1) % n);
+}
+
+static
+size_t
+MOD(size_t i, size_t n) {
+#if 1
+return succ(i, n);
+#else
+return  ((i) % (n) > 0 ? (i) % (n) : (i) % (n) + (n));
+#endif
+}
+
+double
+TSP::D(size_t i, size_t j) {
+    return dist[i][j];
+}
+
+void
+TSP::update(Ids new_order) {
+    auto blength = dist.pathCost(new_order);
+    if (bestCost < blength) {
+        border = new_order;
+        bestCost = blength;
+    }
+}
+
+/*
+ * Prim's approximated TSP tour
+ * See also [Cristophides'92]
+ */
+bool
+TSP::findEulerianPath() {
+    Ids iorder(n);
+    Ids mst(n);
+    Ids arc(n);
+    std::vector < double > dis(n);
+    double d;
+#if 0
+    int n, *iorder, *jorder;
+    DTYPE d;
+    DTYPE maxd;
+    DTYPE *dist;
+    DTYPE *dis;
+
+    jorder = tsp->jorder;
+    iorder = tsp->iorder;
+    dist   = tsp->dist;
+    maxd   = tsp->maxd;
+    n      = tsp->n;
+
+    if (!(mst = (int*) palloc(n * sizeof(int))) ||
+            !(arc = (int*) palloc(n * sizeof(int))) ||
+            !(dis = (DTYPE*) palloc(n * sizeof(DTYPE))) )
+    {
+        elog(ERROR, "Failed to allocate memory!");
+        return -1;
+    }
+#endif
+    // PGR_DBG("findEulerianPath: 1");
+
+    size_t j(0);
+    double curr_maxd = maxd;
+    dis[0] = -1;
+
+    for (size_t i = 1; i < n; ++i) {
+        dis[i] = dist[i][0];
+        arc[i] = 0;
+        if (curr_maxd > dis[i]) {
+            curr_maxd = dis[i];
+            j = i;
+        }
+    }
+    //PGR_DBG("findEulerianPath: j=%d", j);
+
+    if (curr_maxd == maxd) {
+        // PGR_DBG("Error TSP fail to findEulerianPath, check your distance matrix is valid.");
+        return false;
+    }
+
+    /*
+     * O(n^2) Minimum Spanning Trees by Prim and Jarnick 
+     * for graphs with adjacency matrix. 
+     */
+    for (size_t a = 0; a < n - 1; a++) {
+        size_t k(0);
+        mst[a] = j * n + arc[j]; /* join fragment j with MST */
+        dis[j] = -1; 
+        d = maxd;
+        for (size_t i = 0; i < n; i++)
+        {
+            if (dis[i] >= 0) /* not connected yet */
+            {
+                if (dis[i] > dist[i][j])
+                {
+                    dis[i] = dist[i][j];
+                    arc[i] = j;
+                }
+                if (d > dis[i])
+                {
+                    d = dis[i];
+                    k = i;
+                }
+            }
+        }
+        j = k;
+    }
+    //PGR_DBG("findEulerianPath: 3");
+
+    /*
+     * Preorder Tour of MST
+     */
+#if 0
+#define VISITED(x) jorder[x]
+#define NQ(x) arc[l++] = x
+#define DQ()  arc[--l]
+#define EMPTY (l==0)
+#endif
+    for (auto &val : jorder) {
+        val = 0;
+    }
+
+#if 0
+    for (i = 0; i < n; i++) VISITED(i) = 0;
+#endif
+
+    size_t l = 0;
+    size_t k = 0;
+    d = 0;
+    arc[l++] = 0;
+    while (!(l == 0)) {
+        size_t i = arc[--l];
+
+        if (!jorder[i]) {
+            iorder[k++] = i;
+            jorder[i]  = 1;            
+            /* push all kids of i */
+            for (size_t j = 0; j < n - 1; j++) {
+                if (i == mst[j] % n)
+                    arc[l++] = mst[j] % n; 
+            }
+        }
+    }
+
+#if 0
+    k = 0; l = 0; d = 0; NQ(0);
+    while (!EMPTY)
+    {
+        i = DQ();
+        if (!VISITED(i))
+        {
+            iorder[k++] = i;
+            VISITED(i)  = 1;            
+            for (j = 0; j < n - 1; j++) /* push all kids of i */
+            {
+                if (i == mst[j]%n) NQ(mst[j]/n); 
+            }    
+        }
+    }
+#endif
+    //PGR_DBG("findEulerianPath: 4");
+
+    update(iorder);
+    return true;
+}
+
+/*
+ * Local Search Heuristics
+ *  b-------a        b       a
+ *  .       .   =>   .\     /.
+ *  . d...e .        . e...d .  
+ *  ./     \.        .       .
+ *  c       f        c-------f
+ */
+
+double
+TSP::getThreeWayCost(Path p) {
+    size_t a, b, c, d, e, f;
+
+    a = iorder[MOD(p[0] - 1, n)];
+    b = iorder[p[0]];
+    c = iorder[p[1]];
+    d = iorder[MOD(p[1] + 1, n)];
+    e = iorder[p[2]];
+    f = iorder[MOD(p[2] + 1, n)];
+
+    return (D(a,d) + D(e,b) + D(c,f) - D(a,b) - D(c,d) - D(e,f)); 
+    /* add cost between d and e if non symetric TSP */ 
+}
+
+void
+TSP::doThreeWay(Path p) {
+    size_t count, m1, m2, m3, a, b, c, d, e, f;
+
+    a = MOD(p[0]-1,n);
+    b = p[0];
+    c = p[1];
+    d = MOD(p[1]+1,n);
+    e = p[2];
+    f = MOD(p[2]+1,n);    
+
+    m1 = MOD(n + c - b, n) + 1;  /* num cities from b to c */
+    m2 = MOD(n + a - f, n) + 1;  /* num cities from f to a */
+    m3 = MOD(n + e - d, n) + 1;  /* num cities from d to e */
+
+    count = 0;
+    /* [b..c] */
+    for (size_t i = 0; i < m1; i++)
+        jorder[count++] = iorder[MOD(i + b, n)];
+
+    /* [f..a] */
+    for (size_t i = 0; i < m2; i++)
+        jorder[count++] = iorder[MOD(i+f,n)];
+
+    /* [d..e] */
+    for (size_t i = 0; i < m3; i++)
+        jorder[count++] = iorder[MOD(i+d,n)];
+
+    /* copy segment back into iorder */
+    for (size_t i = 0; i < n; i++) iorder[i] = jorder[i];
+}
+
+
+/*
+ *   c..b       c..b
+ *    \/    =>  |  |
+ *    /\        |  |
+ *   a  d       a  d
+ *
+ *   a b 1  2   .. n-1 n c d
+ *   a c n n-1  ..  2  1 c d
+ */
+double
+TSP::getReverseCost(Path p) {
+
+    auto a = iorder[MOD(p[0] - 1, n)];
+    auto b = iorder[p[0]];
+    auto c = iorder[p[1]];
+    auto d = iorder[MOD(p[1] + 1, n)];
+
+    return (D(d,b) + D(c,a) - D(a,b) - D(c,d));
+    /* add cost between c and b if non symetric TSP */ 
+}
+
+void
+TSP::doReverse(Path p) {
+
+    /* reverse path b...c */
+    size_t nswaps = (MOD(p[1] - p[0], n) + 1) / 2;
+    for (size_t i = 0; i < nswaps; i++) {
+        size_t first = MOD(p[0]+i, n);
+        size_t last  = MOD(p[1]-i, n);
+        std::swap(iorder[first], iorder[last]);
+#if 0
+        tmp   = iorder[first];
+        iorder[first] = iorder[last];
+        iorder[last]  = tmp;
+#endif
+    }
+}
+
+
+void
+TSP::annealing() {
+    Path   p;
+    size_t    numOnPath, numNotOnPath;
+
+    double pathCost(dist.pathCost(iorder));
+    const double T_INIT = 100.0;
+    const double FINAL_T = 0.1;
+    const double COOLING = 0.9; /* to lower down T (< 1) */
+    const size_t TRIES_PER_T(500 * n);
+    const size_t IMPROVED_PATH_PER_T = 60 * n;
+
+    /* annealing schedule */
+    for (double T = T_INIT; FINAL_T < T; T *= COOLING) {
+        size_t pathchg = 0;
+        for (size_t j = 0; j < TRIES_PER_T; j++) {
+            do {
+                p[0] = rand(n);
+                p[1] = rand(n);
+                /* non-empty path */
+                if (p[0] == p[1]) 
+                    p[1] = MOD(p[0] + 1, n);
+
+                numOnPath = MOD(p[1] - p[0], n) + 1;
+                numNotOnPath = n - numOnPath;
+            } while (numOnPath < 2 || numNotOnPath < 2); /* non-empty path */
+
+            if (rand(2)) {
+                /*  threeWay */
+                do {
+                    p[2] = MOD(rand(numNotOnPath) + p[1] + 1, n);
+                } while (p[0] == MOD(p[2] + 1, n)); /* avoids a non-change */
+
+                auto energyChange = getThreeWayCost(p);
+                // if (energyChange < 0 || RREAL < exp(-energyChange / T) )
+                if (energyChange < 0 || std::rand() < exp(-energyChange / static_cast<double>(T)) ) {
+                    pathchg++;
+                    pathCost += energyChange;
+                    doThreeWay(p);
+                }
+
+            } else {
+                /* path Reverse */
+                auto energyChange = getReverseCost(p);
+                if (energyChange < 0 || std::rand() < exp(-energyChange / static_cast<double>(T)) ) {
+                    pathchg++;
+                    pathCost += energyChange;
+                    doReverse(p); 
+                }
+            }
+            // if the new length is better than best then save it as best
+            update(iorder);
+#if 0
+            if (pathlen < tsp->bestlen) {
+                tsp->bestlen = pathlen;
+                for (i=0; i<tsp->n; i++) tsp->border[i] = tsp->iorder[i];
+            }
+#endif
+            if (pathchg > IMPROVED_PATH_PER_T) break; /* finish early */
+        }   
+        // PGR_DBG("T:%f L:%f B:%f C:%d", T, pathlen, tsp->bestlen, pathchg);
+        if (pathchg == 0) break;   /* if no change then quit */
+    }
+}
+
diff --git a/src/tsp/src/pgr_tsp.hpp b/src/tsp/src/pgr_tsp.hpp
new file mode 100644
index 0000000..3697ee2
--- /dev/null
+++ b/src/tsp/src/pgr_tsp.hpp
@@ -0,0 +1,93 @@
+/*PGR-GNU*****************************************************************
+ * File: tsp_driver.cpp
+ *
+ * Generated with Template by:
+ * Copyright (c) 2015 pgRouting developers
+ * Mail: project at pgrouting.org
+ *
+ * Function's developer:
+ * Copyright (c) 2015 Celia Virginia Vergara Castillo
+ * Mail: vicky_vergara at hotmail.com
+ *
+ * ------
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *  ********************************************************************PGR-GNU*/
+
+#include <vector>
+
+#include "../../common/src/pgr_types.h"
+#include "./Dmatrix.hpp"
+
+class TSP {
+ public:
+/*
+ * Defs
+ */
+typedef size_t Path[3];      /* specify how to change path */
+
+typedef std::vector< std::vector < double > > Costs;
+typedef std::vector< int64_t > Ids;
+
+     Dmatrix dist;
+     size_t n;
+     double maxd;
+     size_t bestlen;
+     double bestCost;
+     Ids iorder;
+     /*
+      * std::vector< bool > visited;
+      */
+     Ids jorder;
+     Ids border;
+     double b[4];
+
+
+     /*
+      * function members
+      */
+     TSP(Dmatrix  _costs)
+         : dist(_costs),
+         n(_costs.size()) {
+             iorder.resize(n);
+             jorder.resize(n);
+             maxd = dist.max();
+
+             /*
+              * identity_permutations
+              */
+             std::iota(std::begin(iorder), std::end(iorder), 0);
+#if 0
+             for (auto &e : iorder) {
+                  e = i;
+             }
+#endif
+             /*
+              * best order
+              */
+             border = iorder;
+             bestCost = dist.pathCost(border);
+         }
+     void update(Ids new_order);
+     bool findEulerianPath();
+     void annealing();
+     void doThreeWay(Path p);
+     double getThreeWayCost (Path p);
+     double getReverseCost(Path p);
+     void doReverse(Path p);
+     double D(size_t, size_t);
+};
+
diff --git a/src/tsp/src/tsp.h b/src/tsp/src/tsp.h
index 2e86f11..ec83eb2 100644
--- a/src/tsp/src/tsp.h
+++ b/src/tsp/src/tsp.h
@@ -1,24 +1,27 @@
-/*
+/*PGR-GNU*****************************************************************
+
  * Traveling Salesman Problem solution algorithm for PostgreSQL
  *
  * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc.
  * Copyright (c) 2013 Stephen Woodbridge, iMaptools.com.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
  
 #define _TSP_H
 
diff --git a/src/tsp/src/tsp2.c b/src/tsp/src/tsp2.c
index 43e406e..fe9dfa0 100644
--- a/src/tsp/src/tsp2.c
+++ b/src/tsp/src/tsp2.c
@@ -1,10 +1,35 @@
-/*
+/*PGR-MIT*****************************************************************
+
  * Traveling Sales Problem solver for pgRouting and PostgreSQL
  *
  * Copyright 2013, Stephen Woodbridge, iMaptools.com
  * This program is released under an MIT-X license.
  *
-*/
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
 
 #include "tsp.h"
 #include <math.h>
@@ -26,13 +51,7 @@ PG_MODULE_MAGIC;
 
 #undef DEBUG
 //#define DEBUG 1
-
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
+#include "../../common/src/debug_macro.h"
 
 #ifndef INFINITY
 #define INFINITY (1.0/0.0)
@@ -41,6 +60,10 @@ PG_MODULE_MAGIC;
 // The number of tuples to fetch from the SPI cursor at each iteration
 #define TUPLIMIT 1000
 
+PG_FUNCTION_INFO_V1(tsp_matrix);
+Datum
+tsp_matrix(PG_FUNCTION_ARGS);
+
 static DTYPE *get_pgarray(int *num, ArrayType *input)
 {
     int         ndims, *dims; // , *lbs;
@@ -83,16 +106,16 @@ static DTYPE *get_pgarray(int *num, ArrayType *input)
     deconstruct_array(input, i_eltype, i_typlen, i_typbyval, i_typalign,
 &i_data, &nulls, &n);
 
-    DBG("get_pgarray: ndims=%d, n=%d", ndims, n);
+    PGR_DBG("get_pgarray: ndims=%d, n=%d", ndims, n);
 
 #ifdef DEBUG
     for (i=0; i<ndims; i++) {
-        DBG("   dims[%d]=%d, lbs[%d]=%d", i, dims[i], i, lbs[i]);
+        PGR_DBG("   dims[%d]=%d, lbs[%d]=%d", i, dims[i], i, lbs[i]);
     }
 #endif
 
     /* construct a C array */
-    data = (DTYPE *) palloc(n * sizeof(DTYPE));
+    data = (DTYPE *) palloc((size_t)(n) * sizeof(DTYPE));
     if (!data) {
         elog(ERROR, "Error: Out of memory!");
     }
@@ -125,7 +148,7 @@ static DTYPE *get_pgarray(int *num, ArrayType *input)
             if (data[i] < 0)
                 data[i] = INFINITY;
         }
-        DBG("    data[%d]=%.4f", i, data[i]);
+        PGR_DBG("    data[%d]=%.4f", i, data[i]);
     }
 
     pfree(nulls);
@@ -148,7 +171,7 @@ static int solve_tsp(DTYPE *matrix, int num, int start, int end, int **results)
     DTYPE fit;
     char *err_msg = NULL;
 
-    DBG("In solve_tsp: num: %d, start: %d, end: %d", num, start, end);
+    PGR_DBG("In solve_tsp: num: %d, start: %d, end: %d", num, start, end);
 
     if (num < 4)
         elog(ERROR, "Error TSP requires four or more locations to optimize. Only %d were supplied.", num);
@@ -168,14 +191,14 @@ static int solve_tsp(DTYPE *matrix, int num, int start, int end, int **results)
        basically set D(start,end)=INFINITY and D(end,start)=0.0
     */
     if (end >= 0) {
-        DBG("Updating start end costs");
+        PGR_DBG("Updating start end costs");
         D(start,end)=0.0;
         D(end,start)=0.0;
     }
 
-    DBG("Alloc ids");
+    PGR_DBG("Alloc ids");
 
-    ids = (int *) malloc(num * sizeof(int));
+    ids = (int *) malloc((size_t)(num) * sizeof(int));
     if (!ids) {
         elog(ERROR, "Error: Out of memory (solve_tsp)");
     }
@@ -184,7 +207,7 @@ static int solve_tsp(DTYPE *matrix, int num, int start, int end, int **results)
         ids[i] = i;
     }
 
-    DBG("Calling find_tsp_solution");
+    PGR_DBG("Calling find_tsp_solution");
 
 // int find_tsp_solution(int num, DTYPE *dist, int *p_ids, int source, DTYPE *fit, char* err_msg);
     ret = find_tsp_solution(num, matrix, ids, start, end, &fit, err_msg);
@@ -192,7 +215,7 @@ static int solve_tsp(DTYPE *matrix, int num, int start, int end, int **results)
         elog(ERROR, "Error solving TSP, %s", err_msg);
     }
 
-    DBG("TSP solved, Score: %f", fit);
+    PGR_DBG("TSP solved, Score: %f", fit);
 
     *results = ids;
     return ret;
@@ -203,13 +226,12 @@ static int solve_tsp(DTYPE *matrix, int num, int start, int end, int **results)
  *                             OUT seq int, OUT id int);
 */
 
-PG_FUNCTION_INFO_V1(tsp_matrix);
 Datum
 tsp_matrix(PG_FUNCTION_ARGS)
 {
     FuncCallContext     *funcctx;
-    int                  call_cntr;
-    int                  max_calls;
+    uint32_t                  call_cntr;
+    uint32_t                  max_calls;
     TupleDesc            tuple_desc;
     // AttInMetadata       *attinmeta;
 
@@ -241,7 +263,7 @@ tsp_matrix(PG_FUNCTION_ARGS)
             elog(ERROR, "Error, failed to solve TSP.");
         }
 
-        funcctx->max_calls = num;
+        funcctx->max_calls = (uint32_t)num;
         funcctx->user_fctx = tsp_res;
 
         /* Build a tuple descriptor for our result type */
@@ -271,8 +293,8 @@ tsp_matrix(PG_FUNCTION_ARGS)
     tuple_desc = funcctx->tuple_desc;
     tsp_res    = funcctx->user_fctx;
 
-    DBG("Trying to allocate some memory");
-    DBG("call_cntr = %i, max_calls = %i", call_cntr, max_calls);
+    PGR_DBG("Trying to allocate some memory");
+    PGR_DBG("call_cntr = %i, max_calls = %i", call_cntr, max_calls);
 
     if (call_cntr < max_calls) {   /* do when there is more left to send */
         HeapTuple    tuple;
@@ -288,19 +310,19 @@ tsp_matrix(PG_FUNCTION_ARGS)
         values[1] = Int32GetDatum(tsp_res[call_cntr]);
         nulls[1] = ' ';
 
-        DBG("RESULT: %d, %d", call_cntr, tsp_res[call_cntr]);
+        PGR_DBG("RESULT: %d, %d", call_cntr, tsp_res[call_cntr]);
 
-        DBG("Heap making");
+        PGR_DBG("Heap making");
 
         tuple = heap_formtuple(tuple_desc, values, nulls);
 
-        DBG("Datum making");
+        PGR_DBG("Datum making");
 
         /* make the tuple into a datum */
         result = HeapTupleGetDatum(tuple);
 
-        DBG("RESULT: seq:%d, id:%d", call_cntr, tsp_res[call_cntr]);
-        DBG("Trying to free some memory");
+        PGR_DBG("RESULT: seq:%d, id:%d", call_cntr, tsp_res[call_cntr]);
+        PGR_DBG("Trying to free some memory");
 
         /* clean up (this is not really necessary) */
         pfree(values);
@@ -310,10 +332,10 @@ tsp_matrix(PG_FUNCTION_ARGS)
         SRF_RETURN_NEXT(funcctx, result);
     }
     else {   /* do when there is no more left */
-        DBG("Freeing tsp_res");
+        PGR_DBG("Freeing tsp_res");
         free(tsp_res);
 
-        DBG("Ending function");
+        PGR_DBG("Ending function");
         SRF_RETURN_DONE(funcctx);
     }
 }
diff --git a/src/tsp/src/tsp_driver.cpp b/src/tsp/src/tsp_driver.cpp
new file mode 100644
index 0000000..8c8b422
--- /dev/null
+++ b/src/tsp/src/tsp_driver.cpp
@@ -0,0 +1,234 @@
+/*// PGR-GNU*****************************************************************
+ * File: tspi_driver.cpp
+ *
+ * Generated with Template by:
+ * Copyright (c) 2015 pgRouting developers
+ * Mail: project at pgrouting.org
+ *
+ * Function's developer:
+ * Copyright (c) 2015 Celia Virginia Vergara Castillo
+ * Mail: vicky_vergara at hotmail.com
+ *
+ * ------
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *  ******************************************************************** PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <vector>
+#include <algorithm>
+
+#include "./tsp_driver.h"
+
+#include "./Dmatrix.hpp"
+#include "./pgr_tsp.hpp"
+/*
+ * Defs
+ */
+
+typedef std::vector< int64_t > Ids;
+
+int
+do_pgr_tsp(
+        Matrix_cell_t *distances,
+        size_t total_distances,
+        int64_t start_vid,
+        int64_t end_vid,
+        General_path_element_t **path,
+        size_t *total_results,
+        char **err_msg) {
+
+    std::vector < Matrix_cell_t > data_costs(distances, distances + total_distances);
+    Dmatrix costs(data_costs);
+
+    if (!costs.has_no_infinity()) {
+        return 5;
+    }
+    if (!costs.obeys_triangle_inequality()) {
+        return 6;
+    }
+    costs = costs.get_symetric();
+
+
+#if 0
+    int   i, j;
+    int   istart = 0;
+    int   jstart = 0;
+    int   iend = -1;
+    int   jend = -1;
+    int   rev = 0;
+    long  seed = -314159L;
+    size_t blength;
+#endif
+
+    // PGR_DBG("sizeof(long)=%d", (int)sizeof(long));
+
+#if 0
+    // moving forward
+    initRand(seed);
+#endif 
+
+    /* initialize tsp struct */
+    TSP tsp(costs);
+#if 0
+    tsp.n = num;
+    tsp.dist   = NULL;
+    tsp.iorder = NULL;
+    tsp.jorder = NULL;
+    tsp.border = NULL;
+
+
+    if (!(tsp.iorder = (int*) palloc (tsp.n * sizeof(int)))   ||
+            !(tsp.jorder = (int*) palloc (tsp.n * sizeof(int)))   ||
+            !(tsp.border = (int*) palloc (tsp.n * sizeof(int)))   ) {
+        elog(FATAL, "Memory allocation failed!");
+        return -1;
+    }
+
+    tsp.maxd = 0;
+    for (i=0; i<tsp.n*tsp.n; i++) {
+        tsp.maxd = MAX(tsp.maxd, cost[i]);
+    }
+
+    /* identity permutation */
+    for (i = 0; i < tsp.n; i++) tsp.iorder[i] = i;
+
+    tsp.bestlen = pathLength(&tsp);
+    for (i = 0; i < tsp.n; i++) tsp.border[i] = tsp.iorder[i];
+#endif
+
+    // PGR_DBG("Initial Path Length: %.4f", tsp.bestlen);
+
+    /*
+     * Set up first eulerian path iorder to be improved by
+     * simulated annealing.
+     */
+    if (!tsp.findEulerianPath())
+        return 8;
+
+#if 0
+    // this is done automatically in tsp.findEulerianPath call
+    blength = pathLength(&tsp);
+    if (blength < tsp.bestlen) {
+        tsp.bestlen = blength;
+        for (i = 0; i < tsp.n; i++) tsp.border[i] = tsp.iorder[i];
+    }
+#endif
+
+    // PGR_DBG("Approximated Path Length: %.4f", tsp.bestlen);
+
+    tsp.annealing();
+
+    *total_results = tsp.bestlen;
+    // PGR_DBG("Final Path Length: %.4f", tsp.bestlen);
+
+    tsp.iorder = tsp.border;
+#if 0
+    for (i=0; i<tsp.n; i++) tsp.iorder[i] = tsp.border[i];
+    // PGR_DBG("Best Path Length: %.4f", *total_len);
+#endif
+
+    // reorder ids[] with start as first
+
+#ifdef DEBUG
+    for (i=0; i<tsp.n; i++) {
+        // PGR_DBG("i: %d, ids[i]: %d, io[i]: %d, jo[i]: %d, jo[io[i]]: %d",
+        i, ids[i], tsp.iorder[i], tsp.jorder[i], tsp.jorder[tsp.iorder[i]]);
+    }
+#endif
+
+    size_t istart = costs.get_index(start_vid);
+    auto start_ptr = std::find(tsp.iorder.begin(), tsp.iorder.end(), istart);
+
+    /*
+     *  1 2 3 4 5 6 e s 7 8 9 
+     *  =>
+     *  s 7 8 9 1 2 3 4 5 6 e
+     */
+    Ids results(start_ptr, tsp.iorder.end());
+    std::copy(tsp.iorder.begin(), start_ptr, results.end());
+
+    std::vector< General_path_element_t > result;
+    result.reserve(tsp.iorder.size());
+    auto prev_id = tsp.iorder.front();
+    double agg_cost = 0;
+    for (const auto &id : tsp.iorder) {
+        General_path_element_t data;
+        data.node = costs.get_id(id);
+        data.cost   = id == prev_id? 0: costs[prev_id][id];
+        agg_cost += data.cost;
+        data.agg_cost = agg_cost;
+        result.push_back(data);
+    }
+
+    *path = static_cast<General_path_element_t *>(malloc(sizeof(General_path_element_t) * (result.size())));
+
+    //store the results
+    int seq = 0;
+    if (end_vid == -1) {};
+    for (const auto &row : result) {
+        (*path)[seq] = row;
+        ++seq;
+    }
+
+    *total_results = result.size();
+
+    (*err_msg) = NULL;
+    return 0;
+
+#if 0
+/*
+ * If the end is specified and the end point and it follow start
+ * then we swap start and end and extract the list backwards
+ * and later we reverse the list for the desired order.
+ */
+if ((jend > 0 && jend == jstart + 1)
+        || (jend == 0 && jstart == tsp.n-1)) {
+    int tmp = jend;
+    jend = jstart;
+    jstart = tmp;
+    rev = 1;
+    // PGR_DBG("reversed start and end: jstart: %d, jend: %d", jstart, jend);
+}
+
+// copy ids to tsp.jorder so we can rewrite ids
+memcpy(tsp.jorder, ids, tsp.n * sizeof(int));
+
+// write reordered ids into ids[]
+// remember at this point jorder is our list if ids
+for (i=jstart, j=0; i < tsp.n; i++, j++)
+ids[j] = tsp.jorder[tsp.iorder[i]];
+
+for (i=0; i < jstart; i++, j++)
+ids[j] =tsp.jorder[tsp.iorder[i]];
+
+// if we reversed the order above, now put it correct.
+if (rev) {
+    int tmp = jend;
+    jend = jstart;
+    jstart = tmp;
+    reverse(tsp.n, ids);
+}
+#endif
+
+}
+
+
diff --git a/src/tsp/src/tsp_driver.h b/src/tsp/src/tsp_driver.h
new file mode 100644
index 0000000..4ce69ff
--- /dev/null
+++ b/src/tsp/src/tsp_driver.h
@@ -0,0 +1,51 @@
+/*PGR-GNU*****************************************************************
+ * File: tsp_driver.h
+ *
+ * Generated with Template by:
+ * Copyright (c) 2015 pgRouting developers
+ * Mail: project at pgrouting.org
+ *
+ * Function's developer:
+ * Copyright (c) 2015 Celia Virginia Vergara Castillo
+ * Mail: vicky_vergara at hotmail.com
+ *
+ * ------
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *  ********************************************************************PGR-GNU*/
+
+#pragma once
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "../../common/src/pgr_types.h"
+
+int 
+do_pgr_tsp(
+        Matrix_cell_t *distances, size_t total_distances,
+        int64_t start_vid,
+        int64_t end_vid,
+        General_path_element_t **results,
+        size_t *total_results,
+        char **err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/tsp/src/tsplib.c b/src/tsp/src/tsplib.c
index 41e5af0..3aeef9c 100644
--- a/src/tsp/src/tsplib.c
+++ b/src/tsp/src/tsplib.c
@@ -1,11 +1,37 @@
-/*********************************************************************
-*
+/*PGR-MIT*****************************************************************
+
 *  $Id: tsplib.c,v 1.1 2006/05/13 23:39:56 woodbri Exp $
 *
 *  tsplib
 *  Copyright 2005,2013, Stephen Woodbridge, All rights Reserved
 *  This file is released under MIT-X license as part of pgRouting.
-*
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
+
+/*
 **********************************************************************
 *
 *  tsplib.c
@@ -66,13 +92,8 @@
 
 #undef DEBUG
 //#define DEBUG 1
+#include "../../common/src/debug_macro.h"
 
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
 
 
 #define T_INIT                        100
@@ -91,8 +112,10 @@ static int a;
 static int b;
 static int arr[55];
 
-int Rand();
+static
+int Rand(void);
 
+static
 void initRand (int seed)
 {
     int i, ii;
@@ -117,6 +140,7 @@ void initRand (int seed)
         last = Rand ();
 }
 
+static
 int Rand (void)
 {
     int t;
@@ -169,6 +193,7 @@ typedef struct tspstruct {
  * Prim's approximated TSP tour
  * See also [Cristophides'92]
  */
+static
 int findEulerianPath(TSP *tsp)
 {
     int *mst, *arc;    
@@ -185,14 +210,14 @@ int findEulerianPath(TSP *tsp)
     maxd   = tsp->maxd;
     n      = tsp->n;
 
-    if (!(mst = (int*) palloc(n * sizeof(int))) ||
-        !(arc = (int*) palloc(n * sizeof(int))) ||
-        !(dis = (DTYPE*) palloc(n * sizeof(DTYPE))) )
+    if (!(mst = (int*) palloc((size_t) n * sizeof(int))) ||
+        !(arc = (int*) palloc((size_t) n * sizeof(int))) ||
+        !(dis = (DTYPE*) palloc((size_t) n * sizeof(DTYPE))) )
     {
         elog(ERROR, "Failed to allocate memory!");
         return -1;
     }
-    //DBG("findEulerianPath: 1");
+    //PGR_DBG("findEulerianPath: 1");
 
     k = -1;
     j = -1;
@@ -208,7 +233,7 @@ int findEulerianPath(TSP *tsp)
             j = i;
         }
     }
-    //DBG("findEulerianPath: j=%d", j);
+    //PGR_DBG("findEulerianPath: j=%d", j);
 
     if (j == -1)
         elog(ERROR, "Error TSP fail to findEulerianPath, check your distance matrix is valid.");
@@ -240,7 +265,7 @@ int findEulerianPath(TSP *tsp)
         }
         j = k;
     }
-    //DBG("findEulerianPath: 3");
+    //PGR_DBG("findEulerianPath: 3");
 
     /*
      * Preorder Tour of MST
@@ -265,11 +290,12 @@ int findEulerianPath(TSP *tsp)
             }    
         }
     }
-    //DBG("findEulerianPath: 4");
+    //PGR_DBG("findEulerianPath: 4");
 
     return 0;
 }
 
+static
 DTYPE pathLength (TSP *tsp)
 {
     unsigned int i;
@@ -295,6 +321,7 @@ DTYPE pathLength (TSP *tsp)
  *  ./     \.        .       .
  *  c       f        c-------f
  */
+static
 DTYPE getThreeWayCost (TSP *tsp, Path p)
 {
     int a, b, c, d, e, f;
@@ -313,6 +340,7 @@ DTYPE getThreeWayCost (TSP *tsp, Path p)
         /* add cost between d and e if non symetric TSP */ 
 }
 
+static
 void doThreeWay (TSP *tsp, Path p)
 {
     int i, count, m1, m2, m3, a, b, c, d, e, f;
@@ -351,6 +379,7 @@ void doThreeWay (TSP *tsp, Path p)
  *    /\        |  |
  *   a  d       a  d
  */
+static
 DTYPE getReverseCost (TSP *tsp, Path p)
 {
     int a, b, c, d;
@@ -366,7 +395,7 @@ DTYPE getReverseCost (TSP *tsp, Path p)
     return (D(d,b) + D(c,a) - D(a,b) - D(c,d));
     /* add cost between c and b if non symetric TSP */ 
 }
-
+static
 void doReverse(TSP *tsp, Path p)
 {
     int i, nswaps, first, last, tmp;
@@ -386,6 +415,7 @@ void doReverse(TSP *tsp, Path p)
     }
 }
 
+static
 void annealing(TSP *tsp)
 {
     Path   p;
@@ -442,12 +472,13 @@ void annealing(TSP *tsp)
             }
             if (pathchg > IMPROVED_PATH_PER_T) break; /* finish early */
         }   
-        DBG("T:%f L:%f B:%f C:%d", T, pathlen, tsp->bestlen, pathchg);
+        PGR_DBG("T:%f L:%f B:%f C:%d", T, pathlen, tsp->bestlen, pathchg);
         if (pathchg == 0) break;   /* if no change then quit */
     }
 }
 
 
+static
 void reverse(int num, int *ids)
 {
     int i, j, t;
@@ -471,21 +502,21 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
     long  seed = -314159L;
     DTYPE blength;
 
-    DBG("sizeof(long)=%d", (int)sizeof(long));
+    PGR_DBG("sizeof(long)=%d", (int)sizeof(long));
 
-    initRand (seed);
+    initRand((int) seed);
 
 #ifdef DEBUG
     char bufff[2048];
     int nnn;
-    DBG("---------- Matrix[%d][%d] ---------------------\n", num, num);
+    PGR_DBG("---------- Matrix[%d][%d] ---------------------\n", num, num);
     for (i=0; i<num; i++) {
         sprintf(bufff, "%d:", i);
         nnn = 0;
         for (j=0; j<num; j++) {
             nnn += sprintf(bufff+nnn, "\t%.4f", cost[i*num+j]);
         }
-        DBG("%s", bufff);
+        PGR_DBG("%s", bufff);
     }
 #endif
 
@@ -496,9 +527,9 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
     tsp.jorder = NULL;
     tsp.border = NULL;
 
-    if (!(tsp.iorder = (int*) palloc (tsp.n * sizeof(int)))   ||
-        !(tsp.jorder = (int*) palloc (tsp.n * sizeof(int)))   ||
-        !(tsp.border = (int*) palloc (tsp.n * sizeof(int)))   ) {
+    if (!(tsp.iorder = (int*) palloc ((size_t) tsp.n * sizeof(int)))   ||
+        !(tsp.jorder = (int*) palloc ((size_t) tsp.n * sizeof(int)))   ||
+        !(tsp.border = (int*) palloc ((size_t) tsp.n * sizeof(int)))   ) {
             elog(FATAL, "Memory allocation failed!");
             return -1;
         }
@@ -515,7 +546,7 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
     tsp.bestlen = pathLength(&tsp);
     for (i = 0; i < tsp.n; i++) tsp.border[i] = tsp.iorder[i];
 
-    DBG("Initial Path Length: %.4f", tsp.bestlen);
+    PGR_DBG("Initial Path Length: %.4f", tsp.bestlen);
 
     /*
      * Set up first eulerian path iorder to be improved by
@@ -530,22 +561,22 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
         for (i = 0; i < tsp.n; i++) tsp.border[i] = tsp.iorder[i];
     }
 
-    DBG("Approximated Path Length: %.4f", blength);
+    PGR_DBG("Approximated Path Length: %.4f", blength);
 
     annealing(&tsp);
 
     *total_len = pathLength(&tsp);
-    DBG("Final Path Length: %.4f", *total_len);
+    PGR_DBG("Final Path Length: %.4f", *total_len);
 
     *total_len = tsp.bestlen;
     for (i=0; i<tsp.n; i++) tsp.iorder[i] = tsp.border[i];
-    DBG("Best Path Length: %.4f", *total_len);
+    PGR_DBG("Best Path Length: %.4f", *total_len);
 
     // reorder ids[] with start as first
 
 #ifdef DEBUG
     for (i=0; i<tsp.n; i++) {
-        DBG("i: %d, ids[i]: %d, io[i]: %d, jo[i]: %d, jo[io[i]]: %d",
+        PGR_DBG("i: %d, ids[i]: %d, io[i]: %d, jo[i]: %d, jo[io[i]]: %d",
             i, ids[i], tsp.iorder[i], tsp.jorder[i], tsp.jorder[tsp.iorder[i]]);
     }
 #endif
@@ -555,14 +586,14 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
         if (ids[i] == start) istart = i;
         if (ids[i] == end)   iend = i;
     }
-    DBG("istart: %d, iend: %d", istart, iend);
+    PGR_DBG("istart: %d, iend: %d", istart, iend);
 
     // get the idex of start in iorder
     for (i=0; i < tsp.n; i++) {
         if (tsp.iorder[i] == istart) jstart = i;
         if (tsp.iorder[i] == iend)   jend = i;
     }
-    DBG("jstart: %d, jend: %d", jstart, jend);
+    PGR_DBG("jstart: %d, jend: %d", jstart, jend);
 
     /*
      * If the end is specified and the end point and it follow start
@@ -574,11 +605,11 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
         jend = jstart;
         jstart = tmp;
         rev = 1;
-        DBG("reversed start and end: jstart: %d, jend: %d", jstart, jend);
+        PGR_DBG("reversed start and end: jstart: %d, jend: %d", jstart, jend);
     }
 
     // copy ids to tsp.jorder so we can rewrite ids
-    memcpy(tsp.jorder, ids, tsp.n * sizeof(int));
+    memcpy(tsp.jorder, ids, (size_t) tsp.n * sizeof(int));
 
     // write reordered ids into ids[]
     // remember at this point jorder is our list if ids
@@ -597,14 +628,14 @@ int find_tsp_solution(int num, DTYPE *cost, int *ids, int start, int end, DTYPE
     }
 
 #ifdef DEBUG
-    DBG("ids getting returned!");
+    PGR_DBG("ids getting returned!");
     for (i=0; i<tsp.n; i++) {
-        DBG("i: %d, ids[i]: %d, io[i]: %d, jo[i]: %d",
+        PGR_DBG("i: %d, ids[i]: %d, io[i]: %d, jo[i]: %d",
             i, ids[i], tsp.iorder[i], tsp.jorder[i]);
     }
 #endif
 
-    DBG("tsplib: jstart=%d, jend=%d, n=%d, j=%d", jstart, jend, tsp.n, j);
+    PGR_DBG("tsplib: jstart=%d, jend=%d, n=%d, j=%d", jstart, jend, tsp.n, j);
 
     return 0;
 }
diff --git a/src/tsp/src/xyd_tsp.c b/src/tsp/src/xyd_tsp.c
new file mode 100644
index 0000000..462d26d
--- /dev/null
+++ b/src/tsp/src/xyd_tsp.c
@@ -0,0 +1,208 @@
+/*PGR-GNU*****************************************************************
+File: xyz_tsp.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer:
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: vicky_vergara at hotmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+// #define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./distances_input.h"
+#include "./tsp_driver.h"
+
+// #include "./one_to_one_dijkstra_driver.h"
+
+
+PG_FUNCTION_INFO_V1(xyd_tsp);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+xyd_tsp(PG_FUNCTION_ARGS);
+
+/******************************************************************************/
+/*                          MODIFY AS NEEDED                                  */
+static
+void
+process(
+        char* distances_sql,
+        int64_t start_vid,
+        int64_t end_vid,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    Matrix_cell_t *distances = NULL;
+    size_t total_distances = 0;
+    pgr_get_distances(distances_sql, &distances, &total_distances);
+
+    if (total_distances == 0) {
+        PGR_DBG("No distances found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_distances);
+
+    PGR_DBG("Starting processing");
+    char *err_msg = NULL;
+    do_pgr_tsp(
+            distances,
+            total_distances,
+            start_vid,
+            end_vid,
+            result_tuples,
+            result_count,
+            &err_msg);
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(distances);
+    pgr_SPI_finish();
+}
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+xyd_tsp(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /**********************************************************************/
+        /*                          MODIFY AS NEEDED                          */
+        // CREATE OR REPLACE FUNCTION pgr_dijkstra(
+        // sql text,
+        // start_vid BIGINT,
+        // end_vid BIGINT,
+        // directed BOOLEAN default true,
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                PG_GETARG_INT64(1),
+                PG_GETARG_INT64(2),
+                &result_tuples,
+                &result_count);
+
+        /*                                                                    */
+        /**********************************************************************/
+
+        funcctx->max_calls = (uint32_t) result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc)
+                != TYPEFUNC_COMPOSITE) {
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+        }
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /**********************************************************************/
+        /*                          MODIFY AS NEEDED                          */
+        // OUT seq INTEGER,
+        // OUT node BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT
+
+        values = palloc(4 * sizeof(Datum));
+        nulls = palloc(4 * sizeof(char));
+
+
+        size_t i;
+        for (i = 0; i < 4; ++i) {
+            nulls[i] = ' ';
+        }
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[2] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[3] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /**********************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/tsp/test/test.conf b/src/tsp/test/test.conf
index fa27c6c..d50f65d 100644
--- a/src/tsp/test/test.conf
+++ b/src/tsp/test/test.conf
@@ -3,8 +3,14 @@
 %main::tests = (
     'any' => {
         'comment' => 'TSP test for any versions.',
-        'data' => ['tsp-any-00.data'],
-        'tests' => [qw(tsp-any-00 tsp-any-01 tsp-any-03 tsp-any-04 tsp-any-05)]
+        'data' => ['tsp-any-00.data','tsp.data'],
+        'tests' => [qw(
+            tsp-any
+            tsp-any-00
+            tsp-any-01
+            tsp-any-03
+            tsp-any-04
+            tsp-any-05)]
         },
 #    'vpg-vpgis' => {}, # for version specific tests
 #    '8-1' => {},       # for pg 8.x and postgis 1.x
diff --git a/src/tsp/test/tsp-any-00.test.sql b/src/tsp/test/tsp-any-00.test.sql
index a61b413..c015300 100644
--- a/src/tsp/test/tsp-any-00.test.sql
+++ b/src/tsp/test/tsp-any-00.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select round(sum(cost)::numeric, 4) as cost from pgr_tsp('select source_id as id, x, y from tsp_00 where source_id in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22)', 1);
diff --git a/src/tsp/test/tsp-any-01.test.sql b/src/tsp/test/tsp-any-01.test.sql
index 31e93c7..7f6ff54 100644
--- a/src/tsp/test/tsp-any-01.test.sql
+++ b/src/tsp/test/tsp-any-01.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select round(sum(cost)::numeric, 4) as cost from pgr_tsp('select source_id as id, x, y from tsp_00 where source_id<12 order by source_id', 6);
diff --git a/src/tsp/test/tsp-any-03.test.sql b/src/tsp/test/tsp-any-03.test.sql
index 45857bb..0959b41 100644
--- a/src/tsp/test/tsp-any-03.test.sql
+++ b/src/tsp/test/tsp-any-03.test.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select * from pgr_tsp('{{0,1,2,3,4},{1,0,3,2,1},{2,3,0,4,2},{3,2,4,0,3},{4,1,2,3,0}}'::float8[],0,1);
 \echo '----------------------------------'
 select * from pgr_tsp('{{0,1,2,3,4},{1,0,3,2,1},{2,3,0,4,2},{3,2,4,0,3},{4,1,2,3,0}}'::float8[],0,2);
diff --git a/src/tsp/test/tsp-any-04.test.sql b/src/tsp/test/tsp-any-04.test.sql
index 9e00c11..a0504dc 100644
--- a/src/tsp/test/tsp-any-04.test.sql
+++ b/src/tsp/test/tsp-any-04.test.sql
@@ -1 +1,23 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select seq, id1, id2, round(cost::numeric, 2) as cost from pgr_tsp('select source_id as id, x, y from tsp_00 where source_id<12 order by source_id', 6, 5);
diff --git a/src/tsp/test/tsp-any-05.test.sql b/src/tsp/test/tsp-any-05.test.sql
index 211bec9..847561b 100644
--- a/src/tsp/test/tsp-any-05.test.sql
+++ b/src/tsp/test/tsp-any-05.test.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 \echo '----------------------------------1(in ints)'
 select case when r=array[1,2,3,0] then 'OK' when r=array[1,0,3,2] then 'OK' else 'FAIL' end from (select array_agg(id) as r from (SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1)) as a) as b;
 \echo '----------------------------------1(in tenths)'
diff --git a/doc/test/tsp-any.result b/src/tsp/test/tsp-any.result
similarity index 100%
rename from doc/test/tsp-any.result
rename to src/tsp/test/tsp-any.result
diff --git a/src/tsp/test/tsp-any.test.sql b/src/tsp/test/tsp-any.test.sql
new file mode 100644
index 0000000..c1dbe09
--- /dev/null
+++ b/src/tsp/test/tsp-any.test.sql
@@ -0,0 +1,14 @@
+BEGIN;
+--------------------------------------------------------------------------------
+--              PGR_pgr_tsp
+--------------------------------------------------------------------------------
+
+
+
+SELECT round(sum(cost)::numeric, 4) as cost
+FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
+select case when r=array[1,2,3,0] then 'OK' when r=array[1,0,3,2] then 'OK' else 'FAIL' end from (select array_agg(id) as r from (SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1)) as a) as b;
+SELECT seq, id FROM pgr_tsp('{{0,1,2,3},{1,0,4,5},{2,4,0,6},{3,5,6,0}}'::float8[],1,2);
+SELECT round(sum(cost)::numeric, 4) as cost
+FROM pgr_tsp('SELECT id::integer, st_x(the_geom) as x,st_x(the_geom) as y FROM edge_table_vertices_pgr  ORDER BY id', 6, 5);
+ROLLBACK;
diff --git a/src/tsp/test/tsp.data b/src/tsp/test/tsp.data
new file mode 100644
index 0000000..e67ae80
--- /dev/null
+++ b/src/tsp/test/tsp.data
@@ -0,0 +1,12 @@
+
+DROP TABLE IF EXISTS vertex_table;
+CREATE TABLE vertex_table (
+    id serial,
+    x double precision,
+    y double precision
+);
+
+INSERT INTO vertex_table VALUES
+(1,2,0), (2,2,1), (3,3,1), (4,4,1), (5,0,2), (6,1,2), (7,2,2),
+(8,3,2), (9,4,2), (10,2,3), (11,3,3), (12,4,3), (13,2,4);
+
diff --git a/src/vrp_basic/CMakeLists.txt b/src/vrp_basic/CMakeLists.txt
index db45096..a9219b9 100644
--- a/src/vrp_basic/CMakeLists.txt
+++ b/src/vrp_basic/CMakeLists.txt
@@ -4,4 +4,3 @@ set(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
 
 subdirs(doc src test)
 
-
diff --git a/src/vrp_basic/doc/index.rst b/src/vrp_basic/doc/index.rst
deleted file mode 100755
index fa7c4fa..0000000
--- a/src/vrp_basic/doc/index.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-.. 
-   ****************************************************************************
-    pgRouting Manual
-    Copyright(c) pgRouting Contributors
-
-    This documentation is licensed under a Creative Commons Attribution-Share  
-    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
-   ****************************************************************************
-
-.. _pgr_vrp_basic:
-
-pgr_vrpOneDepot 
-===============================================================================
-
-No documentation available from the original developer
-
-.. warning:: this function is experimental and there is no assurance that it will work
-
-* :ref:`type_cost_result`
-* http://en.wikipedia.org/wiki/Vehicle_routing_problem
diff --git a/src/vrp_basic/doc/pgr_vrpOneDepot.rst b/src/vrp_basic/doc/pgr_vrpOneDepot.rst
new file mode 100644
index 0000000..a1c8cea
--- /dev/null
+++ b/src/vrp_basic/doc/pgr_vrpOneDepot.rst
@@ -0,0 +1,20 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_vrp_basic:
+
+pgr_vrpOneDepot 
+===============================================================================
+
+No documentation available from the original developer
+
+.. warning:: this function is experimental and there is no assurance that it will work
+
+* :ref:`type_cost_result`
+* http://en.wikipedia.org/wiki/Vehicle_routing_problem
diff --git a/src/vrp_basic/sql/CMakeLists.txt b/src/vrp_basic/sql/CMakeLists.txt
index 7fccc6e..556b600 100644
--- a/src/vrp_basic/sql/CMakeLists.txt
+++ b/src/vrp_basic/sql/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Append in local scope
 LIST(APPEND PACKAGE_SQL_FILES
     ${CMAKE_CURRENT_SOURCE_DIR}/routing_vrp.sql
-)
+    )
 
 # set in parent scope
 SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/vrp_basic/sql/routing_vrp.sql b/src/vrp_basic/sql/routing_vrp.sql
index 3ac868b..18ab505 100644
--- a/src/vrp_basic/sql/routing_vrp.sql
+++ b/src/vrp_basic/sql/routing_vrp.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 -----------------------------------------------------------------------
 -- Core function for vrp with sigle depot computation
 -- See README for description
@@ -17,7 +39,7 @@ create or replace function pgr_vrpOneDepot(
 	OUT tarrival integer, 
 	OUT tdepart integer)
 returns setof record as
-'$libdir/librouting-2.1', 'vrp'
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'vrp'
 LANGUAGE c VOLATILE STRICT;
 
 
diff --git a/src/vrp_basic/src/Tester.cpp b/src/vrp_basic/src/Tester.cpp
index cb4d40e..a3bb228 100644
--- a/src/vrp_basic/src/Tester.cpp
+++ b/src/vrp_basic/src/Tester.cpp
@@ -1,266 +1,268 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#include "VRP_Solver.h"
-#include "Utils.h"
-
-char buff[1005];
-
-CVRPSolver solver;
-
-// Load orders from the order file. The first order represents the depot.
-// TODO: file names are hard coded, it should be changed to commandline argument.
-void loadOrders()
-{
-	FILE *fp = fopen("Orders.txt", "rt");
-	if(fp == NULL)
-	{
-		fprintf(stderr, "Order file not found!\n");
-	}
-	bool bGotDepot = false;
-	// OrderId XCord YCord Demand StartTime EndTime ServiceTime
-	while(fgets(buff, 1000, fp))
-	{
-		if(strlen(buff) == 0)
-			break;
-		StringTokenizer tokenizer;
-		tokenizer.parse(buff, " \t");
-		StringVector vecToken;
-		tokenizer.getTokens(vecToken);
-
-		if(vecToken.size() != 7)
-			continue;
-
-		if(!isdigit(vecToken[0][0]))
-			continue;
-		
-		if (!bGotDepot)
-		{
-			// This order represents Deopot
-			CDepotInfo depot;
-			int id = atoi(vecToken[0].c_str());
-			depot.setDepotId(id);
-
-			Point pt;
-
-			pt.X = atof(vecToken[1].c_str());
-			pt.Y = atof(vecToken[2].c_str());
-
-			depot.setDepotLocation(pt);
-
-			int openTime = atoi(vecToken[4].c_str());
-			depot.setOpenTime(openTime);
-
-			int closeTime = atoi(vecToken[5].c_str());
-			depot.setCloseTime(closeTime);
-
-			solver.addDepot(depot);
-			bGotDepot = true;
-		}
-		else
-		{
-			// This is an order
-			COrderInfo order;
-			int id = atoi(vecToken[0].c_str());
-			order.setOrderId(id);
-
-			Point pt;
-
-			pt.X = atof(vecToken[1].c_str());
-			pt.Y = atof(vecToken[2].c_str());
-
-			order.setOrderLocation(pt);
-
-			int demand = atoi(vecToken[3].c_str());
-			order.setOrderUnit(demand);
-
-			int openTime = atoi(vecToken[4].c_str());
-			order.setOpenTime(openTime);
-
-			int closeTime = atoi(vecToken[5].c_str());
-			order.setCloseTime(closeTime);
-
-			int serviceTime = atoi(vecToken[6].c_str());
-			order.setServiceTime(serviceTime);
-
-			solver.addOrder(order);
-		}
-	}
-	fclose(fp);
-}
-
-// Load vehicles from vehicle file.
-// TODO: file names are hard coded, it should be changed to commandline argument.
-
-void loadVehicles()
-{
-	FILE *fp = fopen("Vehicles.txt", "rt");
-
-	if(fp == NULL)
-	{
-		fprintf(stderr, "Vehicle file not found!\n");
-	}
-	// VehicleId Capacity 
-	// In terms of cost all the vehicle will have default cost of 1 for the first version
-	while(fgets(buff, 1000, fp))
-	{
-		if(strlen(buff) == 0)
-			break;
-		StringTokenizer tokenizer;
-		tokenizer.parse(buff, " \t");
-		StringVector vecToken;
-		tokenizer.getTokens(vecToken);
-
-		if(vecToken.size() != 2)
-			continue;
-
-		if(!isdigit(vecToken[0][0]))
-			continue;
-
-		CVehicleInfo vehicle;
-
-		int id = atoi(vecToken[0].c_str());
-		vehicle.setId(id);
-		
-		int capcity = atoi(vecToken[1].c_str());
-		vehicle.setCapacity(capcity);
-
-		vehicle.setCostPerKM(1);
-
-		solver.addVehicle(vehicle);
-	}
-	fclose(fp);
-}
-
-// Load the cost matrix
-// TODO: file names are hard coded, it should be changed to commandline argument.
-void loadDistanceMatrix()
-{
-	FILE *fp = fopen("Distance.txt", "rt");
-	if(fp == NULL)
-	{
-		fprintf(stderr, "Cost file not found!\n");
-		return;
-	}
-
-	// From To Cost
-	while(fgets(buff, 1000, fp))
-	{
-		if(strlen(buff) == 0)
-			break;
-		StringTokenizer tokenizer;
-		tokenizer.parse(buff, " \t");
-		StringVector vecToken;
-		tokenizer.getTokens(vecToken);
-
-		if(vecToken.size() != 3)
-			continue;
-
-		if(!isdigit(vecToken[0][0]))
-			continue;
-
-		int fromId = atoi(vecToken[0].c_str());
-		int toId = atoi(vecToken[1].c_str());
-		CostPack cpack;
-		cpack.cost = cpack.distance = atof(vecToken[2].c_str());
-		cpack.traveltime = cpack.cost;
-		
-		if(fromId == 1)
-			solver.addDepotToOrderCost(fromId, toId, cpack);
-		else if(toId == 1)
-			solver.addOrderToDepotCost(fromId, toId, cpack);
-		else
-			solver.addOrderToOrderCost(fromId, toId, cpack);
-	}
-	fclose(fp);		
-}
-
-// Print the solution to a file.
-// TODO: Currently prints on a fixed file. Later the file name will be taken as a command line argument
-
-bool print_solution(std::string strError)
-{
-	FILE *fp = fopen("result.txt", "wt");
-	if(fp == NULL)
-	{
-		strError = "Could not open file";
-		return false;
-	}
-	CSolutionInfo solution;
-	bool bOK = solver.getSolution(solution, strError);
-	if(bOK == false)
-		return false;
-
-	int totalRoute = solution.getTourInfoVector().size();
-	CTourInfo ctour;
-
-	fprintf(fp, "Total Number of Route: %d\n", totalRoute);
-	fprintf(fp, "Total Cost: %.3lf\n", solution.getTotalCost());
-	fprintf(fp, "Total Distance: %.3lf\n", solution.getTotalDistance());
-	fprintf(fp, "Total TravelTime: %.3lf\n", solution.getTotalTravelTime());
-
-	for(int i = 0; i < totalRoute; i++)
-	{
-		ctour = solution.getTour(i);
-		fprintf(fp, "Route No. %d: \n", i + 1);
-		fprintf(fp, "Vehicle Id: %d\n", ctour.getVehicleId());
-		fprintf(fp, "Starting Depot Id: %d\n", ctour.getStartDepot());
-		fprintf(fp, "End Depot Id: %d\n", ctour.getEndDepot());
-
-		std::vector<int> vecOrder = ctour.getOrderVector();
-		int totalOrder = vecOrder.size();
-		fprintf(fp, "Visited Order Ids: ");
-		for(int j = 0; j < totalOrder; j++)
-		{
-			if(j > 0)
-				fprintf(fp, " ");
-			fprintf(fp, "%d", vecOrder[j]);
-			if(j < totalOrder - 1)
-				fprintf(fp, ",");
-		}
-		fprintf(fp, "\n");
-	}
-
-	fclose(fp);
-	return true;
-}
-
-int main()
-{
-	loadOrders();
-	loadVehicles();
-	loadDistanceMatrix();
-	
-	std::string strError;
-	bool bIsOK = solver.solveVRP(strError);
-	
-	if(!bIsOK)
-	{
-		fprintf(stderr, "Error Occurred: %s\n", strError.c_str());
-	}
-	else
-	{
-		print_solution(strError);
-	}
-
-
-	return 0;
-}
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "VRP_Solver.h"
+#include "Utils.h"
+
+char buff[1005];
+
+CVRPSolver solver;
+
+// Load orders from the order file. The first order represents the depot.
+// TODO: file names are hard coded, it should be changed to commandline argument.
+void loadOrders()
+{
+	FILE *fp = fopen("Orders.txt", "rt");
+	if(fp == NULL)
+	{
+		fprintf(stderr, "Order file not found!\n");
+	}
+	bool bGotDepot = false;
+	// OrderId XCord YCord Demand StartTime EndTime ServiceTime
+	while(fgets(buff, 1000, fp))
+	{
+		if(strlen(buff) == 0)
+			break;
+		StringTokenizer tokenizer;
+		tokenizer.parse(buff, " \t");
+		StringVector vecToken;
+		tokenizer.getTokens(vecToken);
+
+		if(vecToken.size() != 7)
+			continue;
+
+		if(!isdigit(vecToken[0][0]))
+			continue;
+		
+		if (!bGotDepot)
+		{
+			// This order represents Deopot
+			CDepotInfo depot;
+			int id = atoi(vecToken[0].c_str());
+			depot.setDepotId(id);
+
+			Point pt;
+
+			pt.X = atof(vecToken[1].c_str());
+			pt.Y = atof(vecToken[2].c_str());
+
+			depot.setDepotLocation(pt);
+
+			int openTime = atoi(vecToken[4].c_str());
+			depot.setOpenTime(openTime);
+
+			int closeTime = atoi(vecToken[5].c_str());
+			depot.setCloseTime(closeTime);
+
+			solver.addDepot(depot);
+			bGotDepot = true;
+		}
+		else
+		{
+			// This is an order
+			COrderInfo order;
+			int id = atoi(vecToken[0].c_str());
+			order.setOrderId(id);
+
+			Point pt;
+
+			pt.X = atof(vecToken[1].c_str());
+			pt.Y = atof(vecToken[2].c_str());
+
+			order.setOrderLocation(pt);
+
+			int demand = atoi(vecToken[3].c_str());
+			order.setOrderUnit(demand);
+
+			int openTime = atoi(vecToken[4].c_str());
+			order.setOpenTime(openTime);
+
+			int closeTime = atoi(vecToken[5].c_str());
+			order.setCloseTime(closeTime);
+
+			int serviceTime = atoi(vecToken[6].c_str());
+			order.setServiceTime(serviceTime);
+
+			solver.addOrder(order);
+		}
+	}
+	fclose(fp);
+}
+
+// Load vehicles from vehicle file.
+// TODO: file names are hard coded, it should be changed to commandline argument.
+
+void loadVehicles()
+{
+	FILE *fp = fopen("Vehicles.txt", "rt");
+
+	if(fp == NULL)
+	{
+		fprintf(stderr, "Vehicle file not found!\n");
+	}
+	// VehicleId Capacity 
+	// In terms of cost all the vehicle will have default cost of 1 for the first version
+	while(fgets(buff, 1000, fp))
+	{
+		if(strlen(buff) == 0)
+			break;
+		StringTokenizer tokenizer;
+		tokenizer.parse(buff, " \t");
+		StringVector vecToken;
+		tokenizer.getTokens(vecToken);
+
+		if(vecToken.size() != 2)
+			continue;
+
+		if(!isdigit(vecToken[0][0]))
+			continue;
+
+		CVehicleInfo vehicle;
+
+		int id = atoi(vecToken[0].c_str());
+		vehicle.setId(id);
+		
+		int capcity = atoi(vecToken[1].c_str());
+		vehicle.setCapacity(capcity);
+
+		vehicle.setCostPerKM(1);
+
+		solver.addVehicle(vehicle);
+	}
+	fclose(fp);
+}
+
+// Load the cost matrix
+// TODO: file names are hard coded, it should be changed to commandline argument.
+void loadDistanceMatrix()
+{
+	FILE *fp = fopen("Distance.txt", "rt");
+	if(fp == NULL)
+	{
+		fprintf(stderr, "Cost file not found!\n");
+		return;
+	}
+
+	// From To Cost
+	while(fgets(buff, 1000, fp))
+	{
+		if(strlen(buff) == 0)
+			break;
+		StringTokenizer tokenizer;
+		tokenizer.parse(buff, " \t");
+		StringVector vecToken;
+		tokenizer.getTokens(vecToken);
+
+		if(vecToken.size() != 3)
+			continue;
+
+		if(!isdigit(vecToken[0][0]))
+			continue;
+
+		int fromId = atoi(vecToken[0].c_str());
+		int toId = atoi(vecToken[1].c_str());
+		CostPack cpack;
+		cpack.cost = cpack.distance = atof(vecToken[2].c_str());
+		cpack.traveltime = cpack.cost;
+		
+		if(fromId == 1)
+			solver.addDepotToOrderCost(fromId, toId, cpack);
+		else if(toId == 1)
+			solver.addOrderToDepotCost(fromId, toId, cpack);
+		else
+			solver.addOrderToOrderCost(fromId, toId, cpack);
+	}
+	fclose(fp);		
+}
+
+// Print the solution to a file.
+// TODO: Currently prints on a fixed file. Later the file name will be taken as a command line argument
+
+bool print_solution(std::string strError)
+{
+	FILE *fp = fopen("result.txt", "wt");
+	if(fp == NULL)
+	{
+		strError = "Could not open file";
+		return false;
+	}
+	CSolutionInfo solution;
+	bool bOK = solver.getSolution(solution, strError);
+	if(bOK == false)
+		return false;
+
+	int totalRoute = solution.getTourInfoVector().size();
+	CTourInfo ctour;
+
+	fprintf(fp, "Total Number of Route: %d\n", totalRoute);
+	fprintf(fp, "Total Cost: %.3lf\n", solution.getTotalCost());
+	fprintf(fp, "Total Distance: %.3lf\n", solution.getTotalDistance());
+	fprintf(fp, "Total TravelTime: %.3lf\n", solution.getTotalTravelTime());
+
+	for(int i = 0; i < totalRoute; i++)
+	{
+		ctour = solution.getTour(i);
+		fprintf(fp, "Route No. %d: \n", i + 1);
+		fprintf(fp, "Vehicle Id: %d\n", ctour.getVehicleId());
+		fprintf(fp, "Starting Depot Id: %d\n", ctour.getStartDepot());
+		fprintf(fp, "End Depot Id: %d\n", ctour.getEndDepot());
+
+		std::vector<int> vecOrder = ctour.getOrderVector();
+		int totalOrder = vecOrder.size();
+		fprintf(fp, "Visited Order Ids: ");
+		for(int j = 0; j < totalOrder; j++)
+		{
+			if(j > 0)
+				fprintf(fp, " ");
+			fprintf(fp, "%d", vecOrder[j]);
+			if(j < totalOrder - 1)
+				fprintf(fp, ",");
+		}
+		fprintf(fp, "\n");
+	}
+
+	fclose(fp);
+	return true;
+}
+
+int main()
+{
+	loadOrders();
+	loadVehicles();
+	loadDistanceMatrix();
+	
+	std::string strError;
+	bool bIsOK = solver.solveVRP(strError);
+	
+	if(!bIsOK)
+	{
+		fprintf(stderr, "Error Occurred: %s\n", strError.c_str());
+	}
+	else
+	{
+		print_solution(strError);
+	}
+
+
+	return 0;
+}
diff --git a/src/vrp_basic/src/Utils.h b/src/vrp_basic/src/Utils.h
index 91b4444..d6ddf0f 100644
--- a/src/vrp_basic/src/Utils.h
+++ b/src/vrp_basic/src/Utils.h
@@ -1,108 +1,130 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#ifndef UTILS_H
-#define UTILS_H
-
-#include <string>
-#include <map>
-#include <vector>
-#include <queue>
-#include <iostream>
-
-
-
-typedef std::vector<int> IntVector;
-typedef std::vector<double> DoubleVector;
-typedef std::vector<std::string> StringVector;
-
-
-class StringOperation
-{
-
-public:
-
-	static std::string TRIMWHITESPACE(std::string strInput)
-	{
-		std::string strOut = strInput;
-		std::string strWht = " \f\n\r\t\v";	
-
-		strOut.erase(0,strOut.find_first_not_of(strWht));
-		strOut.erase(strOut.find_last_not_of(strWht) + 1);
-		return strOut;
-	};
-};
-
-class StringTokenizer
-{
-public:
-	StringTokenizer()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		vecTokens.clear();
-		strInput = "";
-	}
-
-	bool parse(std::string strInput, std::string chDelim)
-	{
-		char *ptr = strtok((char *)strInput.c_str(), chDelim.c_str());
-		while(ptr != NULL)
-		{
-			std::string str = ptr;
-			vecTokens.push_back(str);
-			ptr = strtok(NULL, chDelim.c_str());
-		}
-		return true;
-	}
-
-	size_t getTokenCount() 
-	{
-		return vecTokens.size();
-	}
-
-	bool getToken(std::string& strToken, long iTokenIndex)
-	{
-		long lTokenCount = vecTokens.size();
-		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
-		{
-			strToken = vecTokens[iTokenIndex];
-			return true;
-		}
-		return false;
-	}
-
-	bool getTokens(StringVector& vecTokensRef)
-	{
-		vecTokensRef = vecTokens;
-		return true;
-	}
-
-private:
-	std::string strInput;
-	StringVector vecTokens;
-
-};
-
-#endif
+/*PGR
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <string>
+#include <map>
+#include <vector>
+#include <queue>
+#include <iostream>
+
+
+
+typedef std::vector<int> IntVector;
+typedef std::vector<double> DoubleVector;
+typedef std::vector<std::string> StringVector;
+
+class tokenizer
+{
+    std::string s, delim;
+    std::string::size_type pos;
+
+public:
+
+    tokenizer( std::string xs, std::string xdelim ) : s(xs), delim(xdelim)
+    {
+        pos = s.find_first_not_of( delim );
+    }
+
+    bool has_more_tokens()
+    {
+        return pos != std::string::npos;
+    }
+
+    std::string next_token()
+    {
+        std::string::size_type end_pos = s.find_first_of( delim, pos );
+        std::string token = s.substr( pos, end_pos-pos );
+        pos = s.find_first_not_of( delim, end_pos );
+        return token;
+    }
+};
+
+class StringOperation
+{
+
+public:
+
+	static std::string TRIMWHITESPACE(std::string strInput)
+	{
+		std::string strOut = strInput;
+		std::string strWht = " \f\n\r\t\v";	
+
+		strOut.erase(0,strOut.find_first_not_of(strWht));
+		strOut.erase(strOut.find_last_not_of(strWht) + 1);
+		return strOut;
+	};
+};
+
+class StringTokenizer
+{
+public:
+	StringTokenizer()
+	{
+		reset();
+	}
+
+	void reset()
+	{
+		vecTokens.clear();
+		strInput = "";
+	}
+
+	bool parse(std::string strInput, std::string chDelim)
+	{
+        tokenizer t( strInput, chDelim );
+		while(t.has_more_tokens())
+		{
+			vecTokens.push_back(t.next_token());
+		}
+		return true;
+	}
+
+	size_t getTokenCount() 
+	{
+		return vecTokens.size();
+	}
+
+	bool getToken(std::string& strToken, long iTokenIndex)
+	{
+		long lTokenCount = vecTokens.size();
+		if(iTokenIndex < 0 || iTokenIndex < lTokenCount)
+		{
+			strToken = vecTokens[iTokenIndex];
+			return true;
+		}
+		return false;
+	}
+
+	bool getTokens(StringVector& vecTokensRef)
+	{
+		vecTokensRef = vecTokens;
+		return true;
+	}
+
+private:
+	std::string strInput;
+	StringVector vecTokens;
+
+};
+
diff --git a/src/vrp_basic/src/VRP.c b/src/vrp_basic/src/VRP.c
index 2ede79d..237c21b 100644
--- a/src/vrp_basic/src/VRP.c
+++ b/src/vrp_basic/src/VRP.c
@@ -1,922 +1,916 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#include "VRP.h"
-
-#include "postgres.h"
-#include "executor/spi.h"
-#include "funcapi.h"
-#include "catalog/pg_type.h"
-#if PGSQL_VERSION > 92
-#include "access/htup_details.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <search.h>
-
-#include "string.h"
-#include "math.h"
-
-#include "fmgr.h"
-
-
-
-#undef qsort
-
-//-------------------------------------------------------------------------
-
-/*
- * Define this to have profiling enabled
- */
-//#define PROFILE
-
-#ifdef PROFILE
-#include <sys/time.h>
-
-struct timeval prof_astar, prof_store, prof_extract, prof_total;
-long proftime[5];
-long profipts1, profipts2, profopts;
-
-#define profstart(x) do { gettimeofday(&x, NULL); } while (0);
-#define profstop(n, x) do { struct timeval _profstop;   \
-        long _proftime;                         \
-        gettimeofday(&_profstop, NULL);                         \
-        _proftime = ( _profstop.tv_sec*1000000+_profstop.tv_usec) -     \
-                ( x.tv_sec*1000000+x.tv_usec); \
-        elog(NOTICE, \
-                "PRF(%s) %lu (%f ms)", \
-                (n), \
-             _proftime, _proftime / 1000.0);    \
-        } while (0);
-
-#else
-
-#define profstart(x) do { } while (0);
-#define profstop(n, x) do { } while (0);
-
-#endif // PROFILE
-
-
-// ------------------------------------------------------------------------
-
-Datum vrp(PG_FUNCTION_ARGS);
-
-#undef DEBUG
-//#define DEBUG 1
-
-#ifdef DEBUG
-#define DBG(format, arg...)                     \
-    elog(NOTICE, format , ## arg)
-#else
-#define DBG(format, arg...) do { ; } while (0)
-#endif
-
-// The number of tuples to fetch from the SPI cursor at each iteration
-#define TUPLIMIT 1000
-
-#ifndef PG_MODULE_MAGIC
-PG_MODULE_MAGIC;
-#endif
-
-typedef struct vehicle_columns
-{
-	int vehicle_id;
-	int capacity;
-	
-} vehicle_columns_t;
-
-typedef struct order_columns
-{
-	int id;
-	int order_unit;
-	int open_time;
-	int close_time;
-	int service_time;
-
-	int x;
-	int y;
-} order_columns_t;
-
-typedef struct distance_columns
-{
-	int src_id;
-	int dest_id;
-	int cost;
-	int distance;
-	int traveltime;
-} distance_columns_t;
-
-
-//float DISTANCE[MAX_TOWNS][MAX_TOWNS];
-//float x[MAX_TOWNS],y[MAX_TOWNS];
-int total_tuples;
-
-static char *
-text2char(text *in)
-{
-	char *out = (char*)palloc(VARSIZE(in));
-
-	memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
-	out[VARSIZE(in) - VARHDRSZ] = '\0';
-	return out;
-}
-
-static int
-finish(int *code)
-{
-	*code = SPI_finish();
-	if (*code  != SPI_OK_FINISH )
-	{
-		elog(ERROR,"couldn't disconnect from SPI");
-		return -1 ;
-	}
-	return 0;
-}
-
-
-
-static int
-fetch_distance_columns(SPITupleTable *tuptable, distance_columns_t *distance_columns)
-{
-	DBG("Fetching distance");
-
-	distance_columns->src_id = SPI_fnumber(SPI_tuptable->tupdesc, "src_id");
-	distance_columns->dest_id = SPI_fnumber(SPI_tuptable->tupdesc, "dest_id");
-	distance_columns->cost = SPI_fnumber(SPI_tuptable->tupdesc, "cost");
-	distance_columns->distance = SPI_fnumber(SPI_tuptable->tupdesc, "distance");  
-	distance_columns->traveltime = SPI_fnumber(SPI_tuptable->tupdesc, "traveltime");
-	if (distance_columns->src_id == SPI_ERROR_NOATTRIBUTE ||
-		distance_columns->dest_id == SPI_ERROR_NOATTRIBUTE ||
-		distance_columns->cost == SPI_ERROR_NOATTRIBUTE ||
-		distance_columns->distance == SPI_ERROR_NOATTRIBUTE ||
-		distance_columns->traveltime == SPI_ERROR_NOATTRIBUTE) 
-	{
-		elog(ERROR, "Error, query must return columns "
-			"'src_id', 'dest_id', 'cost', 'distance' and 'traveltime'");
-		return -1;
-	}
-
-	return 0;
-}
-
-
-static void
-fetch_distance(HeapTuple *tuple, TupleDesc *tupdesc, 
-			   distance_columns_t *distance_columns, vrp_cost_element_t *dist, int t)
-{
-	Datum binval;
-	bool isnull;
-
-	DBG("fetch_distance: src_id col:%i", distance_columns->src_id);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->src_id, &isnull);
-
-    DBG("back from SPI_getbinval for src_id");
-    DBG("binval=%i", binval);
-
-	if (isnull)
-		elog(ERROR, "src_id contains a null value");
-
-	dist->src_id = DatumGetInt32(binval);
-
-    DBG("back from DatumGetInt32");
-	DBG("src_id=%i", dist->src_id);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->dest_id, &isnull);
-	if (isnull)
-		elog(ERROR, "dest_id contains a null value");
-
-	dist->dest_id = DatumGetInt32(binval);
-
-	DBG("dest_id=%i", dist->dest_id);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->cost, &isnull);
-
-	if (isnull)
-		elog(ERROR, "cost contains a null value");
-
-	dist->cost = DatumGetFloat8(binval);
-
-	DBG("cost=%lf", dist->cost);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->distance, &isnull);
-	if (isnull)
-		elog(ERROR, "distance contains a null value");
-
-	dist->distance = DatumGetFloat8(binval);
-
-	DBG("distance=%lf", dist->distance);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->traveltime, &isnull);
-
-	if (isnull)
-		elog(ERROR, "traveltime contains a null value");
-
-	dist->traveltime = DatumGetFloat8(binval);
-
-	DBG("traveltime=%lf", dist->traveltime);
-
-	//DBG("dist[%i][%i] = %f\n", from_point, to_point, value);
-
-	
-	//DBG("dist[%i(%i:%i)][%i(%i:%i)] = %f\n", from, from_order, from_point, to, to_order, to_point, *(dist + (num_rows * from) + to));
-
-}
-
-static int
-fetch_order_columns(SPITupleTable *tuptable, order_columns_t *order_columns)
-{
-	DBG("Fetching order");
-
-	//order_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
-	order_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
-	order_columns->order_unit = SPI_fnumber(SPI_tuptable->tupdesc, "order_unit");
-	order_columns->open_time = SPI_fnumber(SPI_tuptable->tupdesc, "open_time");
-	order_columns->close_time = SPI_fnumber(SPI_tuptable->tupdesc, "close_time");
-	order_columns->service_time = SPI_fnumber(SPI_tuptable->tupdesc, "service_time");
-	order_columns->x = SPI_fnumber(SPI_tuptable->tupdesc, "x");
-	order_columns->y = SPI_fnumber(SPI_tuptable->tupdesc, "y");  
-	if (//order_columns->id == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->id == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->open_time == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->order_unit == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->close_time == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->service_time == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->x == SPI_ERROR_NOATTRIBUTE ||
-		order_columns->y == SPI_ERROR_NOATTRIBUTE
-		)
-	{
-		//      elog(ERROR, "Error, query must return columns "
-		//           "'id', 'order_id', 'pu_time', 'do_time', 'pu_time_window', 'do_time_window', 'from_x', 'to_x', 'from_y', 'to_y' and 'size'");
-		elog(ERROR, "Error, query must return columns "
-			//"'id', 
-			"'id', 'order_unit', 'open_time', 'close_time', 'service_time', 'x', 'y'");
-		return -1;
-	}
-
-	return 0;
-}
-
-static void
-fetch_order(HeapTuple *tuple, TupleDesc *tupdesc,
-			order_columns_t *order_columns, vrp_orders_t *order, int t)
-{
-	Datum binval;
-	bool isnull;
-
-	DBG("inside fetch_order\n");
-
-	//binval = SPI_getbinval(*tuple, *tupdesc, order_columns->id, &isnull);
-	//
-	//  DBG("got binval\n");
-	//
-	//if (isnull)
-	//  elog(ERROR, "id contains a null value");
-	//
-	//order->id = DatumGetInt32(binval);
-	order->id = t+1;
-
-	DBG("id = %i\n", order->id);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->id, &isnull);
-	if (isnull)
-		elog(ERROR, "order_id contains a null value");
-
-	order->id = DatumGetInt32(binval);
-
-	DBG("order_id = %i\n", order->id);  
-
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->order_unit, &isnull);
-	if (isnull)
-		elog(ERROR, "order_unit contains a null value");
-
-	order->order_unit = DatumGetInt32(binval);
-
-	DBG("order_unit = %i\n", order->order_unit);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->open_time, &isnull);
-	if (isnull)
-		elog(ERROR, "open_time contains a null value");
-
-	order->open_time = DatumGetInt32(binval);
-
-	DBG("open_time = %i\n", order->open_time);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->close_time, &isnull);
-	if (isnull)
-		elog(ERROR, "close_time contains a null value");
-
-	order->close_time = DatumGetInt32(binval);
-
-	DBG("close_time = %d\n", order->close_time);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->service_time, &isnull);
-	if (isnull)
-		elog(ERROR, "service_time contains a null value");
-
-	order->service_time = DatumGetInt32(binval);
-
-	DBG("service_time = %d\n", order->service_time);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->x, &isnull);
-	if (isnull)
-		elog(ERROR, "x contains a null value");
-
-	order->x = DatumGetFloat8(binval);
-
-	DBG("x = %f\n", order->x);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->y, &isnull);
-	if (isnull)
-		elog(ERROR, "y contains a null value");
-
-	order->y = DatumGetFloat8(binval);
-
-	DBG("doUT = %f\n", order->y);
-
-}
-
-static int
-fetch_vehicle_columns(SPITupleTable *tuptable, vehicle_columns_t *vehicle_columns)
-{
-	DBG("Fetching order");
-
-	vehicle_columns->vehicle_id = SPI_fnumber(SPI_tuptable->tupdesc, "vehicle_id");
-	vehicle_columns->capacity = SPI_fnumber(SPI_tuptable->tupdesc, "capacity");
-	
-	if (vehicle_columns->vehicle_id == SPI_ERROR_NOATTRIBUTE ||
-		vehicle_columns->capacity == SPI_ERROR_NOATTRIBUTE
-		)
-	{
-		elog(ERROR, "Error, query must return columns "
-			"'id' and 'capacity'");
-		return -1;
-	}
-
-	return 0;
-}
-
-static void
-fetch_vehicle(HeapTuple *tuple, TupleDesc *tupdesc,
-			  vehicle_columns_t *vehicle_columns, vrp_vehicles_t *vehicle, int t)
-{
-	Datum binval;
-	bool isnull;
-
-	DBG("inside fetch_vehicle\n");
-
-	//binval = SPI_getbinval(*tuple, *tupdesc, vehicle_columns->id, &isnull);
-	//DBG("Got id\n");
-	//
-	//if (isnull)
-	//  elog(ERROR, "id contains a null value");
-	//
-	//vehicle->id = DatumGetInt32(binval);
-
-	
-	binval = SPI_getbinval(*tuple, *tupdesc, vehicle_columns->vehicle_id, &isnull);
-	DBG("Got vehicle_id\n");
-
-	if (isnull)
-		elog(ERROR, "vehicle_id contains a null value");
-
-	vehicle->id = DatumGetInt32(binval);
-
-	DBG("vehicle_id = %i\n", vehicle->id);
-
-	binval = SPI_getbinval(*tuple, *tupdesc, vehicle_columns->capacity, &isnull);
-	if (isnull)
-		elog(ERROR, "capacity contains a null value");
-
-	vehicle->capacity = DatumGetInt32(binval);
-
-	DBG("capacity = %f\n", vehicle->capacity);
-
-}
-
-static int conn(int *SPIcode)
-{
-	int res = 0;
-
-	*SPIcode = SPI_connect();
-
-	if (*SPIcode  != SPI_OK_CONNECT)
-	{
-		elog(ERROR, "vrp: couldn't open a connection to SPI");
-		res = -1;
-	}
-
-	return res;	
-}
-
-static int prepare_query(Portal *SPIportal, char* sql)
-{
-	int res = 0;
-
-	void* SPIplan = SPI_prepare(sql, 0, NULL);
-
-	if (SPIplan  == NULL)
-	{
-		elog(ERROR, "vrp: couldn't create query plan via SPI");
-		res = -1;
-	}
-
-	if ((*SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL)
-	{
-		elog(ERROR, "vrp: SPI_cursor_open('%s') returns NULL", sql);
-		res = -1;
-	}
-
-	return res;
-}
-
-static int solve_vrp(char* orders_sql, char* vehicles_sql,
-					  char* dist_sql,
-					  int depot,
-					  vrp_result_element_t** path, int *path_count)
-{
-	int SPIcode;
-
-	Portal SPIportal_o; 
-	Portal SPIportal_v; 
-	Portal SPIportal_d; 
-	// Portal SPIportal_p;
-
-	bool moredata = TRUE;
-	int ntuples;
-
-    int order_num, vehicle_num, dist_num;
-
-	vrp_vehicles_t *vehicles=NULL;
-	vehicle_columns_t vehicle_columns = {.vehicle_id = -1, .capacity = -1};
-
-	vrp_orders_t *orders=NULL;
-	order_columns_t order_columns = {.id = -1, .order_unit = -1, .open_time = -1, .close_time = -1, .service_time = -1, .x = -1, .y = -1};
-
-	vrp_cost_element_t *costs=NULL;
-	distance_columns_t distance_columns = {.src_id = -1, .dest_id = -1, .cost = -1, .distance = -1,	.traveltime = -1};
-
-	char *err_msg = NULL;
-	int ret = -1;
-
-	// int   z = 0;
-
-	// int    tt, cc;
-	// double dx, dy;
-	// float  fit=0.0;
-
-	int prep = -1, con = -1;
-
-	//int total_tuples = 0;
-	total_tuples = 0;
-	order_num = 0;
-	vehicle_num = 0;
-
-	DBG("start solve_vrp\n");
-
-	//vrp_orders_t depot_ord = {id:0, order_id:depot, from:depot_point, to:depot_point};
-	//orders = palloc(1 * sizeof(vrp_orders_t));
-	//orders[0] = depot_ord;
-
-	con = conn(&SPIcode);
-
-	if (con < 0)
-		return ret;
-
-
-	// Fetching orders
-
-    DBG("calling prepare_query for orders_sql");
-
-	prep = prepare_query(&SPIportal_o, orders_sql);
-
-	if (prep < 0)
-		return ret;
-
-	DBG("Query: %s\n",orders_sql);
-	DBG("Query executed\n");
-
-	DBG("Orders before: %i\n", order_num);
-
-	while (moredata == TRUE)  
-	{
-		SPI_cursor_fetch(SPIportal_o, TRUE, TUPLIMIT);
-
-		DBG("cursor fetched\n");
-
-		if (order_columns.id == -1)
-		{
-			if (fetch_order_columns(SPI_tuptable, &order_columns) == -1)
-				return finish(&SPIcode);
-		}
-
-		ntuples = SPI_processed;
-
-		order_num += ntuples;
-
-		DBG("Tuples: %i\n", order_num);
-
-		if (!orders)
-		  	orders = palloc(order_num * sizeof(vrp_orders_t));
-		else
-			orders = repalloc(orders, (order_num + 1) * sizeof(vrp_orders_t));
-
-		if (orders == NULL)
-		{
-			elog(ERROR, "Out of memory");
-			return finish(&SPIcode);
-		}
-
-		if (ntuples > 0)
-		{
-			int t;
-			SPITupleTable *tuptable = SPI_tuptable;
-			TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-			DBG("Got tuple desc\n");
-
-			for (t = 0; t < ntuples; t++)
-			{
-				HeapTuple tuple = tuptable->vals[t];
-				//DBG("Before order fetched [%i]\n", order_num - ntuples + t);
-				fetch_order(&tuple, &tupdesc, &order_columns,
-					&orders[order_num - ntuples + t], t);
-
-				//&orders[t+1], t);
-				DBG("Order fetched\n");
-			}
-
-			SPI_freetuptable(tuptable);
-		}
-		else
-		{
-			moredata = FALSE;
-		}
-	}// end of fetching orders
-	//finish(&SPIcode_o);
-/*
-	int o;
-	for(o=0; o<order_num+1;++o)
-	{
-		elog(NOTICE, "ORDERS[%i] = {id=%i, open=%i, close=%i, service=%i}", o, orders[o].id, orders[o].open_time, orders[o].close_time, orders[o].service_time);
-	}
-*/
-	DBG ("order_num = %i", order_num); 
-
-	//qsort (orders, order_num+1, sizeof (vrp_orders_t), order_cmp);
-
-
-	// Fetching vehicles
-
-	moredata = TRUE;
-	prep = prepare_query(&SPIportal_v, vehicles_sql);
-
-	if (prep < 0)
-		return ret;
-
-	DBG("Query: %s\n",vehicles_sql);
-	DBG("Query executed\n");
-
-
-	while (moredata == TRUE)
-	{
-		SPI_cursor_fetch(SPIportal_v, TRUE, TUPLIMIT);
-
-		if (vehicle_columns.vehicle_id == -1)
-		{
-			if (fetch_vehicle_columns(SPI_tuptable, &vehicle_columns) == -1)
-				return finish(&SPIcode);
-		}
-
-
-		ntuples = SPI_processed;
-
-		vehicle_num += ntuples;
-
-		DBG("Tuples: %i\n", vehicle_num);
-
-		if (!vehicles)
-			vehicles = palloc(vehicle_num * sizeof(vrp_vehicles_t));
-		else
-			vehicles = repalloc(vehicles, vehicle_num * sizeof(vrp_vehicles_t));
-
-		if (vehicles == NULL)
-		{
-			elog(ERROR, "Out of memory");
-			return finish(&SPIcode);
-		}
-
-		if (ntuples > 0)
-		{
-			int t;
-			SPITupleTable *tuptable = SPI_tuptable;
-			TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-			DBG("Got tuple desc\n");
-
-			for (t = 0; t < ntuples; t++)
-			{
-				HeapTuple tuple = tuptable->vals[t];
-				DBG("Before vehicle fetched\n");
-				fetch_vehicle(&tuple, &tupdesc, &vehicle_columns,
-					&vehicles[vehicle_num - ntuples + t], t);
-				DBG("Vehicle fetched\n");
-			}
-
-			SPI_freetuptable(tuptable);
-		}
-		else
-		{
-			moredata = FALSE;
-		}
-	}// end of fetching vehicles
-	//finish(&SPIcode_v);
-
-	//double dist[order_num*2+1][order_num*2+1];
-
-	// Fetching distances
-
-	dist_num = 0;
-	moredata = TRUE;
-	prep = prepare_query(&SPIportal_d, dist_sql);
-
-	if (prep < 0)
-		return ret;
-
-	DBG("Query: %s\n",dist_sql);
-	DBG("Query executed\n");
-
-	while (moredata == TRUE)
-	{
-		SPI_cursor_fetch(SPIportal_d, TRUE, TUPLIMIT);
-
-		if (distance_columns.src_id == -1)
-		{
-			if (fetch_distance_columns(SPI_tuptable, &distance_columns) == -1)
-				return finish(&SPIcode);
-		}
-
-		ntuples = SPI_processed;
-		dist_num += ntuples;
-
-		DBG("Tuples: %i\n", vehicle_num);
-
-		if (!costs)
-			costs = palloc(dist_num * sizeof(vrp_cost_element_t));
-		else
-			costs = repalloc(costs, dist_num * sizeof(vrp_cost_element_t));
-
-		if (costs == NULL)
-		{
-			elog(ERROR, "Out of memory");
-			return finish(&SPIcode);
-		}
-
-		if (ntuples > 0)
-		{
-			int t;
-			SPITupleTable *tuptable = SPI_tuptable;
-			TupleDesc tupdesc = SPI_tuptable->tupdesc;
-
-			DBG("Got tuple desc\n");
-
-			for (t = 0; t < ntuples; t++)
-			{
-				HeapTuple tuple = tuptable->vals[t];
-				DBG("Before distance fetched\n");
-				fetch_distance(&tuple, &tupdesc, &distance_columns,
-					&costs[dist_num - ntuples + t], t);
-				DBG("Distance fetched\n");
-			}
-
-			SPI_freetuptable(tuptable);
-		}
-		else
-		{
-			moredata = FALSE;
-		}
-	}// end of fetching distances
-
-
-	DBG("Calling vrp\n");
-
-	profstop("extract", prof_extract);
-	profstart(prof_vrp);
-
-	DBG("Total orders: %i\n", order_num);
-	DBG("Total vehicles: %i\n", vehicle_num);
-
-
-	//qsort (orders, order_num+1, sizeof (vrp_orders_t), order_cmp_asc);
-
-
-#ifdef DEBUG
-	int o;
-	for(o=0; o<order_num+1;++o)
-	{
-		DBG("ORDERS[%i] = {id=%i, open=%i, close=%i, service=%i}", o, orders[o].id, orders[o].open_time, orders[o].close_time, orders[o].service_time);
-	}
-#endif
-	
-
-
-	//itinerary = (vrp_result_element_t *)palloc(sizeof(vrp_result_element_t)*(order_num*2-1)*vehicle_num);
-
-	DBG("Calling vrp solver\n");
-    //elog(NOTICE, "Calling find_vrp_solution: vehicles: %i, orders: %i, dists: %i, depot: %i", vehicle_num, order_num, dist_num, depot);
-
-	ret = find_vrp_solution(vehicles, vehicle_num,
-		orders, order_num,
-		costs, dist_num,
-		depot,
-		path, path_count, &err_msg);
-
-	//ret = -1;
-	total_tuples = *path_count;
-	//elog(NOTICE, "vrp solved! ret: %d, path_count: %d", ret, *path_count);
-	// int pp;
-/*
-	for(pp = 0; pp < *path_count; pp++)
-	{
-		elog(NOTICE, "Row: %d: %d %d %d %d %d", pp, (*path)[pp].order_id, (*path)[pp].order_pos, (*path)[pp].vehicle_id, (*path)[pp].arrival_time, (*path)[pp].depart_time);
-	}
-*/
-	DBG("vrp solved! ret: %d, path_count: %d", ret, path_count);
-	//DBG("Score: %f\n", fit);
-
-	profstop("vrp", prof_vrp);
-	profstart(prof_store);
-
-	DBG("Profile changed and ret is %i", ret);
-
-	if (ret < 0)
-	{
-		//elog(ERROR, "Error computing path: %s", err_msg);
-		ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), errmsg("Error computing path: %s", err_msg)));
-	} 
-
-	//pfree(vehicles);
-	//pfree(orders);
-	return finish(&SPIcode);    
-}
-
-PG_FUNCTION_INFO_V1(vrp);
-Datum
-vrp(PG_FUNCTION_ARGS)
-{
-	FuncCallContext     *funcctx;
-	int                  call_cntr;
-	int                  max_calls;
-	TupleDesc            tuple_desc;
-	vrp_result_element_t         *path;
-
-	/* stuff done only on the first call of the function */
-	if (SRF_IS_FIRSTCALL())
-	{
-		MemoryContext   oldcontext;
-		//int path_count;
-		// int ret=-1;
-		int path_count = 0;
-
-		// XXX profiling messages are not thread safe
-		profstart(prof_total);
-		profstart(prof_extract);
-
-		/* create a function context for cross-call persistence */
-		funcctx = SRF_FIRSTCALL_INIT();
-
-		/* switch to memory context appropriate for multiple function calls */
-		oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
-
-
-		//path = (vrp_result_element_t *)palloc(sizeof(vrp_result_element_t)*(MAX_ORDERS-1)*2*MAX_VEHICLES);
-
-
-        DBG("Calling solve_vrp ...");
-
-		// ret =
-                solve_vrp(//text2char(PG_GETARG_TEXT_P(0)), // points sql
-			text2char(PG_GETARG_TEXT_P(0)),  // orders sql
-			text2char(PG_GETARG_TEXT_P(1)),  // vehicles sql
-			text2char(PG_GETARG_TEXT_P(2)),  // distances query
-			PG_GETARG_INT32(3),  // depot id
-			&path, &path_count);
-
-		DBG("Back from solve_vrp, path_count:%d", path_count);
-		//elog(NOTICE, "Back from solve_vrp, path_count:%d", path_count);
-        
-        /* total number of tuples to be returned */
-		//DBG("Counting tuples number\n");
-
-		funcctx->max_calls = total_tuples;
-
-		funcctx->user_fctx = path;
-
-		/* Build a tuple descriptor for our result type */
-        	if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
-            		ereport(ERROR,
-                    	(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                     	errmsg("function returning record called in context "
-                            "that cannot accept type record")));
-
-        	funcctx->tuple_desc = BlessTupleDesc(tuple_desc);
-
-        	/*
-         	* generate attribute metadata needed later to produce tuples from raw
-         	* C strings
-         	*/
-        	//attinmeta = TupleDescGetAttInMetadata(tuple_desc);
-        	//funcctx->attinmeta = attinmeta;
-
-		MemoryContextSwitchTo(oldcontext);
-		//elog(NOTICE, "table formed");
-	}
-
-	/* stuff done on every call of the function */
-	funcctx = SRF_PERCALL_SETUP();
-
-	call_cntr = funcctx->call_cntr;
-	max_calls = funcctx->max_calls;
-	tuple_desc = funcctx->tuple_desc;
-
-	path = (vrp_result_element_t *)funcctx->user_fctx;
-
-	//elog(NOTICE, "Point 1");
-	//DBG("Trying to allocate some memory\n");
-	//DBG("call_cntr = %i, max_calls = %i\n", call_cntr, max_calls);
-
-	if (call_cntr < max_calls)    /* do when there is more left to send */
-	{
-		HeapTuple    tuple;
-		Datum        result;
-		Datum *values;
-		char* nulls;
-
-		values = palloc(5 * sizeof(Datum));
-		nulls = palloc(5 * sizeof(char));
-
-		values[0] = Int32GetDatum(path[call_cntr].order_id);   // order id
-		nulls[0] = ' ';
-		values[1] = Int32GetDatum(path[call_cntr].order_pos);  // order pos
-		nulls[1] = ' ';
-		values[2] = Int32GetDatum(path[call_cntr].vehicle_id); // vehicle id
-		nulls[2] = ' ';
-		values[3] = Int32GetDatum(path[call_cntr].arrival_time); // arrival time
-		nulls[3] = ' ';
-		//values[4] = TimeTzADTPGetDatum(&path[call_cntr].time);
-		values[4] = Int32GetDatum(path[call_cntr].depart_time);  // departure time
-		nulls[4] = ' ';
-
-		// DBG("Heap making\n");
-		//elog(NOTICE,"Result %d %d %d", call_cntr, path[call_cntr].order_id, max_calls);
-		tuple = heap_formtuple(tuple_desc, values, nulls);
-
-		//DBG("Datum making\n");
-
-		/* make the tuple into a datum */
-		result = HeapTupleGetDatum(tuple);
-
-		//DBG("Trying to free some memory\n");
-
-		/* clean up */
-		pfree(values);
-		pfree(nulls);
-
-
-		SRF_RETURN_NEXT(funcctx, result);
-	}
-	else    /* do when there is no more left */
-	{
-		
-		DBG("Ending function\n");
-		profstop("store", prof_store);
-		profstop("total", prof_total);
-		DBG("Profiles stopped\n");
-
-		free(path);
-		
-		DBG("Itinerary cleared\n");
-
-		SRF_RETURN_DONE(funcctx);
-	}
-}
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "VRP.h"
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <search.h>
+
+#include "string.h"
+#include "math.h"
+
+#include "fmgr.h"
+
+
+
+#undef qsort
+
+//-------------------------------------------------------------------------
+
+/*
+ * Define this to have profiling enabled
+ */
+//#define PROFILE
+
+#ifdef PROFILE
+#include <sys/time.h>
+
+struct timeval prof_astar, prof_store, prof_extract, prof_total;
+long proftime[5];
+long profipts1, profipts2, profopts;
+
+#define profstart(x) do { gettimeofday(&x, NULL); } while (0);
+#define profstop(n, x) do { struct timeval _profstop;   \
+        long _proftime;                         \
+        gettimeofday(&_profstop, NULL);                         \
+        _proftime = ( _profstop.tv_sec*1000000+_profstop.tv_usec) -     \
+                ( x.tv_sec*1000000+x.tv_usec); \
+        elog(NOTICE, \
+                "PRF(%s) %lu (%f ms)", \
+                (n), \
+             _proftime, _proftime / 1000.0);    \
+        } while (0);
+
+#else
+
+#define profstart(x) do { } while (0);
+#define profstop(n, x) do { } while (0);
+
+#endif // PROFILE
+
+
+// ------------------------------------------------------------------------
+
+Datum vrp(PG_FUNCTION_ARGS);
+
+#undef DEBUG
+//#define DEBUG 1
+#include "../../common/src/debug_macro.h"
+
+
+// The number of tuples to fetch from the SPI cursor at each iteration
+#define TUPLIMIT 1000
+
+#ifndef PG_MODULE_MAGIC
+PG_MODULE_MAGIC;
+#endif
+
+typedef struct vehicle_columns
+{
+	int vehicle_id;
+	int capacity;
+	
+} vehicle_columns_t;
+
+typedef struct order_columns
+{
+	int id;
+	int order_unit;
+	int open_time;
+	int close_time;
+	int service_time;
+
+	int x;
+	int y;
+} order_columns_t;
+
+typedef struct distance_columns
+{
+	int src_id;
+	int dest_id;
+	int cost;
+	int distance;
+	int traveltime;
+} distance_columns_t;
+
+
+//float DISTANCE[MAX_TOWNS][MAX_TOWNS];
+//float x[MAX_TOWNS],y[MAX_TOWNS];
+
+static char *
+text2char(text *in)
+{
+	char *out = (char*)palloc(VARSIZE(in));
+
+	memcpy(out, VARDATA(in), VARSIZE(in) - VARHDRSZ);
+	out[VARSIZE(in) - VARHDRSZ] = '\0';
+	return out;
+}
+
+static int
+finish(int *code)
+{
+	*code = SPI_finish();
+	if (*code  != SPI_OK_FINISH )
+	{
+		elog(ERROR,"couldn't disconnect from SPI");
+		return -1 ;
+	}
+	return 0;
+}
+
+
+
+static int
+fetch_distance_columns(SPITupleTable *tuptable, distance_columns_t *distance_columns)
+{
+	PGR_DBG("Fetching distance");
+
+	distance_columns->src_id = SPI_fnumber(SPI_tuptable->tupdesc, "src_id");
+	distance_columns->dest_id = SPI_fnumber(SPI_tuptable->tupdesc, "dest_id");
+	distance_columns->cost = SPI_fnumber(SPI_tuptable->tupdesc, "cost");
+	distance_columns->distance = SPI_fnumber(SPI_tuptable->tupdesc, "distance");  
+	distance_columns->traveltime = SPI_fnumber(SPI_tuptable->tupdesc, "traveltime");
+	if (distance_columns->src_id == SPI_ERROR_NOATTRIBUTE ||
+		distance_columns->dest_id == SPI_ERROR_NOATTRIBUTE ||
+		distance_columns->cost == SPI_ERROR_NOATTRIBUTE ||
+		distance_columns->distance == SPI_ERROR_NOATTRIBUTE ||
+		distance_columns->traveltime == SPI_ERROR_NOATTRIBUTE) 
+	{
+		elog(ERROR, "Error, query must return columns "
+			"'src_id', 'dest_id', 'cost', 'distance' and 'traveltime'");
+		return -1;
+	}
+
+	return 0;
+}
+
+
+static void
+fetch_distance(HeapTuple *tuple, TupleDesc *tupdesc, 
+			   distance_columns_t *distance_columns, vrp_cost_element_t *dist, size_t t)
+{
+	Datum binval;
+	bool isnull;
+
+	PGR_DBG("fetch_distance: src_id col:%i", distance_columns->src_id);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->src_id, &isnull);
+
+    PGR_DBG("back from SPI_getbinval for src_id");
+    PGR_DBG("binval=%i", binval);
+
+	if (isnull)
+		elog(ERROR, "src_id contains a null value");
+
+	dist->src_id = DatumGetInt32(binval);
+
+    PGR_DBG("back from DatumGetInt32");
+	PGR_DBG("src_id=%i", dist->src_id);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->dest_id, &isnull);
+	if (isnull)
+		elog(ERROR, "dest_id contains a null value");
+
+	dist->dest_id = DatumGetInt32(binval);
+
+	PGR_DBG("dest_id=%i", dist->dest_id);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->cost, &isnull);
+
+	if (isnull)
+		elog(ERROR, "cost contains a null value");
+
+	dist->cost = DatumGetFloat8(binval);
+
+	PGR_DBG("cost=%lf", dist->cost);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->distance, &isnull);
+	if (isnull)
+		elog(ERROR, "distance contains a null value");
+
+	dist->distance = DatumGetFloat8(binval);
+
+	PGR_DBG("distance=%lf", dist->distance);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, distance_columns->traveltime, &isnull);
+
+	if (isnull)
+		elog(ERROR, "traveltime contains a null value");
+
+	dist->traveltime = DatumGetFloat8(binval);
+
+	PGR_DBG("traveltime=%lf", dist->traveltime);
+
+	//PGR_DBG("dist[%i][%i] = %f\n", from_point, to_point, value);
+
+	
+	//PGR_DBG("dist[%i(%i:%i)][%i(%i:%i)] = %f\n", from, from_order, from_point, to, to_order, to_point, *(dist + (num_rows * from) + to));
+
+}
+
+static int
+fetch_order_columns(SPITupleTable *tuptable, order_columns_t *order_columns)
+{
+	PGR_DBG("Fetching order");
+
+	//order_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
+	order_columns->id = SPI_fnumber(SPI_tuptable->tupdesc, "id");
+	order_columns->order_unit = SPI_fnumber(SPI_tuptable->tupdesc, "order_unit");
+	order_columns->open_time = SPI_fnumber(SPI_tuptable->tupdesc, "open_time");
+	order_columns->close_time = SPI_fnumber(SPI_tuptable->tupdesc, "close_time");
+	order_columns->service_time = SPI_fnumber(SPI_tuptable->tupdesc, "service_time");
+	order_columns->x = SPI_fnumber(SPI_tuptable->tupdesc, "x");
+	order_columns->y = SPI_fnumber(SPI_tuptable->tupdesc, "y");  
+	if (//order_columns->id == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->id == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->open_time == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->order_unit == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->close_time == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->service_time == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->x == SPI_ERROR_NOATTRIBUTE ||
+		order_columns->y == SPI_ERROR_NOATTRIBUTE
+		)
+	{
+		//      elog(ERROR, "Error, query must return columns "
+		//           "'id', 'order_id', 'pu_time', 'do_time', 'pu_time_window', 'do_time_window', 'from_x', 'to_x', 'from_y', 'to_y' and 'size'");
+		elog(ERROR, "Error, query must return columns "
+			//"'id', 
+			"'id', 'order_unit', 'open_time', 'close_time', 'service_time', 'x', 'y'");
+		return -1;
+	}
+
+	return 0;
+}
+
+static void
+fetch_order(HeapTuple *tuple, TupleDesc *tupdesc,
+			order_columns_t *order_columns, vrp_orders_t *order, size_t t)
+{
+	Datum binval;
+	bool isnull;
+
+	PGR_DBG("inside fetch_order\n");
+
+	//binval = SPI_getbinval(*tuple, *tupdesc, order_columns->id, &isnull);
+	//
+	//  PGR_DBG("got binval\n");
+	//
+	//if (isnull)
+	//  elog(ERROR, "id contains a null value");
+	//
+	//order->id = DatumGetInt32(binval);
+	order->id = (int)t + 1;
+
+	PGR_DBG("id = %i\n", order->id);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->id, &isnull);
+	if (isnull)
+		elog(ERROR, "order_id contains a null value");
+
+	order->id = DatumGetInt32(binval);
+
+	PGR_DBG("order_id = %i\n", order->id);  
+
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->order_unit, &isnull);
+	if (isnull)
+		elog(ERROR, "order_unit contains a null value");
+
+	order->order_unit = DatumGetInt32(binval);
+
+	PGR_DBG("order_unit = %i\n", order->order_unit);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->open_time, &isnull);
+	if (isnull)
+		elog(ERROR, "open_time contains a null value");
+
+	order->open_time = DatumGetInt32(binval);
+
+	PGR_DBG("open_time = %i\n", order->open_time);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->close_time, &isnull);
+	if (isnull)
+		elog(ERROR, "close_time contains a null value");
+
+	order->close_time = DatumGetInt32(binval);
+
+	PGR_DBG("close_time = %d\n", order->close_time);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->service_time, &isnull);
+	if (isnull)
+		elog(ERROR, "service_time contains a null value");
+
+	order->service_time = DatumGetInt32(binval);
+
+	PGR_DBG("service_time = %d\n", order->service_time);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->x, &isnull);
+	if (isnull)
+		elog(ERROR, "x contains a null value");
+
+	order->x = DatumGetFloat8(binval);
+
+	PGR_DBG("x = %f\n", order->x);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, order_columns->y, &isnull);
+	if (isnull)
+		elog(ERROR, "y contains a null value");
+
+	order->y = DatumGetFloat8(binval);
+
+	PGR_DBG("doUT = %f\n", order->y);
+
+}
+
+static int
+fetch_vehicle_columns(SPITupleTable *tuptable, vehicle_columns_t *vehicle_columns)
+{
+	PGR_DBG("Fetching order");
+
+	vehicle_columns->vehicle_id = SPI_fnumber(SPI_tuptable->tupdesc, "vehicle_id");
+	vehicle_columns->capacity = SPI_fnumber(SPI_tuptable->tupdesc, "capacity");
+	
+	if (vehicle_columns->vehicle_id == SPI_ERROR_NOATTRIBUTE ||
+		vehicle_columns->capacity == SPI_ERROR_NOATTRIBUTE
+		)
+	{
+		elog(ERROR, "Error, query must return columns "
+			"'id' and 'capacity'");
+		return -1;
+	}
+
+	return 0;
+}
+
+static void
+fetch_vehicle(HeapTuple *tuple, TupleDesc *tupdesc,
+			  vehicle_columns_t *vehicle_columns, vrp_vehicles_t *vehicle, size_t t)
+{
+	Datum binval;
+	bool isnull;
+
+	PGR_DBG("inside fetch_vehicle\n");
+
+	//binval = SPI_getbinval(*tuple, *tupdesc, vehicle_columns->id, &isnull);
+	//PGR_DBG("Got id\n");
+	//
+	//if (isnull)
+	//  elog(ERROR, "id contains a null value");
+	//
+	//vehicle->id = DatumGetInt32(binval);
+
+	
+	binval = SPI_getbinval(*tuple, *tupdesc, vehicle_columns->vehicle_id, &isnull);
+	PGR_DBG("Got vehicle_id\n");
+
+	if (isnull)
+		elog(ERROR, "vehicle_id contains a null value");
+
+	vehicle->id = DatumGetInt32(binval);
+
+	PGR_DBG("vehicle_id = %i\n", vehicle->id);
+
+	binval = SPI_getbinval(*tuple, *tupdesc, vehicle_columns->capacity, &isnull);
+	if (isnull)
+		elog(ERROR, "capacity contains a null value");
+
+	vehicle->capacity = DatumGetInt32(binval);
+
+	PGR_DBG("capacity = %f\n", vehicle->capacity);
+
+}
+
+static int conn(int *SPIcode)
+{
+	int res = 0;
+
+	*SPIcode = SPI_connect();
+
+	if (*SPIcode  != SPI_OK_CONNECT)
+	{
+		elog(ERROR, "vrp: couldn't open a connection to SPI");
+		res = -1;
+	}
+
+	return res;	
+}
+
+static int prepare_query(Portal *SPIportal, char* sql)
+{
+	int res = 0;
+
+	void* SPIplan = SPI_prepare(sql, 0, NULL);
+
+	if (SPIplan  == NULL)
+	{
+		elog(ERROR, "vrp: couldn't create query plan via SPI");
+		res = -1;
+	}
+
+	if ((*SPIportal = SPI_cursor_open(NULL, SPIplan, NULL, NULL, true)) == NULL)
+	{
+		elog(ERROR, "vrp: SPI_cursor_open('%s') returns NULL", sql);
+		res = -1;
+	}
+
+	return res;
+}
+
+static int solve_vrp(char* orders_sql, char* vehicles_sql,
+					  char* dist_sql,
+					  int depot,
+					  vrp_result_element_t** path, size_t *path_count)
+{
+	int SPIcode;
+
+	Portal SPIportal_o; 
+	Portal SPIportal_v; 
+	Portal SPIportal_d; 
+	// Portal SPIportal_p;
+
+	bool moredata = TRUE;
+	size_t ntuples;
+
+    size_t order_num;
+    size_t vehicle_num;
+    size_t dist_num;
+
+	vrp_vehicles_t *vehicles=NULL;
+	vehicle_columns_t vehicle_columns = {.vehicle_id = -1, .capacity = -1};
+
+	vrp_orders_t *orders=NULL;
+	order_columns_t order_columns = {.id = -1, .order_unit = -1, .open_time = -1, .close_time = -1, .service_time = -1, .x = -1, .y = -1};
+
+	vrp_cost_element_t *costs=NULL;
+	distance_columns_t distance_columns = {.src_id = -1, .dest_id = -1, .cost = -1, .distance = -1,	.traveltime = -1};
+
+	char *err_msg = NULL;
+	int ret = -1;
+
+	// int   z = 0;
+
+	// int    tt, cc;
+	// double dx, dy;
+	// float  fit=0.0;
+
+	int prep = -1, con = -1;
+
+	//int total_tuples = 0;
+	order_num = 0;
+	vehicle_num = 0;
+
+	PGR_DBG("start solve_vrp\n");
+
+	//vrp_orders_t depot_ord = {id:0, order_id:depot, from:depot_point, to:depot_point};
+	//orders = palloc(1 * sizeof(vrp_orders_t));
+	//orders[0] = depot_ord;
+
+	con = conn(&SPIcode);
+
+	if (con < 0)
+		return ret;
+
+
+	// Fetching orders
+
+    PGR_DBG("calling prepare_query for orders_sql");
+
+	prep = prepare_query(&SPIportal_o, orders_sql);
+
+	if (prep < 0)
+		return ret;
+
+	PGR_DBG("Query: %s\n",orders_sql);
+	PGR_DBG("Query executed\n");
+
+	PGR_DBG("Orders before: %i\n", order_num);
+
+	while (moredata == TRUE)  
+	{
+		SPI_cursor_fetch(SPIportal_o, TRUE, TUPLIMIT);
+
+		PGR_DBG("cursor fetched\n");
+
+		if (order_columns.id == -1)
+		{
+			if (fetch_order_columns(SPI_tuptable, &order_columns) == -1)
+				return finish(&SPIcode);
+		}
+
+		ntuples = SPI_processed;
+
+		order_num += ntuples;
+
+		PGR_DBG("Tuples: %i\n", order_num);
+
+		if (!orders)
+		  	orders = palloc(order_num * sizeof(vrp_orders_t));
+		else
+			orders = repalloc(orders, (order_num + 1) * sizeof(vrp_orders_t));
+
+		if (orders == NULL)
+		{
+			elog(ERROR, "Out of memory");
+			return finish(&SPIcode);
+		}
+
+		if (ntuples > 0)
+		{
+			SPITupleTable *tuptable = SPI_tuptable;
+			TupleDesc tupdesc = SPI_tuptable->tupdesc;
+
+			PGR_DBG("Got tuple desc\n");
+            size_t t;
+			for (t = 0; t < ntuples; t++)
+			{
+				HeapTuple tuple = tuptable->vals[t];
+				//PGR_DBG("Before order fetched [%i]\n", order_num - ntuples + t);
+				fetch_order(&tuple, &tupdesc, &order_columns,
+					&orders[order_num - ntuples + t], t);
+
+				//&orders[t+1], t);
+				PGR_DBG("Order fetched\n");
+			}
+
+			SPI_freetuptable(tuptable);
+		}
+		else
+		{
+			moredata = FALSE;
+		}
+	}// end of fetching orders
+	//finish(&SPIcode_o);
+/*
+	int o;
+	for(o=0; o<order_num+1;++o)
+	{
+		elog(NOTICE, "ORDERS[%i] = {id=%i, open=%i, close=%i, service=%i}", o, orders[o].id, orders[o].open_time, orders[o].close_time, orders[o].service_time);
+	}
+*/
+	PGR_DBG ("order_num = %i", order_num); 
+
+	//qsort (orders, order_num+1, sizeof (vrp_orders_t), order_cmp);
+
+
+	// Fetching vehicles
+
+	moredata = TRUE;
+	prep = prepare_query(&SPIportal_v, vehicles_sql);
+
+	if (prep < 0)
+		return ret;
+
+	PGR_DBG("Query: %s\n",vehicles_sql);
+	PGR_DBG("Query executed\n");
+
+
+	while (moredata == TRUE)
+	{
+		SPI_cursor_fetch(SPIportal_v, TRUE, TUPLIMIT);
+
+		if (vehicle_columns.vehicle_id == -1)
+		{
+			if (fetch_vehicle_columns(SPI_tuptable, &vehicle_columns) == -1)
+				return finish(&SPIcode);
+		}
+
+
+		ntuples = SPI_processed;
+
+		vehicle_num += ntuples;
+
+		PGR_DBG("Tuples: %i\n", vehicle_num);
+
+		if (!vehicles)
+			vehicles = palloc(vehicle_num * sizeof(vrp_vehicles_t));
+		else
+			vehicles = repalloc(vehicles, vehicle_num * sizeof(vrp_vehicles_t));
+
+		if (vehicles == NULL)
+		{
+			elog(ERROR, "Out of memory");
+			return finish(&SPIcode);
+		}
+
+		if (ntuples > 0)
+		{
+			SPITupleTable *tuptable = SPI_tuptable;
+			TupleDesc tupdesc = SPI_tuptable->tupdesc;
+
+			PGR_DBG("Got tuple desc\n");
+
+            size_t t;
+			for (t = 0; t < ntuples; t++)
+			{
+				HeapTuple tuple = tuptable->vals[t];
+				PGR_DBG("Before vehicle fetched\n");
+				fetch_vehicle(&tuple, &tupdesc, &vehicle_columns,
+					&vehicles[vehicle_num - ntuples + t], t);
+				PGR_DBG("Vehicle fetched\n");
+			}
+
+			SPI_freetuptable(tuptable);
+		}
+		else
+		{
+			moredata = FALSE;
+		}
+	}// end of fetching vehicles
+	//finish(&SPIcode_v);
+
+	//double dist[order_num*2+1][order_num*2+1];
+
+	// Fetching distances
+
+	dist_num = 0;
+	moredata = TRUE;
+	prep = prepare_query(&SPIportal_d, dist_sql);
+
+	if (prep < 0)
+		return ret;
+
+	PGR_DBG("Query: %s\n",dist_sql);
+	PGR_DBG("Query executed\n");
+
+	while (moredata == TRUE)
+	{
+		SPI_cursor_fetch(SPIportal_d, TRUE, TUPLIMIT);
+
+		if (distance_columns.src_id == -1)
+		{
+			if (fetch_distance_columns(SPI_tuptable, &distance_columns) == -1)
+				return finish(&SPIcode);
+		}
+
+		ntuples = SPI_processed;
+		dist_num += ntuples;
+
+		PGR_DBG("Tuples: %i\n", vehicle_num);
+
+		if (!costs)
+			costs = palloc(dist_num * sizeof(vrp_cost_element_t));
+		else
+			costs = repalloc(costs, dist_num * sizeof(vrp_cost_element_t));
+
+		if (costs == NULL)
+		{
+			elog(ERROR, "Out of memory");
+			return finish(&SPIcode);
+		}
+
+		if (ntuples > 0)
+		{
+			SPITupleTable *tuptable = SPI_tuptable;
+			TupleDesc tupdesc = SPI_tuptable->tupdesc;
+
+			PGR_DBG("Got tuple desc\n");
+            size_t t;
+			for (t = 0; t < ntuples; t++)
+			{
+				HeapTuple tuple = tuptable->vals[t];
+				PGR_DBG("Before distance fetched\n");
+				fetch_distance(&tuple, &tupdesc, &distance_columns,
+					&costs[dist_num - ntuples + t], t);
+				PGR_DBG("Distance fetched\n");
+			}
+
+			SPI_freetuptable(tuptable);
+		}
+		else
+		{
+			moredata = FALSE;
+		}
+	}// end of fetching distances
+
+
+	PGR_DBG("Calling vrp\n");
+
+	profstop("extract", prof_extract);
+	profstart(prof_vrp);
+
+	PGR_DBG("Total orders: %i\n", order_num);
+	PGR_DBG("Total vehicles: %i\n", vehicle_num);
+
+
+	//qsort (orders, order_num+1, sizeof (vrp_orders_t), order_cmp_asc);
+
+
+#ifdef DEBUG
+	int o;
+	for(o=0; o<order_num+1;++o)
+	{
+		PGR_DBG("ORDERS[%i] = {id=%i, open=%i, close=%i, service=%i}", o, orders[o].id, orders[o].open_time, orders[o].close_time, orders[o].service_time);
+	}
+#endif
+	
+
+
+	//itinerary = (vrp_result_element_t *)palloc(sizeof(vrp_result_element_t)*(order_num*2-1)*vehicle_num);
+
+	PGR_DBG("Calling vrp solver\n");
+    //elog(NOTICE, "Calling find_vrp_solution: vehicles: %i, orders: %i, dists: %i, depot: %i", vehicle_num, order_num, dist_num, depot);
+
+	ret = find_vrp_solution(vehicles, vehicle_num,
+		orders, order_num,
+		costs, dist_num,
+		depot,
+		path, path_count, &err_msg);
+
+	//ret = -1;
+	//elog(NOTICE, "vrp solved! ret: %d, path_count: %d", ret, *path_count);
+	// int pp;
+/*
+	for(pp = 0; pp < *path_count; pp++)
+	{
+		elog(NOTICE, "Row: %d: %d %d %d %d %d", pp, (*path)[pp].order_id, (*path)[pp].order_pos, (*path)[pp].vehicle_id, (*path)[pp].arrival_time, (*path)[pp].depart_time);
+	}
+*/
+	PGR_DBG("vrp solved! ret: %d, path_count: %d", ret, path_count);
+	//PGR_DBG("Score: %f\n", fit);
+
+	profstop("vrp", prof_vrp);
+	profstart(prof_store);
+
+	PGR_DBG("Profile changed and ret is %i", ret);
+
+	if (ret < 0)
+	{
+		//elog(ERROR, "Error computing path: %s", err_msg);
+		ereport(ERROR, (errcode(ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED), errmsg("Error computing path: %s", err_msg)));
+	} 
+
+	//pfree(vehicles);
+	//pfree(orders);
+	return finish(&SPIcode);    
+}
+
+PG_FUNCTION_INFO_V1(vrp);
+Datum
+vrp(PG_FUNCTION_ARGS)
+{
+	FuncCallContext     *funcctx;
+	uint32_t                  call_cntr;
+	uint32_t                  max_calls;
+	TupleDesc            tuple_desc;
+	vrp_result_element_t         *path;
+
+	/* stuff done only on the first call of the function */
+	if (SRF_IS_FIRSTCALL())
+	{
+		MemoryContext   oldcontext;
+		//int path_count;
+		// int ret=-1;
+		size_t path_count = 0;
+
+		// XXX profiling messages are not thread safe
+		profstart(prof_total);
+		profstart(prof_extract);
+
+		/* create a function context for cross-call persistence */
+		funcctx = SRF_FIRSTCALL_INIT();
+
+		/* switch to memory context appropriate for multiple function calls */
+		oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+		//path = (vrp_result_element_t *)palloc(sizeof(vrp_result_element_t)*(MAX_ORDERS-1)*2*MAX_VEHICLES);
+
+
+        PGR_DBG("Calling solve_vrp ...");
+
+		// ret =
+                solve_vrp(//text2char(PG_GETARG_TEXT_P(0)), // points sql
+			text2char(PG_GETARG_TEXT_P(0)),  // orders sql
+			text2char(PG_GETARG_TEXT_P(1)),  // vehicles sql
+			text2char(PG_GETARG_TEXT_P(2)),  // distances query
+			PG_GETARG_INT32(3),  // depot id
+			&path, &path_count);
+
+		PGR_DBG("Back from solve_vrp, path_count:%d", path_count);
+		//elog(NOTICE, "Back from solve_vrp, path_count:%d", path_count);
+        
+        /* total number of tuples to be returned */
+		//PGR_DBG("Counting tuples number\n");
+
+		funcctx->max_calls = (uint32_t)path_count;
+
+		funcctx->user_fctx = path;
+
+		/* Build a tuple descriptor for our result type */
+        	if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            		ereport(ERROR,
+                    	(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     	errmsg("function returning record called in context "
+                            "that cannot accept type record")));
+
+        	funcctx->tuple_desc = BlessTupleDesc(tuple_desc);
+
+        	/*
+         	* generate attribute metadata needed later to produce tuples from raw
+         	* C strings
+         	*/
+        	//attinmeta = TupleDescGetAttInMetadata(tuple_desc);
+        	//funcctx->attinmeta = attinmeta;
+
+		MemoryContextSwitchTo(oldcontext);
+		//elog(NOTICE, "table formed");
+	}
+
+	/* stuff done on every call of the function */
+	funcctx = SRF_PERCALL_SETUP();
+
+	call_cntr = funcctx->call_cntr;
+	max_calls = funcctx->max_calls;
+	tuple_desc = funcctx->tuple_desc;
+
+	path = (vrp_result_element_t *)funcctx->user_fctx;
+
+	//elog(NOTICE, "Point 1");
+	//PGR_DBG("Trying to allocate some memory\n");
+	//PGR_DBG("call_cntr = %i, max_calls = %i\n", call_cntr, max_calls);
+
+	if (call_cntr < max_calls)    /* do when there is more left to send */
+	{
+		HeapTuple    tuple;
+		Datum        result;
+		Datum *values;
+		char* nulls;
+
+		values = palloc(5 * sizeof(Datum));
+		nulls = palloc(5 * sizeof(char));
+
+		values[0] = Int32GetDatum(path[call_cntr].order_id);   // order id
+		nulls[0] = ' ';
+		values[1] = Int32GetDatum(path[call_cntr].order_pos);  // order pos
+		nulls[1] = ' ';
+		values[2] = Int32GetDatum(path[call_cntr].vehicle_id); // vehicle id
+		nulls[2] = ' ';
+		values[3] = Int32GetDatum(path[call_cntr].arrival_time); // arrival time
+		nulls[3] = ' ';
+		//values[4] = TimeTzADTPGetDatum(&path[call_cntr].time);
+		values[4] = Int32GetDatum(path[call_cntr].depart_time);  // departure time
+		nulls[4] = ' ';
+
+		// PGR_DBG("Heap making\n");
+		//elog(NOTICE,"Result %d %d %d", call_cntr, path[call_cntr].order_id, max_calls);
+		tuple = heap_formtuple(tuple_desc, values, nulls);
+
+		//PGR_DBG("Datum making\n");
+
+		/* make the tuple into a datum */
+		result = HeapTupleGetDatum(tuple);
+
+		//PGR_DBG("Trying to free some memory\n");
+
+		/* clean up */
+		pfree(values);
+		pfree(nulls);
+
+
+		SRF_RETURN_NEXT(funcctx, result);
+	}
+	else    /* do when there is no more left */
+	{
+		
+		PGR_DBG("Ending function\n");
+		profstop("store", prof_store);
+		profstop("total", prof_total);
+		PGR_DBG("Profiles stopped\n");
+
+		free(path);
+		
+		PGR_DBG("Itinerary cleared\n");
+
+		SRF_RETURN_DONE(funcctx);
+	}
+}
diff --git a/src/vrp_basic/src/VRP.h b/src/vrp_basic/src/VRP.h
index 92b5f3c..6ab7aa1 100644
--- a/src/vrp_basic/src/VRP.h
+++ b/src/vrp_basic/src/VRP.h
@@ -1,84 +1,86 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#ifndef _VRP_H
-#define _VRP_H
-
-#include "postgres.h"
-
-
-typedef struct vrp_vehicles 
-{
-	int id;
-	int capacity;
-	
-} vrp_vehicles_t;
-
-
-typedef struct vrp_orders 
-{
-	int id;
-	int order_unit;
-	int open_time;
-	int close_time;
-	int service_time;
-	
-	float8 x;
-	float8 y;
-	
-} vrp_orders_t;
-
-typedef struct vrp_cost_element
-{
-	int src_id;
-	int dest_id;
-	int cost;
-	int distance;
-	int traveltime;
-
-}vrp_cost_element_t;
-
-
-typedef struct vrp_result_element
-{
-	int order_id;
-	int order_pos;
-	int vehicle_id;
-	int arrival_time;
-	int depart_time;
-} vrp_result_element_t;
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-int find_vrp_solution(vrp_vehicles_t *vehicles, int vehicle_count, 
-					  vrp_orders_t *orders, int order_count,
-					  vrp_cost_element_t *costmatrix, int cost_count,
-					  int depot_id,
-					  vrp_result_element_t **result, int *result_count, char **err_msg);
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-#endif
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef _VRP_H
+#define _VRP_H
+
+#include "postgres.h"
+
+
+typedef struct vrp_vehicles 
+{
+	int id;
+	int capacity;
+	
+} vrp_vehicles_t;
+
+
+typedef struct vrp_orders 
+{
+	int id;
+	int order_unit;
+	int open_time;
+	int close_time;
+	int service_time;
+	
+	float8 x;
+	float8 y;
+	
+} vrp_orders_t;
+
+typedef struct vrp_cost_element
+{
+	int src_id;
+	int dest_id;
+	double cost;
+	double distance;
+	double traveltime;
+
+}vrp_cost_element_t;
+
+
+typedef struct vrp_result_element
+{
+	int order_id;
+	int order_pos;
+	int vehicle_id;
+	int arrival_time;
+	int depart_time;
+} vrp_result_element_t;
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+int find_vrp_solution(vrp_vehicles_t *vehicles, size_t vehicle_count, 
+					  vrp_orders_t *orders, size_t order_count,
+					  vrp_cost_element_t *costmatrix, size_t cost_count,
+					  int depot_id,
+					  vrp_result_element_t **result, size_t *result_count, char **err_msg);
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+#endif
diff --git a/src/vrp_basic/src/VRP_Solver.cpp b/src/vrp_basic/src/VRP_Solver.cpp
index 6b77352..5f6d3c8 100644
--- a/src/vrp_basic/src/VRP_Solver.cpp
+++ b/src/vrp_basic/src/VRP_Solver.cpp
@@ -1,1034 +1,1037 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#include "VRP_Solver.h"
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-
-#undef PGR_LOGGER_ON
-#define PGR_LOGGER_LOC
-#define PGR_LOGGER_FILE "/tmp/vrp-debug.log"
-#include "../../common/src/pgr_logger.h"
-
-#define DOUBLE_MAX 1e50
-
-bool operator != (const CVehicleInfo& cur, const CVehicleInfo& that)
-{
-	return(cur.m_iVehicleId != that.m_iVehicleId);
-}
-
-bool operator== (const CTourInfo& cur, const CTourInfo& that)
-{
-	if(cur.m_vehicleInfo != that.m_vehicleInfo)
-		return false;
-	if(cur.m_viOrderIds.size() != that.m_viOrderIds.size())
-		return false;
-	int tot = cur.m_viOrderIds.size();
-	for(int i = 0; i < tot; i++)
-	{
-		if(cur.m_viOrderIds[i] != that.m_viOrderIds[i])
-			return false;
-	}
-	return true;
-}
-
-bool operator == (const CMoveInfo& cur, const CMoveInfo& that)
-{
-	if(!(cur.m_vInitialTour == that.m_vInitialTour))
-		return false;
-	if(!(cur.m_vModifiedTour == that.m_vModifiedTour))
-		return false;
-	return true;
-}
-
-
-
-CVehicleInfo::CVehicleInfo()
-{
-	m_iCurrentLoad = 0;
-}
-CVehicleInfo::~CVehicleInfo()
-{
-}
-
-bool CVehicleInfo::loadUnit(int lUnit)
-{
-	if(m_iCurrentLoad + lUnit > m_iCapacity)
-		return false;
-	m_iCurrentLoad += lUnit;
-	return true;
-}
-
-COrderInfo::COrderInfo()
-{
-}
-COrderInfo::~COrderInfo()
-{
-}
-
-CDepotInfo::CDepotInfo()
-{
-}
-CDepotInfo::~CDepotInfo()
-{
-}
-
-CTourInfo::CTourInfo()
-{
-	m_dTotalCost = 0.0;
-	m_dTotalDistance = 0.0;
-	m_dTotalTraveltime = 0.0;
-}
-CTourInfo::~CTourInfo()
-{
-}
-
-bool CTourInfo::insertOrder(int orderId, int pos)
-{
-	m_viOrderIds.insert(m_viOrderIds.begin() + pos, orderId);
-	return true;
-}
-
-int CTourInfo::getRemainingCapacity()
-{
-	return(m_vehicleInfo.getRemainingCapacity());
-}
-
-bool CTourInfo::removeOrder(int pos)
-{
-	m_viOrderIds.erase(m_viOrderIds.begin() + pos);
-	return true;
-}
-
-void CTourInfo::updateCost(double cost, double distance, double travelTime)
-{
-	m_dTotalCost = cost;
-	m_dTotalDistance = distance;
-	m_dTotalTraveltime = travelTime;
-}
-
-CSolutionInfo::CSolutionInfo()
-{
-}
-CSolutionInfo::~CSolutionInfo()
-{
-}
-
-void CSolutionInfo::replaceTour(CTourInfo curTour)
-{
-	unsigned int i;
-	for(i = 0; i < m_vtourAll.size(); i++)
-	{
-		if(m_vtourAll[i].getVehicleId() == curTour.getVehicleId())
-		{
-			m_vtourAll[i] = curTour;
-			return;
-		}
-	}
-	return;
-}
-
-void CSolutionInfo::replaceTourAt(int index, CTourInfo curTour)
-{
-	if(index < 0 || (unsigned int) index >= m_vtourAll.size())
-		return;
-	m_vtourAll[index] = curTour;
-}
-
-bool CSolutionInfo::init(std::vector<int> vecOrder, int iTotalOrder, std::vector<int> vecVehicle)
-{
-	m_vUnservedOrderId = vecOrder;
-	m_iTotalOrders = iTotalOrder;
-	m_vUnusedVehicles =  vecVehicle;
-
-	m_vtourAll.clear();
-	m_iVehicleUsed = 0;
-	m_iOrdersServed = 0;
-	m_iTotalOrders = 0;
-	m_dTotalCost = 0;
-	m_dTotalDistance = 0;
-	m_dTotalTravelTime = 0;
-	return true;
-}
-
-bool CSolutionInfo::addTour(CTourInfo& tour)
-{
-	m_vtourAll.push_back(tour);
-	int vid = tour.getVehicleId();
-	std::vector<int>::iterator it;
-	it = std::find(m_vUnusedVehicles.begin(), m_vUnusedVehicles.end(), vid);
-	if(it != m_vUnusedVehicles.end())
-	{
-		m_vUnusedVehicles.erase(it);
-	}
-	m_iVehicleUsed++;
-	m_dTotalDistance += tour.getDistance();
-	m_dTotalTravelTime += tour.getTravelTime();
-	m_dTotalCost += tour.getCost();
-
-	std::vector<int> vecOrders = tour.getOrderVector();
-
-	m_iOrdersServed += vecOrders.size();
-
-	for(unsigned int i = 0; i < vecOrders.size(); i++)
-	{
-		int oid = vecOrders[i];
-		it = std::find(m_vUnservedOrderId.begin(), m_vUnservedOrderId.end(), oid);
-		if(it != m_vUnservedOrderId.end())
-		{
-			m_vUnservedOrderId.erase(it);
-		}
-	}
-
-	return true;
-}
-
-CMoveInfo::CMoveInfo()
-{
-
-}
-CMoveInfo::~CMoveInfo()
-{
-
-}
-
-void CMoveInfo::setInitialTour(CTourInfo tourData)
-{
-	m_vInitialTour.clear();
-	m_vInitialTour.push_back(tourData);
-}
-
-void CMoveInfo::setInitialTour(CTourInfo tourData1, CTourInfo tourData2)
-{
-	m_vInitialTour.clear();
-	m_vInitialTour.push_back(tourData1);
-	m_vInitialTour.push_back(tourData2);
-}
-
-void CMoveInfo::setModifiedTour(CTourInfo tourData)
-{
-	m_vModifiedTour.clear();
-	m_vModifiedTour.push_back(tourData);
-}
-
-void CMoveInfo::setModifiedTour(CTourInfo tourData1, CTourInfo tourData2)
-{
-	m_vModifiedTour.clear();
-	m_vModifiedTour.push_back(tourData1);
-	m_vModifiedTour.push_back(tourData2);
-}
-
-void CMoveInfo::getInitialTour(CTourInfo &tourData)
-{
-	tourData = m_vInitialTour[0];
-}
-
-void CMoveInfo::getInitialTour(CTourInfo &tourData1, CTourInfo &tourData2)
-{
-	tourData1 = m_vInitialTour[0];
-	tourData2 = m_vInitialTour[1];
-}
-
-bool CMoveInfo::getModifiedTourAt(int index, CTourInfo& tourInfo)
-{
-	if(index < 0 || (unsigned int) index >= m_vModifiedTour.size())
-		return false;
-	tourInfo = m_vModifiedTour[index];
-        return true;
-}
-
-
-
-CVRPSolver::CVRPSolver()
-{
-    // set a seed for the random number generator
-    // so it will generate consistent results for the same input
-    // otherwise we can not test it :(
-    srand(1726354);
-}
-CVRPSolver::~CVRPSolver()
-{
-}
-
-bool CVRPSolver::solveVRP(std::string& strError)
-{
-//	if(!m_bIsReadyToSolve)
-//	{
-//		strError = "Scenario is not ready to solve. Configure all parameter";
-//		return false;
-//	}
-	PGR_LOG("Inside Solve VRP");
-	std::vector<int> vecOrders, vecVehicles;
-	for(unsigned int i = 0; i < m_vOrderInfos.size(); i++)
-	{
-		vecOrders.push_back(m_vOrderInfos[i].getOrderId());
-	}
-
-	for(unsigned int i = 0; i < m_vVehicleInfos.size(); i++)
-	{
-		vecVehicles.push_back(m_vVehicleInfos[i].getId());
-	}
-	
-	m_solutionFinal.init(vecOrders, vecOrders.size(), vecVehicles);
-	PGR_LOG("After init solution");
-	int iAttemtCount = 0;
-	while(iAttemtCount < MAXIMUM_TRY)
-	{
-		bool bUpdateFound = false;
-		CSolutionInfo initialSolution = generateInitialSolution();
-		PGR_LOG("After Generate initial Solution");
-		iAttemtCount++;
-		bUpdateFound = updateFinalSolution(initialSolution);
-		PGR_LOG("After update final Solution");
-		bool bUpdateFound2 = tabuSearch(initialSolution);
-		PGR_LOG("After Tabu Search");
-		if((bUpdateFound == true) || (bUpdateFound2 == true))
-		{
-			iAttemtCount = 0;
-		}
-	}
-	m_bIsSolutionReady = true;
-	return true;
-
-}
-
-CSolutionInfo CVRPSolver::generateInitialSolution()
-{
-	CSolutionInfo initialSolution;
-	PGR_LOG("Inside gen ini sol");
-	std::vector<int> vecOrders, vecVehicles;
-	for(unsigned int i = 0; i < m_vOrderInfos.size(); i++)
-	{
-		vecOrders.push_back(m_vOrderInfos[i].getOrderId());
-	}
-
-	for(unsigned int i = 0; i < m_vVehicleInfos.size(); i++)
-	{
-		vecVehicles.push_back(m_vVehicleInfos[i].getId());
-	}
-
-	initialSolution.init(vecOrders, vecOrders.size(), vecVehicles);
-
-	int iUnusedVehicles = initialSolution.getUnusedVehicleCount();
-	int iUnservedOrders = initialSolution.getUnservedOrderCount();//m_viUnservedOrderIndex.size();
-	PGR_LOG("before while");
-	while( iUnusedVehicles && iUnservedOrders )
-	{
-		CTourInfo curTour;
-
-		int vehicleIndex = rand() % iUnusedVehicles--;
-		int vehicleInd = m_mapVehicleIdToIndex[initialSolution.getUnusedVehicleAt(vehicleIndex)];
-		curTour.setVehicleInfo(m_vVehicleInfos[vehicleInd]);//m_viUnusedVehicleIndex[vehicleIndex]
-		initialSolution.removeVehicle(vehicleIndex);
-		
-		curTour.setStartDepot(m_vDepotInfos[0].getDepotId());
-		curTour.setEndDepot(m_vDepotInfos[0].getDepotId());
-		
-		//use a random seed to start to tour. (we can use better approach in future)
-		
-		bool insertAvailable = true;
-
-		while( insertAvailable )
-		{
-			insertAvailable = false;
-			std::pair<int,int> PotentialInsert; // first = insert_index, second = removed_order_index;
-			std::pair<int,double> bestInsert = std::make_pair(-1,DOUBLE_MAX);//first = order_insert_index, second = cost;
-
-			for(int i = 0;i<iUnservedOrders;++i)
-			{
-				int orderInd = m_mapOrderIdToIndex[initialSolution.getUnservedOrderAt(i)];
-				COrderInfo curOrder = m_vOrderInfos[orderInd];
-				std::pair<int,double> curInsert = getPotentialInsert(curTour, curOrder);
-
-				if( curInsert.second < bestInsert.second )
-				{
-					insertAvailable = true;
-					bestInsert = curInsert;
-					PotentialInsert = std::make_pair(curInsert.first,i);
-				}
-			}
-			if( insertAvailable )
-			{
-				if(insertOrder(curTour, initialSolution.getUnservedOrderAt(PotentialInsert.second), PotentialInsert.first))
-				{
-					iUnservedOrders--;
-					initialSolution.removeOrder(PotentialInsert.second);
-				}
-			}
-		}
-
-		initialSolution.addTour(curTour);
-	}
-
-	return initialSolution;
-}
-
-bool CVRPSolver::updateFinalSolution(CSolutionInfo& curSolution)
-{
-	bool callUpdate = false;
-	if ( curSolution.getOrderServed() > m_solutionFinal.getOrderServed() )
-	{
-		callUpdate = true;
-	}
-	else if ( curSolution.getOrderServed() == m_solutionFinal.getOrderServed() )
-	{
-		if ( curSolution.getTotalCost() < m_solutionFinal.getTotalCost() )
-		{
-			callUpdate = true;
-		}
-		else if (curSolution.getTotalCost() == m_solutionFinal.getTotalCost() )
-		{
-			if ( curSolution.getTotalTravelTime() < m_solutionFinal.getTotalTravelTime() )
-			{
-				callUpdate = true;
-			}
-			else if ( curSolution.getTotalTravelTime() == m_solutionFinal.getTotalTravelTime()  )
-			{
-				if ( curSolution.getTotalDistance() < m_solutionFinal.getTotalDistance()  )
-				{
-					callUpdate = true;
-				}
-			}
-		}
-	}
-	if (callUpdate)
-	{
-		//m_iStepsSinceLastSolution = 0;
-		m_solutionFinal = curSolution;
-
-		//clear map and delete objects
-		//m_mpTabuCount.clear();
-		//for (std::map< CVRPTWMove*,int >::iterator it = m_mpMoveFrequency.begin();it!=m_mpMoveFrequency.end();++it)
-		//{
-		//	delete (*it).first;
-		//}
-		//m_mpMoveFrequency.clear();
-		return true;
-	}
-	return false;
-}
-
-std::pair<int,double> CVRPSolver::getPotentialInsert(CTourInfo& curTour, COrderInfo& curOrder)
-{
-	std::pair<int,double> bestInsert = std::make_pair(-1,DOUBLE_MAX);
-	if( curOrder.getOrderUnit() > curTour.getRemainingCapacity() )
-	{
-		return bestInsert;
-	}
-	//check if ith position insert is fisible.
-	std::vector<int> vecOrderId = curTour.getOrderVector();
-	for(unsigned int i = 0; i <= vecOrderId.size();++i)
-	{
-		CostPack costToOrder, costFromOrder;
-		
-		if(!i)
-		{
-			costToOrder = getDepotToOrderCost( curTour.getStartDepot(), curOrder.getOrderId());
-		}
-		else costToOrder = getOrderToOrderCost( vecOrderId[i-1], curOrder.getOrderId());
-
-		double dArrivalTime = costToOrder.traveltime + curTour.getStartTime(i);
-
-		if( dArrivalTime > curOrder.getCloseTime() )
-		{
-			continue;
-		}
-
-		if (i == vecOrderId.size())
-		{
-			costFromOrder = getOrderToDepotCost( curOrder.getOrderId(), curTour.getEndDepot() );
-		}
-		else costFromOrder = getOrderToOrderCost( curOrder.getOrderId(), vecOrderId[i] );
-
-		dArrivalTime += curOrder.getServiceTime() + costFromOrder.traveltime;
-
-		if( i < vecOrderId.size() && dArrivalTime > m_vOrderInfos[m_mapOrderIdToIndex[vecOrderId[i]]].getCloseTime())
-		{
-			continue;
-		}
-
-		CostPack totalCost = getCostForInsert(curTour, curOrder, i);
-
-		
-		if( totalCost.cost < bestInsert.second )
-		{
-			bestInsert = std::make_pair(i,totalCost.cost);
-		}
-	}
-	return bestInsert;
-}
-
-bool CVRPSolver::tabuSearch(CSolutionInfo& curSolution)
-{
-	m_bFoundOptimal = false;
-	updateFinalSolution(curSolution);
-
-	int numberOfSearch = 0;
-	m_iGeneratedSolutionCount = 0;
-	m_iStepsSinceLastSolution = 0;
-
-	while( numberOfSearch < TOTAL_NUMBER_OF_SEARCH )
-	{
-		//applyBestMoveInCurrentSolution(curSolution, identifyPotentialMove(curSolution) );	
-		insertUnservedOrders(curSolution);
-		//attemptFeasibleNodeExchange(curSolution);
-		attempVehicleExchange(curSolution);
-		++numberOfSearch;
-	}
-	return false;
-}
-
-void CVRPSolver::applyBestMoveInCurrentSolution(CSolutionInfo& curSolution, CMoveInfo& bestMove)
-{
-	++m_iGeneratedSolutionCount;
-	++m_iStepsSinceLastSolution;
-
-	updateTabuCount(bestMove);
-
-	int totalTour = bestMove.getModifiedTourCount();
-	for(int i = 0;i<totalTour;++i)
-	{
-		CTourInfo tourInfo;
-		bool bIsValid = bestMove.getModifiedTourAt(i, tourInfo);
-
-		if(bIsValid)
-			curSolution.replaceTour(tourInfo);
-	}
-	updateFinalSolution(curSolution);
-	
-}
-
-void CVRPSolver::insertUnservedOrders(CSolutionInfo& curSolution)
-{
-	++m_iGeneratedSolutionCount;
-	++m_iStepsSinceLastSolution;
-	bool insertAvailable = true;
-	CMoveInfo curMove;
-	int totalUnservedOrder = m_vOrderInfos.size() - curSolution.getOrderServed();
-
-	while( insertAvailable && totalUnservedOrder > 0 )
-	{
-		int insertTourId = -1;
-		insertAvailable = false;
-		int totalTour = curSolution.getTourInfoVector().size();
-		std::pair<int,int> PotentialInsert; // first = insert_index, second = removed_customer_index;
-		std::pair<int,double> bestInsert = std::make_pair(-1,DOUBLE_MAX);//first = customer_insert_index, second = cost;
-
-		for(int j = 0;j<totalTour;++j)
-		{
-			CTourInfo curTour = curSolution.getTour(j);
-			curMove.setInitialTour(curTour);
-
-			for(int i = 0;i<totalUnservedOrder;++i)
-			{
-				int ordIndex = m_mapOrderIdToIndex[curSolution.getUnservedOrderAt(i)];
-				COrderInfo curOrder = m_vOrderInfos[ordIndex];
-				std::pair<int,double> curInsert = getPotentialInsert(curTour, curOrder);
-
-				insertOrder(curTour, i,curInsert.first);
-				curMove.setModifiedTour(curTour);
-				curMove.getInitialTour(curTour);
-
-				//check if current move is tabu.
-				if( isTabuMove(curMove) )
-				{
-					continue;
-				}
-
-				if( curInsert.second < bestInsert.second )
-				{
-					insertTourId = j;
-					insertAvailable = true;
-					bestInsert = curInsert;
-					PotentialInsert = std::make_pair(curInsert.first,i);
-				}
-			}
-		}
-		if( insertAvailable )
-		{
-			totalUnservedOrder--;
-			curMove.setInitialTour(curSolution.getTour(insertTourId));
-
-			addOrderAtTour(curSolution, insertTourId,
-				PotentialInsert.first,
-				PotentialInsert.second);
-
-			curMove.setModifiedTour(curSolution.getTour(insertTourId));
-			this->updateTabuCount(curMove);
-			this->updateFinalSolution(curSolution);//this->evaluateCurrentSolution();
-		}
-	}
-	
-}
-
-bool CVRPSolver::addDepot(CDepotInfo depotInfo)
-{
-	int id = depotInfo.getDepotId();
-	if(m_mapDepotIdToIndex.find(id) != m_mapDepotIdToIndex.end())
-		return false;
-	m_mapDepotIdToIndex.insert(std::make_pair(id, m_vDepotInfos.size()));
-	m_vDepotInfos.push_back(depotInfo);
-	
-	return true;
-}
-
-bool CVRPSolver::addOrder(COrderInfo orderInfo)
-{
-	int id = orderInfo.getOrderId();
-	if(m_mapOrderIdToIndex.find(id) != m_mapOrderIdToIndex.end())
-	{
-		return false;
-	}
-	int index = m_vOrderInfos.size();
-	m_mapOrderIdToIndex.insert(std::make_pair(id, index));
-	m_vOrderInfos.push_back(orderInfo);
-	m_viUnservedOrderIndex.push_back(index);
-	return true;
-}
-
-bool CVRPSolver::addVehicle(CVehicleInfo vehicleInfo)
-{
-	int id = vehicleInfo.getId();
-	if(m_mapVehicleIdToIndex.find(id) != m_mapVehicleIdToIndex.end())
-	{
-		return false;
-	}
-	int index = m_vVehicleInfos.size();
-	m_mapVehicleIdToIndex.insert(std::make_pair(id, index));
-	m_vVehicleInfos.push_back(vehicleInfo);
-	m_viUnusedVehicleIndex.push_back(index);
-	return true;
-}
-
-bool CVRPSolver::addDepotToOrderCost(int depotId, int orderId, CostPack cost)
-{
-	PII depo_order = std::make_pair(depotId, orderId);
-	if(m_mapDepotToOrderrCost.find(depo_order) != m_mapDepotToOrderrCost.end())
-	{
-		return false;
-	}
-	m_mapDepotToOrderrCost.insert(make_pair(depo_order, cost));
-	return true;
-}
-
-bool CVRPSolver::addOrderToDepotCost(int depotId, int orderId, CostPack cost)
-{
-	PII depo_order = std::make_pair(orderId, depotId);
-	if(m_mapOrderToDepotCost.find(depo_order) != m_mapOrderToDepotCost.end())
-	{
-		return false;
-	}
-	m_mapOrderToDepotCost.insert(std::make_pair(depo_order, cost));
-	return true;
-}
-
-bool CVRPSolver::addOrderToOrderCost(int firstOrder, int secondOrder, CostPack cost)
-{
-	PII order_order = std::make_pair(firstOrder, secondOrder);
-	if(m_mapOrderToOrderCost.find(order_order) != m_mapOrderToOrderCost.end())
-	{
-		return false;
-	}
-	m_mapOrderToOrderCost.insert(std::make_pair(order_order, cost));
-	return true;
-}
-
-bool CVRPSolver::getSolution(CSolutionInfo& solution, std::string& strError)
-{
-	if(m_bIsSolutionReady == true)
-	{
-		solution = m_solutionFinal;
-		return true;
-	}
-	else
-	{
-		bool ret = solveVRP(strError);
-		if(ret == true)
-		{
-			solution = m_solutionFinal;
-			return true;
-		}
-		return false;
-	}
-}
-
-CostPack CVRPSolver::getDepotToOrderCost(int depotId, int orderId)
-{
-	PII depo_order = std::make_pair(depotId, orderId);
-
-	if(m_mapDepotToOrderrCost.find(depo_order) != m_mapDepotToOrderrCost.end())
-	{
-		return(m_mapDepotToOrderrCost[depo_order]);
-	}
-	CostPack ret;
-	ret.cost = ret.distance = ret.traveltime = 1e15;
-	return ret;
-}
-
-CostPack CVRPSolver::getOrderToOrderCost(int orderId1, int orderId2)
-{
-	PII order_order = std::make_pair(orderId1, orderId2);
-
-	if(m_mapOrderToOrderCost.find(order_order) != m_mapOrderToOrderCost.end())
-	{
-		return(m_mapOrderToOrderCost[order_order]);
-	}
-	CostPack ret;
-	ret.cost = ret.distance = ret.traveltime = 1e15;
-	return ret;
-}
-
-
-CostPack CVRPSolver::getOrderToDepotCost(int depotId, int orderId)
-{
-	PII depo_order = std::make_pair(orderId, depotId);
-
-	if(m_mapOrderToDepotCost.find(depo_order) != m_mapOrderToDepotCost.end())
-	{
-		return(m_mapOrderToDepotCost[depo_order]);
-	}
-	CostPack ret;
-	ret.cost = ret.distance = ret.traveltime = 1e15;
-	return ret;
-}
-
-bool CVRPSolver::insertOrder(CTourInfo& tourInfo, int orderId, int pos)
-{
-	if(pos < 0 || (unsigned int) pos > tourInfo.getOrderVector().size())
-		return false;
-
-	int orderIndex = m_mapOrderIdToIndex[orderId];
-	if(!tourInfo.getVehicleInfo().loadUnit(m_vOrderInfos[orderIndex].getOrderUnit()))
-		return false;
-	tourInfo.insertOrder(orderId, pos);
-		
-	if(!updateTourCosts(tourInfo))
-	{
-		tourInfo.removeOrder(pos);
-		return false;
-	}
-
-	return true;
-}
-
-bool CVRPSolver::updateTourCosts(CTourInfo& tourInfo)
-{
-	std::vector<int> vecOrderId = tourInfo.getOrderVector();
-	std::vector<int> vecStartTimes;
-
-	double dCost, dDistance, dTravelTime;
-	dCost = dDistance = dTravelTime = 0.0;
-
-	CostPack cPack = getDepotToOrderCost(tourInfo.getStartDepot(), vecOrderId[0]);
-
-	dCost += cPack.cost;
-	dDistance += cPack.distance;
-
-	int ind = m_mapOrderIdToIndex[vecOrderId[0]];
-	vecStartTimes.push_back(0);
-
-	if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
-		return false;
-
-	dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
-						m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
-	vecStartTimes.push_back(ceil(dTravelTime));
-
-	unsigned int i;
-	for(i = 1; i < vecOrderId.size(); i++)
-	{
-		cPack = getOrderToOrderCost(vecOrderId[i - 1], vecOrderId[i]);
-		dCost += cPack.cost;
-		dDistance += cPack.distance;
-
-		ind = m_mapOrderIdToIndex[vecOrderId[i]];
-
-		if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
-			return false;
-
-		dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
-			m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
-
-		vecStartTimes.push_back(ceil(dTravelTime));
-	
-	}
-	
-	cPack = getOrderToDepotCost(vecOrderId[i - 1], tourInfo.getEndDepot());
-	dCost += cPack.cost;
-	dDistance += cPack.distance;
-
-	dTravelTime += cPack.traveltime;
-
-	vecStartTimes.push_back(ceil(dTravelTime));
-	ind = m_mapDepotIdToIndex[tourInfo.getEndDepot()];
-	if(dTravelTime > m_vDepotInfos[ind].getCloseTime())
-		return false;
-
-	tourInfo.updateCost(dCost, dDistance, dTravelTime);
-
-	tourInfo.setStartTime(vecStartTimes);
-
-	return true;
-}
-
-bool CVRPSolver::addOrderAtTour(CSolutionInfo &solutionInfo, int tourIndex, int insertIndex, int orderIndex)
-{
-	return(insertOrder(solutionInfo.getTour(tourIndex), m_vOrderInfos[orderIndex].getOrderId(), insertIndex));
-}
-
-CostPack CVRPSolver::getCostForInsert(CTourInfo& curTour, COrderInfo& curOrder, int pos)
-{
-	std::vector<int> vecOrderId = curTour.getOrderVector();
-	
-	vecOrderId.insert(vecOrderId.begin() + pos, curOrder.getOrderId());
-	double dCost, dDistance, dTravelTime;
-	dCost = dDistance = dTravelTime = 0.0;
-	CostPack costRet;
-
-	costRet.cost = INF;
-	costRet.distance = INF;
-	costRet.traveltime = INF;
-
-	CostPack cPack = getDepotToOrderCost(curTour.getStartDepot(), vecOrderId[0]);
-
-	dCost += cPack.cost;
-	dDistance += cPack.distance;
-
-	int ind = m_mapOrderIdToIndex[vecOrderId[0]];
-
-	if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
-		return costRet;
-
-	dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
-		m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
-
-	unsigned int i;
-	for(i = 1; i < vecOrderId.size(); i++)
-	{
-		cPack = getOrderToOrderCost(vecOrderId[i - 1], vecOrderId[i]);
-		dCost += cPack.cost;
-		dDistance += cPack.distance;
-
-		ind = m_mapOrderIdToIndex[vecOrderId[i]];
-
-		if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
-			return costRet;
-
-		dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
-			m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
-
-	}
-
-	cPack = getOrderToDepotCost(vecOrderId[i - 1], curTour.getEndDepot());
-	dCost += cPack.cost;
-	dDistance += cPack.distance;
-
-	dTravelTime += cPack.traveltime;
-
-	ind = m_mapDepotIdToIndex[curTour.getEndDepot()];
-	if(dTravelTime > m_vDepotInfos[ind].getCloseTime())
-		return costRet;
-
-	costRet.cost = dCost - curTour.getCost();
-	costRet.distance = dDistance - curTour.getDistance();
-	costRet.traveltime = dTravelTime - curTour.getTravelTime();
-
-	return costRet;
-}
-
-void CVRPSolver::attempVehicleExchange(CSolutionInfo& solutionInfo)
-{
-	++m_iGeneratedSolutionCount;
-	++m_iStepsSinceLastSolution;
-	CMoveInfo curMove; 
-	CMoveInfo bestMove;
-
-	int bestFreeCapacity = 0;
-	std::pair<int,int> bestSwapIndex;
-	int totalTour = solutionInfo.getTourCount();
-
-	for (int i = 0;i<totalTour;++i)
-	{
-		CTourInfo firstTour = solutionInfo.getTour(i);
-		int firstTourLoad = firstTour.getVehicleInfo().getCurrentLoad();
-		int firstVehicleCapacity = firstTour.getVehicleInfo().getCapacity();
-
-		for (int j = i+1;j<totalTour;++j)
-		{
-			CTourInfo secondTour = solutionInfo.getTour(j);
-			curMove.setInitialTour(firstTour,secondTour);
-
-			int FirstTourRemainingCapacity = firstVehicleCapacity - secondTour.getVehicleInfo().getCurrentLoad();
-
-			int SecondTourRemainingCapacity = secondTour.getVehicleInfo().getCapacity() - firstTourLoad;
-
-			// int prevFreeCapacity = max( secondTour.getRemainingCapacity(), firstTour.getRemainingCapacity() );
-
-			int curFreeCapacity = max(FirstTourRemainingCapacity,SecondTourRemainingCapacity);
-
-			if ( (FirstTourRemainingCapacity > 0) && (SecondTourRemainingCapacity > 0) && 
-				// curFreeCapacity > curFreeCapacity  autological compare evaluates to false (error on MAC)
-                              (curFreeCapacity > bestFreeCapacity) )
-			{
-
-				CVehicleInfo tempVehicle = m_vVehicleInfos[firstTour.getVehicleId()];
-				firstTour.setVehicleInfo(m_vVehicleInfos[secondTour.getVehicleId()] );
-				secondTour.setVehicleInfo( tempVehicle );
-
-				curMove.setModifiedTour(firstTour, secondTour);
-
-				if (!isTabuMove(curMove))
-				{
-					bestMove = curMove;
-					bestFreeCapacity = curFreeCapacity;
-					bestSwapIndex = std::make_pair(i,j);
-				}
-
-				curMove.getInitialTour(firstTour,secondTour);
-			}
-		}
-	}
-	if (bestFreeCapacity > 0)
-	{
-		CTourInfo tempTour;
-		bestMove.getModifiedTourAt(0, tempTour);
-		solutionInfo.replaceTourAt(bestSwapIndex.first, tempTour);
-		bestMove.getModifiedTourAt(1, tempTour);
-		solutionInfo.replaceTourAt(bestSwapIndex.second, tempTour);
-		updateTabuCount(bestMove);
-		updateFinalSolution(solutionInfo);
-	}
-	
-}
-/*
-void CVRPSolver::attemptFeasibleNodeExchange(CSolutionInfo& solutionInfo)
-{
-	++m_iGeneratedSolutionCount;
-	++m_iStepsSinceLastSolution;
-	CMoveInfo bestMove, curMove;
-
-	int totalTour = solutionInfo.getTourCount();
-	
-	for (int i = 0;i<totalTour;++i)
-	{
-		CTourInfo curTour = solutionInfo.getTour(i);
-		std::vector<int> vecOrderId = curTour.getOrderVector();
-		curMove.setInitialTour(curTour);
-		int totalCustomer = curTour.getServedOrderCount();
-		std::pair<int,int> bestSwapIndex;
-		double lowestCost = DOUBLE_MAX;
-
-		for (int j = 0;j<totalCustomer;++j)
-		{
-			for (int k = j+1;k<totalCustomer;++k)
-			{
-				COrderInfo firstCustomer = m_vOrderInfos[m_mapOrderIdToIndex[vecOrderId[j]]];
-				COrderInfo secondCustomer = m_vOrderInfos[m_mapOrderIdToIndex[vecOrderId[k]]];
-
-				if ( curTour->isFeasibleReplace(j,pSecondCustomer) && pCurTour->isFeasibleReplace(k,pFirstCustomer) )
-				{
-					pCurTour->removeCustomer(j,false);
-					pCurTour->addCustomer(pSecondCustomer,j);
-
-					pCurTour->removeCustomer(k,false);
-					pCurTour->addCustomer(pFirstCustomer,k);
-
-					pCurMove->setModifiedTour(pCurTour);
-					if (isTabuMove(pCurMove))
-					{
-						pCurMove->getInitialTour(pCurTour);
-						continue;
-					}
-
-					double curTourCost = pCurTour->getTourData()->calcCost(pCurTour->getAssignedVehicle());
-					if ( curTourCost < lowestCost )
-					{
-						*pBestMove = *pCurMove;
-						lowestCost = curTourCost;
-						bestSwapIndex = std::make_pair(j,k);
-					}
-					pCurMove->getInitialTour(pCurTour);
-				}
-			}
-		}
-
-		if (lowestCost!=DOUBLE_MAX)
-		{
-			m_pCurrentSolution->replaceTourAt(i,pBestMove->getModifiedTourAt(0));
-			this->updateTabuCount(pBestMove);
-			this->evaluateCurrentSolution();
-		}
-	}
-	delete pCurMove;
-	delete pBestMove;
-}
-*/
-
-void CVRPSolver::updateTabuCount(CMoveInfo& bestMove)
-{
-	m_veMoves.push_back(bestMove);
-	/*
-	bestMove.reverseMove();
-	CMoveInfo curMove;
-
-	std::map< CMoveInfo,int >::iterator mpIt = m_mapMoveFrequency.find(bestMove);
-
-	if (mpIt == m_mapMoveFrequency.end())
-	{
-		curMove = bestMove;
-	}
-	else curMove = (*mpIt).first;
-
-	m_mapMoveFrequency[curMove]++;
-
-	if( m_mapMoveFrequency[curMove] >= MAXIMUM_MOVE_FREQUENCY )
-	{
-		CMoveInfo tmpMove;
-		std::set<CMoveInfo>::iterator sIt = m_sTabuList.find(curMove);
-
-		CMoveInfo tmpMove2;
-		if ( sIt == m_sTabuList.end() )
-		{
-			tmpMove2 = curMove;
-		}
-		else tmpMove2 = (*sIt);
-		m_sTabuList.insert(tmpMove2);
-	}
-	m_mapTabuCount[curMove] = std::make_pair(m_iGeneratedSolutionCount,m_iStepsSinceLastSolution);
-	bestMove.reverseMove();
-	*/
-}
-
-bool CVRPSolver::isTabuMove(CMoveInfo& curMove)
-{
-	int i, tot = m_veMoves.size();
-	for(i = 0; i < tot; i++)
-	{
-		if(curMove == m_veMoves[i])
-			return true;
-	}
-	return false;
-}
-
-
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "VRP_Solver.h"
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#undef PGR_LOGGER_ON
+#define PGR_LOGGER_LOC
+#define PGR_LOGGER_FILE "/tmp/vrp-debug.log"
+#include "../../common/src/pgr_logger.h"
+
+#define DOUBLE_MAX 1e50
+
+bool operator != (const CVehicleInfo& cur, const CVehicleInfo& that)
+{
+	return(cur.m_iVehicleId != that.m_iVehicleId);
+}
+
+bool operator== (const CTourInfo& cur, const CTourInfo& that)
+{
+	if(cur.m_vehicleInfo != that.m_vehicleInfo)
+		return false;
+	if(cur.m_viOrderIds.size() != that.m_viOrderIds.size())
+		return false;
+	auto tot = cur.m_viOrderIds.size();
+	for(size_t i = 0; i < tot; i++)
+	{
+		if(cur.m_viOrderIds[i] != that.m_viOrderIds[i])
+			return false;
+	}
+	return true;
+}
+
+bool operator == (const CMoveInfo& cur, const CMoveInfo& that)
+{
+	if(!(cur.m_vInitialTour == that.m_vInitialTour))
+		return false;
+	if(!(cur.m_vModifiedTour == that.m_vModifiedTour))
+		return false;
+	return true;
+}
+
+
+
+CVehicleInfo::CVehicleInfo()
+{
+	m_iCurrentLoad = 0;
+}
+CVehicleInfo::~CVehicleInfo()
+{
+}
+
+bool CVehicleInfo::loadUnit(int lUnit)
+{
+	if(m_iCurrentLoad + lUnit > m_iCapacity)
+		return false;
+	m_iCurrentLoad += lUnit;
+	return true;
+}
+
+COrderInfo::COrderInfo()
+{
+}
+COrderInfo::~COrderInfo()
+{
+}
+
+CDepotInfo::CDepotInfo()
+{
+}
+CDepotInfo::~CDepotInfo()
+{
+}
+
+CTourInfo::CTourInfo()
+{
+	m_dTotalCost = 0.0;
+	m_dTotalDistance = 0.0;
+	m_dTotalTraveltime = 0.0;
+}
+CTourInfo::~CTourInfo()
+{
+}
+
+bool CTourInfo::insertOrder(int orderId, int pos)
+{
+	m_viOrderIds.insert(m_viOrderIds.begin() + pos, orderId);
+	return true;
+}
+
+int CTourInfo::getRemainingCapacity()
+{
+	return(m_vehicleInfo.getRemainingCapacity());
+}
+
+bool CTourInfo::removeOrder(int pos)
+{
+	m_viOrderIds.erase(m_viOrderIds.begin() + pos);
+	return true;
+}
+
+void CTourInfo::updateCost(double cost, double distance, double travelTime)
+{
+	m_dTotalCost = cost;
+	m_dTotalDistance = distance;
+	m_dTotalTraveltime = travelTime;
+}
+
+CSolutionInfo::CSolutionInfo()
+{
+}
+CSolutionInfo::~CSolutionInfo()
+{
+}
+
+void CSolutionInfo::replaceTour(CTourInfo curTour)
+{
+	unsigned int i;
+	for(i = 0; i < m_vtourAll.size(); i++)
+	{
+		if(m_vtourAll[i].getVehicleId() == curTour.getVehicleId())
+		{
+			m_vtourAll[i] = curTour;
+			return;
+		}
+	}
+	return;
+}
+
+void CSolutionInfo::replaceTourAt(int index, CTourInfo curTour)
+{
+	if(index < 0 || (unsigned int) index >= m_vtourAll.size())
+		return;
+	m_vtourAll[index] = curTour;
+}
+
+bool CSolutionInfo::init(std::vector<int> vecOrder, int iTotalOrder, std::vector<int> vecVehicle)
+{
+	m_vUnservedOrderId = vecOrder;
+	m_iTotalOrders = iTotalOrder;
+	m_vUnusedVehicles =  vecVehicle;
+
+	m_vtourAll.clear();
+	m_iVehicleUsed = 0;
+	m_iOrdersServed = 0;
+	m_iTotalOrders = 0;
+	m_dTotalCost = 0;
+	m_dTotalDistance = 0;
+	m_dTotalTravelTime = 0;
+	return true;
+}
+
+bool CSolutionInfo::addTour(CTourInfo& tour)
+{
+	m_vtourAll.push_back(tour);
+	int vid = tour.getVehicleId();
+	std::vector<int>::iterator it;
+	it = std::find(m_vUnusedVehicles.begin(), m_vUnusedVehicles.end(), vid);
+	if(it != m_vUnusedVehicles.end())
+	{
+		m_vUnusedVehicles.erase(it);
+	}
+	m_iVehicleUsed++;
+	m_dTotalDistance += tour.getDistance();
+	m_dTotalTravelTime += tour.getTravelTime();
+	m_dTotalCost += tour.getCost();
+
+	std::vector<int> vecOrders = tour.getOrderVector();
+
+	m_iOrdersServed += static_cast<int>(vecOrders.size());
+
+	for(unsigned int i = 0; i < vecOrders.size(); i++)
+	{
+		int oid = vecOrders[i];
+		it = std::find(m_vUnservedOrderId.begin(), m_vUnservedOrderId.end(), oid);
+		if(it != m_vUnservedOrderId.end())
+		{
+			m_vUnservedOrderId.erase(it);
+		}
+	}
+
+	return true;
+}
+
+CMoveInfo::CMoveInfo()
+{
+
+}
+CMoveInfo::~CMoveInfo()
+{
+
+}
+
+void CMoveInfo::setInitialTour(CTourInfo tourData)
+{
+	m_vInitialTour.clear();
+	m_vInitialTour.push_back(tourData);
+}
+
+void CMoveInfo::setInitialTour(CTourInfo tourData1, CTourInfo tourData2)
+{
+	m_vInitialTour.clear();
+	m_vInitialTour.push_back(tourData1);
+	m_vInitialTour.push_back(tourData2);
+}
+
+void CMoveInfo::setModifiedTour(CTourInfo tourData)
+{
+	m_vModifiedTour.clear();
+	m_vModifiedTour.push_back(tourData);
+}
+
+void CMoveInfo::setModifiedTour(CTourInfo tourData1, CTourInfo tourData2)
+{
+	m_vModifiedTour.clear();
+	m_vModifiedTour.push_back(tourData1);
+	m_vModifiedTour.push_back(tourData2);
+}
+
+void CMoveInfo::getInitialTour(CTourInfo &tourData)
+{
+	tourData = m_vInitialTour[0];
+}
+
+void CMoveInfo::getInitialTour(CTourInfo &tourData1, CTourInfo &tourData2)
+{
+	tourData1 = m_vInitialTour[0];
+	tourData2 = m_vInitialTour[1];
+}
+
+bool CMoveInfo::getModifiedTourAt(int index, CTourInfo& tourInfo)
+{
+	if(index < 0 || (unsigned int) index >= m_vModifiedTour.size())
+		return false;
+	tourInfo = m_vModifiedTour[index];
+        return true;
+}
+
+
+
+CVRPSolver::CVRPSolver()
+{
+    // set a seed for the random number generator
+    // so it will generate consistent results for the same input
+    // otherwise we can not test it :(
+    srand(1726354);
+}
+CVRPSolver::~CVRPSolver()
+{
+}
+
+bool CVRPSolver::solveVRP(std::string& strError)
+{
+//	if(!m_bIsReadyToSolve)
+//	{
+//		strError = "Scenario is not ready to solve. Configure all parameter";
+//		return false;
+//	}
+	PGR_LOG("Inside Solve VRP");
+	std::vector<int> vecOrders, vecVehicles;
+	for(unsigned int i = 0; i < m_vOrderInfos.size(); i++)
+	{
+		vecOrders.push_back(m_vOrderInfos[i].getOrderId());
+	}
+
+	for(unsigned int i = 0; i < m_vVehicleInfos.size(); i++)
+	{
+		vecVehicles.push_back(m_vVehicleInfos[i].getId());
+	}
+	
+	m_solutionFinal.init(vecOrders, static_cast<int>(vecOrders.size()), vecVehicles);
+	PGR_LOG("After init solution");
+	int iAttemtCount = 0;
+	while(iAttemtCount < MAXIMUM_TRY)
+	{
+		bool bUpdateFound = false;
+		CSolutionInfo initialSolution = generateInitialSolution();
+		PGR_LOG("After Generate initial Solution");
+		iAttemtCount++;
+		bUpdateFound = updateFinalSolution(initialSolution);
+		PGR_LOG("After update final Solution");
+		bool bUpdateFound2 = tabuSearch(initialSolution);
+		PGR_LOG("After Tabu Search");
+		if((bUpdateFound == true) || (bUpdateFound2 == true))
+		{
+			iAttemtCount = 0;
+		}
+	}
+	m_bIsSolutionReady = true;
+    strError += " ";
+	return true;
+
+}
+
+CSolutionInfo CVRPSolver::generateInitialSolution()
+{
+	CSolutionInfo initialSolution;
+	PGR_LOG("Inside gen ini sol");
+	std::vector<int> vecOrders, vecVehicles;
+	for(unsigned int i = 0; i < m_vOrderInfos.size(); i++)
+	{
+		vecOrders.push_back(m_vOrderInfos[i].getOrderId());
+	}
+
+	for(unsigned int i = 0; i < m_vVehicleInfos.size(); i++)
+	{
+		vecVehicles.push_back(m_vVehicleInfos[i].getId());
+	}
+
+	initialSolution.init(vecOrders, static_cast<int>(vecOrders.size()), vecVehicles);
+
+	int iUnusedVehicles = static_cast<int>(initialSolution.getUnusedVehicleCount());
+	int iUnservedOrders = static_cast<int>(initialSolution.getUnservedOrderCount());//m_viUnservedOrderIndex.size();
+	PGR_LOG("before while");
+	while( iUnusedVehicles && iUnservedOrders )
+	{
+		CTourInfo curTour;
+
+		int vehicleIndex = rand() % iUnusedVehicles--;
+		int vehicleInd = m_mapVehicleIdToIndex[initialSolution.getUnusedVehicleAt(vehicleIndex)];
+		curTour.setVehicleInfo(m_vVehicleInfos[vehicleInd]);//m_viUnusedVehicleIndex[vehicleIndex]
+		initialSolution.removeVehicle(vehicleIndex);
+		
+		curTour.setStartDepot(m_vDepotInfos[0].getDepotId());
+		curTour.setEndDepot(m_vDepotInfos[0].getDepotId());
+		
+		//use a random seed to start to tour. (we can use better approach in future)
+		
+		bool insertAvailable = true;
+
+		while( insertAvailable )
+		{
+			insertAvailable = false;
+			std::pair<int,int> PotentialInsert; // first = insert_index, second = removed_order_index;
+			std::pair<int,double> bestInsert = std::make_pair(-1,DOUBLE_MAX);//first = order_insert_index, second = cost;
+
+			for(int i = 0;i<iUnservedOrders;++i)
+			{
+				int orderInd = m_mapOrderIdToIndex[initialSolution.getUnservedOrderAt(i)];
+				COrderInfo curOrder = m_vOrderInfos[orderInd];
+				std::pair<int,double> curInsert = getPotentialInsert(curTour, curOrder);
+
+				if( curInsert.second < bestInsert.second )
+				{
+					insertAvailable = true;
+					bestInsert = curInsert;
+					PotentialInsert = std::make_pair(curInsert.first,i);
+				}
+			}
+			if( insertAvailable )
+			{
+				if(insertOrder(curTour, initialSolution.getUnservedOrderAt(PotentialInsert.second), PotentialInsert.first))
+				{
+					iUnservedOrders--;
+					initialSolution.removeOrder(PotentialInsert.second);
+				}
+			}
+		}
+
+		initialSolution.addTour(curTour);
+	}
+
+	return initialSolution;
+}
+
+bool CVRPSolver::updateFinalSolution(CSolutionInfo& curSolution)
+{
+	bool callUpdate = false;
+	if ( curSolution.getOrderServed() > m_solutionFinal.getOrderServed() )
+	{
+		callUpdate = true;
+	}
+	else if ( curSolution.getOrderServed() == m_solutionFinal.getOrderServed() )
+	{
+		if ( curSolution.getTotalCost() < m_solutionFinal.getTotalCost() )
+		{
+			callUpdate = true;
+		}
+		else if (curSolution.getTotalCost() == m_solutionFinal.getTotalCost() )
+		{
+			if ( curSolution.getTotalTravelTime() < m_solutionFinal.getTotalTravelTime() )
+			{
+				callUpdate = true;
+			}
+			else if ( curSolution.getTotalTravelTime() == m_solutionFinal.getTotalTravelTime()  )
+			{
+				if ( curSolution.getTotalDistance() < m_solutionFinal.getTotalDistance()  )
+				{
+					callUpdate = true;
+				}
+			}
+		}
+	}
+	if (callUpdate)
+	{
+		//m_iStepsSinceLastSolution = 0;
+		m_solutionFinal = curSolution;
+
+		//clear map and delete objects
+		//m_mpTabuCount.clear();
+		//for (std::map< CVRPTWMove*,int >::iterator it = m_mpMoveFrequency.begin();it!=m_mpMoveFrequency.end();++it)
+		//{
+		//	delete (*it).first;
+		//}
+		//m_mpMoveFrequency.clear();
+		return true;
+	}
+	return false;
+}
+
+std::pair<int,double> CVRPSolver::getPotentialInsert(CTourInfo& curTour, COrderInfo& curOrder)
+{
+	std::pair<int,double> bestInsert = std::make_pair(-1,DOUBLE_MAX);
+	if( curOrder.getOrderUnit() > curTour.getRemainingCapacity() )
+	{
+		return bestInsert;
+	}
+	//check if ith position insert is fisible.
+	std::vector<int> vecOrderId = curTour.getOrderVector();
+	for(unsigned int i = 0; i <= vecOrderId.size();++i)
+	{
+		CostPack costToOrder, costFromOrder;
+		
+		if(!i)
+		{
+			costToOrder = getDepotToOrderCost( curTour.getStartDepot(), curOrder.getOrderId());
+		}
+		else costToOrder = getOrderToOrderCost( vecOrderId[i-1], curOrder.getOrderId());
+
+		double dArrivalTime = costToOrder.traveltime + curTour.getStartTime(i);
+
+		if( dArrivalTime > curOrder.getCloseTime() )
+		{
+			continue;
+		}
+
+		if (i == vecOrderId.size())
+		{
+			costFromOrder = getOrderToDepotCost( curOrder.getOrderId(), curTour.getEndDepot() );
+		}
+		else costFromOrder = getOrderToOrderCost( curOrder.getOrderId(), vecOrderId[i] );
+
+		dArrivalTime += curOrder.getServiceTime() + costFromOrder.traveltime;
+
+		if( i < vecOrderId.size() && dArrivalTime > m_vOrderInfos[m_mapOrderIdToIndex[vecOrderId[i]]].getCloseTime())
+		{
+			continue;
+		}
+
+		CostPack totalCost = getCostForInsert(curTour, curOrder, i);
+
+		
+		if( totalCost.cost < bestInsert.second )
+		{
+			bestInsert = std::make_pair(i,totalCost.cost);
+		}
+	}
+	return bestInsert;
+}
+
+bool CVRPSolver::tabuSearch(CSolutionInfo& curSolution)
+{
+	m_bFoundOptimal = false;
+	updateFinalSolution(curSolution);
+
+	int numberOfSearch = 0;
+	m_iGeneratedSolutionCount = 0;
+	m_iStepsSinceLastSolution = 0;
+
+	while( numberOfSearch < TOTAL_NUMBER_OF_SEARCH )
+	{
+		//applyBestMoveInCurrentSolution(curSolution, identifyPotentialMove(curSolution) );	
+		insertUnservedOrders(curSolution);
+		//attemptFeasibleNodeExchange(curSolution);
+		attempVehicleExchange(curSolution);
+		++numberOfSearch;
+	}
+	return false;
+}
+
+void CVRPSolver::applyBestMoveInCurrentSolution(CSolutionInfo& curSolution, CMoveInfo& bestMove)
+{
+	++m_iGeneratedSolutionCount;
+	++m_iStepsSinceLastSolution;
+
+	updateTabuCount(bestMove);
+
+	int totalTour = static_cast<int>(bestMove.getModifiedTourCount());
+	for(int i = 0;i<totalTour;++i)
+	{
+		CTourInfo tourInfo;
+		bool bIsValid = bestMove.getModifiedTourAt(i, tourInfo);
+
+		if(bIsValid)
+			curSolution.replaceTour(tourInfo);
+	}
+	updateFinalSolution(curSolution);
+	
+}
+
+void CVRPSolver::insertUnservedOrders(CSolutionInfo& curSolution)
+{
+	++m_iGeneratedSolutionCount;
+	++m_iStepsSinceLastSolution;
+	bool insertAvailable = true;
+	CMoveInfo curMove;
+	int totalUnservedOrder = static_cast<int>(m_vOrderInfos.size() - curSolution.getOrderServed());
+
+	while( insertAvailable && totalUnservedOrder > 0 )
+	{
+		int insertTourId = -1;
+		insertAvailable = false;
+		int totalTour = static_cast<int>(curSolution.getTourInfoVector().size());
+		std::pair<int,int> PotentialInsert; // first = insert_index, second = removed_customer_index;
+		std::pair<int,double> bestInsert = std::make_pair(-1,DOUBLE_MAX);//first = customer_insert_index, second = cost;
+
+		for(int j = 0;j<totalTour;++j)
+		{
+			CTourInfo curTour = curSolution.getTour(j);
+			curMove.setInitialTour(curTour);
+
+			for(int i = 0;i<totalUnservedOrder;++i)
+			{
+				int ordIndex = m_mapOrderIdToIndex[curSolution.getUnservedOrderAt(i)];
+				COrderInfo curOrder = m_vOrderInfos[ordIndex];
+				std::pair<int,double> curInsert = getPotentialInsert(curTour, curOrder);
+
+				insertOrder(curTour, i,curInsert.first);
+				curMove.setModifiedTour(curTour);
+				curMove.getInitialTour(curTour);
+
+				//check if current move is tabu.
+				if( isTabuMove(curMove) )
+				{
+					continue;
+				}
+
+				if( curInsert.second < bestInsert.second )
+				{
+					insertTourId = j;
+					insertAvailable = true;
+					bestInsert = curInsert;
+					PotentialInsert = std::make_pair(curInsert.first,i);
+				}
+			}
+		}
+		if( insertAvailable )
+		{
+			totalUnservedOrder--;
+			curMove.setInitialTour(curSolution.getTour(insertTourId));
+
+			addOrderAtTour(curSolution, insertTourId,
+				PotentialInsert.first,
+				PotentialInsert.second);
+
+			curMove.setModifiedTour(curSolution.getTour(insertTourId));
+			this->updateTabuCount(curMove);
+			this->updateFinalSolution(curSolution);//this->evaluateCurrentSolution();
+		}
+	}
+	
+}
+
+bool CVRPSolver::addDepot(CDepotInfo depotInfo)
+{
+	int id = depotInfo.getDepotId();
+	if(m_mapDepotIdToIndex.find(id) != m_mapDepotIdToIndex.end())
+		return false;
+	m_mapDepotIdToIndex.insert(std::make_pair(id, m_vDepotInfos.size()));
+	m_vDepotInfos.push_back(depotInfo);
+	
+	return true;
+}
+
+bool CVRPSolver::addOrder(COrderInfo orderInfo)
+{
+	int id = orderInfo.getOrderId();
+	if(m_mapOrderIdToIndex.find(id) != m_mapOrderIdToIndex.end())
+	{
+		return false;
+	}
+	int index = static_cast<int>(m_vOrderInfos.size());
+	m_mapOrderIdToIndex.insert(std::make_pair(id, index));
+	m_vOrderInfos.push_back(orderInfo);
+	m_viUnservedOrderIndex.push_back(index);
+	return true;
+}
+
+bool CVRPSolver::addVehicle(CVehicleInfo vehicleInfo)
+{
+	int id = vehicleInfo.getId();
+	if(m_mapVehicleIdToIndex.find(id) != m_mapVehicleIdToIndex.end())
+	{
+		return false;
+	}
+	int index = static_cast<int>(m_vVehicleInfos.size());
+	m_mapVehicleIdToIndex.insert(std::make_pair(id, index));
+	m_vVehicleInfos.push_back(vehicleInfo);
+	m_viUnusedVehicleIndex.push_back(index);
+	return true;
+}
+
+bool CVRPSolver::addDepotToOrderCost(int depotId, int orderId, CostPack cost)
+{
+	PII depo_order = std::make_pair(depotId, orderId);
+	if(m_mapDepotToOrderrCost.find(depo_order) != m_mapDepotToOrderrCost.end())
+	{
+		return false;
+	}
+	m_mapDepotToOrderrCost.insert(make_pair(depo_order, cost));
+	return true;
+}
+
+bool CVRPSolver::addOrderToDepotCost(int depotId, int orderId, CostPack cost)
+{
+	PII depo_order = std::make_pair(orderId, depotId);
+	if(m_mapOrderToDepotCost.find(depo_order) != m_mapOrderToDepotCost.end())
+	{
+		return false;
+	}
+	m_mapOrderToDepotCost.insert(std::make_pair(depo_order, cost));
+	return true;
+}
+
+bool CVRPSolver::addOrderToOrderCost(int firstOrder, int secondOrder, CostPack cost)
+{
+	PII order_order = std::make_pair(firstOrder, secondOrder);
+	if(m_mapOrderToOrderCost.find(order_order) != m_mapOrderToOrderCost.end())
+	{
+		return false;
+	}
+	m_mapOrderToOrderCost.insert(std::make_pair(order_order, cost));
+	return true;
+}
+
+bool CVRPSolver::getSolution(CSolutionInfo& solution, std::string& strError)
+{
+	if(m_bIsSolutionReady == true)
+	{
+		solution = m_solutionFinal;
+		return true;
+	}
+	else
+	{
+		bool ret = solveVRP(strError);
+		if(ret == true)
+		{
+			solution = m_solutionFinal;
+			return true;
+		}
+		return false;
+	}
+}
+
+CostPack CVRPSolver::getDepotToOrderCost(int depotId, int orderId)
+{
+	PII depo_order = std::make_pair(depotId, orderId);
+
+	if(m_mapDepotToOrderrCost.find(depo_order) != m_mapDepotToOrderrCost.end())
+	{
+		return(m_mapDepotToOrderrCost[depo_order]);
+	}
+	CostPack ret;
+	ret.cost = ret.distance = ret.traveltime = 1e15;
+	return ret;
+}
+
+CostPack CVRPSolver::getOrderToOrderCost(int orderId1, int orderId2)
+{
+	PII order_order = std::make_pair(orderId1, orderId2);
+
+	if(m_mapOrderToOrderCost.find(order_order) != m_mapOrderToOrderCost.end())
+	{
+		return(m_mapOrderToOrderCost[order_order]);
+	}
+	CostPack ret;
+	ret.cost = ret.distance = ret.traveltime = 1e15;
+	return ret;
+}
+
+
+CostPack CVRPSolver::getOrderToDepotCost(int depotId, int orderId)
+{
+	PII depo_order = std::make_pair(orderId, depotId);
+
+	if(m_mapOrderToDepotCost.find(depo_order) != m_mapOrderToDepotCost.end())
+	{
+		return(m_mapOrderToDepotCost[depo_order]);
+	}
+	CostPack ret;
+	ret.cost = ret.distance = ret.traveltime = 1e15;
+	return ret;
+}
+
+bool CVRPSolver::insertOrder(CTourInfo& tourInfo, int orderId, int pos)
+{
+	if(pos < 0 || (unsigned int) pos > tourInfo.getOrderVector().size())
+		return false;
+
+	int orderIndex = m_mapOrderIdToIndex[orderId];
+	if(!tourInfo.getVehicleInfo().loadUnit(m_vOrderInfos[orderIndex].getOrderUnit()))
+		return false;
+	tourInfo.insertOrder(orderId, pos);
+		
+	if(!updateTourCosts(tourInfo))
+	{
+		tourInfo.removeOrder(pos);
+		return false;
+	}
+
+	return true;
+}
+
+bool CVRPSolver::updateTourCosts(CTourInfo& tourInfo)
+{
+	std::vector<int> vecOrderId = tourInfo.getOrderVector();
+	std::vector<int> vecStartTimes;
+
+	double dCost, dDistance, dTravelTime;
+	dCost = dDistance = dTravelTime = 0.0;
+
+	CostPack cPack = getDepotToOrderCost(tourInfo.getStartDepot(), vecOrderId[0]);
+
+	dCost += cPack.cost;
+	dDistance += cPack.distance;
+
+	int ind = m_mapOrderIdToIndex[vecOrderId[0]];
+	vecStartTimes.push_back(0);
+
+	if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
+		return false;
+
+	dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
+						m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
+	vecStartTimes.push_back(static_cast<int>(ceil(dTravelTime)));
+
+	unsigned int i;
+	for(i = 1; i < vecOrderId.size(); i++)
+	{
+		cPack = getOrderToOrderCost(vecOrderId[i - 1], vecOrderId[i]);
+		dCost += cPack.cost;
+		dDistance += cPack.distance;
+
+		ind = m_mapOrderIdToIndex[vecOrderId[i]];
+
+		if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
+			return false;
+
+		dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
+			m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
+
+	    vecStartTimes.push_back(static_cast<int>(ceil(dTravelTime)));
+	
+	}
+	
+	cPack = getOrderToDepotCost(vecOrderId[i - 1], tourInfo.getEndDepot());
+	dCost += cPack.cost;
+	dDistance += cPack.distance;
+
+	dTravelTime += cPack.traveltime;
+
+	vecStartTimes.push_back(static_cast<int>(ceil(dTravelTime)));
+	ind = m_mapDepotIdToIndex[tourInfo.getEndDepot()];
+	if(dTravelTime > m_vDepotInfos[ind].getCloseTime())
+		return false;
+
+	tourInfo.updateCost(dCost, dDistance, dTravelTime);
+
+	tourInfo.setStartTime(vecStartTimes);
+
+	return true;
+}
+
+bool CVRPSolver::addOrderAtTour(CSolutionInfo &solutionInfo, int tourIndex, int insertIndex, int orderIndex)
+{
+	return(insertOrder(solutionInfo.getTour(tourIndex), m_vOrderInfos[orderIndex].getOrderId(), insertIndex));
+}
+
+CostPack CVRPSolver::getCostForInsert(CTourInfo& curTour, COrderInfo& curOrder, int pos)
+{
+	std::vector<int> vecOrderId = curTour.getOrderVector();
+	
+	vecOrderId.insert(vecOrderId.begin() + pos, curOrder.getOrderId());
+	double dCost, dDistance, dTravelTime;
+	dCost = dDistance = dTravelTime = 0.0;
+	CostPack costRet;
+
+	costRet.cost = INF;
+	costRet.distance = INF;
+	costRet.traveltime = INF;
+
+	CostPack cPack = getDepotToOrderCost(curTour.getStartDepot(), vecOrderId[0]);
+
+	dCost += cPack.cost;
+	dDistance += cPack.distance;
+
+	int ind = m_mapOrderIdToIndex[vecOrderId[0]];
+
+	if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
+		return costRet;
+
+	dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
+		m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
+
+	unsigned int i;
+	for(i = 1; i < vecOrderId.size(); i++)
+	{
+		cPack = getOrderToOrderCost(vecOrderId[i - 1], vecOrderId[i]);
+		dCost += cPack.cost;
+		dDistance += cPack.distance;
+
+		ind = m_mapOrderIdToIndex[vecOrderId[i]];
+
+		if(dTravelTime + cPack.traveltime > m_vOrderInfos[ind].getCloseTime())
+			return costRet;
+
+		dTravelTime = max(dTravelTime + cPack.traveltime + m_vOrderInfos[ind].getServiceTime(), 
+			m_vOrderInfos[ind].getOpenTime() + m_vOrderInfos[ind].getServiceTime());
+
+	}
+
+	cPack = getOrderToDepotCost(vecOrderId[i - 1], curTour.getEndDepot());
+	dCost += cPack.cost;
+	dDistance += cPack.distance;
+
+	dTravelTime += cPack.traveltime;
+
+	ind = m_mapDepotIdToIndex[curTour.getEndDepot()];
+	if(dTravelTime > m_vDepotInfos[ind].getCloseTime())
+		return costRet;
+
+	costRet.cost = dCost - curTour.getCost();
+	costRet.distance = dDistance - curTour.getDistance();
+	costRet.traveltime = dTravelTime - curTour.getTravelTime();
+
+	return costRet;
+}
+
+void CVRPSolver::attempVehicleExchange(CSolutionInfo& solutionInfo)
+{
+	++m_iGeneratedSolutionCount;
+	++m_iStepsSinceLastSolution;
+	CMoveInfo curMove; 
+	CMoveInfo bestMove;
+
+	int bestFreeCapacity = 0;
+	std::pair<int,int> bestSwapIndex;
+	int totalTour = static_cast<int>(solutionInfo.getTourCount());
+
+	for (int i = 0;i<totalTour;++i)
+	{
+		CTourInfo firstTour = solutionInfo.getTour(i);
+		int firstTourLoad = firstTour.getVehicleInfo().getCurrentLoad();
+		int firstVehicleCapacity = firstTour.getVehicleInfo().getCapacity();
+
+		for (int j = i+1;j<totalTour;++j)
+		{
+			CTourInfo secondTour = solutionInfo.getTour(j);
+			curMove.setInitialTour(firstTour,secondTour);
+
+			int FirstTourRemainingCapacity = firstVehicleCapacity - secondTour.getVehicleInfo().getCurrentLoad();
+
+			int SecondTourRemainingCapacity = secondTour.getVehicleInfo().getCapacity() - firstTourLoad;
+
+			// int prevFreeCapacity = max( secondTour.getRemainingCapacity(), firstTour.getRemainingCapacity() );
+
+			int curFreeCapacity = max(FirstTourRemainingCapacity,SecondTourRemainingCapacity);
+
+			if ( (FirstTourRemainingCapacity > 0) && (SecondTourRemainingCapacity > 0) && 
+				// curFreeCapacity > curFreeCapacity  autological compare evaluates to false (error on MAC)
+                              (curFreeCapacity > bestFreeCapacity) )
+			{
+
+				CVehicleInfo tempVehicle = m_vVehicleInfos[firstTour.getVehicleId()];
+				firstTour.setVehicleInfo(m_vVehicleInfos[secondTour.getVehicleId()] );
+				secondTour.setVehicleInfo( tempVehicle );
+
+				curMove.setModifiedTour(firstTour, secondTour);
+
+				if (!isTabuMove(curMove))
+				{
+					bestMove = curMove;
+					bestFreeCapacity = curFreeCapacity;
+					bestSwapIndex = std::make_pair(i,j);
+				}
+
+				curMove.getInitialTour(firstTour,secondTour);
+			}
+		}
+	}
+	if (bestFreeCapacity > 0)
+	{
+		CTourInfo tempTour;
+		bestMove.getModifiedTourAt(0, tempTour);
+		solutionInfo.replaceTourAt(bestSwapIndex.first, tempTour);
+		bestMove.getModifiedTourAt(1, tempTour);
+		solutionInfo.replaceTourAt(bestSwapIndex.second, tempTour);
+		updateTabuCount(bestMove);
+		updateFinalSolution(solutionInfo);
+	}
+	
+}
+/*
+void CVRPSolver::attemptFeasibleNodeExchange(CSolutionInfo& solutionInfo)
+{
+	++m_iGeneratedSolutionCount;
+	++m_iStepsSinceLastSolution;
+	CMoveInfo bestMove, curMove;
+
+	int totalTour = solutionInfo.getTourCount();
+	
+	for (int i = 0;i<totalTour;++i)
+	{
+		CTourInfo curTour = solutionInfo.getTour(i);
+		std::vector<int> vecOrderId = curTour.getOrderVector();
+		curMove.setInitialTour(curTour);
+		int totalCustomer = curTour.getServedOrderCount();
+		std::pair<int,int> bestSwapIndex;
+		double lowestCost = DOUBLE_MAX;
+
+		for (int j = 0;j<totalCustomer;++j)
+		{
+			for (int k = j+1;k<totalCustomer;++k)
+			{
+				COrderInfo firstCustomer = m_vOrderInfos[m_mapOrderIdToIndex[vecOrderId[j]]];
+				COrderInfo secondCustomer = m_vOrderInfos[m_mapOrderIdToIndex[vecOrderId[k]]];
+
+				if ( curTour->isFeasibleReplace(j,pSecondCustomer) && pCurTour->isFeasibleReplace(k,pFirstCustomer) )
+				{
+					pCurTour->removeCustomer(j,false);
+					pCurTour->addCustomer(pSecondCustomer,j);
+
+					pCurTour->removeCustomer(k,false);
+					pCurTour->addCustomer(pFirstCustomer,k);
+
+					pCurMove->setModifiedTour(pCurTour);
+					if (isTabuMove(pCurMove))
+					{
+						pCurMove->getInitialTour(pCurTour);
+						continue;
+					}
+
+					double curTourCost = pCurTour->getTourData()->calcCost(pCurTour->getAssignedVehicle());
+					if ( curTourCost < lowestCost )
+					{
+						*pBestMove = *pCurMove;
+						lowestCost = curTourCost;
+						bestSwapIndex = std::make_pair(j,k);
+					}
+					pCurMove->getInitialTour(pCurTour);
+				}
+			}
+		}
+
+		if (lowestCost!=DOUBLE_MAX)
+		{
+			m_pCurrentSolution->replaceTourAt(i,pBestMove->getModifiedTourAt(0));
+			this->updateTabuCount(pBestMove);
+			this->evaluateCurrentSolution();
+		}
+	}
+	delete pCurMove;
+	delete pBestMove;
+}
+*/
+
+void CVRPSolver::updateTabuCount(CMoveInfo& bestMove)
+{
+	m_veMoves.push_back(bestMove);
+	/*
+	bestMove.reverseMove();
+	CMoveInfo curMove;
+
+	std::map< CMoveInfo,int >::iterator mpIt = m_mapMoveFrequency.find(bestMove);
+
+	if (mpIt == m_mapMoveFrequency.end())
+	{
+		curMove = bestMove;
+	}
+	else curMove = (*mpIt).first;
+
+	m_mapMoveFrequency[curMove]++;
+
+	if( m_mapMoveFrequency[curMove] >= MAXIMUM_MOVE_FREQUENCY )
+	{
+		CMoveInfo tmpMove;
+		std::set<CMoveInfo>::iterator sIt = m_sTabuList.find(curMove);
+
+		CMoveInfo tmpMove2;
+		if ( sIt == m_sTabuList.end() )
+		{
+			tmpMove2 = curMove;
+		}
+		else tmpMove2 = (*sIt);
+		m_sTabuList.insert(tmpMove2);
+	}
+	m_mapTabuCount[curMove] = std::make_pair(m_iGeneratedSolutionCount,m_iStepsSinceLastSolution);
+	bestMove.reverseMove();
+	*/
+}
+
+bool CVRPSolver::isTabuMove(CMoveInfo& curMove)
+{
+	size_t i, tot = m_veMoves.size();
+	for(i = 0; i < tot; i++)
+	{
+		if(curMove == m_veMoves[i])
+			return true;
+	}
+	return false;
+}
+
+
diff --git a/src/vrp_basic/src/VRP_Solver.h b/src/vrp_basic/src/VRP_Solver.h
index ce558d5..cdf05a9 100644
--- a/src/vrp_basic/src/VRP_Solver.h
+++ b/src/vrp_basic/src/VRP_Solver.h
@@ -1,426 +1,428 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#ifndef VRPSOLVER_H
-#define VRPSOLVER_H
-
-#include <vector>
-#include <map>
-#include <queue>
-#include <string>
-#include <stdlib.h>
-#include <iostream>
-#include <algorithm>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-#include <set>
-
-#define MAXIMUM_TRY 15
-#define TOTAL_NUMBER_OF_SEARCH 15
-#define MAXIMUM_MOVE_FREQUENCY 15
-
-#define INF (1e15)
-
-typedef std::pair<int, int> PII;
-
-#define max(a,b) ((a)>(b))?(a):(b)
-
-// Structure for Point, Geo coordinates can be represented with it
-typedef struct
-{
-  double X, Y;
-}Point;
-
-// Structure to keep cost, distance and traveltime. If distance/ traveltime is missing, there may be a negative flag
-typedef struct
-{
-	double cost, distance, traveltime;
-}CostPack;
-
-
-// Class for holding vehicle information which consist of capacity, and cost_per_km
-// For first version we will use homogeneous cost
-class CVehicleInfo
-{
-public:
-	CVehicleInfo();
-	~CVehicleInfo();
-
-	bool init();
-
-	bool loadUnit(int lUnit);
-	bool unloadUnit(int lUnit);
-	int getRemainingCapacity(){return (m_iCapacity - m_iCurrentLoad);}
-
-	int getCurrentLoad(){return m_iCurrentLoad;}
-	
-	int getCapacity(){return m_iCapacity;}
-	void setCapacity(int capacity){m_iCapacity = capacity;}
-
-	int getId(){return (this->m_iVehicleId);}
-	void setId(int id){m_iVehicleId = id;}
-
-	double getCostPerKM(){return m_dCostPerKM;}
-	void setCostPerKM(double cost){m_dCostPerKM = cost;}
-
-	friend bool operator != (const CVehicleInfo& cur, const CVehicleInfo& that);
-	
-	
-	//CVehicleInfo( CVehicleInfo const& );
-	//CVehicleInfo& operator = (const CVehicleInfo& vehicleInfo);
-
-private:
-	int m_iCapacity;
-	int m_iCurrentLoad;
-	int m_iVehicleId;
-	double m_dCostPerKM;
-	
-};
-
-
-
-// Class to represent Orders. Each order is consist of open_time, close_time and sevice_time, its location and number of units ordered.
-class COrderInfo
-{
-public:
-	COrderInfo();
-	~COrderInfo();
-
-	int getOpenTime(){return m_iOrderOpenTime;}
-	void setOpenTime(int openTime){m_iOrderOpenTime = openTime;}
-
-	int getCloseTime(){return m_iOrderCloseTime;}
-	void setCloseTime(int closeTime){m_iOrderCloseTime = closeTime;}
-
-	int getServiceTime(){return m_iOrderServiceTime;}
-	void setServiceTime(int serviceTime){m_iOrderServiceTime = serviceTime;}
-
-	int getOrderUnit(){return m_iOrderUnitCount;}
-	void setOrderUnit(int orderUnit){m_iOrderUnitCount = orderUnit;}
-
-	Point getOrderLocation(){return m_ptOrderLocation;}
-	void setOrderLocation(Point location){m_ptOrderLocation = location;}
-
-	int getOrderId(){return m_iOrderId;	}
-	void setOrderId(int orderId){m_iOrderId = orderId;}
-
-
-	//COrderInfo( COrderInfo const& );
-	//COrderInfo& operator = (const COrderInfo& solution);
-
-private:
-	int m_iOrderOpenTime;
-	int m_iOrderCloseTime;
-	int m_iOrderServiceTime;
-	int m_iOrderUnitCount;
-	int m_iOrderId;
-	
-	Point m_ptOrderLocation; 
-};
-
-
-// Class to represent Depot information. Each depot will have it's Open_Time and Close_Time. The Depot that will open earliest will have open time 0
-// and all other time will be normalized with respect to it. For the first version there will be only one depot
-class CDepotInfo
-{
-public:
-	CDepotInfo();
-	~CDepotInfo();
-
-	int getOpenTime(){return m_iDepotOpenTime;}
-	void setOpenTime(int openTime){m_iDepotOpenTime = openTime;}
-
-	int getCloseTime(){return m_iDepotCloseTime;}
-	void setCloseTime(int closeTime){m_iDepotCloseTime = closeTime;}
-
-	int getDepotId(){return m_iDepotId;}
-	void setDepotId(int id){m_iDepotId = id;}
-
-	Point getDepotLocation(){return m_ptDepotLocation;}
-	void setDepotLocation(Point location){m_ptDepotLocation = location;}
-	
-	//CDepotInfo( CDepotInfo const& );
-	//CDepotInfo& operator = (const CDepotInfo& solution);
-
-private:
-	int m_iDepotOpenTime;
-	int m_iDepotCloseTime;
-	
-	int m_iDepotId;
-
-	Point m_ptDepotLocation;
-};
-
-// Class to represent information of a Tour. A Tour starts from a depot and ends in a depot. On the way it serves several orders. 
-// Each Tour has a vehicle ID and the list of Orders it serves in appropriate order. It also has the total Distance, Cost and Time assciated.
-class CTourInfo
-{
-public:
-	CTourInfo();
-	~CTourInfo();
-	
-	void init();
-
-	int getRemainingCapacity();
-	
-	int getVehicleId(){return m_vehicleInfo.getId();}
-
-	CVehicleInfo& getVehicleInfo(){return m_vehicleInfo;}
-	void setVehicleInfo(CVehicleInfo vehicleInfo){m_vehicleInfo = vehicleInfo;}
-	
-	int getStartDepot(){return m_iStartDepotId;}
-	void setStartDepot(int depotId){m_iStartDepotId = depotId;}
-	
-	int getEndDepot(){return m_iEndDepotId;}
-	void setEndDepot(int depotId){m_iEndDepotId = depotId;}
-
-	int getServedOrderCount(){return m_viOrderIds.size();}
-
-	void updateCost(double cost, double distance, double travelTime);
-
-	void setStartTime(std::vector<int> vStartTime){m_viStartTime = vStartTime;}
-
-
-	bool insertOrder(int orderId, int pos);
-	bool removeOrder(int pos);
-	
-
-	double getDistance(){return m_dTotalDistance;}
-
-	double getCost(){return m_dTotalCost;}
-
-	double getTravelTime(){return m_dTotalTraveltime;}
-	
-	std::vector<int> getOrderVector(){return m_viOrderIds;}
-
-	int getStartTime(int pos){if( (unsigned int) pos >= m_viStartTime.size()) return 0; 
-								else return m_viStartTime[pos];}
-
-	friend bool operator== (const CTourInfo& cur, const CTourInfo& that);
-	
-
-	//bool operator != (const CTourInfo& that)
-	//{
-	//	return(!(*this == that));
-	//}
-	
-	//CTourInfo( CTourInfo const& );
-	//CTourInfo& operator = (const CTourInfo& solution);
-	
-
-private:
-	CVehicleInfo m_vehicleInfo;
-	int m_iStartDepotId;
-	int m_iEndDepotId;
-	int m_iOrdersServed;
-	std::vector<int> m_viOrderIds;
-	std::vector<int> m_viStartTime;
-	double m_dTotalCost;
-	double m_dTotalDistance;
-	double m_dTotalTraveltime;
-};
-
-
-
-// This class will represent a solution of a VRP problem. A solution will be consist of multiple tour. 
-// It also contains the number of vehicle used, number of orders served and total cost, distance and traveltime.
-class CSolutionInfo
-{
-public:
-	CSolutionInfo();
-	~CSolutionInfo();
-	
-	int getVehicleUsed(){return m_iVehicleUsed;}
-	int getOrderServed(){return m_iOrdersServed;}
-	//int getVehicleUsed(){return m_iVehicleUsed;}
-	
-	bool addTour(CTourInfo& tour);
-	CTourInfo& getTour(int pos){return m_vtourAll[pos];}
-
-	int getTourCount(){return (m_vtourAll.size());}
-
-	int getUnservedOrderCount(){return m_vUnservedOrderId.size();}
-	int getUnusedVehicleCount(){return m_vUnusedVehicles.size();}
-
-	int getUnusedVehicleAt(int pos){return m_vUnusedVehicles[pos];}
-
-	void removeVehicle(int pos){m_vUnusedVehicles.erase(m_vUnusedVehicles.begin() + pos);}
-	void removeOrder(int pos){m_vUnservedOrderId.erase(m_vUnservedOrderId.begin() + pos);}
-	
-	double getTotalCost(){return m_dTotalCost;}
-	double getTotalDistance(){return m_dTotalDistance;}
-	double getTotalTravelTime(){return m_dTotalTravelTime;}
-	int getUnservedOrderAt(int pos){return m_vUnservedOrderId[pos];}
-	//void addOrderAtTour(int tourIndex, int insertIndex, int orderIndex);
-
-	void replaceTourAt(int index, CTourInfo curTour);
-	void replaceTour(CTourInfo curTour);
-
-	bool init(std::vector<int> vecOrder, int iTotalOrder, std::vector<int> vecVehicle);
-	
-	std::vector<CTourInfo> getTourInfoVector(){return m_vtourAll;}
-	
-	//CTourInfo( CTourInfo const& );
-	//CTourInfo& operator = (const CTourInfo& solution);
-	
-private:
-	std::vector<CTourInfo> m_vtourAll;
-	std::vector<int> m_vUnservedOrderId;
-	std::vector<int> m_vUnusedVehicles;
-	int m_iVehicleUsed;
-	int m_iOrdersServed;
-	int m_iTotalOrders;
-	double m_dTotalCost;
-	double m_dTotalDistance;
-	double m_dTotalTravelTime;
-};
-
-class CMoveInfo
-{
-public:
-
-	CMoveInfo();
-	~CMoveInfo();
-
-	bool isBetter( CMoveInfo *pVRPMove );
-
-	void reverseMove();
-	void setInitialTour(CTourInfo pTourData);
-	void setInitialTour(CTourInfo pTourData1, CTourInfo pTourData2);
-	void setModifiedTour(CTourInfo pTourData);
-	void setModifiedTour(CTourInfo pTourData1, CTourInfo pTourData2);
-
-	bool getModifiedTourAt(int index, CTourInfo& tourInfo);
-	int getModifiedTourCount() const { return m_vModifiedTour.size();}
-	double getModifiedTourCost() const;
-	void getInitialTour(CTourInfo &TourData);
-	void getInitialTour(CTourInfo &TourData1, CTourInfo &TourData2);
-
-	friend bool operator == (const CMoveInfo& cur, const CMoveInfo& that);
-	
-
-	//bool operator != (const CMoveInfo& that)
-	//{
-	//	return(!(*this == that));
-	//}
-
-	//CMoveInfo( CMoveInfo const& );
-	//CMoveInfo& operator = (const CMoveInfo& solution);
-
-private:
-
-	void clearInitialTour();
-	void clearModifiedTour();
-
-	std::vector<CTourInfo> m_vInitialTour;
-	std::vector<CTourInfo> m_vModifiedTour;
-};
-
-
-
-
-// This is the main class that will solve the VRP problem. It will use the previous classes to represent the problem and the solution.
-// It will also have pre generated point to point distance/ cost/ traveltime information in maps.
-class CVRPSolver
-{
-public:
-	CVRPSolver();
-	~CVRPSolver();
-	
-	bool init();
-	
-	bool addDepot(CDepotInfo depotInfo);
-	bool addOrder(COrderInfo orderInfo);
-	bool addVehicle(CVehicleInfo vehicleInfo);
-	
-	CostPack getOrderToOrderCost(int firstOrder, int secondOrder);
-	CostPack getDepotToOrderCost(int depotId, int orderId);
-	CostPack getOrderToDepotCost(int depotId, int orderId);
-	
-	bool addOrderToOrderCost(int firstOrder, int secondOrder, CostPack cost);
-	bool addDepotToOrderCost(int depotId, int orderId, CostPack cost);
-	bool addOrderToDepotCost(int depotId, int orderId, CostPack cost);
-
-	void removeVehicle(int vehicleIndex)
-	{m_viUnusedVehicleIndex.erase(m_viUnusedVehicleIndex.begin() + vehicleIndex, m_viUnusedVehicleIndex.begin() + vehicleIndex+1);}
-	
-	void removeOrder(int orderIndex)
-	{m_viUnservedOrderIndex.erase(m_viUnservedOrderIndex.begin() + orderIndex, m_viUnservedOrderIndex.begin() + orderIndex + 1);}
-	
-	bool solveVRP(std::string& strError);
-	
-	bool getSolution(CSolutionInfo& solution, std::string& strError);
-	CSolutionInfo generateInitialSolution();
-	bool updateFinalSolution(CSolutionInfo& solutionInfo);
-	std::pair<int,double> getPotentialInsert(CTourInfo& curTour, COrderInfo& curOrder);
-	CostPack getCostForInsert(CTourInfo& curTour, COrderInfo& curOrder, int pos);
-	bool tabuSearch(CSolutionInfo& solutionInfo);
-	int getServiceTime(int order_id){return (m_vOrderInfos[m_mapOrderIdToIndex[order_id]].getServiceTime());}
-
-	bool insertOrder(CTourInfo& tourInfo, int orderId, int pos);
-	void applyBestMoveInCurrentSolution(CSolutionInfo& solutionInfo, CMoveInfo& bestMove );
-	void insertUnservedOrders(CSolutionInfo& solutionInfo);
-	//void attemptFeasibleNodeExchange(CSolutionInfo& solutionInfo);
-	void attempVehicleExchange(CSolutionInfo& solutionInfo);
-	//CMoveInfo identifyPotentialMove();
-	void updateTabuCount(CMoveInfo& bestMove);
-
-	bool isTabuMove(CMoveInfo& curMove);
-	bool updateTourCosts(CTourInfo& tourInfo);
-	bool addOrderAtTour(CSolutionInfo& solutionInfo, int tourIndex, int insertIndex, int orderIndex);
-	
-
-private:
-	bool m_bIsReadyToSolve;
-	std::vector<CVehicleInfo> m_vVehicleInfos;
-	std::vector<COrderInfo> m_vOrderInfos;
-	std::vector<CDepotInfo> m_vDepotInfos;
-	
-	std::map<int, int> m_mapOrderIdToIndex;
-	std::map<int, int> m_mapVehicleIdToIndex;
-	std::map<int, int> m_mapDepotIdToIndex;
-	
-	std::map<std::pair<int, int>, CostPack> m_mapOrderToOrderCost;
-	std::map<std::pair<int, int>, CostPack> m_mapDepotToOrderrCost;
-	std::map<std::pair<int, int>, CostPack> m_mapOrderToDepotCost;
-
-	/*
-	std::map<CMoveInfo, int> m_mapMoveFrequency;
-	std::map<CMoveInfo, std::pair<int, int> > m_mapTabuCount;
-	std::set<CMoveInfo> m_sTabuList;
-	*/
-
-	std::vector<CMoveInfo> m_veMoves;
-	
-	bool m_bIsSolutionReady;
-	CSolutionInfo m_solutionFinal;
-
-private:
-	std::vector<int> m_viUnservedOrderIndex;
-	std::vector<int> m_viUnusedVehicleIndex;
-	int m_iGeneratedSolutionCount;
-	int m_iStepsSinceLastSolution;
-	bool m_bFoundOptimal;
-		
-};
-
-#endif
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef VRPSOLVER_H
+#define VRPSOLVER_H
+
+#include <vector>
+#include <map>
+#include <queue>
+#include <string>
+#include <stdlib.h>
+#include <iostream>
+#include <algorithm>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <set>
+
+#define MAXIMUM_TRY 15
+#define TOTAL_NUMBER_OF_SEARCH 15
+#define MAXIMUM_MOVE_FREQUENCY 15
+
+#define INF (1e15)
+
+typedef std::pair<int, int> PII;
+
+#define max(a,b) ((a)>(b))?(a):(b)
+
+// Structure for Point, Geo coordinates can be represented with it
+typedef struct
+{
+  double X, Y;
+}Point;
+
+// Structure to keep cost, distance and traveltime. If distance/ traveltime is missing, there may be a negative flag
+typedef struct
+{
+	double cost, distance, traveltime;
+}CostPack;
+
+
+// Class for holding vehicle information which consist of capacity, and cost_per_km
+// For first version we will use homogeneous cost
+class CVehicleInfo
+{
+public:
+	CVehicleInfo();
+	~CVehicleInfo();
+
+	bool init();
+
+	bool loadUnit(int lUnit);
+	bool unloadUnit(int lUnit);
+	int getRemainingCapacity(){return (m_iCapacity - m_iCurrentLoad);}
+
+	int getCurrentLoad(){return m_iCurrentLoad;}
+	
+	int getCapacity(){return m_iCapacity;}
+	void setCapacity(int capacity){m_iCapacity = capacity;}
+
+	int getId(){return (this->m_iVehicleId);}
+	void setId(int id){m_iVehicleId = id;}
+
+	double getCostPerKM(){return m_dCostPerKM;}
+	void setCostPerKM(double cost){m_dCostPerKM = cost;}
+
+	friend bool operator != (const CVehicleInfo& cur, const CVehicleInfo& that);
+	
+	
+	//CVehicleInfo( CVehicleInfo const& );
+	//CVehicleInfo& operator = (const CVehicleInfo& vehicleInfo);
+
+private:
+	int m_iCapacity;
+	int m_iCurrentLoad;
+	int m_iVehicleId;
+	double m_dCostPerKM;
+	
+};
+
+
+
+// Class to represent Orders. Each order is consist of open_time, close_time and sevice_time, its location and number of units ordered.
+class COrderInfo
+{
+public:
+	COrderInfo();
+	~COrderInfo();
+
+	int getOpenTime(){return m_iOrderOpenTime;}
+	void setOpenTime(int openTime){m_iOrderOpenTime = openTime;}
+
+	int getCloseTime(){return m_iOrderCloseTime;}
+	void setCloseTime(int closeTime){m_iOrderCloseTime = closeTime;}
+
+	int getServiceTime(){return m_iOrderServiceTime;}
+	void setServiceTime(int serviceTime){m_iOrderServiceTime = serviceTime;}
+
+	int getOrderUnit(){return m_iOrderUnitCount;}
+	void setOrderUnit(int orderUnit){m_iOrderUnitCount = orderUnit;}
+
+	Point getOrderLocation(){return m_ptOrderLocation;}
+	void setOrderLocation(Point location){m_ptOrderLocation = location;}
+
+	int getOrderId(){return m_iOrderId;	}
+	void setOrderId(int orderId){m_iOrderId = orderId;}
+
+
+	//COrderInfo( COrderInfo const& );
+	//COrderInfo& operator = (const COrderInfo& solution);
+
+private:
+	int m_iOrderOpenTime;
+	int m_iOrderCloseTime;
+	int m_iOrderServiceTime;
+	int m_iOrderUnitCount;
+	int m_iOrderId;
+	
+	Point m_ptOrderLocation; 
+};
+
+
+// Class to represent Depot information. Each depot will have it's Open_Time and Close_Time. The Depot that will open earliest will have open time 0
+// and all other time will be normalized with respect to it. For the first version there will be only one depot
+class CDepotInfo
+{
+public:
+	CDepotInfo();
+	~CDepotInfo();
+
+	int getOpenTime(){return m_iDepotOpenTime;}
+	void setOpenTime(int openTime){m_iDepotOpenTime = openTime;}
+
+	int getCloseTime(){return m_iDepotCloseTime;}
+	void setCloseTime(int closeTime){m_iDepotCloseTime = closeTime;}
+
+	int getDepotId(){return m_iDepotId;}
+	void setDepotId(int id){m_iDepotId = id;}
+
+	Point getDepotLocation(){return m_ptDepotLocation;}
+	void setDepotLocation(Point location){m_ptDepotLocation = location;}
+	
+	//CDepotInfo( CDepotInfo const& );
+	//CDepotInfo& operator = (const CDepotInfo& solution);
+
+private:
+	int m_iDepotOpenTime;
+	int m_iDepotCloseTime;
+	
+	int m_iDepotId;
+
+	Point m_ptDepotLocation;
+};
+
+// Class to represent information of a Tour. A Tour starts from a depot and ends in a depot. On the way it serves several orders. 
+// Each Tour has a vehicle ID and the list of Orders it serves in appropriate order. It also has the total Distance, Cost and Time assciated.
+class CTourInfo
+{
+public:
+	CTourInfo();
+	~CTourInfo();
+	
+	void init();
+
+	int getRemainingCapacity();
+	
+	int getVehicleId(){return m_vehicleInfo.getId();}
+
+	CVehicleInfo& getVehicleInfo(){return m_vehicleInfo;}
+	void setVehicleInfo(CVehicleInfo vehicleInfo){m_vehicleInfo = vehicleInfo;}
+	
+	int getStartDepot(){return m_iStartDepotId;}
+	void setStartDepot(int depotId){m_iStartDepotId = depotId;}
+	
+	int getEndDepot(){return m_iEndDepotId;}
+	void setEndDepot(int depotId){m_iEndDepotId = depotId;}
+
+	size_t getServedOrderCount(){return m_viOrderIds.size();}
+
+	void updateCost(double cost, double distance, double travelTime);
+
+	void setStartTime(std::vector<int> vStartTime){m_viStartTime = vStartTime;}
+
+
+	bool insertOrder(int orderId, int pos);
+	bool removeOrder(int pos);
+	
+
+	double getDistance(){return m_dTotalDistance;}
+
+	double getCost(){return m_dTotalCost;}
+
+	double getTravelTime(){return m_dTotalTraveltime;}
+	
+	std::vector<int> getOrderVector(){return m_viOrderIds;}
+
+	int getStartTime(int pos){if( (unsigned int) pos >= m_viStartTime.size()) return 0; 
+								else return m_viStartTime[pos];}
+
+	friend bool operator== (const CTourInfo& cur, const CTourInfo& that);
+	
+
+	//bool operator != (const CTourInfo& that)
+	//{
+	//	return(!(*this == that));
+	//}
+	
+	//CTourInfo( CTourInfo const& );
+	//CTourInfo& operator = (const CTourInfo& solution);
+	
+
+private:
+	CVehicleInfo m_vehicleInfo;
+	int m_iStartDepotId;
+	int m_iEndDepotId;
+	int m_iOrdersServed;
+	std::vector<int> m_viOrderIds;
+	std::vector<int> m_viStartTime;
+	double m_dTotalCost;
+	double m_dTotalDistance;
+	double m_dTotalTraveltime;
+};
+
+
+
+// This class will represent a solution of a VRP problem. A solution will be consist of multiple tour. 
+// It also contains the number of vehicle used, number of orders served and total cost, distance and traveltime.
+class CSolutionInfo
+{
+public:
+	CSolutionInfo();
+	~CSolutionInfo();
+	
+	int getVehicleUsed(){return m_iVehicleUsed;}
+	int getOrderServed(){return m_iOrdersServed;}
+	//int getVehicleUsed(){return m_iVehicleUsed;}
+	
+	bool addTour(CTourInfo& tour);
+	CTourInfo& getTour(int pos){return m_vtourAll[pos];}
+
+	size_t getTourCount(){return (m_vtourAll.size());}
+
+	size_t getUnservedOrderCount(){return m_vUnservedOrderId.size();}
+	size_t getUnusedVehicleCount(){return m_vUnusedVehicles.size();}
+
+	int getUnusedVehicleAt(int pos){return m_vUnusedVehicles[pos];}
+
+	void removeVehicle(int pos){m_vUnusedVehicles.erase(m_vUnusedVehicles.begin() + pos);}
+	void removeOrder(int pos){m_vUnservedOrderId.erase(m_vUnservedOrderId.begin() + pos);}
+	
+	double getTotalCost(){return m_dTotalCost;}
+	double getTotalDistance(){return m_dTotalDistance;}
+	double getTotalTravelTime(){return m_dTotalTravelTime;}
+	int getUnservedOrderAt(int pos){return m_vUnservedOrderId[pos];}
+	//void addOrderAtTour(int tourIndex, int insertIndex, int orderIndex);
+
+	void replaceTourAt(int index, CTourInfo curTour);
+	void replaceTour(CTourInfo curTour);
+
+	bool init(std::vector<int> vecOrder, int iTotalOrder, std::vector<int> vecVehicle);
+	
+	std::vector<CTourInfo> getTourInfoVector(){return m_vtourAll;}
+	
+	//CTourInfo( CTourInfo const& );
+	//CTourInfo& operator = (const CTourInfo& solution);
+	
+private:
+	std::vector<CTourInfo> m_vtourAll;
+	std::vector<int> m_vUnservedOrderId;
+	std::vector<int> m_vUnusedVehicles;
+	int m_iVehicleUsed;
+	int m_iOrdersServed;
+	int m_iTotalOrders;
+	double m_dTotalCost;
+	double m_dTotalDistance;
+	double m_dTotalTravelTime;
+};
+
+class CMoveInfo
+{
+public:
+
+	CMoveInfo();
+	~CMoveInfo();
+
+	bool isBetter( CMoveInfo *pVRPMove );
+
+	void reverseMove();
+	void setInitialTour(CTourInfo pTourData);
+	void setInitialTour(CTourInfo pTourData1, CTourInfo pTourData2);
+	void setModifiedTour(CTourInfo pTourData);
+	void setModifiedTour(CTourInfo pTourData1, CTourInfo pTourData2);
+
+	bool getModifiedTourAt(int index, CTourInfo& tourInfo);
+	size_t getModifiedTourCount() const { return m_vModifiedTour.size();}
+	double getModifiedTourCost() const;
+	void getInitialTour(CTourInfo &TourData);
+	void getInitialTour(CTourInfo &TourData1, CTourInfo &TourData2);
+
+	friend bool operator == (const CMoveInfo& cur, const CMoveInfo& that);
+	
+
+	//bool operator != (const CMoveInfo& that)
+	//{
+	//	return(!(*this == that));
+	//}
+
+	//CMoveInfo( CMoveInfo const& );
+	//CMoveInfo& operator = (const CMoveInfo& solution);
+
+private:
+
+	void clearInitialTour();
+	void clearModifiedTour();
+
+	std::vector<CTourInfo> m_vInitialTour;
+	std::vector<CTourInfo> m_vModifiedTour;
+};
+
+
+
+
+// This is the main class that will solve the VRP problem. It will use the previous classes to represent the problem and the solution.
+// It will also have pre generated point to point distance/ cost/ traveltime information in maps.
+class CVRPSolver
+{
+public:
+	CVRPSolver();
+	~CVRPSolver();
+	
+	bool init();
+	
+	bool addDepot(CDepotInfo depotInfo);
+	bool addOrder(COrderInfo orderInfo);
+	bool addVehicle(CVehicleInfo vehicleInfo);
+	
+	CostPack getOrderToOrderCost(int firstOrder, int secondOrder);
+	CostPack getDepotToOrderCost(int depotId, int orderId);
+	CostPack getOrderToDepotCost(int depotId, int orderId);
+	
+	bool addOrderToOrderCost(int firstOrder, int secondOrder, CostPack cost);
+	bool addDepotToOrderCost(int depotId, int orderId, CostPack cost);
+	bool addOrderToDepotCost(int depotId, int orderId, CostPack cost);
+
+	void removeVehicle(int vehicleIndex)
+	{m_viUnusedVehicleIndex.erase(m_viUnusedVehicleIndex.begin() + vehicleIndex, m_viUnusedVehicleIndex.begin() + vehicleIndex+1);}
+	
+	void removeOrder(int orderIndex)
+	{m_viUnservedOrderIndex.erase(m_viUnservedOrderIndex.begin() + orderIndex, m_viUnservedOrderIndex.begin() + orderIndex + 1);}
+	
+	bool solveVRP(std::string& strError);
+	
+	bool getSolution(CSolutionInfo& solution, std::string& strError);
+	CSolutionInfo generateInitialSolution();
+	bool updateFinalSolution(CSolutionInfo& solutionInfo);
+	std::pair<int,double> getPotentialInsert(CTourInfo& curTour, COrderInfo& curOrder);
+	CostPack getCostForInsert(CTourInfo& curTour, COrderInfo& curOrder, int pos);
+	bool tabuSearch(CSolutionInfo& solutionInfo);
+	int getServiceTime(int order_id){return (m_vOrderInfos[m_mapOrderIdToIndex[order_id]].getServiceTime());}
+
+	bool insertOrder(CTourInfo& tourInfo, int orderId, int pos);
+	void applyBestMoveInCurrentSolution(CSolutionInfo& solutionInfo, CMoveInfo& bestMove );
+	void insertUnservedOrders(CSolutionInfo& solutionInfo);
+	//void attemptFeasibleNodeExchange(CSolutionInfo& solutionInfo);
+	void attempVehicleExchange(CSolutionInfo& solutionInfo);
+	//CMoveInfo identifyPotentialMove();
+	void updateTabuCount(CMoveInfo& bestMove);
+
+	bool isTabuMove(CMoveInfo& curMove);
+	bool updateTourCosts(CTourInfo& tourInfo);
+	bool addOrderAtTour(CSolutionInfo& solutionInfo, int tourIndex, int insertIndex, int orderIndex);
+	
+
+private:
+	bool m_bIsReadyToSolve;
+	std::vector<CVehicleInfo> m_vVehicleInfos;
+	std::vector<COrderInfo> m_vOrderInfos;
+	std::vector<CDepotInfo> m_vDepotInfos;
+	
+	std::map<int, int> m_mapOrderIdToIndex;
+	std::map<int, int> m_mapVehicleIdToIndex;
+	std::map<int, int> m_mapDepotIdToIndex;
+	
+	std::map<std::pair<int, int>, CostPack> m_mapOrderToOrderCost;
+	std::map<std::pair<int, int>, CostPack> m_mapDepotToOrderrCost;
+	std::map<std::pair<int, int>, CostPack> m_mapOrderToDepotCost;
+
+	/*
+	std::map<CMoveInfo, int> m_mapMoveFrequency;
+	std::map<CMoveInfo, std::pair<int, int> > m_mapTabuCount;
+	std::set<CMoveInfo> m_sTabuList;
+	*/
+
+	std::vector<CMoveInfo> m_veMoves;
+	
+	bool m_bIsSolutionReady;
+	CSolutionInfo m_solutionFinal;
+
+private:
+	std::vector<int> m_viUnservedOrderIndex;
+	std::vector<int> m_viUnusedVehicleIndex;
+	int m_iGeneratedSolutionCount;
+	int m_iStepsSinceLastSolution;
+	bool m_bFoundOptimal;
+		
+};
+
+#endif
diff --git a/src/vrp_basic/src/VRP_core.cpp b/src/vrp_basic/src/VRP_core.cpp
index 1248c56..aec0c35 100644
--- a/src/vrp_basic/src/VRP_core.cpp
+++ b/src/vrp_basic/src/VRP_core.cpp
@@ -1,240 +1,241 @@
-/*PGR
-
-Copyright (c) 2013 Khondoker Md. Razequl Islam
-ziboncsedu at gmail.com
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-*/
-
-#ifdef __MINGW32__
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
-#include "VRP.h"
-#include "VRP_Solver.h"
-#include <exception>
-
-#undef PGR_LOGGER_ON
-#define PGR_LOGGER_LOC
-#define PGR_LOGGER_FILE "/tmp/vrp-debug.log"
-#include "../../common/src/pgr_logger.h"
-
-CVRPSolver solver;
-
-void loadOrders(vrp_orders_t *orders, int order_count, int depotId)
-{
-	int i;
-    PGR_LOGF("%s: %d\n", "Depot ID", id)
-	for(i = 0; i < order_count; i++)
-	{
-		int id = orders[i].id;
-        PGR_LOGF("%s: %d\n", "Order ID", id)
-		if (id == depotId)
-		{
-			PGR_LOG("Got depot");
-			// This order represents Deopot
-			CDepotInfo depot;
-			
-			depot.setDepotId(id);
-
-			Point pt;
-
-			pt.X = orders[i].x;
-			pt.Y = orders[i].y;
-
-			depot.setDepotLocation(pt);
-
-			int openTime = orders[i].open_time;
-			depot.setOpenTime(openTime);
-
-			int closeTime = orders[i].close_time;
-			depot.setCloseTime(closeTime);
-
-			solver.addDepot(depot);
-			
-		}
-		else
-		{
-			// This is an order
-			COrderInfo order;
-			
-			order.setOrderId(id);
-
-			Point pt;
-
-			pt.X = orders[i].x;
-			pt.Y = orders[i].y;
-
-			order.setOrderLocation(pt);
-
-			int demand = orders[i].order_unit;
-			order.setOrderUnit(demand);
-
-			int openTime = orders[i].open_time;
-			order.setOpenTime(openTime);
-
-			int closeTime = orders[i].close_time;
-			order.setCloseTime(closeTime);
-
-			int serviceTime = orders[i].service_time;
-			order.setServiceTime(serviceTime);
-
-			solver.addOrder(order);
-		}
-	}
-	
-}
-
-void loadVehicles(vrp_vehicles_t *vehicles, int vehicle_count)
-{
-	int i;
-	for(i = 0; i < vehicle_count; i++)
-	{
-		CVehicleInfo vehicle;
-
-		int id = vehicles[i].id;
-		vehicle.setId(id);
-
-		int capcity = vehicles[i].capacity;
-		vehicle.setCapacity(capcity);
-
-		vehicle.setCostPerKM(1);
-
-		solver.addVehicle(vehicle);
-	}
-	
-}
-
-void loadDistanceMatrix(vrp_cost_element_t *costmatrix, int cost_count, int depotId)
-{
-	int i;
-	for(i = 0; i < cost_count; i++)
-	{
-		int fromId = costmatrix[i].src_id;
-		int toId = costmatrix[i].dest_id;
-		CostPack cpack;
-		cpack.cost = costmatrix[i].cost;
-		cpack.distance = costmatrix[i].distance; 
-		cpack.traveltime = costmatrix[i].traveltime;
-
-		if(fromId == depotId)
-			solver.addDepotToOrderCost(fromId, toId, cpack);
-		else if(toId == depotId)
-			solver.addOrderToDepotCost(fromId, toId, cpack);
-		else
-			solver.addOrderToOrderCost(fromId, toId, cpack);
-	}
-	
-}
-
-
-int find_vrp_solution(vrp_vehicles_t *vehicles, int vehicle_count,
-					  vrp_orders_t *orders, int order_count,
-					  vrp_cost_element_t *costmatrix, int cost_count,
-					  int depot_id,
-					  vrp_result_element_t **results, int *result_count, char **err_msg)
-{
-	int res;
-	
-	std::string strError;
-	try {
-		PGR_LOG("Before load order");
-		loadOrders(orders, order_count, depot_id);
-		PGR_LOG("After load order");
-		loadVehicles(vehicles, vehicle_count);
-		PGR_LOG("After load vehicles");
-		loadDistanceMatrix(costmatrix, cost_count, depot_id);
-		PGR_LOG("After load distance matrix");
-		res = solver.solveVRP(strError);
-		PGR_LOG("After VRP Solve");
-	
-	}
-	catch(std::exception& e) {
-		*err_msg = (char *) e.what();
-		return -1;
-	}
-	catch(...) {
-		*err_msg = (char *) "Caught unknown exception!";
-		return -1;
-	}
-
-	
-	if (res < 0)
-		return res;
-	else
-	{
-		try {
-		CSolutionInfo solution;
-		CTourInfo ctour;
-		// bool bOK =
-                solver.getSolution(solution, strError);
-		int totalRoute = solution.getTourInfoVector().size();
-		int totRows = 0;
-		int i;
-		for(i = 0; i < totalRoute; i++)
-		{
-			totRows += (solution.getTour(i).getServedOrderCount() + 2);
-		}
-		*results = (vrp_result_element_t *) malloc(totRows * sizeof(vrp_result_element_t));
-		*result_count = totRows;
-		int cnt = 0;
-		for(int i = 0; i < totalRoute; i++)
-		{
-			ctour = solution.getTour(i);
-			std::vector<int> vecOrder = ctour.getOrderVector();
-			int totalOrder = vecOrder.size();
-
-			// For start depot
-			(*results)[cnt].order_id = ctour.getStartDepot();
-			(*results)[cnt].order_pos = 0;
-			(*results)[cnt].vehicle_id = ctour.getVehicleId();
-			(*results)[cnt].arrival_time = -1;
-			(*results)[cnt].depart_time = ctour.getStartTime(0);
-			cnt++;
-			
-			// For each order
-			for(int j = 0; j < totalOrder; j++)
-			{
-				(*results)[cnt].order_id = vecOrder[j];
-				(*results)[cnt].order_pos = j + 1;
-				(*results)[cnt].vehicle_id = ctour.getVehicleId();
-				(*results)[cnt].depart_time = ctour.getStartTime(j + 1);
-				(*results)[cnt].arrival_time = ctour.getStartTime(j + 1) - solver.getServiceTime(vecOrder[j]);
-				cnt++;
-			}
-			
-			// For return depot
-			(*results)[cnt].order_id = ctour.getEndDepot();
-			(*results)[cnt].order_pos = totalOrder + 1;
-			(*results)[cnt].vehicle_id = ctour.getVehicleId();
-			(*results)[cnt].arrival_time = ctour.getStartTime(totalOrder + 1);
-			(*results)[cnt].depart_time = -1;
-			cnt++;
-		}
-		}
-		catch(std::exception& e) {
-		*err_msg = (char *) e.what();
-		return -1;
-		}
-		catch(...) {
-		*err_msg = (char *) "Caught unknown exception!";
-		return -1;
-		}
-	}
-	return EXIT_SUCCESS;
-}
-
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2013 Khondoker Md. Razequl Islam
+ziboncsedu at gmail.com
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "VRP.h"
+#include "VRP_Solver.h"
+#include <exception>
+
+#undef PGR_LOGGER_ON
+#define PGR_LOGGER_LOC
+#define PGR_LOGGER_FILE "/tmp/vrp-debug.log"
+#include "../../common/src/pgr_logger.h"
+
+CVRPSolver solver;
+
+void loadOrders(vrp_orders_t *orders, int order_count, int depotId)
+{
+	int i;
+    PGR_LOGF("%s: %d\n", "Depot ID", id)
+	for(i = 0; i < order_count; i++)
+	{
+		int id = orders[i].id;
+        PGR_LOGF("%s: %d\n", "Order ID", id)
+		if (id == depotId)
+		{
+			PGR_LOG("Got depot");
+			// This order represents Deopot
+			CDepotInfo depot;
+			
+			depot.setDepotId(id);
+
+			Point pt;
+
+			pt.X = orders[i].x;
+			pt.Y = orders[i].y;
+
+			depot.setDepotLocation(pt);
+
+			int openTime = orders[i].open_time;
+			depot.setOpenTime(openTime);
+
+			int closeTime = orders[i].close_time;
+			depot.setCloseTime(closeTime);
+
+			solver.addDepot(depot);
+			
+		}
+		else
+		{
+			// This is an order
+			COrderInfo order;
+			
+			order.setOrderId(id);
+
+			Point pt;
+
+			pt.X = orders[i].x;
+			pt.Y = orders[i].y;
+
+			order.setOrderLocation(pt);
+
+			int demand = orders[i].order_unit;
+			order.setOrderUnit(demand);
+
+			int openTime = orders[i].open_time;
+			order.setOpenTime(openTime);
+
+			int closeTime = orders[i].close_time;
+			order.setCloseTime(closeTime);
+
+			int serviceTime = orders[i].service_time;
+			order.setServiceTime(serviceTime);
+
+			solver.addOrder(order);
+		}
+	}
+	
+}
+
+void loadVehicles(vrp_vehicles_t *vehicles, int vehicle_count)
+{
+	int i;
+	for(i = 0; i < vehicle_count; i++)
+	{
+		CVehicleInfo vehicle;
+
+		int id = vehicles[i].id;
+		vehicle.setId(id);
+
+		int capcity = vehicles[i].capacity;
+		vehicle.setCapacity(capcity);
+
+		vehicle.setCostPerKM(1);
+
+		solver.addVehicle(vehicle);
+	}
+	
+}
+
+void loadDistanceMatrix(vrp_cost_element_t *costmatrix, int cost_count, int depotId)
+{
+	int i;
+	for(i = 0; i < cost_count; i++)
+	{
+		int fromId = costmatrix[i].src_id;
+		int toId = costmatrix[i].dest_id;
+		CostPack cpack;
+		cpack.cost = costmatrix[i].cost;
+		cpack.distance = costmatrix[i].distance; 
+		cpack.traveltime = costmatrix[i].traveltime;
+
+		if(fromId == depotId)
+			solver.addDepotToOrderCost(fromId, toId, cpack);
+		else if(toId == depotId)
+			solver.addOrderToDepotCost(fromId, toId, cpack);
+		else
+			solver.addOrderToOrderCost(fromId, toId, cpack);
+	}
+	
+}
+
+
+int find_vrp_solution(vrp_vehicles_t *vehicles, size_t vehicle_count,
+					  vrp_orders_t *orders, size_t order_count,
+					  vrp_cost_element_t *costmatrix, size_t cost_count,
+					  int depot_id,
+					  vrp_result_element_t **results, size_t *result_count, char **err_msg)
+{
+	int res;
+	
+	std::string strError;
+	try {
+		PGR_LOG("Before load order");
+		loadOrders(orders, static_cast<int>(order_count), depot_id);
+		PGR_LOG("After load order");
+		loadVehicles(vehicles, static_cast<int>(vehicle_count));
+		PGR_LOG("After load vehicles");
+		loadDistanceMatrix(costmatrix, static_cast<int>(cost_count), depot_id);
+		PGR_LOG("After load distance matrix");
+		res = solver.solveVRP(strError);
+		PGR_LOG("After VRP Solve");
+	
+	}
+	catch(std::exception& e) {
+		*err_msg = (char *) e.what();
+		return -1;
+	}
+	catch(...) {
+		*err_msg = (char *) "Caught unknown exception!";
+		return -1;
+	}
+
+	
+	if (res < 0)
+		return res;
+	else
+	{
+		try {
+		CSolutionInfo solution;
+		CTourInfo ctour;
+		// bool bOK =
+                solver.getSolution(solution, strError);
+		auto totalRoute = solution.getTourInfoVector().size();
+		size_t totRows = 0;
+		for(size_t i = 0; i < totalRoute; i++)
+		{
+			totRows += (solution.getTour(static_cast<int>(i)).getServedOrderCount() + 2);
+		}
+		*results = (vrp_result_element_t *) malloc(totRows * sizeof(vrp_result_element_t));
+		*result_count = totRows;
+		int cnt = 0;
+		for(size_t i = 0; i < totalRoute; i++)
+		{
+			ctour = solution.getTour(static_cast<int>(i));
+			std::vector<int> vecOrder = ctour.getOrderVector();
+			auto totalOrder = vecOrder.size();
+
+			// For start depot
+			(*results)[cnt].order_id = ctour.getStartDepot();
+			(*results)[cnt].order_pos = 0;
+			(*results)[cnt].vehicle_id = ctour.getVehicleId();
+			(*results)[cnt].arrival_time = -1;
+			(*results)[cnt].depart_time = ctour.getStartTime(0);
+			cnt++;
+			
+			// For each order
+			for(size_t j = 0; j < totalOrder; j++)
+			{
+				(*results)[cnt].order_id = vecOrder[j];
+				(*results)[cnt].order_pos = static_cast<int>(j) + 1;
+				(*results)[cnt].vehicle_id = ctour.getVehicleId();
+				(*results)[cnt].depart_time = ctour.getStartTime(static_cast<int>(j) + 1);
+				(*results)[cnt].arrival_time = ctour.getStartTime(static_cast<int>(j) + 1) - solver.getServiceTime(vecOrder[j]);
+				cnt++;
+			}
+			
+			// For return depot
+			(*results)[cnt].order_id = ctour.getEndDepot();
+			(*results)[cnt].order_pos = static_cast<int>(totalOrder) + 1;
+			(*results)[cnt].vehicle_id = ctour.getVehicleId();
+			(*results)[cnt].arrival_time = ctour.getStartTime(static_cast<int>(totalOrder) + 1);
+			(*results)[cnt].depart_time = -1;
+			cnt++;
+		}
+		}
+		catch(std::exception& e) {
+		*err_msg = (char *) e.what();
+		return -1;
+		}
+		catch(...) {
+		*err_msg = (char *) "Caught unknown exception!";
+		return -1;
+		}
+	}
+	return EXIT_SUCCESS;
+}
+
diff --git a/src/vrp_basic/test/VRP-any-01.test.sql b/src/vrp_basic/test/VRP-any-01.test.sql
index db9d364..3b9585e 100644
--- a/src/vrp_basic/test/VRP-any-01.test.sql
+++ b/src/vrp_basic/test/VRP-any-01.test.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select * from pgr_vrpOneDepot(
     'select * from vrp_orders order by id'::text,
     'select * from vrp_vehicles order by vehicle_id'::text,
diff --git a/src/vrp_basic/test/VRP-any-02.test.sql b/src/vrp_basic/test/VRP-any-02.test.sql
index c5a977d..8190b16 100644
--- a/src/vrp_basic/test/VRP-any-02.test.sql
+++ b/src/vrp_basic/test/VRP-any-02.test.sql
@@ -1,3 +1,25 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
 select * from pgr_vrpOneDepot(
   'select * from vrp100_orders order by id'::text,
   'select vehicle_id::integer, 200 as capacity from generate_series(1,50) as vehicle_id',
diff --git a/src/vrpdptw/test/README.vrpdptw-testdata b/src/vrpdptw/test/README.vrpdptw-testdata
deleted file mode 100644
index caf333a..0000000
--- a/src/vrpdptw/test/README.vrpdptw-testdata
+++ /dev/null
@@ -1,33 +0,0 @@
-
-# Li & Lim benchmark
-
-Here you find instance definitions and the best known solutions
-(to our knowledge) for the 100, 200, 400, 600, 800, and 1000 customer
-instances of Li & Lim's PDPTW benchmark problems. The version reported
-here has a hierarchical objective:
-
- 1. Minimize number of vehicles
- 2. Minimize total distance.
-
-Distance and time should be calculated with double precision, total
-distance results are rounded to two decimals. Exact methods typically
-use a total distance objective and use integral or low precision distance
-and time calculations. Hence, results are not directly comparable.
-
-This data base was built from data published at
-http://www.sintef.no/Projectweb/TOP/PDPTW/Li--Lim-benchmark/
-
-The data loads into a schema named "testdata" and there are 352 test cases
-with each test cases loaded into a table. there is a summary table called
-"pdp_problems" which lists each data table as "instance" and provides
-additional information about the best know result and the number of
-vehicles and vehicle capacity for each test cases.
-
-You might load these with commands like:
-
-```
-createdb -U postgres -h localhost vrpdptw_tests
-zcat vrpdptw-testdata.sql.gz | psql -U postgres -h localhost vrpdptw_tests
-```
-
-
diff --git a/src/vrpdptw/test/vrpdptw-testdata.sql.gz b/src/vrpdptw/test/vrpdptw-testdata.sql.gz
deleted file mode 100644
index efda4b2..0000000
Binary files a/src/vrpdptw/test/vrpdptw-testdata.sql.gz and /dev/null differ
diff --git a/src/vrppdtw/doc/index.rst b/src/vrppdtw/doc/index.rst
index 0ab5cc3..1ab2a25 100755
--- a/src/vrppdtw/doc/index.rst
+++ b/src/vrppdtw/doc/index.rst
@@ -9,12 +9,11 @@
 
 .. _pgr_gsocvrppdtw:
 
-pgr_vrppdtw - Pickup and Delivery problem 
+pgr_gsoc_vrppdtw
 ===============================================================================
 
 .. index:: 
-	single: pgr_gsocvrppdtw(text,integer,integer)
-	module: vrppdtw
+	single: pgr_gsoc_vrppdtw(text,integer,integer)
 
 Name
 -------------------------------------------------------------------------------
diff --git a/src/vrppdtw/sql/routing_vrppdtw.sql b/src/vrppdtw/sql/routing_vrppdtw.sql
index e675772..8ff857e 100644
--- a/src/vrppdtw/sql/routing_vrppdtw.sql
+++ b/src/vrppdtw/sql/routing_vrppdtw.sql
@@ -35,7 +35,7 @@ create or replace function pgr_gsoc_vrppdtw(
                 OUT cost integer
                 )
 returns setof record as
-'$libdir/librouting-2.1', 'vrppdtw'
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'vrppdtw'
 LANGUAGE c VOLATILE STRICT;
 
 
diff --git a/src/vrppdtw/src/CMakeLists.txt b/src/vrppdtw/src/CMakeLists.txt
index 3dd4e76..a67c349 100644
--- a/src/vrppdtw/src/CMakeLists.txt
+++ b/src/vrppdtw/src/CMakeLists.txt
@@ -1,3 +1,6 @@
-add_library(vrppdtw OBJECT  pdp.h  pdp.c  Route.h   Solution.h pdp_solver.cpp )
-
-
+add_library(vrppdtw OBJECT
+    pdp.h
+    pdp.c
+    Route.h
+    Solution.h
+    pdp_solver.cpp )
diff --git a/src/driving_distance/doc/CMakeLists.txt b/src/withPoints/doc/CMakeLists.txt
similarity index 100%
rename from src/driving_distance/doc/CMakeLists.txt
rename to src/withPoints/doc/CMakeLists.txt
diff --git a/src/withPoints/doc/doc-pgr_withPoints.queries b/src/withPoints/doc/doc-pgr_withPoints.queries
new file mode 100644
index 0000000..7a7004a
--- /dev/null
+++ b/src/withPoints/doc/doc-pgr_withPoints.queries
@@ -0,0 +1,206 @@
+BEGIN;
+BEGIN
+--e1
+SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -3);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   -1 |    1 |  0.6 |        0
+   2 |        2 |    2 |    4 |    1 |      0.6
+   3 |        3 |    5 |    7 |    1 |      1.6
+   4 |        4 |    8 |    6 |  0.7 |      2.6
+   5 |        5 |   -3 |   -1 |    0 |      3.3
+(5 rows)
+
+--e2
+SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3,
+        details := true);
+ seq | path_seq | node | edge | cost | agg_cost 
+-----+----------+------+------+------+----------
+   1 |        1 |   -1 |    1 |  0.6 |        0
+   2 |        2 |    2 |    4 |  0.7 |      0.6
+   3 |        3 |   -6 |    4 |  0.3 |      1.3
+   4 |        4 |    5 |    8 |    1 |      1.6
+   5 |        5 |    6 |    9 |    1 |      2.6
+   6 |        6 |    9 |   16 |    1 |      3.6
+   7 |        7 |    4 |    3 |    1 |      4.6
+   8 |        8 |    3 |   -1 |    0 |      5.6
+(8 rows)
+
+--e3
+SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, ARRAY[-3,5]);
+ seq | path_seq | end_pid | node | edge | cost | agg_cost 
+-----+----------+---------+------+------+------+----------
+   1 |        1 |      -3 |   -1 |    1 |  0.6 |        0
+   2 |        2 |      -3 |    2 |    4 |    1 |      0.6
+   3 |        3 |      -3 |    5 |    7 |    1 |      1.6
+   4 |        4 |      -3 |    8 |    6 |  0.7 |      2.6
+   5 |        5 |      -3 |   -3 |   -1 |    0 |      3.3
+   6 |        1 |       5 |   -1 |    1 |  0.6 |        0
+   7 |        2 |       5 |    2 |    4 |    1 |      0.6
+   8 |        3 |       5 |    5 |   -1 |    0 |      1.6
+(8 rows)
+
+--e4
+SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], -3);
+ seq | path_seq | start_pid | node | edge | cost | agg_cost 
+-----+----------+-----------+------+------+------+----------
+   1 |        1 |        -1 |   -1 |    1 |  0.6 |        0
+   2 |        2 |        -1 |    2 |    4 |    1 |      0.6
+   3 |        3 |        -1 |    5 |    7 |    1 |      1.6
+   4 |        4 |        -1 |    8 |    6 |  0.7 |      2.6
+   5 |        5 |        -1 |   -3 |   -1 |    0 |      3.3
+   6 |        1 |         2 |    2 |    4 |    1 |        0
+   7 |        2 |         2 |    5 |    7 |    1 |        1
+   8 |        3 |         2 |    8 |    6 |  0.7 |        2
+   9 |        4 |         2 |   -3 |   -1 |    0 |      2.7
+(9 rows)
+
+--e5
+SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7]);
+ seq | path_seq | start_pid | end_pid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |        -1 |      -3 |   -1 |    1 |  0.6 |        0
+   2 |        2 |        -1 |      -3 |    2 |    4 |    1 |      0.6
+   3 |        3 |        -1 |      -3 |    5 |    7 |    1 |      1.6
+   4 |        4 |        -1 |      -3 |    8 |    6 |  0.7 |      2.6
+   5 |        5 |        -1 |      -3 |   -3 |   -1 |    0 |      3.3
+   6 |        1 |        -1 |       7 |   -1 |    1 |  0.6 |        0
+   7 |        2 |        -1 |       7 |    2 |    4 |    1 |      0.6
+   8 |        3 |        -1 |       7 |    5 |    7 |    1 |      1.6
+   9 |        4 |        -1 |       7 |    8 |    6 |    1 |      2.6
+  10 |        5 |        -1 |       7 |    7 |   -1 |    0 |      3.6
+  11 |        1 |         2 |      -3 |    2 |    4 |    1 |        0
+  12 |        2 |         2 |      -3 |    5 |    7 |    1 |        1
+  13 |        3 |         2 |      -3 |    8 |    6 |  0.7 |        2
+  14 |        4 |         2 |      -3 |   -3 |   -1 |    0 |      2.7
+  15 |        1 |         2 |       7 |    2 |    4 |    1 |        0
+  16 |        2 |         2 |       7 |    5 |    7 |    1 |        1
+  17 |        3 |         2 |       7 |    8 |    6 |    1 |        2
+  18 |        4 |         2 |       7 |    7 |   -1 |    0 |        3
+(18 rows)
+
+--q2
+SELECT ('(' || start_pid || ' => ' || end_pid ||') at ' || path_seq || 'th step:')::TEXT AS path_at,
+            CASE WHEN edge = -1 THEN ' visits'
+                ELSE ' passes in front of'
+            END as status,
+            CASE WHEN node < 0 THEN 'Point'
+                ELSE 'Vertex'
+            END as is_a,
+            abs(node) as id
+        FROM pgr_withPoints(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+            'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+            ARRAY[1,-1], ARRAY[-2,-3,-6,3,6],
+            driving_side := 'r',
+            details := true)
+        WHERE node IN (-6,6);
+         path_at         |       status        |  is_a  | id 
+-------------------------+---------------------+--------+----
+ (-1 => -6) at 4th step: |  visits             | Point  |  6
+ (-1 => -3) at 4th step: |  passes in front of | Point  |  6
+ (-1 => -2) at 4th step: |  passes in front of | Point  |  6
+ (-1 => -2) at 6th step: |  passes in front of | Vertex |  6
+ (-1 => 3) at 4th step:  |  passes in front of | Point  |  6
+ (-1 => 3) at 6th step:  |  passes in front of | Vertex |  6
+ (-1 => 6) at 4th step:  |  passes in front of | Point  |  6
+ (-1 => 6) at 6th step:  |  visits             | Vertex |  6
+ (1 => -6) at 3th step:  |  visits             | Point  |  6
+ (1 => -3) at 3th step:  |  passes in front of | Point  |  6
+ (1 => -2) at 3th step:  |  passes in front of | Point  |  6
+ (1 => -2) at 5th step:  |  passes in front of | Vertex |  6
+ (1 => 3) at 3th step:   |  passes in front of | Point  |  6
+ (1 => 3) at 5th step:   |  passes in front of | Vertex |  6
+ (1 => 6) at 3th step:   |  passes in front of | Point  |  6
+ (1 => 6) at 5th step:   |  visits             | Vertex |  6
+(16 rows)
+
+--q3
+SELECT ('(' || start_pid || ' => ' || end_pid ||') at ' || path_seq || 'th step:')::TEXT AS path_at,
+            CASE WHEN edge = -1 THEN ' visits'
+                ELSE ' passes in front of'
+            END as status,
+            CASE WHEN node < 0 THEN 'Point'
+                ELSE 'Vertex'
+            END as is_a,
+            abs(node) as id
+        FROM pgr_withPoints(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+            'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+            ARRAY[1,-1], ARRAY[-2,-3,-6,3,6],
+            driving_side := 'l',
+            details := true)
+        WHERE node IN (-6,6);
+         path_at         |       status        |  is_a  | id 
+-------------------------+---------------------+--------+----
+ (-1 => -6) at 3th step: |  visits             | Point  |  6
+ (-1 => -3) at 3th step: |  passes in front of | Point  |  6
+ (-1 => -2) at 3th step: |  passes in front of | Point  |  6
+ (-1 => -2) at 5th step: |  passes in front of | Vertex |  6
+ (-1 => 3) at 3th step:  |  passes in front of | Point  |  6
+ (-1 => 3) at 5th step:  |  passes in front of | Vertex |  6
+ (-1 => 6) at 3th step:  |  passes in front of | Point  |  6
+ (-1 => 6) at 5th step:  |  visits             | Vertex |  6
+ (1 => -6) at 4th step:  |  visits             | Point  |  6
+ (1 => -3) at 4th step:  |  passes in front of | Point  |  6
+ (1 => -2) at 4th step:  |  passes in front of | Point  |  6
+ (1 => -2) at 6th step:  |  passes in front of | Vertex |  6
+ (1 => 3) at 4th step:   |  passes in front of | Point  |  6
+ (1 => 3) at 6th step:   |  passes in front of | Vertex |  6
+ (1 => 6) at 4th step:   |  passes in front of | Point  |  6
+ (1 => 6) at 6th step:   |  visits             | Vertex |  6
+(16 rows)
+
+--q4
+SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        directed := false,
+        details := true);
+ seq | path_seq | start_pid | end_pid | node | edge | cost | agg_cost 
+-----+----------+-----------+---------+------+------+------+----------
+   1 |        1 |        -1 |      -3 |   -1 |    1 |  0.6 |        0
+   2 |        2 |        -1 |      -3 |    2 |    4 |  0.7 |      0.6
+   3 |        3 |        -1 |      -3 |   -6 |    4 |  0.3 |      1.3
+   4 |        4 |        -1 |      -3 |    5 |    7 |    1 |      1.6
+   5 |        5 |        -1 |      -3 |    8 |    6 |  0.7 |      2.6
+   6 |        6 |        -1 |      -3 |   -3 |   -1 |    0 |      3.3
+   7 |        1 |        -1 |       7 |   -1 |    1 |  0.6 |        0
+   8 |        2 |        -1 |       7 |    2 |    4 |  0.7 |      0.6
+   9 |        3 |        -1 |       7 |   -6 |    4 |  0.3 |      1.3
+  10 |        4 |        -1 |       7 |    5 |    7 |    1 |      1.6
+  11 |        5 |        -1 |       7 |    8 |    6 |  0.7 |      2.6
+  12 |        6 |        -1 |       7 |   -3 |    6 |  0.3 |      3.3
+  13 |        7 |        -1 |       7 |    7 |   -1 |    0 |      3.6
+  14 |        1 |         2 |      -3 |    2 |    4 |  0.7 |        0
+  15 |        2 |         2 |      -3 |   -6 |    4 |  0.3 |      0.7
+  16 |        3 |         2 |      -3 |    5 |    7 |    1 |        1
+  17 |        4 |         2 |      -3 |    8 |    6 |  0.7 |        2
+  18 |        5 |         2 |      -3 |   -3 |   -1 |    0 |      2.7
+  19 |        1 |         2 |       7 |    2 |    4 |  0.7 |        0
+  20 |        2 |         2 |       7 |   -6 |    4 |  0.3 |      0.7
+  21 |        3 |         2 |       7 |    5 |    7 |    1 |        1
+  22 |        4 |         2 |       7 |    8 |    6 |  0.7 |        2
+  23 |        5 |         2 |       7 |   -3 |    6 |  0.3 |      2.7
+  24 |        6 |         2 |       7 |    7 |   -1 |    0 |        3
+(24 rows)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/withPoints/doc/doc-pgr_withPointsCost.queries b/src/withPoints/doc/doc-pgr_withPointsCost.queries
new file mode 100644
index 0000000..bfc9f4e
--- /dev/null
+++ b/src/withPoints/doc/doc-pgr_withPointsCost.queries
@@ -0,0 +1,103 @@
+BEGIN;
+BEGIN
+--e1
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -3);
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      3.3
+(1 row)
+
+--e2
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3,
+        directed := false);
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |       3 |      1.6
+(1 row)
+
+--e3
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, ARRAY[-3,5]);
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      3.3
+        -1 |       5 |      1.6
+(2 rows)
+
+--e4
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], -3);
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      3.3
+         2 |      -3 |      2.7
+(2 rows)
+
+--e5
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7]);
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      3.3
+        -1 |       7 |      3.6
+         2 |      -3 |      2.7
+         2 |       7 |        3
+(4 rows)
+
+--q2
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        driving_side := 'l');
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      3.3
+        -1 |       7 |      3.6
+         2 |      -3 |      2.7
+         2 |       7 |        3
+(4 rows)
+
+--q3
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        driving_side := 'r');
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      4.7
+        -1 |       7 |      4.4
+         2 |      -3 |      3.3
+         2 |       7 |        3
+(4 rows)
+
+--q4
+SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        driving_side := 'b');
+ start_pid | end_pid | agg_cost 
+-----------+---------+----------
+        -1 |      -3 |      3.3
+        -1 |       7 |      3.6
+         2 |      -3 |      2.7
+         2 |       7 |        3
+(4 rows)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/withPoints/doc/doc-pgr_withPointsDD.queries b/src/withPoints/doc/doc-pgr_withPointsDD.queries
new file mode 100644
index 0000000..266a9b4
--- /dev/null
+++ b/src/withPoints/doc/doc-pgr_withPointsDD.queries
@@ -0,0 +1,94 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8);
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   -1 |   -1 |    0 |        0
+   2 |    1 |    1 |  0.4 |      0.4
+   3 |    2 |    1 |  0.6 |      0.6
+   4 |    5 |    4 |  0.3 |      1.6
+   5 |    6 |    8 |    1 |      2.6
+   6 |    8 |    7 |    1 |      2.6
+   7 |   10 |   10 |    1 |      2.6
+   8 |    7 |    6 |  0.3 |      3.6
+   9 |    9 |    9 |    1 |      3.6
+  10 |   11 |   11 |    1 |      3.6
+  11 |   13 |   14 |    1 |      3.6
+(11 rows)
+
+--q2
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8,
+        driving_side := 'r',
+        details := true);
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   -1 |   -1 |    0 |        0
+   2 |    1 |    1 |  0.4 |      0.4
+   3 |    2 |    1 |    1 |      1.4
+   4 |   -6 |    4 |  0.7 |      2.1
+   5 |    5 |    4 |  0.3 |      2.4
+   6 |    6 |    8 |    1 |      3.4
+   7 |    8 |    7 |    1 |      3.4
+   8 |   10 |   10 |    1 |      3.4
+(8 rows)
+
+--q3
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8,
+        driving_side := 'l',
+        details := true);
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   -1 |   -1 |    0 |        0
+   2 |    2 |    1 |  0.6 |      0.6
+   3 |   -6 |    4 |  0.7 |      1.3
+   4 |    5 |    4 |  0.3 |      1.6
+   5 |    1 |    1 |    1 |      1.6
+   6 |    6 |    8 |    1 |      2.6
+   7 |    8 |    7 |    1 |      2.6
+   8 |   10 |   10 |    1 |      2.6
+   9 |   -5 |   12 |  0.6 |      3.2
+  10 |   -3 |    6 |  0.7 |      3.3
+  11 |    7 |    6 |  0.3 |      3.6
+  12 |    9 |    9 |    1 |      3.6
+  13 |   11 |   11 |    1 |      3.6
+  14 |   13 |   14 |    1 |      3.6
+(14 rows)
+
+--q4
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8,
+        driving_side := 'b',
+        details := true);
+ seq | node | edge | cost | agg_cost 
+-----+------+------+------+----------
+   1 |   -1 |   -1 |    0 |        0
+   2 |    1 |    1 |  0.4 |      0.4
+   3 |    2 |    1 |  0.6 |      0.6
+   4 |   -6 |    4 |  0.7 |      1.3
+   5 |    5 |    4 |  0.3 |      1.6
+   6 |    6 |    8 |    1 |      2.6
+   7 |    8 |    7 |    1 |      2.6
+   8 |   10 |   10 |    1 |      2.6
+   9 |   -5 |   12 |  0.6 |      3.2
+  10 |   -3 |    6 |  0.7 |      3.3
+  11 |    7 |    6 |  0.3 |      3.6
+  12 |    9 |    9 |    1 |      3.6
+  13 |   11 |   11 |    1 |      3.6
+  14 |   13 |   14 |    1 |      3.6
+(14 rows)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/withPoints/doc/doc-pgr_withPointsKSP.queries b/src/withPoints/doc/doc-pgr_withPointsKSP.queries
new file mode 100644
index 0000000..ae6f150
--- /dev/null
+++ b/src/withPoints/doc/doc-pgr_withPointsKSP.queries
@@ -0,0 +1,133 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -2, 2);
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |   -1 |    1 |  0.6 |        0
+   2 |       1 |        2 |    2 |    4 |    1 |      0.6
+   3 |       1 |        3 |    5 |    8 |    1 |      1.6
+   4 |       1 |        4 |    6 |    9 |    1 |      2.6
+   5 |       1 |        5 |    9 |   16 |    1 |      3.6
+   6 |       1 |        6 |    4 |    3 |    1 |      4.6
+   7 |       1 |        7 |    3 |    5 |  0.8 |      5.6
+   8 |       1 |        8 |   -2 |   -1 |    0 |      6.4
+   9 |       2 |        1 |   -1 |    1 |  0.6 |        0
+  10 |       2 |        2 |    2 |    4 |    1 |      0.6
+  11 |       2 |        3 |    5 |    8 |    1 |      1.6
+  12 |       2 |        4 |    6 |   11 |    1 |      2.6
+  13 |       2 |        5 |   11 |   13 |    1 |      3.6
+  14 |       2 |        6 |   12 |   15 |    1 |      4.6
+  15 |       2 |        7 |    9 |   16 |    1 |      5.6
+  16 |       2 |        8 |    4 |    3 |    1 |      6.6
+  17 |       2 |        9 |    3 |    5 |  0.8 |      7.6
+  18 |       2 |       10 |   -2 |   -1 |    0 |      8.4
+(18 rows)
+
+--q2
+SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 6, 2, details := true);
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |   -1 |    1 |  0.6 |        0
+   2 |       1 |        2 |    2 |    4 |  0.7 |      0.6
+   3 |       1 |        3 |   -6 |    4 |  0.3 |      1.3
+   4 |       1 |        4 |    5 |    8 |    1 |      1.6
+   5 |       1 |        5 |    6 |   -1 |    0 |      2.6
+   6 |       2 |        1 |   -1 |    1 |  0.6 |        0
+   7 |       2 |        2 |    2 |    4 |  0.7 |      0.6
+   8 |       2 |        3 |   -6 |    4 |  0.3 |      1.3
+   9 |       2 |        4 |    5 |   10 |    1 |      1.6
+  10 |       2 |        5 |   10 |   12 |  0.6 |      2.6
+  11 |       2 |        6 |   -5 |   12 |  0.4 |      3.2
+  12 |       2 |        7 |   11 |   13 |    1 |      3.6
+  13 |       2 |        8 |   12 |   15 |  0.6 |      4.6
+  14 |       2 |        9 |   -4 |   15 |  0.4 |      5.2
+  15 |       2 |       10 |    9 |    9 |    1 |      5.6
+  16 |       2 |       11 |    6 |   -1 |    0 |      6.6
+(16 rows)
+
+--q3
+SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -2, 2,
+        driving_side := 'l', details := true);
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |   -1 |    1 |  0.6 |        0
+   2 |       1 |        2 |    2 |    4 |  0.7 |      0.6
+   3 |       1 |        3 |   -6 |    4 |  0.3 |      1.3
+   4 |       1 |        4 |    5 |    8 |    1 |      1.6
+   5 |       1 |        5 |    6 |    9 |    1 |      2.6
+   6 |       1 |        6 |    9 |   16 |    1 |      3.6
+   7 |       1 |        7 |    4 |    3 |    1 |      4.6
+   8 |       1 |        8 |    3 |    5 |  0.8 |      5.6
+   9 |       1 |        9 |   -2 |   -1 |    0 |      6.4
+  10 |       2 |        1 |   -1 |    1 |  0.6 |        0
+  11 |       2 |        2 |    2 |    4 |  0.7 |      0.6
+  12 |       2 |        3 |   -6 |    4 |  0.3 |      1.3
+  13 |       2 |        4 |    5 |    8 |    1 |      1.6
+  14 |       2 |        5 |    6 |   11 |    1 |      2.6
+  15 |       2 |        6 |   11 |   13 |    1 |      3.6
+  16 |       2 |        7 |   12 |   15 |  0.6 |      4.6
+  17 |       2 |        8 |   -4 |   15 |  0.4 |      5.2
+  18 |       2 |        9 |    9 |   16 |    1 |      5.6
+  19 |       2 |       10 |    4 |    3 |    1 |      6.6
+  20 |       2 |       11 |    3 |    5 |  0.8 |      7.6
+  21 |       2 |       12 |   -2 |   -1 |    0 |      8.4
+(21 rows)
+
+--q4
+SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -2, 2,
+        heap_paths := true, driving_side := 'r', details := true);
+ seq | path_id | path_seq | node | edge | cost | agg_cost 
+-----+---------+----------+------+------+------+----------
+   1 |       1 |        1 |   -1 |    1 |  0.4 |        0
+   2 |       1 |        2 |    1 |    1 |    1 |      0.4
+   3 |       1 |        3 |    2 |    4 |  0.7 |      1.4
+   4 |       1 |        4 |   -6 |    4 |  0.3 |      2.1
+   5 |       1 |        5 |    5 |    8 |    1 |      2.4
+   6 |       1 |        6 |    6 |    9 |    1 |      3.4
+   7 |       1 |        7 |    9 |   16 |    1 |      4.4
+   8 |       1 |        8 |    4 |    3 |    1 |      5.4
+   9 |       1 |        9 |    3 |    5 |  0.8 |      6.4
+  10 |       1 |       10 |   -2 |   -1 |    0 |      7.2
+  11 |       2 |        1 |   -1 |    1 |  0.4 |        0
+  12 |       2 |        2 |    1 |    1 |    1 |      0.4
+  13 |       2 |        3 |    2 |    4 |  0.7 |      1.4
+  14 |       2 |        4 |   -6 |    4 |  0.3 |      2.1
+  15 |       2 |        5 |    5 |    8 |    1 |      2.4
+  16 |       2 |        6 |    6 |   11 |    1 |      3.4
+  17 |       2 |        7 |   11 |   13 |    1 |      4.4
+  18 |       2 |        8 |   12 |   15 |    1 |      5.4
+  19 |       2 |        9 |    9 |   16 |    1 |      6.4
+  20 |       2 |       10 |    4 |    3 |    1 |      7.4
+  21 |       2 |       11 |    3 |    5 |  0.8 |      8.4
+  22 |       2 |       12 |   -2 |   -1 |    0 |      9.2
+  23 |       3 |        1 |   -1 |    1 |  0.4 |        0
+  24 |       3 |        2 |    1 |    1 |    1 |      0.4
+  25 |       3 |        3 |    2 |    4 |  0.7 |      1.4
+  26 |       3 |        4 |   -6 |    4 |  0.3 |      2.1
+  27 |       3 |        5 |    5 |   10 |    1 |      2.4
+  28 |       3 |        6 |   10 |   12 |  0.6 |      3.4
+  29 |       3 |        7 |   -5 |   12 |  0.4 |        4
+  30 |       3 |        8 |   11 |   13 |    1 |      4.4
+  31 |       3 |        9 |   12 |   15 |    1 |      5.4
+  32 |       3 |       10 |    9 |   16 |    1 |      6.4
+  33 |       3 |       11 |    4 |    3 |    1 |      7.4
+  34 |       3 |       12 |    3 |    5 |  0.8 |      8.4
+  35 |       3 |       13 |   -2 |   -1 |    0 |      9.2
+(35 rows)
+
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/withPoints/doc/doc-pgr_withPointsVia.queries b/src/withPoints/doc/doc-pgr_withPointsVia.queries
new file mode 100644
index 0000000..7aa342c
--- /dev/null
+++ b/src/withPoints/doc/doc-pgr_withPointsVia.queries
@@ -0,0 +1,37 @@
+BEGIN;
+BEGIN
+--q1
+SELECT * FROM pgr_withPointsVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[1,3,5]);
+ERROR:  array value must start with "{" or dimension information
+LINE 3:         'SELECT pid, edge_id, fraction, side from pointsOfIn...
+                ^
+--q2
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        3, 3.0,
+        driving_side := 'r',
+        details := true);
+ERROR:  current transaction is aborted, commands ignored until end of transaction block
+--q3
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        3, 3.0,
+        driving_side := 'l',
+        details := true);
+ERROR:  current transaction is aborted, commands ignored until end of transaction block
+--q4
+SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        3, 3.0,
+        driving_side := 'b',
+        details := true);
+ERROR:  current transaction is aborted, commands ignored until end of transaction block
+--q5
+ROLLBACK;
+ROLLBACK
diff --git a/src/withPoints/doc/doc-withPointsVia.queries b/src/withPoints/doc/doc-withPointsVia.queries
new file mode 100644
index 0000000..1716ab5
--- /dev/null
+++ b/src/withPoints/doc/doc-withPointsVia.queries
@@ -0,0 +1,100 @@
+-- q0
+SELECT id, source, target FROM edge_table WHERE id IN (4, 5, 14);
+ id | source | target 
+----+--------+--------
+  4 |      2 |      5
+  5 |      3 |      6
+ 14 |     10 |     13
+(3 rows)
+
+-- q1
+SELECT * FROM pgr_withPointsVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    array[4, 5, 14], array[0.1, 0.5, 0.85]
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |        -1 |      -2 |   -1 |    4 |  0.9 |        0 |              0
+   2 |       1 |        2 |        -1 |      -2 |    5 |    8 |    1 |      0.9 |            0.9
+   3 |       1 |        3 |        -1 |      -2 |    6 |    9 |    1 |      1.9 |            1.9
+   4 |       1 |        4 |        -1 |      -2 |    9 |   16 |    1 |      2.9 |            2.9
+   5 |       1 |        5 |        -1 |      -2 |    4 |    3 |    1 |      3.9 |            3.9
+   6 |       1 |        6 |        -1 |      -2 |    3 |    5 |  0.5 |      4.9 |            4.9
+   7 |       1 |        7 |        -1 |      -2 |   -2 |   -1 |    0 |      5.4 |            5.4
+   8 |       2 |        1 |        -2 |      -3 |   -2 |    5 |  0.5 |        0 |            5.4
+   9 |       2 |        2 |        -2 |      -3 |    6 |    8 |    1 |      0.5 |            5.9
+  10 |       2 |        3 |        -2 |      -3 |    5 |   10 |    1 |      1.5 |            6.9
+  11 |       2 |        4 |        -2 |      -3 |   10 |   14 | 0.85 |      2.5 |            7.9
+  12 |       2 |        5 |        -2 |      -3 |   -3 |   -2 |    0 |     3.35 |           8.75
+(12 rows)
+
+SELECT * FROM pgr_withPointsVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    array[4, 5, 14], array[0.1, 0.5, 0.85],
+    true
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |        -1 |      -2 |   -1 |    4 |  0.9 |        0 |              0
+   2 |       1 |        2 |        -1 |      -2 |    5 |    8 |    1 |      0.9 |            0.9
+   3 |       1 |        3 |        -1 |      -2 |    6 |    9 |    1 |      1.9 |            1.9
+   4 |       1 |        4 |        -1 |      -2 |    9 |   16 |    1 |      2.9 |            2.9
+   5 |       1 |        5 |        -1 |      -2 |    4 |    3 |    1 |      3.9 |            3.9
+   6 |       1 |        6 |        -1 |      -2 |    3 |    5 |  0.5 |      4.9 |            4.9
+   7 |       1 |        7 |        -1 |      -2 |   -2 |   -1 |    0 |      5.4 |            5.4
+   8 |       2 |        1 |        -2 |      -3 |   -2 |    5 |  0.5 |        0 |            5.4
+   9 |       2 |        2 |        -2 |      -3 |    6 |    8 |    1 |      0.5 |            5.9
+  10 |       2 |        3 |        -2 |      -3 |    5 |   10 |    1 |      1.5 |            6.9
+  11 |       2 |        4 |        -2 |      -3 |   10 |   14 | 0.85 |      2.5 |            7.9
+  12 |       2 |        5 |        -2 |      -3 |   -3 |   -2 |    0 |     3.35 |           8.75
+(12 rows)
+
+-- q2
+SELECT * FROM pgr_withPointsVia(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    array[4, 5, 14], array[0.1, 0.5, 0.85],
+    false
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |        -1 |      -2 |   -1 |    4 |  0.1 |        0 |              0
+   2 |       1 |        2 |        -1 |      -2 |    2 |    2 |    1 |      0.1 |            0.1
+   3 |       1 |        3 |        -1 |      -2 |    3 |    5 |  0.5 |      1.1 |            1.1
+   4 |       1 |        4 |        -1 |      -2 |   -2 |   -1 |    0 |      1.6 |            1.6
+   5 |       2 |        1 |        -2 |      -3 |   -2 |    5 |  0.5 |        0 |            1.6
+   6 |       2 |        2 |        -2 |      -3 |    6 |   11 |    1 |      0.5 |            2.1
+   7 |       2 |        3 |        -2 |      -3 |   11 |   12 |    1 |      1.5 |            3.1
+   8 |       2 |        4 |        -2 |      -3 |   10 |   14 | 0.15 |      2.5 |            4.1
+   9 |       2 |        5 |        -2 |      -3 |   -3 |   -2 |    0 |     2.65 |           4.25
+(9 rows)
+
+-- q3
+SELECT * FROM pgr_withPointsVia(
+    'SELECT id, source, target, cost FROM edge_table',
+    array[4, 5, 14], array[0.1, 0.5, 0.85],
+    true
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+(0 rows)
+
+-- q4
+SELECT * FROM pgr_withPointsVia(
+    'SELECT id, source, target, cost FROM edge_table',
+    array[4, 5, 14], array[0.1, 0.5, 0.85],
+    false
+);
+ seq | path_id | path_seq | start_vid | end_vid | node | edge | cost | agg_cost | route_agg_cost 
+-----+---------+----------+-----------+---------+------+------+------+----------+----------------
+   1 |       1 |        1 |        -1 |      -2 |   -1 |    4 |  0.9 |        0 |              0
+   2 |       1 |        2 |        -1 |      -2 |    5 |    8 |    1 |      0.9 |            0.9
+   3 |       1 |        3 |        -1 |      -2 |    6 |    5 |  0.5 |      1.9 |            1.9
+   4 |       1 |        4 |        -1 |      -2 |   -2 |   -1 |    0 |      2.4 |            2.4
+   5 |       2 |        1 |        -2 |      -3 |   -2 |    5 |  0.5 |        0 |            2.4
+   6 |       2 |        2 |        -2 |      -3 |    6 |    8 |    1 |      0.5 |            2.9
+   7 |       2 |        3 |        -2 |      -3 |    5 |   10 |    1 |      1.5 |            3.9
+   8 |       2 |        4 |        -2 |      -3 |   10 |   14 | 0.85 |      2.5 |            4.9
+   9 |       2 |        5 |        -2 |      -3 |   -3 |   -2 |    0 |     3.35 |           5.75
+(9 rows)
+
+-- q5
diff --git a/src/withPoints/doc/images/leftDrivingSide.png b/src/withPoints/doc/images/leftDrivingSide.png
new file mode 100644
index 0000000..4b95af9
Binary files /dev/null and b/src/withPoints/doc/images/leftDrivingSide.png differ
diff --git a/src/withPoints/doc/images/noMatterDrivingSide.png b/src/withPoints/doc/images/noMatterDrivingSide.png
new file mode 100644
index 0000000..f1ec802
Binary files /dev/null and b/src/withPoints/doc/images/noMatterDrivingSide.png differ
diff --git a/src/withPoints/doc/images/rightDrivingSide.png b/src/withPoints/doc/images/rightDrivingSide.png
new file mode 100644
index 0000000..2f02c2d
Binary files /dev/null and b/src/withPoints/doc/images/rightDrivingSide.png differ
diff --git a/src/withPoints/doc/pgr_withPoints.rst b/src/withPoints/doc/pgr_withPoints.rst
new file mode 100644
index 0000000..e1e0fb9
--- /dev/null
+++ b/src/withPoints/doc/pgr_withPoints.rst
@@ -0,0 +1,292 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_withPoints:
+
+pgr_withPoints
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_withPoints`` - Returns the shortest path in a graph with additional temporary vertices.
+
+.. note::  This is a proposed function for version 2.3.
+
+     - Is not officially in the version 2.2 release.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Modify the graph to include points defined by points_sql. 
+Using Dijkstra algorithm, find the shortest path(s)
+
+Characteristics:
+-------------------------------------------------------------------------------
+
+The main Characteristics are:
+
+  - Process is done only on edges with positive costs.
+  - Vertices of the graph are:
+
+    - **positive** when it belongs to the edges_sql
+    - **negative** when it belongs to the points_sql
+
+  - Values are returned when there is a path.
+
+   - When the starting vertex and ending vertex are the same, there is no path.
+
+    - The agg_cost the non included values (v, v) is 0
+
+   - When the starting vertex and ending vertex are the different and there is no path:
+
+    - The agg_cost the non included values (u, v) is ∞
+
+  - For optimization purposes, any duplicated value in the start_vids or end_vids are ignored.
+  - The returned values are ordered:
+
+    - start_vid ascending
+    - end_vid ascending
+
+  - Runing time: :math:`O(|start\_vids|∗(V \log V + E))`
+
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+    pgr_withPoints(edges_sql, points_sql, start_vid, end_vid)
+    pgr_withPoints(edges_sql, points_sql, start_vid, end_vid, directed, driving_side, details)
+    pgr_withPoints(edges_sql, points_sql, start_vid, end_vids, directed, driving_side, details)
+    pgr_withPoints(edges_sql, points_sql, start_vids, end_vid, directed, driving_side, details)
+    pgr_withPoints(edges_sql, points_sql, start_vids, end_vids, directed, driving_side, details)
+    RETURNS SET OF (seq, path_seq, [start_vid,] [end_vid,] node, edge, cost, agg_cost)
+
+
+Signatures
+==========
+
+.. index::
+    single: withPoints(edges_sql, points_sql, start_vid, end_vid) -- proposed
+
+Minimal signature
+-----------------
+
+The minimal signature:
+    - Is for a **directed** graph.
+    - The driving side is set as **b** both. So arriving/departing to/from the point(s) can be in any direction.
+    - No **details** are given about distance of other points of points_sql query.
+
+.. code-block:: none
+
+    pgr_withPoints(edges_sql, points_sql, start_vid, end_vid)
+    RETURNS SET OF (seq, path_seq, node, edge, cost, agg_cost)
+
+
+:Example: From point 1 to point 3
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --e1
+   :end-before: --e2
+
+.. index::
+    single: withPoints(edges_sql, points_sql, start_vid, end_vid, directed, driving_side, details) -- proposed
+
+One to One
+----------
+
+
+.. code-block:: none
+
+    pgr_withPoints(edges_sql, points_sql, start_vid, end_vid,
+        directed:=true, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, path_seq, node, edge, cost, agg_cost)
+
+
+:Example: From point 1 to vertex 3
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --e2
+   :end-before: --e3
+
+.. index::
+    single: withPoints(edges_sql, points_sql, start_vid, end_vids, directed, driving_side, details) -- proposed
+
+One to Many
+-----------
+
+
+.. code-block:: none
+
+    pgr_withPoints(edges_sql, points_sql, start_vid, end_vids,
+        directed:=true, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, path_seq, end_vid, node, edge, cost, agg_cost)
+
+
+:Example: From point 1 to point 3 and vertex 5
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --e3
+   :end-before: --e4
+
+.. index::
+    single: withPoints(edges_sql, points_sql, start_vids, end_vid, directed, driving_side, details) -- proposed
+
+Many to One
+-----------
+
+
+.. code-block:: none
+
+    pgr_withPoints(edges_sql, points_sql, start_vids, end_vid,
+        directed:=true, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, path_seq, start_vid, node, edge, cost, agg_cost)
+
+
+:Example: From point 1 and vertex 2  to point 3
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --e4
+   :end-before: --e5
+
+.. index::
+    single: withPoints(edges_sql, points_sql, start_vids, end_vids, directed, driving_side, details) -- proposed
+
+Many to Many
+------------
+
+
+.. code-block:: none
+
+    pgr_withPoints(edges_sql, points_sql, start_vids, end_vids,
+        directed:=true, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)
+
+
+:Example: From point 1 and vertex 2  to point 3 and vertex 7
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --e5
+   :end-before: --q2
+
+
+
+
+Description of the Signatures
+=============================
+
+..
+    description of the sql queries
+
+
+.. include:: withPoints_queries.txt 
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+
+================ ====================== =================================================
+Parameter        Type                   Description
+================ ====================== =================================================
+**edges_sql**    ``TEXT``               Edges SQL query as decribed above.
+**points_sql**   ``TEXT``               Points SQL query as decribed above.
+**start_vid**    ``ANY-INTEGER``        Starting vertex identifier. When negative: is a point's pid.
+**end_vid**      ``ANY-INTEGER``        Ending vertex identifier. When negative: is a point's pid.
+**start_vids**   ``ARRAY[ANY-INTEGER]`` Array of identifiers of starting vertices. When negative: is a point's pid.
+**end_vids**     ``ARRAY[ANY-INTEGER]`` Array of identifiers of ending vertices. When negative: is a point's pid.
+**directed**     ``BOOLEAN``            (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+**driving_side** ``CHAR``               (optional) Value in ['b', 'r', 'l', NULL] indicating if the driving side is:
+                                          - In the right or left or
+                                          - If it doesn't matter with 'b' or NULL.
+                                          - If column not present 'b' is considered.
+
+**details**      ``BOOLEAN``            (optional). When ``true`` the results will include the points in points_sql that are in the path.
+                                        Default is ``false`` which ignores other points of the points_sql.
+================ ====================== =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq, [path_seq,] [start_vid,] [end_vid,] node, edge, cost, agg_cost)``
+
+============= =========== =================================================
+Column           Type              Description
+============= =========== =================================================
+**seq**       ``INTEGER`` Row sequence.
+**path_seq**  ``INTEGER`` Path sequence that indicates the relative position on the path.
+**start_vid** ``BIGINT``  Identifier of the starting vertex. When negative: is a point's pid.
+**end_vid**   ``BIGINT``  Identifier of the ending vertex. When negative: is a point's pid.
+**node**      ``BIGINT``  Identifier of the node:
+                            - A positive value indicates the node is a vertex of edges_sql.
+                            - A negative value indicates the node is a point of points_sql.
+
+**edge**      ``BIGINT``  Identifier of the edge used to go from ``node`` to the next node in the path sequence.
+                            - ``-1`` for the last row in the path sequence.
+
+**cost**      ``FLOAT``   Cost to traverse from ``node`` using ``edge`` to the next ``node`` in the path sequence.
+                            - ``0`` for the last row in the path sequence.
+
+**agg_cost**  ``FLOAT``   Aggregate cost from ``start_pid`` to ``node``.
+                            - ``0`` for the first row in the path sequence.
+
+============= =========== =================================================
+
+
+
+Examples
+--------------------------------------------------------------------------------------
+
+:Example: Which path (if any) passes in front of point 6 or vertex 6 with **right** side driving topology.
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --q2
+   :end-before: --q3
+
+:Example: Which path (if any) passes in front of point 6 or vertex 6 with **left** side driving topology.
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --q3
+   :end-before: --q4
+
+:Example: Many to many example with a twist: on undirected graph and showing details.
+
+.. literalinclude:: doc-pgr_withPoints.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+The queries use the :ref:`sampledata` network.
+
+
+
+.. rubric:: History
+
+* Proposed in version 2.2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`withPoints`
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/withPoints/doc/pgr_withPointsCost.rst b/src/withPoints/doc/pgr_withPointsCost.rst
new file mode 100644
index 0000000..49ebffb
--- /dev/null
+++ b/src/withPoints/doc/pgr_withPointsCost.rst
@@ -0,0 +1,287 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_withPointsCost:
+
+pgr_withPointsCost
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_withPointsCost`` - Calculates the shortest path and returns only the aggregate cost of the shortest path(s) found, for the combination of points given.
+
+.. note::  This is a proposed function for version 2.3.
+
+     - Is not officially in the version 2.2 release.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Modify the graph to include points defined by points_sql.
+Using Dijkstra algorithm, return only the aggregate cost of the shortest path(s) found.
+
+Characteristics:
+----------------
+
+The main Characteristics are:
+  - It does not return a path.
+  - Returns the sum of the costs of the shortest path for pair combination of vertices in the modified graph.
+  - Vertices of the graph are:
+
+    - **positive** when it belongs to the edges_sql
+    - **negative** when it belongs to the points_sql
+
+  - Process is done only on edges with positive costs.
+  - Values are returned when there is a path.
+
+    - The returned values are in the form of a set of `(start_vid, end_vid, agg_cost)`.
+
+    - When the starting vertex and ending vertex are the same, there is no path.
+
+      - The `agg_cost` in the non included values `(v, v)` is `0`
+
+    - When the starting vertex and ending vertex are the different and there is no path.
+
+      - The `agg_cost` in the non included values `(u, v)` is :math:`\infty`
+
+  - If the values returned are stored in a table, the unique index would be the pair:
+    `(start_vid, end_vid)`.
+
+  - For undirected graphs, the results are symmetric.
+
+    - The  `agg_cost` of `(u, v)` is the same as for `(v, u)`.
+
+  - For optimization purposes, any duplicated value in the `start_vids` or `end_vids` is ignored.
+
+  - The returned values are ordered:
+
+    - `start_vid` ascending
+    - `end_vid` ascending
+
+  - Running time: :math:`O(| start\_vids | * (V \log V + E))`
+
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+    pgr_withPointsCost(edges_sql, points_sql, start_vid, end_vid, directed, driving_side)
+    pgr_withPointsCost(edges_sql, points_sql, start_vid, end_vids, directed, driving_side)
+    pgr_withPointsCost(edges_sql, points_sql, start_vids, end_vid, directed, driving_side)
+    pgr_withPointsCost(edges_sql, points_sql, start_vids, end_vids, directed, driving_side)
+    RETURNS SET OF (start_vid, end_vid, agg_cost)
+
+.. note:: There is no **details** flag, unlike the other members of the family of functions.  
+
+
+Signatures
+==========
+
+.. index::
+    single: withPointsCost(edges_sql, points_sql, start_pid, end_pid) -- proposed
+
+Minimal Usage
+-----------------
+
+The minimal signature:
+    - Is for a **directed** graph.
+    - The driving side is set as **b** both. So arriving/departing to/from the point(s) can be in any direction.
+
+.. code-block:: none
+
+    pgr_withPointsCost(edges_sql, points_sql, start_vid, end_vid)
+    RETURNS SET OF (start_vid, end_vid, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --e1
+   :end-before: --e2
+
+.. index::
+    single: withPointsCost(edges_sql, points_sql, start_pid, end_pid, directed, driving_side) -- proposed
+
+One to One
+----------
+
+
+.. code-block:: none
+
+    pgr_withPointsCost(edges_sql, points_sql, start_vid, end_vid,
+        directed:=true, driving_side:='b')
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --e2
+   :end-before: --e3
+
+.. index::
+    single: withPointsCost(edges_sql, points_sql, start_pid, end_pids, directed, driving_side) -- proposed
+
+One to Many
+-----------
+
+
+.. code-block:: none
+
+    pgr_withPointsCost(edges_sql, points_sql, start_vid, end_vids,
+        directed:=true, driving_side:='b')
+    RETURNS SET OF (start_vid, end_vid, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --e3
+   :end-before: --e4
+
+.. index::
+    single: withPointsCost(edges_sql, points_sql, start_pids, end_pid, directed, driving_side) -- proposed
+
+
+Many to One
+-----------
+
+.. code-block:: none
+
+    pgr_withPointsCost(edges_sql, points_sql, start_vids, end_vid,
+        directed:=true, driving_side:='b')
+    RETURNS SET OF (start_vid, end_vid, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --e4
+   :end-before: --e5
+
+.. index::
+    single: withPointsCost(edges_sql, points_sql, start_vids, end_vids, directed, driving_side)
+
+
+Many to Many
+------------
+
+.. code-block:: none
+
+    pgr_withPointsCost(edges_sql, points_sql, start_vids, end_vids,
+        directed:=true, driving_side:='b')
+    RETURNS SET OF (start_vid, end_vid, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --e5
+   :end-before: --q2
+
+
+
+
+Description of the Signatures
+=============================
+
+..
+    description of the sql queries
+
+
+.. include:: withPoints_queries.txt 
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+
+================ ====================== =================================================
+Parameter        Type                   Description
+================ ====================== =================================================
+**edges_sql**    ``TEXT``               Edges SQL query as decribed above.
+**points_sql**   ``TEXT``               Points SQL query as decribed above.
+**start_vid**    ``ANY-INTEGER``        Starting vertex identifier. When negative: is a point's pid.
+**end_vid**      ``ANY-INTEGER``        Ending vertex identifier. When negative: is a point's pid.
+**start_vids**   ``ARRAY[ANY-INTEGER]`` Array of identifiers of starting vertices. When negative: is a point's pid.
+**end_vids**     ``ARRAY[ANY-INTEGER]`` Array of identifiers of ending vertices. When negative: is a point's pid.
+**directed**     ``BOOLEAN``            (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+**driving_side** ``CHAR``               (optional) Value in ['b', 'r', 'l', NULL] indicating if the driving side is:
+                                          - In the right or left or
+                                          - If it doesn't matter with 'b' or NULL.
+                                          - If column not present 'b' is considered.
+
+================ ====================== =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(start_vid, end_vid, agg_cost)``
+
+============= =========== =================================================
+Column           Type              Description
+============= =========== =================================================
+**start_vid** ``BIGINT``  Identifier of the starting vertex. When negative: is a point's pid.
+**end_vid**   ``BIGINT``  Identifier of the ending point. When negative: is a point's pid.
+**agg_cost**  ``FLOAT``   Aggregate cost from ``start_vid`` to ``end_vid``.
+============= =========== =================================================
+
+
+
+Examples
+--------------------------------------------------------------------------------------
+
+:Example: With **right** side driving topology.
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --q2
+   :end-before: --q3
+
+:Example: With **left** side driving topology.
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --q3
+   :end-before: --q4
+
+:Example: Does not matter driving side.
+
+.. literalinclude:: doc-pgr_withPointsCost.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+The queries use the :ref:`sampledata` network.
+
+
+
+.. rubric:: History
+
+* Proposed in version 2.2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`withPoints`
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/withPoints/doc/pgr_withPointsDD.rst b/src/withPoints/doc/pgr_withPointsDD.rst
new file mode 100644
index 0000000..fa19b74
--- /dev/null
+++ b/src/withPoints/doc/pgr_withPointsDD.rst
@@ -0,0 +1,213 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_withPointsDD:
+
+pgr_withPointsDD
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_withPointsDD`` - Returns the driving distance from a starting point.
+
+.. note::  This is a proposed function for version 2.3.
+
+     - Is not officially in the version 2.2 release.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Modify the graph to include points and 
+using Dijkstra algorithm, extracts all the nodes and points that have costs less
+than or equal to the value ``distance`` from the starting point.
+The edges extracted will conform the corresponding spanning tree.
+
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+    pgr_withPointsDD(edges_sql, points_sql, start_vid, distance)
+    pgr_withPointsDD(edges_sql, points_sql, start_vid, distance, directed, driving_side, details)
+    pgr_withPointsDD(edges_sql, points_sql, start_vids, distance, directed, driving_side, details, equicost)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+Signatures
+==========
+
+.. index::
+    single: withPointsDD(edges_sql, points_sql, start_vid, distance) -- proposed
+
+Minimal signature
+-----------------
+
+The minimal signature:
+    - Is for a **directed** graph.
+    - The driving side is set as **b** both. So arriving/departing to/from the point(s) can be in any direction.
+    - No **details** are given about distance of other points of the query.
+
+.. code-block:: none
+
+    pgr_withPointsDD(edges_sql, points_sql, start_vid, distance)
+        directed:=true, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsDD.queries
+   :start-after: --q1
+   :end-before: --q2
+
+.. index::
+    single: withPointsDD(edges_sql, points_sql, start_vid, distance, directed, driving_side, details) -- proposed
+
+Driving distance from a single point
+------------------------------------
+
+Finds the driving distance depending on the optional parameters setup.
+
+.. code-block:: none
+
+    pgr_withPointsDD(edges_sql, points_sql, start_vids, distance,
+        directed:=true, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+:Example: Right side driving topology
+
+.. literalinclude:: doc-pgr_withPointsDD.queries
+   :start-after: --q2
+   :end-before: --q3
+
+.. index::
+    single: withPointsDD(edges_sql, points_sql, start_vid, distance, directed, driving_side, details, equicost) -- proposed
+
+Driving distance from many starting points
+------------------------------------------
+
+.. note:: Not coded yet
+
+Finds the driving distance depending on the optional parameters setup.
+
+.. code-block:: none
+
+    pgr_withPointsDD(edges_sql, points_sql, start_vids, distance,
+        directed:=true, driving_side:='b', details:=false, equicost:=false)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+
+
+Description of the Signatures
+=============================
+
+
+..
+    description of the sql queries
+
+
+.. include:: withPoints_queries.txt 
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+
+================ ================= =================================================
+Parameter        Type              Description
+================ ================= =================================================
+**edges_sql**    ``TEXT``          Edges SQL query as decribed above.
+**points_sql**   ``TEXT``          Points SQL query as decribed above.
+**start_vid**    ``ANY-INTEGER``   Starting point id
+**distance**     ``ANY-NUMERICAL`` Distance from the start_pid
+**directed**     ``BOOLEAN``       (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+**driving_side** ``CHAR``          (optional). Value in ['b', 'r', 'l', NULL] indicating if the driving side is:
+                                     - In the right or left or
+                                     - If it doesn't matter with 'b' or NULL.
+                                     - If column not present 'b' is considered.
+
+**details**      ``BOOLEAN``       (optional). When ``true`` the results will include the driving distance to the points with in the ``distance``.
+                                   Default is ``false`` which ignores other points of the points_sql.
+**equicost**     ``BOOLEAN``       (optional). When ``true`` the nodes will only appear in the closest start_v list. Default is ``false`` which resembles several calls using the single starting point signatures. Tie brakes are arbitrary.                                   
+================ ================= =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq, node, edge, cost, agg_cost)``
+
+============ =========== =================================================
+Column           Type              Description
+============ =========== =================================================
+**seq**      ``INT``     row sequence.
+**node**     ``BIGINT``  Identifier of the node within the Distance from ``start_pid``. If ``details =: true`` a negative value is the identifier of a point.
+**edge**     ``BIGINT``  Identifier of the edge used to go from ``node`` to the next node in the path sequence.
+                           - ``-1`` when ``start_vid`` = ``node``.
+
+**cost**     ``FLOAT``   Cost to traverse ``edge``.
+                           - ``0`` when ``start_vid`` = ``node``.
+
+**agg_cost** ``FLOAT``   Aggregate cost from ``start_vid`` to ``node``.
+                           - ``0`` when ``start_vid`` = ``node``.
+
+============ =========== =================================================
+
+
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+--------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+:Example: Left side driving topology
+
+.. literalinclude:: doc-pgr_withPointsDD.queries
+   :start-after: --q3
+   :end-before: --q4
+
+:Example: Does not matter driving side.
+
+.. literalinclude:: doc-pgr_withPointsDD.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+
+
+The queries use the :ref:`sampledata` network.
+
+
+
+.. rubric:: History
+
+* Proposed in version 2.2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_drivingDistance` - Driving distance using dijkstra.
+* :ref:`pgr_alphashape` - Alpha shape computation.
+* :ref:`pgr_points_as_polygon` - Polygon around set of points.
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/withPoints/doc/pgr_withPointsKSP.rst b/src/withPoints/doc/pgr_withPointsKSP.rst
new file mode 100644
index 0000000..8aa9b7f
--- /dev/null
+++ b/src/withPoints/doc/pgr_withPointsKSP.rst
@@ -0,0 +1,186 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_withPointsKSP:
+
+pgr_withPointsKSP
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_withPointsKSP`` - Find the K shortest paths using Yen's algorithm.
+
+.. note::  This is a proposed function for version 2.3.
+
+     - Is not officially in the version 2.2 release.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Modifies the graph to include the points defined in the ``points_sql`` and 
+using Yen algorithm, finds the K shortest paths.
+
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+    pgr_withPointsKSP(edges_sql, points_sql, start_pid, end_pid, K)
+    pgr_withPointsKSP(edges_sql, points_sql, start_pid, end_pid, K, directed, heap_paths, driving_side, details)
+    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost)
+
+Signatures
+==========
+
+.. index::
+    single: withPointsKSP(edges_sql, points_sql, start_pid, end_pid, K) -- proposed
+
+Minimal Usage
+-----------------
+
+The minimal usage:
+    - Is for a **directed** graph.
+    - The driving side is set as **b** both. So arriving/departing to/from the point(s) can be in any direction.
+    - No **details** are given about distance of other points of the query.
+    - No **heap paths** are returned.
+
+.. code-block:: none
+
+    pgr_withPointsKSP(edges_sql, points_sql, start_pid, end_pid, K)
+    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsKSP.queries
+   :start-after: --q1
+   :end-before: --q2
+
+.. index::
+    single: withPointsKSP(edges_sql, points_sql, start_pid, end_pid, K, directed, heap_paths, driving_side, details) -- proposed
+
+Complete Signature
+------------------------------------
+
+Finds the K shortest paths depending on the optional parameters setup.
+
+.. code-block:: none
+
+    pgr_withPointsKSP(edges_sql, points_sql, start_pid, end_pid, K,
+        directed:=true, heap_paths:=false, driving_side:='b', details:=false)
+    RETURNS SET OF (seq, path_id, path_seq, node, edge, cost, agg_cost)
+
+
+:Example: With details.
+
+.. literalinclude:: doc-pgr_withPointsKSP.queries
+   :start-after: --q2
+   :end-before: --q3
+
+Description of the Signatures
+=============================
+
+
+..
+    description of the sql queries
+
+
+.. include:: withPoints_queries.txt 
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+
+================ ================= =================================================
+Parameter        Type              Description
+================ ================= =================================================
+**edges_sql**    ``TEXT``          Edges SQL query as decribed above.
+**points_sql**   ``TEXT``          Points SQL query as decribed above.
+**start_pid**    ``ANY-INTEGER``   Starting point id.
+**end_pid**      ``ANY-INTEGER``   Ending point id.
+**K**            ``INTEGER``       Number of shortest paths.
+**directed**     ``BOOLEAN``       (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+**heap_paths**   ``BOOLEAN``       (optional). When ``true`` the paths calculated to get the shortests paths will be returned also. Default is ``false`` only the K shortest paths are returned.
+**driving_side** ``CHAR``          (optional) Value in ['b', 'r', 'l', NULL] indicating if the driving side is:
+                                     - In the right or left or
+                                     - If it doesn't matter with 'b' or NULL.
+                                     - If column not present 'b' is considered.
+
+**details**      ``BOOLEAN``       (optional). When ``true`` the results will include the driving distance to the points with in the ``distance``.
+                                   Default is ``false`` which ignores other points of the points_sql.
+================ ================= =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq, path_id, path_seq, node, edge, cost, agg_cost)``
+
+============ =========== =================================================
+Column           Type              Description
+============ =========== =================================================
+**seq**      ``INTEGER`` Row sequence.
+**path_seq** ``INTEGER`` Relative position in the path of node and edge. Has value 1 for the begining of a path.
+**path_id**  ``INTEGER``  Path identifier. The ordering of the paths: For two paths i, j if i < j then agg_cost(i) <= agg_cost(j).
+**node**     ``BIGINT``  Identifier of the node in the path. Negative values are the identifiers of a point.
+**edge**     ``BIGINT``  Identifier of the edge used to go from ``node`` to the next node in the path sequence. 
+                           - ``-1`` for the last row in the path sequence.
+
+**cost**     ``FLOAT``   Cost to traverse from ``node`` using ``edge`` to the next ``node`` in the path sequence. 
+                           - ``0`` for the last row in the path sequence.
+
+**agg_cost** ``FLOAT``   Aggregate cost from ``start_pid`` to ``node``.
+                           - ``0`` for the first row in the path sequence.
+
+============ =========== =================================================
+
+
+
+Examples
+--------------------------------------------------------------------------------------
+
+:Example: Left side driving topology with details.
+
+.. literalinclude:: doc-pgr_withPointsKSP.queries
+   :start-after: --q3
+   :end-before: --q4
+
+:Example: Right side driving topology with heap paths and details.
+
+.. literalinclude:: doc-pgr_withPointsKSP.queries
+   :start-after: --q4
+   :end-before: --q5
+
+The queries use the :ref:`sampledata` network.
+
+.. rubric:: History
+
+* Proposed in version 2.2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`withPoints` 
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/withPoints/doc/pgr_withPointsVia.rst b/src/withPoints/doc/pgr_withPointsVia.rst
new file mode 100644
index 0000000..dc959ac
--- /dev/null
+++ b/src/withPoints/doc/pgr_withPointsVia.rst
@@ -0,0 +1,190 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+.. _pgr_withPointsVia:
+
+pgr_withPointsVia
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_withPointsVia`` - Returns the driving distance from a starting point.
+
+.. note::  This is a proposed function for version 2.3.
+
+     - Is not officially in the version 2.2 release.
+
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Modify the graph to include points and 
+using Dijkstra algorithm, extracts all the nodes and points that have costs less
+than or equal to the value ``distance`` from the starting point.
+The edges extracted will conform the corresponding spanning tree.
+
+
+Signature Summary
+-----------------
+
+.. code-block:: none
+
+	withPointsVia(edges_sql, points_sql, start_pid, distance)
+	withPointsVia(edges_sql, points_sql, start_pid, distance, directed, driving_side, details)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+Signatures
+==========
+
+.. index::
+	single: withPointsVia(edges_sql, points_sql, start_pid, distance) -- proposed
+
+Minimal signature
+-----------------
+
+The minimal signature:
+    - Is for a **directed** graph.
+    - The driving side is set as **b** both. So arriving/departing to/from the point(s) can be in any direction.
+    - No **details** are given about distance of other points of the query.
+
+.. code-block:: none
+
+	withPointsVia(edges_sql, points_sql, start_pid, distance)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+:Example:
+
+.. literalinclude:: doc-pgr_withPointsVia.queries
+   :start-after: --q1
+   :end-before: --q2
+
+.. index::
+	single: withPointsVia(edges_sql, points_sql, start_pid, distance, directed, driving_side, details) -- proposed
+
+Driving distance from a single point
+------------------------------------
+
+Finds the driving distance depending on the optional parameters setup.
+
+.. code-block:: none
+
+	pgr_withPointsVia(edges_sql, points_sql, start_pid, distance,
+        directed := true, driving_side := 'b', details := false)
+    RETURNS SET OF (seq, node, edge, cost, agg_cost)
+
+
+:Example: Right side driving topology
+
+.. literalinclude:: doc-pgr_withPointsVia.queries
+   :start-after: --q2
+   :end-before: --q3
+
+Description of the Signatures
+=============================
+
+
+..
+    description of the sql queries
+
+
+.. include:: withPoints_queries.txt 
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+
+================ ================= =================================================
+Parameter        Type              Description
+================ ================= =================================================
+**edges_sql**    ``TEXT``          Edges SQL query as decribed above.
+**points_sql**   ``TEXT``          Points SQL query as decribed above.
+**start_pid**    ``ANY-INTEGER``   Starting point id.
+**distance**     ``ANY_NUMERICAL`` Distance from the start_pid
+**directed**     ``BOOLEAN``       (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+**driving_side** ``CHAR``          (optional) Value in ['b', 'r', 'l', NULL] indicating if the driving side is:
+                                     - In the right or left or
+                                     - If it doesn't matter with 'b' or NULL.
+                                     - If column not present 'b' is considered.
+
+**details**      ``BOOLEAN``       (optional). When ``true`` the results will include the driving distance to the points with in Distance.
+                                   Default is ``false`` which ignores other points of the points_sql.
+================ ================= =================================================
+
+
+Description of the return values
+-------------------------------------------------------------------------------
+
+Returns set of ``(seq, node, edge, cost, agg_cost)``
+
+============ =========== =================================================
+Column           Type              Description
+============ =========== =================================================
+**seq**      ``INT``     row sequence.
+**node**     ``BIGINT``  Identifier of the node within the Distance from ``start_pid``. If ``details =: true`` a negative value is the identifier of a point.
+**edge**     ``BIGINT``  Identifier of the edge used to go from ``node`` to the next node in the path sequence.
+                           - ``-1`` for the last row in the path sequence.
+
+**cost**     ``FLOAT``   Cost to traverse from ``node`` using ``edge`` to the next ``node`` in the path sequence.
+                           - ``0`` for the last row in the path sequence.
+
+**agg_cost** ``FLOAT``   Aggregate cost from ``start_pid`` to ``node``.
+                           - ``0`` for the first row in the path sequence.
+
+============ =========== =================================================
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+--------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+:Example: Left side driving topology
+
+.. literalinclude:: doc-pgr_withPointsVia.queries
+   :start-after: --q3
+   :end-before: --q4
+
+:Example: Does not matter driving side.
+
+.. literalinclude:: doc-pgr_withPointsVia.queries
+   :start-after: --q4
+   :end-before: --q5
+
+
+
+
+The queries use the :ref:`sampledata` network.
+
+
+
+.. rubric:: History
+
+* Proposed in version 2.2
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* :ref:`pgr_drivingDistance` - Driving distance using dijkstra.
+* :ref:`pgr_alphashape` - Alpha shape computation.
+* :ref:`pgr_points_as_polygon` - Polygon around set of points.
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/src/withPoints/doc/withPoints.rst b/src/withPoints/doc/withPoints.rst
new file mode 100644
index 0000000..9879bd1
--- /dev/null
+++ b/src/withPoints/doc/withPoints.rst
@@ -0,0 +1,175 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+
+.. _withPoints:
+
+withPoints - Family of functions
+===============================================================================
+
+When points are also given as input:
+
+    - :ref:`pgr_withPoints` - Route from/to points anywhere on the graph.
+    - :ref:`pgr_withPointsCost` - Costs of the shortest paths.
+    - :ref:`pgr_withPointsKSP` - K shortest paths.
+    - :ref:`pgr_withPointsDD` - Driving distance.
+
+.. note:: The numbering of the points are handled with negative sign.
+
+          - Original point identifiers are to be positive.
+          - Transformation to negative is done internally.
+          - For results for involving vertices identifiers 
+
+            - positive sign is a vertex of the original grpah
+            - negative sign is a point of the temporary points
+
+          The reason for doing this is to avoid confusion when there is a vertex with the same number as identifier as the points identifier.
+
+
+Images
+--------------
+
+The squared vertices are the temporary vertices, The temporary vertices are added acordng to the
+dirving side, The following images visualy show the diferences on how depending on the driving side the data is interpreted.
+
+.. rubric:: Right driving side
+
+.. image:: images/rightDrivingSide.png
+    :scale: 50%
+
+.. rubric:: Left driving side
+
+.. image:: images/leftDrivingSide.png
+    :scale: 50%
+
+.. rubric:: doesn't matter the driving side
+
+.. image:: images/noMatterDrivingSide.png
+    :scale: 50%
+
+Introduction
+--------------
+
+This famly of functions was thought for routing vehicles, but might as well work
+for some other application that we can not think of.
+
+The with points family of function give you the ability to route between
+arbitrary points located outside the original graph.
+
+When given a point identified with a `pid` that its being mapped to and edge with
+an identifier `edge_id`, with a `fraction` along
+that edge (from the source to the target of the edge) and some additional
+information about which `side` of the edge the point is on, then routing
+from arbitrary points more accurately reflect routing vehicles in road networks,
+
+
+I talk about a family of functios because it includes different functionalities.
+  - pgr_withPoints is pgr_dijkstra based
+  - pgr_withPointsCost is pgr_dijkstraCost based
+  - pgr_withPointsKSP is pgr_ksp based
+  - pgr_withPointsDD is pgr_drivingDistance based
+  
+In all this functions we have to take care of as many aspects as possible:
+
+- Must work for routing:
+
+    - Cars (directed graph)
+    - Pedestrians (undirected graph)
+
+- Arriving at the point:
+
+    - In either side of the street.
+    - Compulsory arrival on the side of the street where the point is located.
+
+- Countries with:
+
+    - Right side driving
+    - Left side driving
+
+- Some points are:
+
+  - Permanent, for example the set of points of clients stored in a table in the data base
+  - Temporal, for example points given thru a web application
+
+Graph & edges
+----------------
+
+- Let :math:`G_d(V,E)` where :math:`V` is the set of vertices and :math:`E` is the set of edges be the original directed graph.
+
+  - An edge of the original `edges_sql` is :math:`(id, source, target, cost, reverse\_cost)` will generate internally
+
+    - :math:`(id, source, target, cost)`
+    - :math:`(id, target, source, reverse\_cost)`
+
+Point Definition
+----------------
+
+- A point is defined by the quadruplet: :math:`(pid, eid, fraction, side)` 
+
+  - :ped: is the point identifier
+  - :eid: is an edge id of the `edges_sql`
+  - :fraction: represents where the edge `eid` will be cut.
+  - :side: Indicates the side of the edge where the point is located.
+  
+
+Creating Temporary Vertices in the Graph
+----------------------------------------
+
+For edge (15,  9,12  10, 20), & lets insert point (2, 12, 0.3, r)
+
+.. rubric:: On a right hand side driving network
+
+From first image above:
+
+  - We can arrive to the point only via vertex 9.
+  - It only afects the edge (15, 9,12, 10) so that edge is removed.
+  - Edge (15, 12,9, 20) is kept.
+  - Create new edges:
+
+    - (15, 9,-1, 3) edge from vertex 9 to point 1 has cost 3
+    - (15, -1,12, 7) edge from point 1 to vertex 12 has cost 7
+
+.. rubric:: On a left hand side driving network
+
+From second image above:
+
+  - We can arrive to the point only via vertex 12.
+  - It only afects the edge (15, 12,9 20) so that edge is removed.
+  - Edge (15, 9,12, 10) is kept.
+  - Create new edges:
+
+    - (15, 12,-1, 14) edge from vertex 12 to point 1 has cost 14
+    - (15, -1,9, 6) edge from point 1 to vertex 9 has cost 6
+
+:Remember: that fraction is from vertex 9 to vertex 12
+
+
+.. rubric:: When driving side does not matter
+
+From third image above:
+
+  - We can arrive to the point either via vertex 12 or via vertex 9
+  - Edge (15, 12,9 20) is removed.
+  - Edge (15, 9,12, 10) is removed.
+  - Create new edges:
+
+    - (15, 12,-1, 14) edge from vertex 12 to point 1 has cost 14
+    - (15, -1,9, 6) edge from point 1 to vertex 9 has cost 6
+    - (15, 9,-1, 3) edge from vertex 9 to point 1 has cost 3
+    - (15, -1,12, 7) edge from point 1 to vertex 12 has cost 7
+
+.. toctree::
+    :hidden: 
+
+    ./pgr_withPoints
+    ./pgr_withPointsCost
+    ./pgr_withPointsKSP
+    ./pgr_withPointsDD
+
+
diff --git a/src/withPoints/doc/withPoints_queries.txt b/src/withPoints/doc/withPoints_queries.txt
new file mode 100644
index 0000000..edcc236
--- /dev/null
+++ b/src/withPoints/doc/withPoints_queries.txt
@@ -0,0 +1,51 @@
+.. 
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+
+Description of the Edges SQL query
+-------------------------------------------------------------------------------
+
+:edges_sql: an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                  Description
+================  ===================   =================================================
+**id**            ``ANY-INTEGER``       Identifier of the edge.
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, If negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, If negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+
+Description of the Points SQL query
+-------------------------------------------------------------------------------
+
+:points_sql: an SQL query, which should return a set of rows with the following columns:
+
+============ ================= =================================================
+Column            Type              Description
+============ ================= =================================================
+**pid**      ``ANY-INTEGER``   (optional) Identifier of the point.
+                                 - Can not be NULL. 
+                                 - If column not present, a sequential identifier will be given automatically.
+
+**eid**      ``ANY-INTEGER``   Identifier of the "closest" edge to the point.
+**fraction** ``ANY-NUMERICAL`` Value in <0,1> that indicates the relative postition from the first end point of the edge.
+**side**     ``CHAR``          (optional) Value in ['b', 'r', 'l', NULL] indicating if the point is:
+                                 - In the right, left of the edge or
+                                 - If it doesn't matter with 'b' or NULL.
+                                 - If column not present 'b' is considered.
+============ ================= =================================================
+
+Where:
+
+:ANY-INTEGER: smallint, int, bigint
+:ANY-NUMERICAL: smallint, int, bigint, real, float
+
diff --git a/src/withPoints/sql/CMakeLists.txt b/src/withPoints/sql/CMakeLists.txt
new file mode 100644
index 0000000..71af8f2
--- /dev/null
+++ b/src/withPoints/sql/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/withPoints.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/withPointsCost.sql
+    ${CMAKE_CURRENT_SOURCE_DIR}/withPointsVia.sql
+)
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/src/withPoints/sql/withPoints.sql b/src/withPoints/sql/withPoints.sql
new file mode 100644
index 0000000..dbf876e
--- /dev/null
+++ b/src/withPoints/sql/withPoints.sql
@@ -0,0 +1,264 @@
+/*PGR-GNU*****************************************************************
+File: withPoints.sql
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+/*
+ONE TO ONE
+*/
+
+CREATE OR REPLACE FUNCTION _pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pid BIGINT,
+    end_pid BIGINT,
+    directed BOOLEAN,
+    driving_side CHAR,
+    details BOOLEAN,
+
+    only_cost BOOLEAN DEFAULT false, -- gets path
+
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'one_to_one_withPoints'
+LANGUAGE c IMMUTABLE STRICT;
+
+/*
+ONE TO MANY
+*/
+
+CREATE OR REPLACE FUNCTION _pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pid BIGINT,
+    end_pids ANYARRAY,
+    directed BOOLEAN,
+    driving_side CHAR,
+    details BOOLEAN,
+
+    only_cost BOOLEAN DEFAULT false, -- gets path
+
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT end_pid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'one_to_many_withPoints'
+LANGUAGE c IMMUTABLE STRICT;
+
+
+/*
+MANY TO ONE
+*/
+
+CREATE OR REPLACE FUNCTION _pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pids ANYARRAY,
+    end_pid BIGINT,
+    directed BOOLEAN,
+    driving_side CHAR,
+    details BOOLEAN,
+
+    only_cost BOOLEAN DEFAULT false, -- gets path
+
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT start_pid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'many_to_one_withPoints'
+LANGUAGE c IMMUTABLE STRICT;
+
+
+
+
+/*
+MANY TO MANY
+*/
+
+CREATE OR REPLACE FUNCTION _pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pids ANYARRAY,
+    end_pids ANYARRAY,
+    directed BOOLEAN,
+    driving_side CHAR,
+    details BOOLEAN,
+
+    only_cost BOOLEAN DEFAULT false, -- gets path
+
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT start_pid BIGINT,
+    OUT end_pid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+'$libdir/${PGROUTING_LIBRARY_NAME}', 'many_to_many_withPoints'
+LANGUAGE c IMMUTABLE STRICT;
+
+
+
+
+/*
+ONE TO ONE
+*/
+CREATE OR REPLACE FUNCTION pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pid BIGINT,
+    end_pid BIGINT,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+    details BOOLEAN DEFAULT false,
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+        FROM _pgr_withPoints($1, $2, $3, $4, $5, $6, $7);
+    END
+    $BODY$
+    LANGUAGE plpgsql VOLATILE
+    COST 100
+    ROWS 1000;
+
+
+/*
+ONE TO MANY
+*/
+CREATE OR REPLACE FUNCTION pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pid BIGINT,
+    end_pids ANYARRAY,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+    details BOOLEAN DEFAULT false,
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT end_pid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+        FROM _pgr_withPoints($1, $2, $3, $4, $5, $6, $7);
+    END
+    $BODY$
+    LANGUAGE plpgsql VOLATILE
+    COST 100
+    ROWS 1000;
+
+/*
+MANY TO ONE
+*/
+CREATE OR REPLACE FUNCTION pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pids ANYARRAY,
+    end_pid BIGINT,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+    details BOOLEAN DEFAULT false,
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT start_pid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+        FROM _pgr_withPoints($1, $2, $3, $4, $5, $6, $7);
+    END
+    $BODY$
+    LANGUAGE plpgsql VOLATILE
+    COST 100
+    ROWS 1000;
+
+/*
+MANY TO MANY
+*/
+CREATE OR REPLACE FUNCTION pgr_withPoints(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pids ANYARRAY,
+    end_pids ANYARRAY,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+    details BOOLEAN DEFAULT false,
+
+    OUT seq INTEGER,
+    OUT path_seq INTEGER,
+    OUT start_pid BIGINT,
+    OUT end_pid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT *
+        FROM _pgr_withPoints($1, $2, $3, $4, $5, $6, $7);
+    END
+    $BODY$
+    LANGUAGE plpgsql VOLATILE
+    COST 100
+    ROWS 1000;
diff --git a/src/withPoints/sql/withPointsCost.sql b/src/withPoints/sql/withPointsCost.sql
new file mode 100644
index 0000000..fdf050b
--- /dev/null
+++ b/src/withPoints/sql/withPointsCost.sql
@@ -0,0 +1,132 @@
+/*PGR-GNU*****************************************************************
+File: withPointsCost.sql
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+/*
+ONE TO ONE
+*/
+
+CREATE OR REPLACE FUNCTION pgr_withPointsCost(
+    edges_sql TEXT,
+    points_sql TEXT,
+    BIGINT,
+    BIGINT,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+
+    OUT start_pid BIGINT,
+    OUT end_pid BIGINT,
+    OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT $3, $4, a.agg_cost
+        FROM _pgr_withPoints($1, $2, $3, $4, $5, $6, TRUE, TRUE) AS a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+/*
+ONE TO MANY
+*/
+
+CREATE OR REPLACE FUNCTION pgr_withPointsCost(
+    edges_sql TEXT,
+    points_sql TEXT,
+    BIGINT,
+    end_pids ANYARRAY,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+
+    OUT start_pid BIGINT,
+    OUT end_pid BIGINT,
+    OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT $3, a.end_pid, a.agg_cost
+        FROM _pgr_withPoints($1, $2, $3, $4, $5,  $6, TRUE, TRUE) AS a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+/*
+MANY TO ONE
+*/
+
+CREATE OR REPLACE FUNCTION pgr_withPointsCost(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pids ANYARRAY,
+    BIGINT,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+
+    OUT start_pid BIGINT,
+    OUT end_pid BIGINT,
+    OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT a.start_pid, $4, a.agg_cost
+        FROM _pgr_withPoints($1, $2, $3, $4, $5,  $6, TRUE, TRUE) AS a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
+
+/*
+MANY TO MANY
+*/
+
+CREATE OR REPLACE FUNCTION pgr_withPointsCost(
+    edges_sql TEXT,
+    points_sql TEXT,
+    start_pids ANYARRAY,
+    end_pids ANYARRAY,
+    directed BOOLEAN DEFAULT true,
+    driving_side CHAR DEFAULT 'b', -- 'r'/'l'/'b'/NULL
+
+    OUT start_pid BIGINT,
+    OUT end_pid BIGINT,
+    OUT agg_cost float)
+RETURNS SETOF RECORD AS
+$BODY$
+BEGIN
+    RETURN query SELECT a.start_pid, a.end_pid, a.agg_cost
+        FROM _pgr_withPoints($1, $2, $3, $4, $5,  $6, TRUE, TRUE) AS a;
+END
+$BODY$
+LANGUAGE plpgsql VOLATILE
+COST 100
+ROWS 1000;
diff --git a/src/withPoints/sql/withPointsVia.sql b/src/withPoints/sql/withPointsVia.sql
new file mode 100644
index 0000000..d0870cd
--- /dev/null
+++ b/src/withPoints/sql/withPointsVia.sql
@@ -0,0 +1,165 @@
+/*PGR-GNU*****************************************************************
+
+Template:
+Copyright (c) 2015 pgRouting developers
+
+Function developer:
+Copyright (c) 2015 Vicky Vergara
+vicky_vergara at hotmail.com
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+
+CREATE OR REPLACE FUNCTION  _pgr_withPointsVia(
+    sql text,
+    via_edges bigint[], 
+    fraction float[], 
+    directed BOOLEAN DEFAULT TRUE,
+
+    OUT seq INTEGER,
+    OUT path_id INTEGER,
+    OUT path_seq INTEGER,
+    OUT start_vid BIGINT,
+    OUT end_vid BIGINT,
+    OUT node BIGINT,
+    OUT edge BIGINT,
+    OUT cost FLOAT,
+    OUT agg_cost FLOAT,
+    OUT route_agg_cost FLOAT)
+
+  RETURNS SETOF RECORD AS
+  $BODY$
+  DECLARE
+  has_rcost boolean;
+  sql_new_vertices text := ' ';
+  sql_on_vertex text;
+  v_union text := ' ';
+  dummyrec record;
+  rec1 record;
+  via_vertices int[];
+  sql_safe text;
+  new_edges text;
+  BEGIN
+     BEGIN
+        sql_safe = 'SELECT id, source, target, cost, reverse_cost FROM ('|| sql || ') AS __a';
+
+        EXECUTE 'select reverse_cost, pg_typeof(reverse_cost)::text as rev_type  from ('||sql_safe||' ) AS __b__ limit 1 ' INTO rec1;
+        has_rcost := true;
+        EXCEPTION
+          WHEN OTHERS THEN
+            has_rcost = false;
+     END;
+ 
+
+      IF array_length(via_edges, 1) != array_length(fraction, 1) then
+        RAISE EXCEPTION 'The length of via_edges is different of length of via_edges';
+      END IF;
+
+      FOR i IN 1 .. array_length(via_edges, 1)
+      LOOP
+          IF fraction[i] = 0 THEN
+              sql_on_vertex := 'SELECT source FROM ('|| sql || ') __a where id = ' || via_edges[i];
+              EXECUTE sql_on_vertex into dummyrec; 
+              via_vertices[i] = dummyrec.source;
+          ELSE IF fraction[i] = 1 THEN
+              sql_on_vertex := 'SELECT target FROM ('|| sql || ') __a where id = ' || via_edges[i];
+              EXECUTE sql_on_vertex into dummyrec; 
+              via_vertices[i] = dummyrec.target;
+          ELSE
+              via_vertices[i] = -i;
+              IF has_rcost THEN
+                   sql_new_vertices = sql_new_vertices || v_union ||
+                          '(SELECT id, source, ' ||  -i || ' AS target, cost * ' || fraction[i] || ' AS cost,
+                              reverse_cost * (1 - ' || fraction[i] || ')  AS reverse_cost
+                          FROM (SELECT * FROM (' || sql || ') __b' || i || ' WHERE id = ' || via_edges[i] || ') __a' || i ||')
+                             UNION
+                          (SELECT id, ' ||  -i || ' AS source, target, cost * (1 -' || fraction[i] || ') AS cost,
+                              reverse_cost *  ' || fraction[i] || '  AS reverse_cost
+                          FROM (SELECT * FROM (' || sql || ') __b' || i || ' where id = ' || via_edges[i] || ') __a' || i ||')';
+                      v_union = ' UNION ';
+               ELSE 
+                   sql_new_vertices = sql_new_vertices || v_union ||
+                          '(SELECT id, source, ' ||  -i || ' AS target, cost * ' || fraction[i] || ' AS cost
+                          FROM (SELECT * FROM (' || sql || ') __b' || i || ' WHERE id = ' || via_edges[i] || ') __a' || i ||')
+                             UNION
+                          (SELECT id, ' ||  -i || ' AS source, target, cost * (1 -' || fraction[i] || ') AS cost
+                          FROM (SELECT * FROM (' || sql || ') __b' || i || ' WHERE id = ' || via_edges[i] || ') __a' || i ||')';
+                      v_union = ' UNION ';
+               END IF;
+          END IF;
+          END IF;
+     END LOOP;
+
+     IF sql_new_vertices = ' ' THEN
+         new_edges := sql; 
+     ELSE
+         IF has_rcost THEN
+            new_edges:= 'WITH
+                   original AS ( ' || sql || '),
+                   the_union AS ( ' || sql_new_vertices || '),
+                   first_part AS ( SELECT * FROM (SELECT id, target AS source,  lead(target) OVER w  AS target,
+                         lead(cost) OVER w  - cost AS cost,
+                         lead(cost) OVER w  - cost AS reverse_cost
+                      FROM  the_union  WHERE source > 0 AND cost > 0
+                      WINDOW w AS (PARTITION BY id  ORDER BY cost ASC) ) as n2
+                      WHERE target IS NOT NULL),
+                   second_part AS ( SELECT * FROM (SELECT id, lead(source) OVER w  AS source, source as target,
+                         reverse_cost - lead(reverse_cost) OVER w  AS cost,
+                         reverse_cost - lead(reverse_cost) OVER w  AS reverse_cost
+                      FROM  the_union  WHERE target > 0 and reverse_cost > 0
+                      WINDOW w AS (PARTITION BY id  ORDER BY reverse_cost ASC) ) as n2
+                      WHERE source IS NOT NULL),
+                   more_union AS ( SELECT * from (
+                       (SELECT * FROM original) 
+                             UNION 
+                       (SELECT * FROM the_union) 
+                             UNION 
+                       (SELECT * FROM first_part) 
+                             UNION
+                       (SELECT * FROM second_part) ) _union )
+                  SELECT *  FROM more_union';
+         ELSE
+            new_edges:= 'WITH
+                   original AS ( ' || sql || '),
+                   the_union AS ( ' || sql_new_vertices || '),
+                   first_part AS ( SELECT * FROM (SELECT id, target AS source,  lead(target) OVER w  AS target,
+                         lead(cost) OVER w  - cost AS cost
+                      FROM  the_union  WHERE source > 0 AND cost > 0
+                      WINDOW w AS (PARTITION BY id  ORDER BY cost ASC) ) as n2
+                      WHERE target IS NOT NULL ),
+                   more_union AS ( SELECT * from (
+                       (SELECT * FROM original) 
+                             UNION 
+                       (SELECT * FROM the_union) 
+                             UNION 
+                       (SELECT * FROM first_part) ) _union )
+                  SELECT *  FROM more_union';
+          END IF;
+      END IF;
+
+ -- raise notice '%', new_edges;
+     sql_new_vertices := sql_new_vertices || v_union || ' (' || sql || ')';
+     RETURN query SELECT *
+         FROM pgr_dijkstraVia(new_edges, via_vertices, directed, has_rcost);
+  END
+  $BODY$
+  LANGUAGE plpgsql VOLATILE
+  COST 100
+  ROWS 1000;
+
+
diff --git a/src/withPoints/src/CMakeLists.txt b/src/withPoints/src/CMakeLists.txt
new file mode 100644
index 0000000..95cfff5
--- /dev/null
+++ b/src/withPoints/src/CMakeLists.txt
@@ -0,0 +1,15 @@
+ADD_LIBRARY(withPoints OBJECT 
+    one_to_one_withPoints.c 
+    one_to_many_withPoints.c 
+    many_to_one_withPoints.c 
+    many_to_many_withPoints.c 
+
+
+    get_new_queries.cpp
+    pgr_withPoints.cpp
+
+    one_to_one_withPoints_driver.cpp
+    many_to_one_withPoints_driver.cpp
+    many_to_many_withPoints_driver.cpp
+    one_to_many_withPoints_driver.cpp
+    )
diff --git a/src/withPoints/src/get_new_queries.cpp b/src/withPoints/src/get_new_queries.cpp
new file mode 100644
index 0000000..5424878
--- /dev/null
+++ b/src/withPoints/src/get_new_queries.cpp
@@ -0,0 +1,59 @@
+/*PGR-GNU*****************************************************************
+File: get_new_queries.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include <sstream>
+#include "string.h"
+#include "./get_new_queries.h"
+
+
+void
+get_new_queries(
+        char *edges_sql,
+        char *points_sql,
+        char **edges_of_points_query,
+        char **edges_no_points_query) {
+
+    std::ostringstream edges_of_points_sql;
+    std::ostringstream edges_no_points_sql;
+
+    edges_of_points_sql << "WITH "
+        << " edges AS (" << edges_sql << "),"
+        << " points AS (" << points_sql << ")"
+        << " SELECT DISTINCT edges.* FROM edges JOIN points ON (id = edge_id)";
+    *edges_of_points_query = strdup(edges_of_points_sql.str().c_str());
+
+    edges_no_points_sql << "WITH "
+        << " edges AS (" << edges_sql << "),"
+        << " points AS (" << points_sql << ")"
+        << " SELECT edges.* FROM edges WHERE NOT EXISTS (SELECT edge_id FROM points WHERE id = edge_id)";
+    *edges_no_points_query = strdup(edges_no_points_sql.str().c_str());
+}
+
+
+
diff --git a/src/withPoints/src/get_new_queries.h b/src/withPoints/src/get_new_queries.h
new file mode 100644
index 0000000..147c05e
--- /dev/null
+++ b/src/withPoints/src/get_new_queries.h
@@ -0,0 +1,45 @@
+/*PGR-GNU*****************************************************************
+File: get_new_queries.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    void get_new_queries(
+            char *edges_sql,
+            char *points_sql, 
+            char **edges_of_points_query,
+            char **edges_no_points_query);
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/withPoints/src/many_to_many_withPoints.c b/src/withPoints/src/many_to_many_withPoints.c
new file mode 100644
index 0000000..0e2151b
--- /dev/null
+++ b/src/withPoints/src/many_to_many_withPoints.c
@@ -0,0 +1,282 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_withPoints.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+//#define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./../../common/src/points_input.h"
+#include "./get_new_queries.h"
+#include "./many_to_many_withPoints_driver.h"
+
+PG_FUNCTION_INFO_V1(many_to_many_withPoints);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+many_to_many_withPoints(PG_FUNCTION_ARGS);
+
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process(
+        char* edges_sql,
+        char* points_sql,
+
+        int64_t *start_pidsArr,
+        size_t size_start_pidsArr,
+
+        int64_t *end_pidsArr,
+        size_t size_end_pidsArr,
+
+        bool directed,
+        char *driving_side,
+        bool details,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+
+    driving_side[0] = tolower(driving_side[0]);
+
+    pgr_SPI_connect();
+
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+    get_new_queries(
+            edges_sql, points_sql,
+            &edges_of_points_query,
+            &edges_no_points_query);
+
+
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ( (total_edges + total_edges_of_points) == 0) {
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int  errcode = do_pgr_many_to_many_withPoints(
+            edges,  total_edges,
+            points, total_points,
+            edges_of_points, total_edges_of_points,
+            start_pidsArr, size_start_pidsArr,
+            end_pidsArr, size_end_pidsArr,
+            driving_side[0],
+            details,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPoints many to many", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+
+    pgr_SPI_finish();
+
+    
+    if (errcode)  {
+        free(start_pidsArr);
+        free(end_pidsArr);
+        pgr_send_error(errcode);
+    }
+}
+
+/*                                                                             */
+/*******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+many_to_many_withPoints(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPoint(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pid BIGINT,
+        // end_pids ANYARRAY,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT false,
+        // directed BOOLEAN -- DEFAULT true,
+        // only_cost BOOLEAN DEFAULT false,
+
+
+        int64_t* start_pidsArr;
+        size_t size_start_pidsArr;
+        start_pidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_start_pidsArr, PG_GETARG_ARRAYTYPE_P(2));
+
+        int64_t* end_pidsArr;
+        size_t size_end_pidsArr;
+        end_pidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_end_pidsArr, PG_GETARG_ARRAYTYPE_P(3));
+
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                pgr_text2char(PG_GETARG_TEXT_P(1)),
+                start_pidsArr, size_start_pidsArr,
+                end_pidsArr, size_end_pidsArr,
+                PG_GETARG_BOOL(4),
+                pgr_text2char(PG_GETARG_TEXT_P(5)),
+                PG_GETARG_BOOL(6),
+                PG_GETARG_BOOL(7),
+                &result_tuples,
+                &result_count);
+
+        if (start_pidsArr) free(start_pidsArr);
+        if (end_pidsArr) free(end_pidsArr);
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // OUT seq BIGINT,
+        // OUT path_seq,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT)
+
+
+        values = palloc(8 * sizeof(Datum));
+        nulls = palloc(8 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 8; ++i) {
+            nulls[i] = ' ';
+        }
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[5] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[7] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/withPoints/src/many_to_many_withPoints_driver.cpp b/src/withPoints/src/many_to_many_withPoints_driver.cpp
new file mode 100644
index 0000000..2dfadb0
--- /dev/null
+++ b/src/withPoints/src/many_to_many_withPoints_driver.cpp
@@ -0,0 +1,210 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_withPoints_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include <cassert>
+
+// #define DEBUG
+
+#include "./pgr_dijkstra.hpp"
+#include "./pgr_withPoints.hpp"
+#include "./many_to_many_withPoints_driver.h"
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+#include "./../../common/src/memory_func.hpp"
+
+
+// CREATE OR REPLACE FUNCTION pgr_withPoint(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pid ANYARRAY,
+// end_pid BIGINT,
+// directed BOOLEAN DEFAULT true
+
+int
+do_pgr_many_to_many_withPoints(
+        pgr_edge_t  *edges,
+        size_t total_edges,
+        Point_on_edge_t  *points_p,
+        size_t total_points,
+        pgr_edge_t  *edges_of_points,
+        size_t total_edges_of_points,
+        int64_t  *start_pidsArr,
+        size_t size_start_pidsArr,
+        int64_t  *end_pidsArr,
+        size_t size_end_pidsArr,
+
+        char driving_side,
+        bool details,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+
+        int errcode = check_points(points, log);
+        if (errcode) {
+            /* Point(s) with same pid but different edge/fraction/side combination found */
+            *err_msg = strdup(log.str().c_str());
+            return errcode;
+        }
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges);
+
+
+        std::set< int64_t > s_start_vertices(start_pidsArr, start_pidsArr + size_start_pidsArr);
+        std::set< int64_t > s_end_vertices(end_pidsArr, end_pidsArr + size_end_pidsArr);
+
+        std::vector< int64_t > start_vertices(s_start_vertices.begin(), s_start_vertices.end());
+        std::vector< int64_t > end_vertices(s_end_vertices.begin(), s_end_vertices.end());
+
+#if 0
+
+        std::set< int64_t > start_vertices;
+        std::set< int64_t > end_vertices;
+
+        for (const auto &start_pid : start_points) {
+            for (const auto point : points) {
+                if (point.pid == start_pid) {
+                    start_vertices.insert(point.vertex_id);
+                    break;
+                }
+            }
+        }
+        for (const auto &end_pid : end_points) {
+            for (const auto point : points) {
+                if (point.pid == end_pid) {
+                    end_vertices.insert(point.vertex_id);
+                    break;
+                }
+            }
+        }
+#endif
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_edges;
+
+        std::deque< Path > paths;
+
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            pgr_dijkstra(digraph, paths, start_vertices, end_vertices, only_cost);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            pgr_dijkstra(undigraph, paths, start_vertices, end_vertices, only_cost);
+        }
+
+#if 0
+        for (auto &path :paths) {
+            adjust_pids(points, path);
+        }
+#endif
+        if (!details) {
+            for (auto &path :paths) {
+                eliminate_details(path, edges_to_modify);
+            }
+        }
+
+        /*
+         *  order paths based on the start_pid, end_pid
+         */
+        std::sort(paths.begin(), paths.end(),
+                [](const Path &a,const  Path &b)
+                -> bool {
+                if (b.start_id() != a.start_id()) {
+                return a.start_id() < b.start_id();
+                }
+                return a.end_id() < b.end_id();  
+                });
+
+        size_t count(0);
+        count = count_tuples(paths);
+
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log <<
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return 0;
+        }
+
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (collapse_paths(return_tuples, paths));
+
+#ifndef DEBUG
+        {
+            std::ostringstream log;
+            log << "OK";
+            *err_msg = strdup(log.str().c_str());
+        }
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+        return 1000;
+    }
+    return 0;
+}
+
diff --git a/src/withPoints/src/many_to_many_withPoints_driver.h b/src/withPoints/src/many_to_many_withPoints_driver.h
new file mode 100644
index 0000000..a9ee9b3
--- /dev/null
+++ b/src/withPoints/src/many_to_many_withPoints_driver.h
@@ -0,0 +1,71 @@
+/*PGR-GNU*****************************************************************
+File: many_to_many_withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//  CREATE OR REPLACE FUNCTION pgr_withPoint(
+//  edges_sql TEXT,
+//  points_sql TEXT,
+//  start_pid ANYARRAY,
+//  end_pid BIGINT,
+//  directed BOOLEAN DEFAULT true,
+    int do_pgr_many_to_many_withPoints(
+            pgr_edge_t  *edges,
+            size_t total_edges,
+
+            Point_on_edge_t  *points,
+            size_t total_points,
+
+            pgr_edge_t  *edges_of_points,
+            size_t total_edges_of_points,
+
+            int64_t  *start_pidsArr,
+            size_t size_start_pidsArr,
+
+            int64_t  *end_pidsArr,
+            size_t size_end_pidsArr,
+
+
+            char driving_side,
+            bool details,
+            bool directed,
+            bool only_cost,
+            General_path_element_t **return_tuples,
+            size_t *return_count,
+            char ** err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/withPoints/src/many_to_one_withPoints.c b/src/withPoints/src/many_to_one_withPoints.c
new file mode 100644
index 0000000..b102ae6
--- /dev/null
+++ b/src/withPoints/src/many_to_one_withPoints.c
@@ -0,0 +1,269 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_withPoints.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+//#define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./../../common/src/points_input.h"
+#include "./get_new_queries.h"
+#include "./many_to_one_withPoints_driver.h"
+
+PG_FUNCTION_INFO_V1(many_to_one_withPoints);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+many_to_one_withPoints(PG_FUNCTION_ARGS);
+
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process(
+        char* edges_sql,
+        char* points_sql,
+        int64_t *start_pidsArr,
+        size_t size_start_pidsArr,
+        int64_t end_pid,
+        bool directed,
+        char *driving_side,
+        bool details,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+
+    driving_side[0] = tolower(driving_side[0]);
+
+    pgr_SPI_connect();
+
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+    get_new_queries(
+            edges_sql, points_sql,
+            &edges_of_points_query,
+            &edges_no_points_query);
+
+
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ( (total_edges + total_edges_of_points) == 0) {
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int  errcode = do_pgr_many_to_one_withPoints(
+            edges,  total_edges,
+            points, total_points,
+            edges_of_points, total_edges_of_points,
+            start_pidsArr, size_start_pidsArr,
+            end_pid,
+            driving_side[0],
+            details,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPoints many to one", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+    if (!err_msg) free(err_msg);
+
+    pfree(edges);
+    pgr_SPI_finish();
+
+    
+    if (errcode)  {
+        free(start_pidsArr);
+        pgr_send_error(errcode);
+    }
+}
+
+/*                                                                             */
+/*******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+many_to_one_withPoints(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPoint(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pid BIGINT,
+        // end_pids ANYARRAY,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT false,
+        // directed BOOLEAN -- DEFAULT true,
+        // only_cost BOOLEAN DEFAULT false,
+
+
+        int64_t* start_pidsArr;
+        size_t size_start_pidsArr;
+        start_pidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_start_pidsArr, PG_GETARG_ARRAYTYPE_P(2));
+
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                pgr_text2char(PG_GETARG_TEXT_P(1)),
+                start_pidsArr, size_start_pidsArr,
+                PG_GETARG_INT64(3),
+                PG_GETARG_BOOL(4),
+                pgr_text2char(PG_GETARG_TEXT_P(5)),
+                PG_GETARG_BOOL(6),
+                PG_GETARG_BOOL(7),
+                &result_tuples,
+                &result_count);
+
+        if (start_pidsArr) free(start_pidsArr);
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // OUT seq BIGINT,
+        // OUT path_seq,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT)
+
+
+        values = palloc(7 * sizeof(Datum));
+        nulls = palloc(7 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 7; ++i) {
+            nulls[i] = ' ';
+        }
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/withPoints/src/many_to_one_withPoints_driver.cpp b/src/withPoints/src/many_to_one_withPoints_driver.cpp
new file mode 100644
index 0000000..8d961e5
--- /dev/null
+++ b/src/withPoints/src/many_to_one_withPoints_driver.cpp
@@ -0,0 +1,173 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_withPoints_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include <cassert>
+
+#include "./pgr_dijkstra.hpp"
+#include "./pgr_withPoints.hpp"
+#include "./many_to_one_withPoints_driver.h"
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+#include "./../../common/src/memory_func.hpp"
+
+// #define DEBUG
+
+// CREATE OR REPLACE FUNCTION pgr_withPoint(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pid ANYARRAY,
+// end_pid BIGINT,
+// directed BOOLEAN DEFAULT true
+
+
+int
+do_pgr_many_to_one_withPoints(
+        pgr_edge_t  *edges,                     size_t total_edges,
+        Point_on_edge_t  *points_p,             size_t total_points,
+        pgr_edge_t  *edges_of_points,           size_t total_edges_of_points,
+        int64_t  *start_pidsArr,                size_t size_start_pidsArr,
+        int64_t end_vid,
+        char driving_side,
+        bool details,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples, size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+
+        int errcode = check_points(points, log);
+        if (errcode) {
+            /* Point(s) with same pid but different edge/fraction/side combination found */
+            *err_msg = strdup(log.str().c_str());
+            return errcode;
+        }
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges);
+
+
+        std::set< int64_t > s_start_vertices(start_pidsArr, start_pidsArr + size_start_pidsArr);
+        std::vector< int64_t > start_vertices(s_start_vertices.begin(), s_start_vertices.end());
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_edges;
+
+        std::deque< Path > paths;
+
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            pgr_dijkstra(digraph, paths, start_vertices, end_vid, only_cost);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            pgr_dijkstra(undigraph, paths, start_vertices, end_vid, only_cost);
+        }
+
+#if 0
+        for (auto &path :paths) {
+            adjust_pids(points, path);
+        }
+#endif
+        if (!details) {
+            for (auto &path :paths) {
+                eliminate_details(path, edges_to_modify);
+            }
+        }
+
+        /*
+         *  order paths based on the start_pid
+         */
+        std::sort(paths.begin(), paths.end(), [](const Path &a,const  Path &b) {
+                return a.start_id() < b.start_id();   
+                });
+
+        size_t count(0);
+        count = count_tuples(paths);
+
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log <<
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return 0;
+        }
+
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (collapse_paths(return_tuples, paths));
+
+#ifndef DEBUG
+        {
+            std::ostringstream log;
+            log << "OK";
+            *err_msg = strdup(log.str().c_str());
+        }
+
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+        return 1000;
+    }
+    return 0;
+}
+
diff --git a/src/withPoints/src/many_to_one_withPoints_driver.h b/src/withPoints/src/many_to_one_withPoints_driver.h
new file mode 100644
index 0000000..841cf61
--- /dev/null
+++ b/src/withPoints/src/many_to_one_withPoints_driver.h
@@ -0,0 +1,62 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//  CREATE OR REPLACE FUNCTION pgr_withPoint(
+//  edges_sql TEXT,
+//  points_sql TEXT,
+//  start_pid ANYARRAY,
+//  end_pid BIGINT,
+//  directed BOOLEAN DEFAULT true,
+    int do_pgr_many_to_one_withPoints(
+            pgr_edge_t  *edges,                     size_t total_edges,
+            Point_on_edge_t  *points,               size_t total_points,
+            pgr_edge_t  *edges_of_points,           size_t total_edges_of_points,
+            int64_t  *start_pidsArr,                size_t size_start_pidsArr,
+
+            int64_t end_pid,
+
+
+            char driving_side,
+            bool details,
+            bool directed,
+            bool only_cost,
+            General_path_element_t **return_tuples, size_t *return_count,
+            char ** err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/withPoints/src/msg_logger.hpp b/src/withPoints/src/msg_logger.hpp
new file mode 100644
index 0000000..11124d4
--- /dev/null
+++ b/src/withPoints/src/msg_logger.hpp
@@ -0,0 +1,45 @@
+/*PGR-GNU*****************************************************************
+File: msg_logger.hpp
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+void
+PGR_LOG_POINTS(
+        std::ostringstream &log,
+        const std::vector< Point_on_edge_t > &points,
+        const std::string &title) {
+    log << title << "\n";
+    for (const auto &p : points) {
+        log << p.pid << "\t"
+            << p.edge_id << "\t"
+            << p.fraction << "\t"
+            << p.side << "\n";
+    }
+}
diff --git a/src/withPoints/src/one_to_many_withPoints.c b/src/withPoints/src/one_to_many_withPoints.c
new file mode 100644
index 0000000..33ac4e0
--- /dev/null
+++ b/src/withPoints/src/one_to_many_withPoints.c
@@ -0,0 +1,324 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_withPoints.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+// #define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+#include "./../../common/src/points_input.h"
+#include "./get_new_queries.h"
+#include "./one_to_many_withPoints_driver.h"
+
+PG_FUNCTION_INFO_V1(one_to_many_withPoints);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_many_withPoints(PG_FUNCTION_ARGS);
+
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process(
+        char* edges_sql,
+        char* points_sql,
+        int64_t start_pid,
+        int64_t *end_pidsArr,
+        size_t size_end_pidsArr,
+        bool directed,
+        char *driving_side,
+        bool details,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+
+    driving_side[0] = tolower(driving_side[0]);
+    PGR_DBG("driving side:%c",driving_side[0]);
+    if (! ((driving_side[0] == 'r')
+                || (driving_side[0] == 'l'))) {
+        driving_side[0] = 'b'; 
+    }
+    PGR_DBG("estimated driving side:%c",driving_side[0]);
+
+    pgr_SPI_connect();
+
+    PGR_DBG("load the points");
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+#ifdef DEBUG
+    size_t i = 0;
+    for (i = 0; i < total_points; i ++) {
+        PGR_DBG("%ld\t%ld\t%f\t%c",points[i].pid, points[i].edge_id, points[i].fraction, points[i].side);
+    }
+#endif
+
+    /*
+     * TODO move this code to c++
+     */
+    PGR_DBG("  -- change the query");
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+    get_new_queries(
+            edges_sql, points_sql,
+            &edges_of_points_query,
+            &edges_no_points_query);
+
+    PGR_DBG("edges_of_points_query:\n%s", edges_of_points_query);
+    PGR_DBG("edges_no_points_query:\n%s", edges_no_points_query);
+
+    PGR_DBG("load the edges that match the points");
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+    PGR_DBG("Total %ld edges in query:", total_edges_of_points);
+#ifdef DEBUG
+    for (i = 0; i < total_edges_of_points; i ++) {
+        PGR_DBG("%ld\t%ld\t%ld\t%f\t%f",
+                edges_of_points[i].id,
+                edges_of_points[i].source,
+                edges_of_points[i].target,
+                edges_of_points[i].cost,
+                edges_of_points[i].reverse_cost);
+    }
+#endif
+
+
+
+    PGR_DBG("load the edges that dont match the points");
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    PGR_DBG("Total %ld edges in query:", total_edges);
+#ifdef DEBUG
+    for (i = 0; i < total_edges; i ++) {
+        PGR_DBG("%ld\t%ld\t%ld\t%f\t%f",
+                edges[i].id,
+                edges[i].source,
+                edges[i].target,
+                edges[i].cost,
+                edges[i].reverse_cost);
+    }
+#endif
+
+    PGR_DBG("freeing allocated memory not used anymore");
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ( (total_edges + total_edges_of_points) == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    PGR_DBG("Starting processing");
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int  errcode = do_pgr_one_to_many_withPoints(
+            edges,  total_edges,
+            points, total_points,
+            edges_of_points, total_edges_of_points,
+            start_pid,
+            end_pidsArr, size_end_pidsArr,
+            driving_side[0],
+            details,
+            directed,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPoints one to many", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+    if (!err_msg) free(err_msg);
+
+    pfree(edges);
+    pgr_SPI_finish();
+
+    
+    if (errcode)  {
+        PGR_DBG("Cleaning arrays because there was an error to avoid leak");
+        free(end_pidsArr);
+        pgr_send_error(errcode);
+    }
+}
+
+/*                                                                             */
+/*******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_many_withPoints(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPoint(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pid BIGINT,
+        // end_pids ANYARRAY,
+        // directed BOOLEAN -- DEFAULT true,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT false,
+        // only_cost BOOLEAN DEFAULT false,
+
+
+        PGR_DBG("Initializing arrays");
+        int64_t* end_pidsArr;
+        size_t size_end_pidsArr;
+        end_pidsArr = (int64_t*)
+            pgr_get_bigIntArray(&size_end_pidsArr, PG_GETARG_ARRAYTYPE_P(3));
+        PGR_DBG("targetsArr size %ld ", size_end_pidsArr);
+
+        PGR_DBG("Calling process");
+        PGR_DBG("initial driving side:%s", pgr_text2char(PG_GETARG_TEXT_P(4)));
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                pgr_text2char(PG_GETARG_TEXT_P(1)),
+                PG_GETARG_INT64(2),
+                end_pidsArr, size_end_pidsArr,
+                PG_GETARG_BOOL(4),
+                pgr_text2char(PG_GETARG_TEXT_P(5)),
+                PG_GETARG_BOOL(6),
+                PG_GETARG_BOOL(7),
+                &result_tuples,
+                &result_count);
+
+        PGR_DBG("Cleaning arrays");
+        free(end_pidsArr);
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // OUT seq BIGINT,
+        // OUT path_seq,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT)
+
+
+        values = palloc(7 * sizeof(Datum));
+        nulls = palloc(7 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 7; ++i) {
+            nulls[i] = ' ';
+        }
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].end_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/withPoints/src/one_to_many_withPoints_driver.cpp b/src/withPoints/src/one_to_many_withPoints_driver.cpp
new file mode 100644
index 0000000..083cb3a
--- /dev/null
+++ b/src/withPoints/src/one_to_many_withPoints_driver.cpp
@@ -0,0 +1,198 @@
+/*PGR-GNU*****************************************************************
+File: one_to_many_withPoints_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include <cassert>
+
+// #define DEBUG
+
+#include "./pgr_dijkstra.hpp"
+#include "./pgr_withPoints.hpp"
+#include "./one_to_many_withPoints_driver.h"
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+#include "./../../common/src/memory_func.hpp"
+
+
+// CREATE OR REPLACE FUNCTION pgr_withPoint(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pid BIGINT,
+// end_pid BIGINT,
+// directed BOOLEAN DEFAULT true
+
+
+int
+do_pgr_one_to_many_withPoints(
+        pgr_edge_t  *edges, size_t total_edges,
+        Point_on_edge_t  *points_p, size_t total_points,
+        pgr_edge_t  *edges_of_points, size_t total_edges_of_points,
+        int64_t start_vid,
+        int64_t  *end_pidsArr, size_t size_end_pidsArr,
+        char driving_side,
+        bool details,
+        bool directed,
+        bool only_cost,
+        General_path_element_t **return_tuples, size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+        /*
+         * DOCUMENT:
+         *   - Points are treated as the same point when the pid is the same
+         *   therefore when two points have the same pid, but different edge/fraction
+         *   an error is generated.
+         */
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+
+        int errcode = check_points(points, log);
+        if (errcode) {
+            log << "Point(s) with same pid but different edge/fraction/side combination found";
+            *err_msg = strdup(log.str().c_str());
+            return errcode;
+        }
+
+
+
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+
+        log << "driving_side" << driving_side << "\n";
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges);
+
+        log << "Inserting points into a c++ vector structure\n";
+        /*
+         * Eliminating duplicates
+         * & ordering the points
+         */
+        std::set< int64_t > s_end_vertices(end_pidsArr, end_pidsArr + size_end_pidsArr);
+
+        std::vector< int64_t > end_vertices(s_end_vertices.begin(), s_end_vertices.end());
+
+        log << "start_vid" << start_vid << "\n";
+        log << "end_vertices";
+
+        for (const auto &vid : end_vertices) {
+            log << vid << "\n";
+        }
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_edges;
+
+        std::deque< Path > paths;
+
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            pgr_dijkstra(digraph, paths, start_vid, end_vertices, only_cost);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            pgr_dijkstra(undigraph, paths, start_vid, end_vertices, only_cost);
+        }
+
+#if 0
+        for (auto &path :paths) {
+            adjust_pids(points, path);
+        }
+#endif
+        if (!details) {
+            for (auto &path :paths) {
+                eliminate_details(path, edges_to_modify);
+            }
+        }
+        /*
+         *  order paths based on the end_pid
+         */
+        std::sort(paths.begin(), paths.end(), [](const Path &a,const  Path &b) {
+                return a.end_id() < b.end_id();   
+                });
+
+        size_t count(0);
+        count = count_tuples(paths);
+
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log <<
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return 0;
+        }
+
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (collapse_paths(return_tuples, paths));
+
+
+#ifndef DEBUG
+        {
+            std::ostringstream log;
+            log << "OK";
+            *err_msg = strdup(log.str().c_str());
+        }
+
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+        return 1000;
+    }
+    return 0;
+}
+
diff --git a/src/withPoints/src/one_to_many_withPoints_driver.h b/src/withPoints/src/one_to_many_withPoints_driver.h
new file mode 100644
index 0000000..07df1f5
--- /dev/null
+++ b/src/withPoints/src/one_to_many_withPoints_driver.h
@@ -0,0 +1,69 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//  CREATE OR REPLACE FUNCTION pgr_withPoint(
+//  edges_sql TEXT,
+//  points_sql TEXT,
+//  start_pid BIGINT,
+//  end_pid BIGINT,
+//  directed BOOLEAN DEFAULT true,
+    int do_pgr_one_to_many_withPoints(
+            pgr_edge_t  *edges,
+            size_t total_edges,
+
+            Point_on_edge_t  *points,
+            size_t total_points,
+
+            pgr_edge_t  *edges_of_points,
+            size_t total_edges_of_points,
+
+            int64_t start_pid,
+
+            int64_t  *end_pidsArr,
+            size_t size_end_pidsArr,
+
+            char driving_side,
+            bool details,
+            bool directed,
+            bool only_cost,
+            General_path_element_t **return_tuples,
+            size_t *return_count,
+            char ** err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/withPoints/src/one_to_one_withPoints.c b/src/withPoints/src/one_to_one_withPoints.c
new file mode 100644
index 0000000..2b508f5
--- /dev/null
+++ b/src/withPoints/src/one_to_one_withPoints.c
@@ -0,0 +1,307 @@
+/*PGR-GNU*****************************************************************
+File: one_to_one_withPoints.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+
+#include "fmgr.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/points_input.h"
+#include "./get_new_queries.h"
+#include "./one_to_one_withPoints_driver.h"
+// #define DEBUG
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/time_msg.h"
+
+PG_FUNCTION_INFO_V1(one_to_one_withPoints);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_one_withPoints(PG_FUNCTION_ARGS);
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process(
+        char* edges_sql,
+        char* points_sql,
+        int64_t start_pid,
+        int64_t end_pid,
+        bool directed,
+        char *driving_side,
+        bool details,
+        bool only_cost,
+        General_path_element_t **result_tuples,
+        size_t *result_count) {
+
+    driving_side[0] = tolower(driving_side[0]);
+    PGR_DBG("driving side:%c",driving_side[0]);
+    if (! ((driving_side[0] == 'r')
+                || (driving_side[0] == 'l'))) {
+        driving_side[0] = 'b'; 
+    }
+    PGR_DBG("estimated driving side:%c",driving_side[0]);
+
+    pgr_SPI_connect();
+
+    PGR_DBG("load the points");
+    Point_on_edge_t *points = NULL;
+    size_t total_points = 0;
+    pgr_get_points(points_sql, &points, &total_points);
+
+#ifdef DEBUG
+    size_t i = 0;
+    for (i = 0; i < total_points; i ++) {
+       PGR_DBG("%ld\t%ld\t%f\t%c",points[i].pid, points[i].edge_id, points[i].fraction, points[i].side);
+    }
+#endif
+
+    PGR_DBG("  -- change the query");
+    char *edges_of_points_query = NULL;
+    char *edges_no_points_query = NULL;
+        get_new_queries(
+                edges_sql, points_sql,
+                &edges_of_points_query,
+                &edges_no_points_query);
+
+    PGR_DBG("edges_of_points_query:\n%s", edges_of_points_query);
+    PGR_DBG("edges_no_points_query:\n%s", edges_no_points_query);
+
+    PGR_DBG("load the edges that match the points");
+    pgr_edge_t *edges_of_points = NULL;
+    size_t total_edges_of_points = 0;
+    pgr_get_data_5_columns(edges_of_points_query, &edges_of_points, &total_edges_of_points);
+
+    PGR_DBG("Total %ld edges in query:", total_edges_of_points);
+#ifdef DEBUG
+    for (i = 0; i < total_edges_of_points; i ++) {
+        PGR_DBG("%ld\t%ld\t%ld\t%f\t%f",
+                edges_of_points[i].id,
+                edges_of_points[i].source,
+                edges_of_points[i].target,
+                edges_of_points[i].cost,
+                edges_of_points[i].reverse_cost);
+    }
+#endif
+
+
+
+    PGR_DBG("load the edges that dont match the points");
+    pgr_edge_t *edges = NULL;
+    size_t total_edges = 0;
+    pgr_get_data_5_columns(edges_no_points_query, &edges, &total_edges);
+
+    PGR_DBG("Total %ld edges in query:", total_edges);
+#ifdef DEBUG
+    for (i = 0; i < total_edges; i ++) {
+        PGR_DBG("%ld\t%ld\t%ld\t%f\t%f",
+                edges[i].id,
+                edges[i].source,
+                edges[i].target,
+                edges[i].cost,
+                edges[i].reverse_cost);
+    }
+#endif
+
+    PGR_DBG("freeing allocated memory not used anymore");
+    free(edges_of_points_query);
+    free(edges_no_points_query);
+
+    if ( (total_edges + total_edges_of_points) == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+
+    PGR_DBG("Starting processing");
+    char *err_msg = NULL;
+    clock_t start_t = clock();
+    int errcode = do_pgr_withPoints(
+            edges,
+            total_edges,
+            points,
+            total_points,
+            edges_of_points,
+            total_edges_of_points,
+            start_pid,
+            end_pid,
+            directed,
+            driving_side[0],
+            details,
+            only_cost,
+            result_tuples,
+            result_count,
+            &err_msg);
+    time_msg(" processing withPoints one to one", start_t, clock());
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    if (!err_msg) free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+
+    if (errcode) {
+        pgr_send_error(errcode);
+    }
+
+}
+
+/*                                                                             */
+/*******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+one_to_one_withPoints(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    uint32_t              call_cntr;
+    uint32_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /*******************************************************************************/
+    /*                          MODIFY AS NEEDED                                   */
+    /*                                                                             */
+    General_path_element_t  *result_tuples = NULL;
+    size_t result_count = 0;
+    /*                                                                             */
+    /*******************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // CREATE OR REPLACE FUNCTION pgr_withPoint(
+        // edges_sql TEXT,
+        // points_sql TEXT,
+        // start_pid BIGINT,
+        // end_pid BIGINT,
+        // directed BOOLEAN -- DEFAULT true,
+        // driving_side CHAR -- DEFAULT 'b',
+        // details BOOLEAN -- DEFAULT true,
+        // only_cost BOOLEAN DEFAULT false,
+
+        PGR_DBG("Calling process");
+        PGR_DBG("initial driving side:%s", pgr_text2char(PG_GETARG_TEXT_P(5)));
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                pgr_text2char(PG_GETARG_TEXT_P(1)),
+                PG_GETARG_INT64(2),
+                PG_GETARG_INT64(3),
+                PG_GETARG_BOOL(4),
+                pgr_text2char(PG_GETARG_TEXT_P(5)),
+                PG_GETARG_BOOL(6),
+                PG_GETARG_BOOL(7),
+                &result_tuples,
+                &result_count);
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = (uint32_t)result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (General_path_element_t*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY AS NEEDED                                   */
+        // OUT seq BIGINT,
+        // OUT path_seq,
+        // OUT node BIGINT,
+        // OUT edge BIGINT,
+        // OUT cost FLOAT,
+        // OUT agg_cost FLOAT)
+
+
+        values = palloc(6 * sizeof(Datum));
+        nulls = palloc(6 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 6; ++i) {
+            nulls[i] = ' ';
+        }
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[4] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[5] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/src/withPoints/src/one_to_one_withPoints_driver.cpp b/src/withPoints/src/one_to_one_withPoints_driver.cpp
new file mode 100644
index 0000000..90cc511
--- /dev/null
+++ b/src/withPoints/src/one_to_one_withPoints_driver.cpp
@@ -0,0 +1,175 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_dijkstra.hpp"
+#include "./pgr_withPoints.hpp"
+#include "./one_to_one_withPoints_driver.h"
+
+// #define DEBUG
+
+
+#include "./../../common/src/memory_func.hpp"
+
+
+// CREATE OR REPLACE FUNCTION pgr_withPoint(
+// edges_sql TEXT,
+// points_sql TEXT,
+// start_pid BIGINT,
+// end_pid BIGINT,
+// directed BOOLEAN DEFAULT true
+
+
+int
+do_pgr_withPoints(
+        pgr_edge_t  *edges,           size_t total_edges,
+        Point_on_edge_t  *points_p,   size_t total_points,
+        pgr_edge_t  *edges_of_points, size_t total_edges_of_points,
+        int64_t start_pid,
+        int64_t end_pid,
+        bool directed,
+        char driving_side,
+        bool details,
+        bool only_cost,
+        General_path_element_t **return_tuples,
+        size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+        log << "Entering do_pgr_withPoints\n";
+        std::vector< Point_on_edge_t >
+            points(points_p, points_p + total_points);
+        
+        log << "total points" << points.size() << "\n";
+
+        /*
+         * This test is easier in C++
+         */
+        int errcode = check_points(points, log);
+        if (errcode) {
+            log << "Point(s) with same pid but different edge/fraction/side combination found";
+            *err_msg = strdup(log.str().c_str());
+            return errcode;
+        }
+
+        std::vector< pgr_edge_t >
+            edges_to_modify(edges_of_points, edges_of_points + total_edges_of_points);
+
+        std::vector< pgr_edge_t > new_edges;
+        log << "start_pid" << start_pid << "\n";
+        log << "end_pid" << end_pid << "\n";
+        log << "driving_side" << driving_side << "\n";
+        create_new_edges(
+                points,
+                edges_to_modify,
+                driving_side,
+                new_edges,
+                log);
+
+        int64_t start_vid(start_pid);
+        int64_t end_vid(end_pid);
+#if 0
+        for (const auto point : points) {
+            if (point.pid == start_pid) {
+                start_vid = point.vertex_id;
+            }
+            if (point.pid == end_pid) {
+                end_vid = point.vertex_id;
+            }
+
+        }
+#endif
+        log << "start_vid" << start_vid << "\n";
+        log << "end_vid" << end_vid << "\n";
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const auto initial_size = total_edges;
+
+        Path path;
+
+
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(edges, total_edges);
+            digraph.graph_insert_data(new_edges);
+            pgr_dijkstra(digraph, path, start_vid, end_vid, only_cost);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(edges, total_edges);
+            undigraph.graph_insert_data(new_edges);
+            pgr_dijkstra(undigraph, path, start_vid, end_vid, only_cost);
+        }
+
+
+        size_t count(path.size());
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log <<
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return 0;
+        }
+
+        if (!details) {
+            eliminate_details(path, edges_to_modify);
+        }
+
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        size_t sequence = 0;
+        path.generate_postgres_data(return_tuples, sequence);
+        (*return_count) = sequence;
+
+#ifndef DEBUG
+        {
+            std::ostringstream log;
+            log << "OK";
+            *err_msg = strdup(log.str().c_str());
+        }
+
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+        return 0;
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+    }
+    return 1000;
+}
diff --git a/src/withPoints/src/one_to_one_withPoints_driver.h b/src/withPoints/src/one_to_one_withPoints_driver.h
new file mode 100644
index 0000000..40f0cb3
--- /dev/null
+++ b/src/withPoints/src/one_to_one_withPoints_driver.h
@@ -0,0 +1,63 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_WITHPOINTS_SRC_WITHPOINTS_DRIVER_H_
+#define SRC_WITHPOINTS_SRC_WITHPOINTS_DRIVER_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "./../../common/src/pgr_types.h"
+
+//  CREATE OR REPLACE FUNCTION pgr_withPoint(
+//  edges_sql TEXT,
+//  points_sql TEXT,
+//  start_pid BIGINT,
+//  end_pid BIGINT,
+//  directed BOOLEAN DEFAULT true,
+    int do_pgr_withPoints(
+            pgr_edge_t  *edges,           size_t total_edges,
+            Point_on_edge_t  *points,     size_t total_points,
+            pgr_edge_t  *edges_of_points, size_t total_edges_of_points,
+            int64_t start_pid,
+            int64_t end_pid,
+            bool directed,
+            char driving_side,
+            bool details,
+            bool only_cost,
+            General_path_element_t **return_tuples,
+            size_t *return_count,
+            char ** err_msg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_WITHPOINTS_SRC_WITHPOINTS_DRIVER_H_
diff --git a/src/withPoints/src/pgr_withPoints.cpp b/src/withPoints/src/pgr_withPoints.cpp
new file mode 100644
index 0000000..9d7f9e5
--- /dev/null
+++ b/src/withPoints/src/pgr_withPoints.cpp
@@ -0,0 +1,428 @@
+/*PGR-GNU*****************************************************************
+File: pgr_withPoints.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <set>
+#include <vector>
+#include <cassert>
+#include "./pgr_withPoints.hpp"
+// #define DEBUG
+#include "./msg_logger.hpp"
+
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+/*
+ * 0 = success
+ * non 0 = error code
+ */
+
+int check_points(std::vector< Point_on_edge_t > &points,
+        std::ostringstream  &log) {
+
+    PGR_LOG_POINTS(log, points, "original points");
+    /* 
+     * deleting duplicate points
+     */
+    std::sort(points.begin(), points.end(),
+            [](const Point_on_edge_t &a, const  Point_on_edge_t &b)
+           -> bool {
+            if (a.pid != b.pid) return a.pid < b.pid;
+            if (a.edge_id != b.edge_id) return a.edge_id < b.edge_id;
+            if (a.fraction != b.fraction) return a.fraction < b.fraction;
+            return a.side < b.side;
+            });
+    PGR_LOG_POINTS(log, points, "after sorting");
+    auto last = std::unique(points.begin(), points.end(),
+            [](const Point_on_edge_t &a, const  Point_on_edge_t &b) {
+            return a.pid == b.pid &&
+            a.edge_id == b.edge_id &&
+            a.fraction == b.fraction &&
+            a.side == b.side;
+            });
+    points.erase(last, points.end());
+    size_t total_points = points.size();
+
+    PGR_LOG_POINTS(log, points, "after deleting repetitions");
+    log << "We have " << total_points << " different points";
+
+    last = std::unique(points.begin(), points.end(),
+            [](const Point_on_edge_t &a, const  Point_on_edge_t &b) {
+            return a.pid == b.pid;
+            });
+    points.erase(last, points.end());
+    PGR_LOG_POINTS(log, points, "after deleting points with same id");
+
+    if (points.size() != total_points) {
+        return 1;
+    }
+    return 0;
+}
+
+
+void
+eliminate_details_dd(
+        Path &path) {
+    /* 
+     *  There is no path nothing to do
+     */
+    if (path.empty()) return;
+
+    Path newPath(path.start_id(), path.end_id());
+    for (const auto &pathstop :  path) {
+        if ((pathstop.node == path.start_id()) 
+                || (pathstop.node == path.end_id())
+                || (pathstop.node > 0)) {
+            newPath.push_back(pathstop);
+        }
+    }
+
+    path = newPath;
+}
+
+
+void
+eliminate_details(
+        Path &path,
+        const std::vector< pgr_edge_t > &point_edges) {
+    /* 
+     *  There is no path nothing to do
+     */
+    if (path.empty()) return;
+
+    Path newPath(path.start_id(), path.end_id());
+    double cost = 0.0;
+    for (const auto &pathstop :  path) {
+        if ((pathstop.node == path.start_id()) 
+                || (pathstop.node == path.end_id())
+                || (pathstop.node > 0)) {
+            newPath.push_back(pathstop);
+            if (pathstop.node != path.end_id()) cost = 0.0;
+            continue;
+        }
+        cost += pathstop.cost;
+    }
+
+    newPath[0].cost = newPath[1].agg_cost;
+    for (unsigned int i = 1; i < newPath.size() - 2; ++i) {
+        /* newPath[i] has: node, edge, cost, agg_cost 
+         * pgr_type_t has: id, source, target, cost, reverse_cost
+         *
+         * find the edge where the pathstop.edge == edge.id */
+
+        int64_t edge_to_find =  newPath[i].edge;
+        auto edge_ptr = std::find_if(point_edges.begin(), point_edges.end(),
+                [&edge_to_find](const pgr_edge_t &edge)
+                {return edge_to_find == edge.id;});
+        if (edge_ptr != point_edges.end()) {
+            newPath[i].cost = edge_ptr->target ==  newPath[i+1].node ?
+                edge_ptr->cost : edge_ptr->reverse_cost;
+        }
+    }
+    newPath[newPath.size()-2].cost += cost;
+
+
+    path = newPath;
+}
+
+
+static void
+adjust_pids(
+        const std::vector< Point_on_edge_t > &points,
+        const int64_t &start_pid,
+        const int64_t &end_pid,
+        Path &path) {
+    if (path.empty()) return;
+    path.start_id(start_pid);
+    path.end_id(end_pid);
+
+    for (auto &path_stop : path) {
+        for (const auto point: points) {
+            if (point.vertex_id == path_stop.node) {
+                path_stop.node = -point.pid;
+                break;
+            }
+        }
+    }
+}
+
+void
+adjust_pids(
+        const std::vector< Point_on_edge_t > &points,
+        Path &path) {
+    /* 
+     *  There is no path nothing to do
+     */
+    if (path.empty()) return;
+    /* from, to:
+     *      *  are constant along the path
+     *           */
+    int64_t start_vid = path.start_id();
+    int64_t end_vid = path.end_id();
+
+    int64_t start_pid = 0;
+    int64_t end_pid = 0;
+
+    for (auto &p : points) {
+        if (p.vertex_id == start_vid) {
+            start_pid = -p.pid;
+        }
+        if (p.vertex_id == end_vid) {
+            end_pid = -p.pid;
+        }
+    }
+    adjust_pids(points, start_pid, end_pid, path);
+}
+
+
+struct pointCompare {
+    bool operator() (const Point_on_edge_t& lhs, const Point_on_edge_t& rhs) const
+    { return lhs.fraction < rhs.fraction? true : lhs.pid < rhs.pid;}
+};
+
+bool
+create_new_edges(
+        std::vector< Point_on_edge_t >  &points,
+        const std::vector< pgr_edge_t > &edges,
+        char driving_side,
+        std::vector< pgr_edge_t > &new_edges) {
+    std::ostringstream log;
+    return create_new_edges( points, edges, driving_side, new_edges, log);
+}
+
+
+
+bool
+create_new_edges(
+        std::vector< Point_on_edge_t >  &points,
+        const std::vector< pgr_edge_t > &edges,
+        char driving_side,
+        std::vector< pgr_edge_t > &new_edges,
+        std::ostringstream &log) {
+
+    for (const auto &point : points){
+        log << "point: " 
+            << point.pid <<"\t"
+            << point.edge_id <<"\t"
+            << point.fraction <<"\t"
+            << point.side <<"\t"
+            << point.vertex_id <<"\n";
+    }
+
+    int64_t vertex_id = 1;
+    std::vector< Point_on_edge_t >  new_points;
+    for (const auto edge : edges) {
+        std::set< Point_on_edge_t, pointCompare> points_on_edge;
+        for (const auto point : points) {
+            if (edge.id == point.edge_id) {
+                points_on_edge.insert(point);
+                log << "working points: " 
+                    << point.pid <<"\t"
+                    << point.edge_id <<"\t"
+                    << point.fraction <<"\t"
+                    << point.side <<"\t"
+                    << point.vertex_id <<"\n";
+            }
+        }
+        if (points_on_edge.empty()) {
+            log << "For some reason we didnt find a point belonging to the edge, must be an error\n";
+            return false;
+        }
+#if 0
+        log << "breaking:  \n"
+            << edge.id << "\t" 
+            << edge.source << "\t" 
+            << edge.target << "\t" 
+            << edge.cost << "\t"
+            << edge.reverse_cost << "\n";
+#endif
+        int64_t prev_target = edge.source;
+        int64_t prev_rtarget = edge.source;
+        double prev_fraction = 0;
+        double prev_rfraction = 0;
+        double agg_cost = 0;
+        double agg_rcost = 0;
+        double  last_cost = 0;
+        double  last_rcost = 0;
+        std::vector< Point_on_edge_t> the_points(points_on_edge.begin(), points_on_edge.end());
+
+        for (auto &point : the_points) {
+
+            /* the point either has
+             * vertex_id = source
+             * vertex_id = target
+             * vertex_id = -newnumber
+             */
+            log << "\npid" << point.pid << "\teid" << point.edge_id << "/t" << point.fraction << "\t" << point.side << "\n";
+            if (point.fraction < 0 || point.fraction > 1) {
+                log << "For some reason an invalid fraction was accepted, must be an error\n";
+                return false;
+            }
+            if (point.fraction == 0) {
+                log << "vertex_id of the point is the source" << edge.source << "\n";
+                point.vertex_id = edge.source;
+            }
+            if (point.fraction == 1) {
+                log << "vertex_id of the point is the target" << edge.target << "\n";
+                point.vertex_id = edge.target;
+            }
+            if (point.fraction > 0 && point.fraction < 1) {
+                log << "vertex_id of the point is " << - vertex_id << "\n";
+                point.vertex_id = -vertex_id;
+                ++vertex_id;
+            }
+            new_points.push_back(point);
+
+            double deltaFraction = point.fraction - prev_fraction;
+            double deltarFraction = point.fraction - prev_rfraction;
+            if ((edge.cost < 0 or edge.reverse_cost < 0)
+                    || driving_side == 'b'
+                    || point.side == 'b') {
+                log << "Edge is one way or driving side is both or point side is both\n";
+                log << "Edge is one way: " << (edge.cost < 0 or edge.reverse_cost < 0) << "\n";
+                log << "driving side: " << driving_side << "\n";
+                log << "point side: " << point.side << "\n";
+                if (point.fraction > 0 && point.fraction < 1) {
+                    if (edge.cost >= 0) {
+                        last_cost = deltaFraction * edge.cost;
+                        pgr_edge_t new_edge = {edge.id , prev_target, point.vertex_id, last_cost, -1};
+                        new_edges.push_back(new_edge);
+                        log << "new_edge: (id,source,target,cost,reverse_cost) = ("
+                            << new_edge.id << "\t"
+                            << new_edge.source << "\t"
+                            << new_edge.target << "\t"
+                            << new_edge.cost << "\t"
+                            << new_edge.reverse_cost << ")\n";
+                    }
+                    if (edge.reverse_cost >= 0) {
+                        last_rcost = deltarFraction * edge.reverse_cost;
+                        pgr_edge_t new_edge = {edge.id , prev_target, point.vertex_id, -1, last_rcost};
+                        new_edges.push_back(new_edge);
+                        log << "new_edge: (id,source,target,cost,reverse_cost) = ("
+                            << new_edge.id << "\t"
+                            << new_edge.source << "\t"
+                            << new_edge.target << "\t"
+                            << new_edge.cost << "\t"
+                            << new_edge.reverse_cost << ")\n";
+                    }
+                }
+                prev_target = point.vertex_id;
+                prev_fraction = point.fraction;
+                agg_cost += last_cost;
+
+                prev_rtarget = point.vertex_id;
+                prev_rfraction = point.fraction;
+                agg_rcost += last_rcost;
+                continue;
+            }
+
+            assert(edge.cost > 0 && edge.reverse_cost > 0);
+            assert(point.side != 'b');
+
+            if (driving_side == point.side) {
+                log << "Edge is two way and driving side is the same as the side of the point\n";
+                log << "Breaking (source, target) edge only when its not the extreme of the segment\n";
+                if (point.fraction > 0 && point.fraction < 1) {
+                    last_cost = deltaFraction * edge.cost;
+                    pgr_edge_t new_edge = {edge.id , prev_target, point.vertex_id, last_cost, -1};
+                    new_edges.push_back(new_edge);
+                    log << "new_edge: (id,source,target,cost,reverse_cost) = ("
+                        << new_edge.id << "\t"
+                        << new_edge.source << "\t"
+                        << new_edge.target << "\t"
+                        << new_edge.cost << "\t"
+                        << new_edge.reverse_cost << ")\n";
+                }
+                prev_target = point.vertex_id;
+                prev_fraction = point.fraction;
+                agg_cost += last_cost;
+                continue;
+            }
+
+            log << "Edge is two way and driving side is different than the side of the point\n";
+            if (point.fraction > 0 && point.fraction < 1) {
+                last_rcost = deltarFraction * edge.reverse_cost;
+                pgr_edge_t new_edge = {edge.id , prev_rtarget, point.vertex_id, -1, last_rcost};
+                new_edges.push_back(new_edge);
+                log << "new_edge: (id,source,target,cost,reverse_cost) = ("
+                    << new_edge.id << "\t"
+                    << new_edge.source << "\t"
+                    << new_edge.target << "\t"
+                    << new_edge.cost << "\t"
+                    << new_edge.reverse_cost << ")\n";
+            }
+            prev_rtarget = point.vertex_id;
+            prev_rfraction = point.fraction;
+            agg_rcost += last_rcost;
+        }
+
+        { // the last segments
+            pgr_edge_t new_edge = {edge.id , prev_target, edge.target,
+                (edge.cost - agg_cost), -1};
+            new_edges.push_back(new_edge);
+            log << "last edge: (id,source,target,cost,reverse_cost) = ("
+                << new_edge.id << "\t"
+                << new_edge.source << "\t"
+                << new_edge.target << "\t"
+                << new_edge.cost << "\t"
+                << new_edge.reverse_cost << ")\n";
+
+            new_edge = {edge.id , prev_rtarget, edge.target,
+                -1, (edge.reverse_cost - agg_rcost)};
+            new_edges.push_back(new_edge);
+            log << "last edge: (id,source,target,cost,reverse_cost) = ("
+                << new_edge.id << "\t"
+                << new_edge.source << "\t"
+                << new_edge.target << "\t"
+                << new_edge.cost << "\t"
+                << new_edge.reverse_cost << ")\n";
+        }
+    }
+
+    points = new_points;
+    for (const auto &point : points){
+        log << "point: " 
+            << point.pid <<"\t"
+            << point.edge_id <<"\t"
+            << point.fraction <<"\t"
+            << point.side <<"\t"
+            << point.vertex_id <<"\n";
+    }
+    return true;
+}
diff --git a/src/withPoints/src/pgr_withPoints.hpp b/src/withPoints/src/pgr_withPoints.hpp
new file mode 100644
index 0000000..a698fca
--- /dev/null
+++ b/src/withPoints/src/pgr_withPoints.hpp
@@ -0,0 +1,66 @@
+/*PGR-GNU*****************************************************************
+File: withPoints_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) 2015 Celia Virginia Vergara Castillo
+Mail: 
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#pragma once
+
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/basePath_SSEC.hpp"
+
+int
+check_points(std::vector< Point_on_edge_t > &points,
+                std::ostringstream  &log);
+
+void
+eliminate_details_dd(
+        Path &path);
+
+void
+eliminate_details(
+        Path &path,
+        const std::vector< pgr_edge_t > &point_edges);
+
+void
+adjust_pids(
+        const std::vector< Point_on_edge_t > &points,
+        Path &path);
+
+
+bool
+create_new_edges(
+        std::vector< Point_on_edge_t >  &points,
+        const std::vector< pgr_edge_t > &edges,
+        char driving_side,
+        std::vector< pgr_edge_t > &new_edges);
+
+bool
+create_new_edges(
+        std::vector< Point_on_edge_t >  &points,
+        const std::vector< pgr_edge_t > &edges,
+        char driving_side,
+        std::vector< pgr_edge_t > &new_edges,
+        std::ostringstream &log);
diff --git a/src/withPoints/test/doc-pgr_withPoints.result b/src/withPoints/test/doc-pgr_withPoints.result
new file mode 100644
index 0000000..c113090
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPoints.result
@@ -0,0 +1,113 @@
+--e1
+1|1|-1|1|0.6|0
+2|2|2|4|1|0.6
+3|3|5|7|1|1.6
+4|4|8|6|0.7|2.6
+5|5|-3|-1|0|3.3
+--e2
+1|1|-1|1|0.6|0
+2|2|2|4|0.7|0.6
+3|3|-6|4|0.3|1.3
+4|4|5|8|1|1.6
+5|5|6|9|1|2.6
+6|6|9|16|1|3.6
+7|7|4|3|1|4.6
+8|8|3|-1|0|5.6
+--e3
+1|1|-3|-1|1|0.6|0
+2|2|-3|2|4|1|0.6
+3|3|-3|5|7|1|1.6
+4|4|-3|8|6|0.7|2.6
+5|5|-3|-3|-1|0|3.3
+6|1|5|-1|1|0.6|0
+7|2|5|2|4|1|0.6
+8|3|5|5|-1|0|1.6
+--e4
+1|1|-1|-1|1|0.6|0
+2|2|-1|2|4|1|0.6
+3|3|-1|5|7|1|1.6
+4|4|-1|8|6|0.7|2.6
+5|5|-1|-3|-1|0|3.3
+6|1|2|2|4|1|0
+7|2|2|5|7|1|1
+8|3|2|8|6|0.7|2
+9|4|2|-3|-1|0|2.7
+--e5
+1|1|-1|-3|-1|1|0.6|0
+2|2|-1|-3|2|4|1|0.6
+3|3|-1|-3|5|7|1|1.6
+4|4|-1|-3|8|6|0.7|2.6
+5|5|-1|-3|-3|-1|0|3.3
+6|1|-1|7|-1|1|0.6|0
+7|2|-1|7|2|4|1|0.6
+8|3|-1|7|5|7|1|1.6
+9|4|-1|7|8|6|1|2.6
+10|5|-1|7|7|-1|0|3.6
+11|1|2|-3|2|4|1|0
+12|2|2|-3|5|7|1|1
+13|3|2|-3|8|6|0.7|2
+14|4|2|-3|-3|-1|0|2.7
+15|1|2|7|2|4|1|0
+16|2|2|7|5|7|1|1
+17|3|2|7|8|6|1|2
+18|4|2|7|7|-1|0|3
+--q2
+(-1 => -6) at 4th step:| visits|Point|6
+(-1 => -3) at 4th step:| passes in front of|Point|6
+(-1 => -2) at 4th step:| passes in front of|Point|6
+(-1 => -2) at 6th step:| passes in front of|Vertex|6
+(-1 => 3) at 4th step:| passes in front of|Point|6
+(-1 => 3) at 6th step:| passes in front of|Vertex|6
+(-1 => 6) at 4th step:| passes in front of|Point|6
+(-1 => 6) at 6th step:| visits|Vertex|6
+(1 => -6) at 3th step:| visits|Point|6
+(1 => -3) at 3th step:| passes in front of|Point|6
+(1 => -2) at 3th step:| passes in front of|Point|6
+(1 => -2) at 5th step:| passes in front of|Vertex|6
+(1 => 3) at 3th step:| passes in front of|Point|6
+(1 => 3) at 5th step:| passes in front of|Vertex|6
+(1 => 6) at 3th step:| passes in front of|Point|6
+(1 => 6) at 5th step:| visits|Vertex|6
+--q3
+(-1 => -6) at 3th step:| visits|Point|6
+(-1 => -3) at 3th step:| passes in front of|Point|6
+(-1 => -2) at 3th step:| passes in front of|Point|6
+(-1 => -2) at 5th step:| passes in front of|Vertex|6
+(-1 => 3) at 3th step:| passes in front of|Point|6
+(-1 => 3) at 5th step:| passes in front of|Vertex|6
+(-1 => 6) at 3th step:| passes in front of|Point|6
+(-1 => 6) at 5th step:| visits|Vertex|6
+(1 => -6) at 4th step:| visits|Point|6
+(1 => -3) at 4th step:| passes in front of|Point|6
+(1 => -2) at 4th step:| passes in front of|Point|6
+(1 => -2) at 6th step:| passes in front of|Vertex|6
+(1 => 3) at 4th step:| passes in front of|Point|6
+(1 => 3) at 6th step:| passes in front of|Vertex|6
+(1 => 6) at 4th step:| passes in front of|Point|6
+(1 => 6) at 6th step:| visits|Vertex|6
+--q4
+1|1|-1|-3|-1|1|0.6|0
+2|2|-1|-3|2|4|0.7|0.6
+3|3|-1|-3|-6|4|0.3|1.3
+4|4|-1|-3|5|7|1|1.6
+5|5|-1|-3|8|6|0.7|2.6
+6|6|-1|-3|-3|-1|0|3.3
+7|1|-1|7|-1|1|0.6|0
+8|2|-1|7|2|4|0.7|0.6
+9|3|-1|7|-6|4|0.3|1.3
+10|4|-1|7|5|7|1|1.6
+11|5|-1|7|8|6|0.7|2.6
+12|6|-1|7|-3|6|0.3|3.3
+13|7|-1|7|7|-1|0|3.6
+14|1|2|-3|2|4|0.7|0
+15|2|2|-3|-6|4|0.3|0.7
+16|3|2|-3|5|7|1|1
+17|4|2|-3|8|6|0.7|2
+18|5|2|-3|-3|-1|0|2.7
+19|1|2|7|2|4|0.7|0
+20|2|2|7|-6|4|0.3|0.7
+21|3|2|7|5|7|1|1
+22|4|2|7|8|6|0.7|2
+23|5|2|7|-3|6|0.3|2.7
+24|6|2|7|7|-1|0|3
+--q5
diff --git a/src/withPoints/test/doc-pgr_withPoints.test.sql b/src/withPoints/test/doc-pgr_withPoints.test.sql
new file mode 100644
index 0000000..631779e
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPoints.test.sql
@@ -0,0 +1,76 @@
+
+BEGIN;
+
+    \echo --e1
+    SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -3);
+    \echo --e2
+    SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3,
+        details := true);
+    \echo --e3
+    SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, ARRAY[-3,5]);
+    \echo --e4
+    SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], -3);
+    \echo --e5
+    SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7]);
+
+    \echo --q2
+    SELECT ('(' || start_pid || ' => ' || end_pid ||') at ' || path_seq || 'th step:')::TEXT AS path_at,
+            CASE WHEN edge = -1 THEN ' visits'
+                ELSE ' passes in front of'
+            END as status,
+            CASE WHEN node < 0 THEN 'Point'
+                ELSE 'Vertex'
+            END as is_a,
+            abs(node) as id
+        FROM pgr_withPoints(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+            'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+            ARRAY[1,-1], ARRAY[-2,-3,-6,3,6],
+            driving_side := 'r',
+            details := true)
+        WHERE node IN (-6,6);
+    \echo --q3
+    SELECT ('(' || start_pid || ' => ' || end_pid ||') at ' || path_seq || 'th step:')::TEXT AS path_at,
+            CASE WHEN edge = -1 THEN ' visits'
+                ELSE ' passes in front of'
+            END as status,
+            CASE WHEN node < 0 THEN 'Point'
+                ELSE 'Vertex'
+            END as is_a,
+            abs(node) as id
+        FROM pgr_withPoints(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+            'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+            ARRAY[1,-1], ARRAY[-2,-3,-6,3,6],
+            driving_side := 'l',
+            details := true)
+        WHERE node IN (-6,6);
+    \echo --q4
+    SELECT * FROM pgr_withPoints(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        directed := false,
+        details := true);
+    \echo --q5
+
+
+
+    ROLLBACK;
+
+
diff --git a/src/withPoints/test/doc-pgr_withPointsCost.result b/src/withPoints/test/doc-pgr_withPointsCost.result
new file mode 100644
index 0000000..cb2f816
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsCost.result
@@ -0,0 +1,31 @@
+--e1
+-1|-3|3.3
+--e2
+-1|3|1.6
+--e3
+-1|-3|3.3
+-1|5|1.6
+--e4
+-1|-3|3.3
+2|-3|2.7
+--e5
+-1|-3|3.3
+-1|7|3.6
+2|-3|2.7
+2|7|3
+--q2
+-1|-3|3.3
+-1|7|3.6
+2|-3|2.7
+2|7|3
+--q3
+-1|-3|4.7
+-1|7|4.4
+2|-3|3.3
+2|7|3
+--q4
+-1|-3|3.3
+-1|7|3.6
+2|-3|2.7
+2|7|3
+--q5
diff --git a/src/withPoints/test/doc-pgr_withPointsCost.test.sql b/src/withPoints/test/doc-pgr_withPointsCost.test.sql
new file mode 100644
index 0000000..f01defa
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsCost.test.sql
@@ -0,0 +1,55 @@
+
+BEGIN;
+
+    \echo --e1
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -3);
+    \echo --e2
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3,
+        directed := false);
+    \echo --e3
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, ARRAY[-3,5]);
+    \echo --e4
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], -3);
+    \echo --e5
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7]);
+
+    \echo --q2
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        driving_side := 'l');
+    \echo --q3
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        driving_side := 'r');
+    \echo --q4
+    SELECT * FROM pgr_withPointsCost(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[-1,2], ARRAY[-3,7],
+        driving_side := 'b');
+    \echo --q5
+
+
+
+    ROLLBACK;
+
+
diff --git a/src/withPoints/test/doc-pgr_withPointsDD.result b/src/withPoints/test/doc-pgr_withPointsDD.result
new file mode 100644
index 0000000..8d0c284
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsDD.result
@@ -0,0 +1,52 @@
+--q1
+1|-1|-1|0|0
+2|1|1|0.4|0.4
+3|2|1|0.6|0.6
+4|5|4|0.3|1.6
+5|6|8|1|2.6
+6|8|7|1|2.6
+7|10|10|1|2.6
+8|7|6|0.3|3.6
+9|9|9|1|3.6
+10|11|11|1|3.6
+11|13|14|1|3.6
+--q2
+1|-1|-1|0|0
+2|1|1|0.4|0.4
+3|2|1|1|1.4
+4|-6|4|0.7|2.1
+5|5|4|0.3|2.4
+6|6|8|1|3.4
+7|8|7|1|3.4
+8|10|10|1|3.4
+--q3
+1|-1|-1|0|0
+2|2|1|0.6|0.6
+3|-6|4|0.7|1.3
+4|5|4|0.3|1.6
+5|1|1|1|1.6
+6|6|8|1|2.6
+7|8|7|1|2.6
+8|10|10|1|2.6
+9|-5|12|0.6|3.2
+10|-3|6|0.7|3.3
+11|7|6|0.3|3.6
+12|9|9|1|3.6
+13|11|11|1|3.6
+14|13|14|1|3.6
+--q4
+1|-1|-1|0|0
+2|1|1|0.4|0.4
+3|2|1|0.6|0.6
+4|-6|4|0.7|1.3
+5|5|4|0.3|1.6
+6|6|8|1|2.6
+7|8|7|1|2.6
+8|10|10|1|2.6
+9|-5|12|0.6|3.2
+10|-3|6|0.7|3.3
+11|7|6|0.3|3.6
+12|9|9|1|3.6
+13|11|11|1|3.6
+14|13|14|1|3.6
+--q5
diff --git a/src/withPoints/test/doc-pgr_withPointsDD.test.sql b/src/withPoints/test/doc-pgr_withPointsDD.test.sql
new file mode 100644
index 0000000..c633207
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsDD.test.sql
@@ -0,0 +1,36 @@
+
+BEGIN;
+
+    \echo --q1
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8);
+    \echo --q2
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8,
+        driving_side := 'r',
+        details := true);
+    \echo --q3
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8,
+        driving_side := 'l',
+        details := true);
+    \echo --q4
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 3.8,
+        driving_side := 'b',
+        details := true);
+    \echo --q5
+
+
+
+    ROLLBACK;
+
+
diff --git a/src/withPoints/test/doc-pgr_withPointsKSP.result b/src/withPoints/test/doc-pgr_withPointsKSP.result
new file mode 100644
index 0000000..5bceb72
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsKSP.result
@@ -0,0 +1,95 @@
+--q1
+1|1|1|-1|1|0.6|0
+2|1|2|2|4|1|0.6
+3|1|3|5|8|1|1.6
+4|1|4|6|9|1|2.6
+5|1|5|9|16|1|3.6
+6|1|6|4|3|1|4.6
+7|1|7|3|5|0.8|5.6
+8|1|8|-2|-1|0|6.4
+9|2|1|-1|1|0.6|0
+10|2|2|2|4|1|0.6
+11|2|3|5|8|1|1.6
+12|2|4|6|11|1|2.6
+13|2|5|11|13|1|3.6
+14|2|6|12|15|1|4.6
+15|2|7|9|16|1|5.6
+16|2|8|4|3|1|6.6
+17|2|9|3|5|0.8|7.6
+18|2|10|-2|-1|0|8.4
+--q2
+1|1|1|-1|1|0.6|0
+2|1|2|2|4|0.7|0.6
+3|1|3|-6|4|0.3|1.3
+4|1|4|5|8|1|1.6
+5|1|5|6|-1|0|2.6
+6|2|1|-1|1|0.6|0
+7|2|2|2|4|0.7|0.6
+8|2|3|-6|4|0.3|1.3
+9|2|4|5|10|1|1.6
+10|2|5|10|12|0.6|2.6
+11|2|6|-5|12|0.4|3.2
+12|2|7|11|13|1|3.6
+13|2|8|12|15|0.6|4.6
+14|2|9|-4|15|0.4|5.2
+15|2|10|9|9|1|5.6
+16|2|11|6|-1|0|6.6
+--q3
+1|1|1|-1|1|0.6|0
+2|1|2|2|4|0.7|0.6
+3|1|3|-6|4|0.3|1.3
+4|1|4|5|8|1|1.6
+5|1|5|6|9|1|2.6
+6|1|6|9|16|1|3.6
+7|1|7|4|3|1|4.6
+8|1|8|3|5|0.8|5.6
+9|1|9|-2|-1|0|6.4
+10|2|1|-1|1|0.6|0
+11|2|2|2|4|0.7|0.6
+12|2|3|-6|4|0.3|1.3
+13|2|4|5|8|1|1.6
+14|2|5|6|11|1|2.6
+15|2|6|11|13|1|3.6
+16|2|7|12|15|0.6|4.6
+17|2|8|-4|15|0.4|5.2
+18|2|9|9|16|1|5.6
+19|2|10|4|3|1|6.6
+20|2|11|3|5|0.8|7.6
+21|2|12|-2|-1|0|8.4
+--q4
+1|1|1|-1|1|0.4|0
+2|1|2|1|1|1|0.4
+3|1|3|2|4|0.7|1.4
+4|1|4|-6|4|0.3|2.1
+5|1|5|5|8|1|2.4
+6|1|6|6|9|1|3.4
+7|1|7|9|16|1|4.4
+8|1|8|4|3|1|5.4
+9|1|9|3|5|0.8|6.4
+10|1|10|-2|-1|0|7.2
+11|2|1|-1|1|0.4|0
+12|2|2|1|1|1|0.4
+13|2|3|2|4|0.7|1.4
+14|2|4|-6|4|0.3|2.1
+15|2|5|5|8|1|2.4
+16|2|6|6|11|1|3.4
+17|2|7|11|13|1|4.4
+18|2|8|12|15|1|5.4
+19|2|9|9|16|1|6.4
+20|2|10|4|3|1|7.4
+21|2|11|3|5|0.8|8.4
+22|2|12|-2|-1|0|9.2
+23|3|1|-1|1|0.4|0
+24|3|2|1|1|1|0.4
+25|3|3|2|4|0.7|1.4
+26|3|4|-6|4|0.3|2.1
+27|3|5|5|10|1|2.4
+28|3|6|10|12|0.6|3.4
+29|3|7|-5|12|0.4|4
+30|3|8|11|13|1|4.4
+31|3|9|12|15|1|5.4
+32|3|10|9|16|1|6.4
+33|3|11|4|3|1|7.4
+34|3|12|3|5|0.8|8.4
+35|3|13|-2|-1|0|9.2
+--q5
diff --git a/src/withPoints/test/doc-pgr_withPointsKSP.test.sql b/src/withPoints/test/doc-pgr_withPointsKSP.test.sql
new file mode 100644
index 0000000..fae7642
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsKSP.test.sql
@@ -0,0 +1,32 @@
+
+BEGIN;
+
+    \echo --q1
+    SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -2, 2);
+    \echo --q2
+    SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, 6, 2, details := true);
+    \echo --q3
+    SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -2, 2,
+        driving_side := 'l', details := true);
+    \echo --q4
+    SELECT * FROM pgr_withPointsKSP(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        -1, -2, 2,
+        heap_paths := true, driving_side := 'r', details := true);
+    \echo --q5
+
+
+
+    ROLLBACK;
+
+
diff --git a/src/driving_distance/test/CMakeLists.txt b/src/withPoints/test/doc-pgr_withPointsVia.result
similarity index 100%
rename from src/driving_distance/test/CMakeLists.txt
rename to src/withPoints/test/doc-pgr_withPointsVia.result
diff --git a/src/withPoints/test/doc-pgr_withPointsVia.test.sql b/src/withPoints/test/doc-pgr_withPointsVia.test.sql
new file mode 100644
index 0000000..f7823d3
--- /dev/null
+++ b/src/withPoints/test/doc-pgr_withPointsVia.test.sql
@@ -0,0 +1,36 @@
+
+BEGIN;
+
+    \echo --q1
+    SELECT * FROM pgr_withPointsVia(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        ARRAY[1,3,5]);
+    \echo --q2
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        3, 3.0,
+        driving_side := 'r',
+        details := true);
+    \echo --q3
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        3, 3.0,
+        driving_side := 'l',
+        details := true);
+    \echo --q4
+    SELECT * FROM pgr_withPointsDD(
+        'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+        'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+        3, 3.0,
+        driving_side := 'b',
+        details := true);
+    \echo --q5
+
+
+
+    ROLLBACK;
+
+
diff --git a/src/withPoints/test/pgtap/many_to_many_eq_one_to_one_withPoint.test.sql b/src/withPoints/test/pgtap/many_to_many_eq_one_to_one_withPoint.test.sql
new file mode 100644
index 0000000..64020dc
--- /dev/null
+++ b/src/withPoints/test/pgtap/many_to_many_eq_one_to_one_withPoint.test.sql
@@ -0,0 +1,126 @@
+
+\i setup.sql
+
+SELECT PLAN(13);
+
+PREPARE q1 AS
+SELECT  path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1], ARRAY[-5], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q11 AS
+SELECT  path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1], ARRAY[-3], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q2 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q21 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -3, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q1', 'q2', '1: Right: from point ARRAY[-1] to -5 same as one to one');
+SELECT set_eq('q11', 'q21', '2: Right: from point ARRAY[-1] to -3 same as one to one');
+
+PREPARE q3 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-4], ARRAY[-5], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q31 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-4], ARRAY[-3], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q4 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -4, -5,
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q41 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -4, -3, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q3','q4','3: Right: from ARRAY[-4] to -5 same as one to one');
+SELECT set_eq('q31','q41','4: Right: from ARRAY[-4] to -3 same as one to one');
+
+PREPARE q5 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1, -4], ARRAY[-5,-3],
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_has('q5', 'q1', '5: Right: from point ARRAY[-1,-4] to -5 has results of from point -1 to -5');
+SELECT set_has('q5', 'q2', '6: Right: from point ARRAY[-1,-4] to -5 has results of from point -1 to -5');
+SELECT set_has('q5', 'q3', '7: Right: from point ARRAY[-1,-4] to -5 has results of from point -4 to -5');
+SELECT set_has('q5', 'q4', '8: Right: from point ARRAY[-1,-4] to -5 has results of from point -4 to -5');
+SELECT set_has('q5', 'q11', '9: Right: from point ARRAY[-1,-4] to -5 has results of from point -1 to -3');
+SELECT set_has('q5', 'q21', '10: Right: from point ARRAY[-1,-4] to -5 has results of from point -1 to -3');
+SELECT set_has('q5', 'q31', '11: Right: from point ARRAY[-1,-4] to -5 has results of from point -4 to -3');
+SELECT set_has('q5', 'q41', '12: Right: from point ARRAY[-1,-4] to -5 has results of from point -4 to -3');
+
+
+
+PREPARE q9 AS
+SELECT  -1 AS start_vid, -5 AS end_vid,  agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1], ARRAY[-5],
+    driving_side := 'r',
+    directed := true,
+    details := true) WHERE edge = -1;
+
+
+PREPARE q10 AS
+SELECT *  FROM pgr_withPointsCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5,
+    driving_side := 'r',
+    directed := true);
+
+SELECT set_eq('q10','q9','Right, directed: Cost is the last row');
+
+
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/withPoints/test/pgtap/many_to_one_eq_one_to_one_withPoint.test.sql b/src/withPoints/test/pgtap/many_to_one_eq_one_to_one_withPoint.test.sql
new file mode 100644
index 0000000..61cd393
--- /dev/null
+++ b/src/withPoints/test/pgtap/many_to_one_eq_one_to_one_withPoint.test.sql
@@ -0,0 +1,86 @@
+
+\i setup.sql
+
+SELECT PLAN(7);
+
+
+
+PREPARE q1 AS
+SELECT  path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1], -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q2 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q1', 'q2', '1: Right: from point ARRAY[-1] to -5 same as one to one');
+
+PREPARE q3 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-4], -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q4 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -4, -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q3','q4','2: Right: from ARRAY[-4] to -5 same as one to one');
+
+PREPARE q5 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1, -4], -5,
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_has('q5', 'q1', '3: Right: from point ARRAY[-1,-4] to -5 has results of from point -1 to -5');
+SELECT set_has('q5', 'q2', '4: Right: from point ARRAY[-1,-4] to -5 has results of from point -1 to -5');
+SELECT set_has('q5', 'q3', '5: Right: from point ARRAY[-1,-4] to -5 has results of from point -4 to -5');
+SELECT set_has('q5', 'q4', '6: Right: from point ARRAY[-1,-4] to -5 has results of from point -4 to -5');
+
+
+
+PREPARE q9 AS
+SELECT  -1 AS start_vid, -5 AS end_vid,  agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    ARRAY[-1], -5,
+    driving_side := 'r',
+    directed := true,
+    details := true) WHERE edge = -1;
+
+
+PREPARE q10 AS
+SELECT *  FROM pgr_withPointsCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5,
+    driving_side := 'r',
+    directed := true);
+
+SELECT set_eq('q10','q9','Right, directed: Cost is the last row');
+
+
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/withPoints/test/pgtap/one_to_many_eq_one_to_one_withPoint.test.sql b/src/withPoints/test/pgtap/one_to_many_eq_one_to_one_withPoint.test.sql
new file mode 100644
index 0000000..ba1eefb
--- /dev/null
+++ b/src/withPoints/test/pgtap/one_to_many_eq_one_to_one_withPoint.test.sql
@@ -0,0 +1,86 @@
+
+\i setup.sql
+
+SELECT PLAN(7);
+
+
+
+PREPARE q1 AS
+SELECT  path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-5], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q2 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q1', 'q2', '1: Right: from point -1 to -5 same as one to one');
+
+PREPARE q3 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-4], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q4 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -4, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q3','q4','2: Right: from -1 to -4 same as one to one');
+
+PREPARE q5 AS
+SELECT path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-4, -5],
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_has('q5', 'q1', '3: Right: from point -1 to -4 & -5 has results of from point -1 to -5');
+SELECT set_has('q5', 'q2', '4: Right: from point -1 to -4 & -5 has results of from point -1 to -5');
+SELECT set_has('q5', 'q3', '5: Right: from point -1 to -4 & -5 has results of from point -1 to -4');
+SELECT set_has('q5', 'q4', '6: Right: from point -1 to -4 & -5 has results of from point -1 to -5');
+
+
+
+PREPARE q9 AS
+SELECT  -1 AS start_vid, -5 AS end_vid,  agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-5],
+    driving_side := 'r',
+    directed := true,
+    details := true) WHERE edge = -1;
+
+
+PREPARE q10 AS
+SELECT *  FROM pgr_withPointsCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5,
+    driving_side := 'r',
+    directed := true);
+
+SELECT set_eq('q10','q9','Right, directed: Cost is the last row');
+
+
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/withPoints/test/pgtap/one_to_many_withPoint.test.sql b/src/withPoints/test/pgtap/one_to_many_withPoint.test.sql
new file mode 100644
index 0000000..d8d8bd2
--- /dev/null
+++ b/src/withPoints/test/pgtap/one_to_many_withPoint.test.sql
@@ -0,0 +1,188 @@
+
+\i setup.sql
+
+SELECT PLAN(8);
+
+
+PREPARE q1 AS
+WITH the_union AS (
+    (SELECT path_seq, -2 AS end_pid, node, agg_cost FROM pgr_withPoints(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+            'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+            -1, ARRAY[-2], 
+            driving_side := 'r',
+            directed := true,
+            details := true))
+    UNION ALL
+    (SELECT path_seq, -5 AS end_pid, node, agg_cost FROM pgr_withPoints(
+            'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+            'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+            -1, ARRAY[-5], 
+            driving_side := 'r',
+            directed := true,
+            details := true))
+),
+the_ordered AS (SELECT * FROM the_union ORDER BY end_pid, path_seq)
+select row_number() OVER() AS seq, * FROM the_ordered;
+
+PREPARE q2 AS
+SELECT seq, path_seq, end_pid AS end_pid, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-2, -5], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q3 AS
+SELECT seq, path_seq, end_pid AS end_pid, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-5, -2], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q4 AS
+SELECT seq, path_seq, end_pid AS end_pid, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, ARRAY[-5, -2, -2, -2, -5, -5, -2],
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+
+SELECT set_eq('q2', 'q1', '1: From point 1 to 2 and 5 the union vs 2,5 order');
+SELECT set_eq('q3', 'q1', '2: From point 1 to 2 and 5 the union vs 5,2 order');
+SELECT set_eq('q4', 'q1', '3: From point 1 to 2 and 5 the union vs 5,2 eliminate repetitions');
+SELECT set_eq('q2', 'q3', '4: From point 1 to 2 and 5 the 2,5 vs 5,2 order');
+SELECT set_eq('q2', 'q4', '5: From point 1 to 2 and 5 the 2,5 vs 5,2 eliminate repetitions');
+
+
+PREPARE q5 AS
+SELECT seq, path_seq, -end_pid AS end_pid, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    '(SELECT pid, edge_id, fraction, side from pointsOfInterest) UNION ALL (SELECT pid, edge_id, fraction, side from pointsOfInterest)',
+    3, ARRAY[5, 1, 1, 5, 5, 1],
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT lives_ok('q5');
+
+PREPARE q6 AS
+SELECT seq, path_seq, -end_pid AS end_pid, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    '(SELECT pid, edge_id, fraction, side from pointsOfInterest) UNION ALL (SELECT 1 as pid, edge_id, fraction, side from pointsOfInterest)',
+    3, ARRAY[5, 1, 1, 5, 5, 1],
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT throws_ok('q6', 'XX000',
+    'Unexpected point(s) with same pid but different edge/fraction/side combination found.',
+    'Same id with different data throws');
+
+PREPARE q7 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    '(SELECT pid, edge_id, fraction, side from pointsOfInterest) UNION ALL (SELECT 1 as pid, edge_id, fraction, side from pointsOfInterest)',
+    3, 5,
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT throws_ok('q7', 'XX000',
+    'Unexpected point(s) with same pid but different edge/fraction/side combination found.',
+    'Same id with different data throws');
+
+/*
+PREPARE q3 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[4], 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_has('q3','q2','2: Right: from 3 to 4 it passes in front of point 1');
+
+PREPARE q4 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[4],
+    driving_side := 'l',
+    directed := true,
+    details := true);
+
+PREPARE q5 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[4],
+    driving_side := 'l',
+    directed := true,
+    details := false);
+
+SELECT set_eq('q4', 'q5', '3: Left: from point 3 to 4 it does not pass in front of any other point');
+
+
+PREPARE q6 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[1], 
+    driving_side := 'l',
+    directed := true,
+    details := true);
+
+SELECT set_has('q6','q5','4: Left: from 3 to 1 it passes in front of point 4');
+
+
+PREPARE q7 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[1],
+    driving_side := 'b',
+    directed := true,
+    details := true);
+
+PREPARE q8 AS
+SELECT seq, path_seq, node, agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[4],
+    driving_side := 'b',
+    directed := true,
+    details := true);
+
+SELECT set_has('q7','q8','Both: from 3 to 1 it passes in front of point 4');
+
+PREPARE q9 AS
+SELECT  -3 AS start_vid, -1 AS end_vid,  agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[1],
+    driving_side := 'r',
+    directed := true,
+    details := true) WHERE edge = -1;
+
+
+PREPARE q10 AS
+SELECT *  FROM pgr_withPointsCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    3, ARRAY[1],
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+SELECT set_eq('q10','q9','Right, directed: Cost is the last row');
+ */
+
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/withPoints/test/pgtap/one_to_one_withPoint.test.sql b/src/withPoints/test/pgtap/one_to_one_withPoint.test.sql
new file mode 100644
index 0000000..7ab7516
--- /dev/null
+++ b/src/withPoints/test/pgtap/one_to_one_withPoint.test.sql
@@ -0,0 +1,99 @@
+
+\i setup.sql
+
+SELECT PLAN(6);
+
+PREPARE q1 AS
+SELECT node, edge, agg_cost::TEXT FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'r',
+    directed := true,
+    details := true);
+
+PREPARE q2 AS
+SELECT node, edge, agg_cost::TEXT FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'r',
+    directed := true,
+    details := false);
+
+PREPARE q21 AS
+SELECT -6 AS node, 4 AS edge, '2.1'::TEXT AS agg_cost;
+
+SELECT set_has('q1', 'q2', '1: Right: from p1 to p5 pass in front of a point');
+SELECT set_has('q1', 'q21', '2: Right: from p1 to p5 pass in front of  p6');
+
+PREPARE q3 AS
+SELECT seq, path_seq, node, edge, cost::text, agg_cost::text FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'l',
+    directed := true,
+    details := true);
+
+
+PREPARE q4 AS
+SELECT  seq, path_seq, node, edge, cost::text, agg_cost::text FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5, 
+    driving_side := 'l',
+    directed := true,
+    details := false);
+
+SELECT set_has('q1', 'q2', '3: Right: from p1 to p5 pass dont pass in front of points');
+
+PREPARE q5 AS
+SELECT node, edge, agg_cost::text FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5,
+    driving_side := 'b',
+    directed := true,
+    details := true);
+
+PREPARE q6 AS
+SELECT node, edge, agg_cost::text FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -1, -5,
+    driving_side := 'b',
+    directed := true,
+    details := false);
+
+PREPARE q61 AS
+SELECT -6 AS node, 4 AS edge, '1.3'::TEXT AS agg_cost;
+
+SELECT set_has('q5', 'q6', '4: both: from p1 to p5 pass in front of a point');
+SELECT set_has('q5', 'q61', '5: both: from p1 to p5 pass in front of  p6');
+
+
+PREPARE q7 AS
+SELECT  -3 AS start_vid, -1 AS end_vid,  agg_cost FROM pgr_withPoints(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -3, -1,
+    driving_side := 'r',
+    directed := true,
+    details := true) WHERE edge = -1;
+
+
+PREPARE q8 AS
+SELECT *  FROM pgr_withPointsCost(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
+    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
+    -3, -1,
+    driving_side := 'r',
+    directed := true
+    );
+
+SELECT set_eq('q7','q8','Right, directed: Cost is the last row');
+
+
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/src/withPoints/test/test.conf b/src/withPoints/test/test.conf
new file mode 100644
index 0000000..93cd2d3
--- /dev/null
+++ b/src/withPoints/test/test.conf
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+    'any' => {
+        'comment' => 'Function test for any versions.',
+        'data' => ['sampledata.data'],
+        'tests' => [qw(
+            doc-pgr_withPoints
+            doc-pgr_withPointsCost
+            doc-pgr_withPointsKSP
+            doc-pgr_withPointsDD
+            )],
+        'documentation' => [qw(
+            doc-pgr_withPoints
+            doc-pgr_withPointsCost
+            doc-pgr_withPointsKSP
+            doc-pgr_withPointsDD
+            )],
+        'not on 2.2' => [qw(
+            doc-pgr_withPointsVia
+            )],
+    },
+# I dont know what this are for or how to use them.
+#  TODO ask Steve 
+#    'vpg-vpgis' => {}, # for version specific tests
+#    '8-1' => {},       # for pg 8.x and postgis 1.x
+#    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
+);
+
+1;
diff --git a/tools/build-extension-update-files b/tools/build-extension-update-files
index ffad204..c5f28e5 100755
--- a/tools/build-extension-update-files
+++ b/tools/build-extension-update-files
@@ -94,6 +94,7 @@ exit 0;
 
 sub wanted {
     /^.*\.sig\z/s &&
+    ! /^pgrouting--$version.sig\z/s &&
     push @old_files, $name;
 }
 
diff --git a/tools/doxygen/Doxyfile b/tools/doxygen/Doxyfile
index 52e683f..ab48741 100644
--- a/tools/doxygen/Doxyfile
+++ b/tools/doxygen/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME           = "pgRouting"
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 2.1
+PROJECT_NUMBER         = 2.2
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
@@ -125,7 +125,7 @@ ABBREVIATE_BRIEF       =
 # description.
 # The default value is: NO.
 
-ALWAYS_DETAILED_SEC    = NO
+ALWAYS_DETAILED_SEC    = YES
 
 # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
 # inherited members of a class in the documentation of that class as if those
@@ -133,14 +133,14 @@ ALWAYS_DETAILED_SEC    = NO
 # operators of the base classes will not be shown.
 # The default value is: NO.
 
-INLINE_INHERITED_MEMB  = NO
+INLINE_INHERITED_MEMB  = YES
 
 # If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
 # before files name in the file list and in the header files. If set to NO the
 # shortest path that makes the file name unique will be used
 # The default value is: YES.
 
-FULL_PATH_NAMES        = YES
+FULL_PATH_NAMES        = NO
 
 # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
 # Stripping is only done if one of the specified strings matches the left-hand
@@ -177,7 +177,7 @@ SHORT_NAMES            = NO
 # description.)
 # The default value is: NO.
 
-JAVADOC_AUTOBRIEF      = NO
+JAVADOC_AUTOBRIEF      = YES
 
 # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
 # line (until the first dot) of a Qt-style comment as the brief description. If
@@ -185,7 +185,7 @@ JAVADOC_AUTOBRIEF      = NO
 # requiring an explicit \brief command for a brief description.)
 # The default value is: NO.
 
-QT_AUTOBRIEF           = NO
+QT_AUTOBRIEF           = YES
 
 # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
 # multi-line C++ special comment block (i.e. a block of //! or /// comments) as
@@ -309,7 +309,7 @@ AUTOLINK_SUPPORT       = YES
 # diagrams that involve STL classes more complete and accurate.
 # The default value is: NO.
 
-BUILTIN_STL_SUPPORT    = NO
+BUILTIN_STL_SUPPORT    = YES
 
 # If you use Microsoft's C++/CLI language, you should set this option to YES to
 # enable parsing support.
@@ -409,7 +409,7 @@ LOOKUP_CACHE_SIZE      = 0
 # normally produced when WARNINGS is set to YES.
 # The default value is: NO.
 
-EXTRACT_ALL            = YES
+EXTRACT_ALL            = NO
 
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
 # be included in the documentation.
@@ -421,13 +421,13 @@ EXTRACT_PRIVATE        = YES
 # scope will be included in the documentation.
 # The default value is: NO.
 
-EXTRACT_PACKAGE        = NO
+EXTRACT_PACKAGE        = YES
 
 # If the EXTRACT_STATIC tag is set to YES all static members of a file will be
 # included in the documentation.
 # The default value is: NO.
 
-EXTRACT_STATIC         = NO
+EXTRACT_STATIC         = YES
 
 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
 # locally in source files will be included in the documentation. If set to NO
@@ -460,7 +460,7 @@ EXTRACT_ANON_NSPACES   = NO
 # section is generated. This option has no effect if EXTRACT_ALL is enabled.
 # The default value is: NO.
 
-HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_MEMBERS     = YES
 
 # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
 # undocumented classes that are normally visible in the class hierarchy. If set
@@ -518,7 +518,7 @@ SHOW_INCLUDE_FILES     = YES
 # which file to include in order to use the member.
 # The default value is: NO.
 
-SHOW_GROUPED_MEMB_INC  = NO
+SHOW_GROUPED_MEMB_INC  = YES
 
 # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
 # files with double quotes in the documentation rather than with sharp brackets.
@@ -574,7 +574,7 @@ SORT_GROUP_NAMES       = NO
 # list.
 # The default value is: NO.
 
-SORT_BY_SCOPE_NAME     = NO
+SORT_BY_SCOPE_NAME     = YES
 
 # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
 # type resolution of all parameters of a function it will reject a match between
@@ -584,7 +584,7 @@ SORT_BY_SCOPE_NAME     = NO
 # accept a match between prototype and implementation in such cases.
 # The default value is: NO.
 
-STRICT_PROTO_MATCHING  = NO
+STRICT_PROTO_MATCHING  = YES 
 
 # The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
 # todo list. This list is created by putting \todo commands in the
@@ -710,7 +710,7 @@ WARNINGS               = YES
 # will automatically be disabled.
 # The default value is: YES.
 
-WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_UNDOCUMENTED   = NO
 
 # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
 # potential errors in the documentation, such as not documenting some parameters
@@ -726,7 +726,7 @@ WARN_IF_DOC_ERROR      = YES
 # documentation, but not about the absence of documentation.
 # The default value is: NO.
 
-WARN_NO_PARAMDOC       = NO
+WARN_NO_PARAMDOC       = YES
 
 # The WARN_FORMAT tag determines the format of the warning messages that doxygen
 # can produce. The string should contain the $file, $line, and $text tags, which
@@ -754,7 +754,7 @@ WARN_LOGFILE           =
 # spaces.
 # Note: If this tag is empty the current directory is searched.
 
-INPUT                  = ../..
+INPUT                  = ../../src ../../doc
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -774,7 +774,7 @@ INPUT_ENCODING         = UTF-8
 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
 # *.qsf, *.as and *.js.
 
-FILE_PATTERNS          =
+FILE_PATTERNS          = 
 
 # The RECURSIVE tag can be used to specify whether or not subdirectories should
 # be searched for input files as well.
@@ -805,7 +805,7 @@ EXCLUDE_SYMLINKS       = NO
 # Note that the wildcards are matched against the file with absolute path, so to
 # exclude all test directories for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       = */notUsed/*
+EXCLUDE_PATTERNS       = */notUsed/* */test/*
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -890,7 +890,7 @@ FILTER_SOURCE_PATTERNS =
 # (index.html). This can be useful if you have a project on for instance GitHub
 # and want to reuse the introduction page also for the doxygen output.
 
-USE_MDFILE_AS_MAINPAGE = ../README.md
+USE_MDFILE_AS_MAINPAGE = ../../README.md
 
 #---------------------------------------------------------------------------
 # Configuration options related to source browsing
@@ -1364,7 +1364,7 @@ DISABLE_INDEX          = NO
 # The default value is: NO.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-GENERATE_TREEVIEW      = NO
+GENERATE_TREEVIEW      = YES
 
 # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
 # doxygen will group on one line in the generated HTML documentation.
@@ -1388,7 +1388,7 @@ TREEVIEW_WIDTH         = 250
 # The default value is: NO.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-EXT_LINKS_IN_WINDOW    = NO
+EXT_LINKS_IN_WINDOW    = YES
 
 # Use this tag to change the font size of LaTeX formulas included as images in
 # the HTML documentation. When you change the font size after a successful
@@ -1942,7 +1942,7 @@ INCLUDE_FILE_PATTERNS  =
 # recursively expanded use the := operator instead of the = operator.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-PREDEFINED             = VICKY
+PREDEFINED             = 
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
diff --git a/tools/licences/CCM_license.txt b/tools/licences/CCM_license.txt
new file mode 100644
index 0000000..62fcc1c
--- /dev/null
+++ b/tools/licences/CCM_license.txt
@@ -0,0 +1,8 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
diff --git a/tools/licences/GNU_license.txt b/tools/licences/GNU_license.txt
new file mode 100644
index 0000000..63ca261
--- /dev/null
+++ b/tools/licences/GNU_license.txt
@@ -0,0 +1,22 @@
+/*PGR-GNU*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
diff --git a/tools/licences/MIT_license.txt b/tools/licences/MIT_license.txt
new file mode 100644
index 0000000..4e6bdf4
--- /dev/null
+++ b/tools/licences/MIT_license.txt
@@ -0,0 +1,29 @@
+/*PGR-MIT*****************************************************************
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+------
+MIT/X license
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+********************************************************************PGR-MIT*/
diff --git a/tools/licences/add-licenses b/tools/licences/add-licenses
new file mode 100755
index 0000000..a5e7768
--- /dev/null
+++ b/tools/licences/add-licenses
@@ -0,0 +1,217 @@
+#! /usr/bin/perl -w
+    eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+        if 0; #$running_under_some_shell
+
+use strict;
+use File::Find ();
+use File::Basename;
+
+# Set the variable $File::Find::dont_use_nlink if you're using AFS,
+# since AFS cheats.
+
+# for the convenience of &wanted calls, including -eval statements:
+use vars qw/*name *dir *prune/;
+*name   = *File::Find::name;
+*dir    = *File::Find::dir;
+*prune  = *File::Find::prune;
+
+#sub wanted;
+
+sub Usage {
+    die "Usage: add-licenses dir [exclude.txt]\n";
+}
+
+my $DOUPDATES = 1;
+
+my @files = ();
+my %exclude = (
+);
+
+my $gnu_license = "GNU_license.txt";
+my @GNU_LICENSE = loadLicense($gnu_license);
+my @GNU_BODY = @GNU_LICENSE;
+splice @GNU_BODY, 0, 6;
+
+my $mit_license = "MIT_license.txt";
+my @MIT_LICENSE = loadLicense($mit_license);
+my @MIT_BODY = @MIT_LICENSE;
+splice @MIT_BODY, 0, 6;
+
+my $ccm_license = "CCM_license.txt";
+my @CCM_LICENSE = loadLicense($ccm_license);
+my @CCM_BODY = @CCM_LICENSE;
+splice @CCM_BODY, 0, 1;
+
+my @LICENSE = ();
+my @LICENSE_BODY = ();
+
+my $dir    = shift @ARGV || Usage();
+my $xfile  = shift @ARGV;
+
+if ($xfile) {
+    open(IN, $xfile) || die "Failed to open '$xfile' : $!\n";
+    while (my $x = <IN>) {
+        chomp($x);
+        $exclude{$x} = 1;
+    }
+    close(IN);
+}
+
+# Traverse desired filesystems
+File::Find::find({wanted => \&wanted}, $dir);
+
+for my $file (sort @files) {
+
+    my $f = basename($file);
+    next if $exclude{$f};
+    my $task = get_task($file);
+    next if $task == 0;
+    print "\n\n PROCESSING '$file'\n";
+    update_license($task, $file) if $DOUPDATES;
+}
+
+exit;
+
+
+sub wanted {
+    /^.*\.(h|cpp|c|sql|hpp|rst)\z/s &&
+    push @files, $name;
+}
+
+sub loadLicense {
+    my $file_name = shift;
+    my @file_storage;
+    open(IN, $file_name) || die "Failed to open '$file_name' : $!\n";
+    @file_storage = <IN>;
+    close(IN);
+    return @file_storage;
+}
+
+# When the first line is not equal it doesnt have the
+# generated license.
+# The generated license has to be added
+# And Manually fixed.
+# 
+# When the first line is equal, then we skip up to find
+# The "-------" line in both files
+# The rest of the license must be equal
+#
+sub get_task{
+    my $f = shift;
+
+    open(IN, $f) || return 0;
+
+    my $line = <IN>;
+
+    my $license_type = 0;
+    $license_type = 1 if $GNU_LICENSE[0] eq $line;
+    $license_type = 2 if $MIT_LICENSE[0] eq $line;
+    $license_type = 3 if $CCM_LICENSE[0] eq $line;
+
+    #The license is not found
+    if ($license_type == 0) {
+        close(IN);
+        return 1;
+    }
+
+    # look for the dividing line
+    if ($license_type != 3) {
+        while ($line and ($line ne "------\n")) {
+            $line = <IN>;
+        }
+
+        #The dividing line is not found
+        if (!$line) {
+            close(IN);
+            return 1;
+        }
+    }
+
+    @LICENSE_BODY = @GNU_BODY if $license_type == 1;
+    @LICENSE_BODY = @MIT_BODY if $license_type == 2;
+    @LICENSE_BODY = @CCM_BODY if $license_type == 3;
+
+
+    #The license is found but the body is different
+    for (my $i = 0; $i < @LICENSE_BODY; $i++) {
+
+        $line = <IN>;
+        if ($LICENSE_BODY[$i] ne $line) {
+            close(IN);
+            return 2;
+        }
+    }
+
+    close(IN);
+    #print "License up to date\n";
+    return 0;
+}
+
+# task = 0 Do nothing
+# task = 1 Insert complete license
+# task = 2 Update license body 
+sub update_license {
+    my $task = shift;
+    my $file_name = shift;
+
+    return if $task == 0; 
+
+    # read the file
+    my @file = ();
+    open(IN, $file_name) || die "Failed to read '$file_name' : $!\n";
+    @file = <IN>;
+    close(IN);
+
+    my $license_type = 0;
+    @LICENSE = @GNU_LICENSE;
+    @LICENSE_BODY = @GNU_BODY;
+    if ($file[0] eq  $MIT_LICENSE[0])  {
+        $license_type = 2;
+        @LICENSE = @MIT_LICENSE;
+        @LICENSE_BODY = @MIT_BODY;
+    } elsif ($file[0] eq  $CCM_LICENSE[0])  {
+        $license_type = 3;
+        @LICENSE = @CCM_LICENSE;
+        @LICENSE_BODY = @CCM_BODY;
+    } 
+
+
+
+    if ($task == 1) {
+        print "  Adding full license\n";
+        print "     --> Please remove old license and update names if needed\n";
+        @file = (@LICENSE, @file);
+
+    } else {
+        print "  Changing Body of license\n";
+        #task = 2
+
+
+        # Find the dividing line
+        my $first = 0;
+        my $last = 0;
+        if ($license_type !=3) {
+            while ($file[$first] ne "------\n") {
+                $first++;
+            }
+        } else {
+            $first = 2;
+        }
+
+        $first++;
+        $last = $first;
+
+        # Find the last line
+        while ($file[$last] ne $LICENSE[$#LICENSE]) {
+            $last++;
+        }
+
+        splice @file, $first, $last-$first+1, @LICENSE_BODY;
+
+    }
+    open(OUT, ">$file_name") || die "Failed to rewrite '$file_name' : $!\n";
+    print OUT @file;
+    close(OUT);
+
+}
+
diff --git a/tools/mapserver/arialbd.ttf b/tools/mapserver/arialbd.ttf
deleted file mode 100644
index b7e58f5..0000000
Binary files a/tools/mapserver/arialbd.ttf and /dev/null differ
diff --git a/tools/mapserver/fonts.txt b/tools/mapserver/fonts.txt
deleted file mode 100644
index a7b17cc..0000000
--- a/tools/mapserver/fonts.txt
+++ /dev/null
@@ -1 +0,0 @@
-arial-bold  arialbd.ttf
diff --git a/tools/mapserver/trsp-test-image.map b/tools/mapserver/trsp-test-image.map
deleted file mode 100644
index 6f04367..0000000
--- a/tools/mapserver/trsp-test-image.map
+++ /dev/null
@@ -1,130 +0,0 @@
-MAP
-  NAME "pgRouting Test Mapfile"
-  EXTENT -0.25 -0.25 4.24 4.25
-  SIZE 500 500
-  IMAGECOLOR 238 238 153
-  TRANSPARENT OFF
-#  UNITS PIXELS
-  FONTSET "fonts.txt"
-  CONFIG MS_ERRORFILE "stderr"
-
-  OUTPUTFORMAT
-    NAME agg_qn
-    DRIVER "AGG/PNG"
-    EXTENSION "png"
-    MIMETYPE "image/png"
-    IMAGEMODE RGB
-    FORMATOPTION "INTERLACE=false"
-    FORMATOPTION "QUANTIZE_NEW=ON"
-    FORMATOPTION "QUANTIZE_DITHER=OFF"
-    FORMATOPTION "QUANTIZE_COLORS=256"
-  END
-
-  SYMBOL
-    NAME "circle"
-    TYPE ELLIPSE
-    POINTS 1 1 END
-  END
-
-  SYMBOL
-    NAME "circle-filled"
-    TYPE ELLIPSE
-    FILLED TRUE
-    POINTS 1 1 END
-  END
-
-  SYMBOL
-    NAME "one_way_from"
-    TYPE TRUETYPE
-    FONT "arial-bold"
-    CHARACTER ">"
-    #GAP -40
-  END
-
-  SYMBOL
-    NAME "one_way_to"
-    TYPE TRUETYPE
-    FONT "arial-bold"
-    CHARACTER "<"
-    #GAP -40
-  END
-
-  LAYER
-    NAME "Streets"
-#    DEBUG 5
-    STATUS DEFAULT
-    TYPE LINE
-    CONNECTIONTYPE postgis
-    CONNECTION "user=postgres dbname=trsp_test host=localhost port=5432"
-    DATA "the_geom from (select eid, the_geom from edges1) as foo using srid=-1 using unique eid"
-    LABELITEM 'eid'
-    CLASS
-      STYLE
-        COLOR 87 87 87
-        WIDTH 2
-      END
-      LABEL
-        TYPE BITMAP
-        SIZE medium
-        COLOR 0 0 0
-        POSITION UR
-        OFFSET 2 2
-      END
-    END
-  END
-
-  LAYER
-    NAME "One_Way_Arrows"
-    STATUS DEFAULT
-    TYPE LINE
-    CONNECTIONTYPE postgis
-    CONNECTION "user=postgres dbname=trsp_test host=localhost port=5432"
-    DATA "the_geom from (select eid, dir, the_geom from edges1 where dir != 'B') as foo using srid=-1 using unique eid"
-    CLASSITEM 'dir'
-    CLASS
-      NAME 'From'
-      EXPRESSION "FT"
-      STYLE
-        SYMBOL "one_way_from"
-        COLOR 80 80 80
-        SIZE 8
-        GAP -40
-      END
-    END
-    CLASS
-      NAME 'To'
-      EXPRESSION "TF"
-      STYLE
-        SYMBOL "one_way_to"
-        COLOR 80 80 80
-        SIZE 8
-        GAP -40
-      END
-    END
-  END
-
-  LAYER
-    NAME "Nodes"
-    STATUS DEFAULT
-    TYPE POINT
-    CONNECTIONTYPE postgis
-    CONNECTION "user=postgres dbname=trsp_test host=localhost port=5432"
-    DATA "the_geom from (select source as node, makepoint(x1,y1) as the_geom from edges1 union select target as node, makepoint(x2,y2) as the_geom from edges1) as foo using srid=-1 using unique node"
-    LABELITEM 'node'
-    CLASS
-      STYLE
-        SYMBOL "circle-filled"
-        COLOR 180 80 80
-        SIZE 8
-      END
-      LABEL
-        TYPE BITMAP
-        SIZE medium
-        COLOR 180 0 0
-        POSITION UR
-        OFFSET 6 6
-      END
-    END
-  END
-
-END
diff --git a/tools/mapserver/trsp-test-image.png b/tools/mapserver/trsp-test-image.png
deleted file mode 100644
index e4cd594..0000000
Binary files a/tools/mapserver/trsp-test-image.png and /dev/null differ
diff --git a/tools/mk-signature-file b/tools/mk-signature-file
index 271e09c..5790f50 100755
--- a/tools/mk-signature-file
+++ b/tools/mk-signature-file
@@ -29,6 +29,8 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
 # ------------------------------------------------------------
 
 use strict;
+use warnings;
+
 use Data::Dumper;
 use Cwd qw(cwd chdir);
 
@@ -64,6 +66,13 @@ close(SIG);
 
 exit 0;
 
+sub writeout {
+    my ($file, $data) = @_;
+    open(TMPOUT, ">$file") || die "ERROR: Failed to create '$file' : $!\n";
+    print TMPOUT $data;
+    close(TMPOUT);
+}
+
 # open the input file
 # manipulate it with regular expression to extract what we need
 sub parse_signatures {
@@ -78,6 +87,13 @@ sub parse_signatures {
 
     # manipulate the data with regular expressions
 
+    # delete function bodies
+    $data =~ s{
+        AS\s*\$(BODY)?\$
+        .*?
+        END;?\s*\$(BODY)?\$
+    } []gsxi;
+    writeout('a1', $data) if $DEBUG;
     # delete C style comments
     $data =~ s{
         /\*
@@ -85,7 +101,25 @@ sub parse_signatures {
         \*/
     } []gsx;
     # delete sql comments
+    writeout('aa', $data) if $DEBUG;
+    $data =~ s/^--[^\n]*\n//mgs;
+    writeout('aa1', $data) if $DEBUG;
+    $data =~ s/^ +//mgs;
+    writeout('bb', $data) if $DEBUG;
+    # remove all text enclosed in single quotes(')
+    $data =~ s/'[^\']*'/''/gs;
+    # remove the default clauses
+    {
+        # temporarily disable warnings for the next command
+        # because either $2 OR $3 will always be uninitialized
+        no warnings 'uninitialized';
+        $data =~ s/\bdefault\s*[^,)]+((,)|\)\s*(\)))/$2$3/igs;
+    }
+    # and now clean up the other cases
+    $data =~ s/\bdefault[^)]+\)/\)/igs;
+    writeout('cc', $data) if $DEBUG;
     $data =~ s/--[^\n]*\n//gs;
+    writeout('dd', $data) if $DEBUG;
 
     # extract TYPEs
 
@@ -110,15 +144,13 @@ sub parse_signatures {
 
     # extract all "create or replace function <name>(<args>) returns"
     # and sort them
-    my @funcs = $data =~ /create\s+or\s+replace\s+function\s+(\w+\s*\([^\)]+\))\s*RETURNS/igs;
+    my @funcs = $data =~ /create\s+or\s+replace\s+function\s+(\w+\s*\([^\)]*\))/igs;
     @funcs = sort @funcs;
 
     # clean up functions
     for (my $i=0; $i<@funcs; $i++) {
         # compress multiple white spaces into a single <space>
         $funcs[$i] =~ s/\s+/ /gs;
-        # remove DEFAULT clauses
-        $funcs[$i] =~ s/\sdefault\s*((?:\()[^\)]+\)|[^\(\),]+)//ig;
         # remove argument names and keep IN|OUT and type name
         $funcs[$i] =~ s/(IN|OUT)\s(\w+)\s([^,\)]+)/$1 $3/ig;
         # remove <space> following "("
diff --git a/tools/performanceQueries/allPairs-performance.sql b/tools/performanceQueries/allPairs-performance.sql
new file mode 100644
index 0000000..1f09835
--- /dev/null
+++ b/tools/performanceQueries/allPairs-performance.sql
@@ -0,0 +1,244 @@
+/* 
+Performance for pgr_floydWarshall & pgr_Johnson
+
+Using a bounding box
+
+create or replace function fw_j_statsQuery(low , delta , max , m , query_sql text)
+
+starts from low edges
+each change is with delta edges
+ends with max edges
+each query is executed M times
+query_sql the query
+
+RETURNS
+ avg_rows average numbers of rows returned
+ lim      limit used
+ avgt     average seconds to perform the query
+ err      error if any
+
+
+Example usage
+
+select * from fw_j_BB_statsQuery(0.001 , 0.001, 0.01, 1,
+ 'pgr_floydWarshall','select gid AS id, source, target, cost, reverse_cost from ways');
+
+select * from fw_j_BB_statsQuery(0.001 , 0.001, 0.01, 1,
+ 'pgr_johnson','select gid AS id, source, target, cost, reverse_cost from ways');
+
+*/
+
+
+
+create or replace function fw_j_BB_statsQuery(low FLOAT, delta FLOAT, max FLOAT, n integer, fn text, query_sql text)
+returns TABLE (
+   seq    INTEGER,
+   avg_rows FLOAT,
+   cnt_edge_rows BIGINT,
+   lim   FLOAT,
+   avgt   FLOAT,
+   density FLOAT,
+   err text) AS
+
+$body$
+DECLARE
+  time1 time;
+  time2 time;
+  sumt float;
+  deltaTime time;
+  info record;
+  sql TEXT;
+BEGIN
+    lim := low;
+    seq := 1;
+    LOOP 
+        EXIT WHEN lim > max;
+        
+        sql =
+            'WITH  buffer AS (SELECT ST_Buffer(ST_Centroid(ST_Extent(the_geom)),' || lim || ') as geom FROM ways),
+                bbox AS (SELECT ST_Envelope(ST_Extent(geom)) as box from buffer),
+                query AS (' || query_sql || ' where the_geom && (SELECT box from bbox))
+            SELECT count(*) AS cnt FROM query';
+        EXECUTE sql INTO info;
+        cnt_edge_rows := info.cnt;
+        sql =
+            'WITH  buffer AS (SELECT ST_Buffer(ST_Centroid(ST_Extent(the_geom)),' || lim || ') as geom FROM ways),
+                bbox AS (SELECT ST_Envelope(ST_Extent(geom)) as box from buffer),
+                query AS (' || query_sql || ' where the_geom && (SELECT box from bbox)),
+                edges1 AS (SELECT count(*) AS cnt1 FROM query where cost > 0),
+                edges2 AS (SELECT count(*) AS cnt2 FROM query where reverse_cost > 0)
+            SELECT cnt1 + cnt2 AS cnt FROM edges1 , edges2';
+        EXECUTE sql INTO info;
+        density := info.cnt;
+        sql =
+            'WITH  buffer AS (SELECT ST_Buffer(ST_Centroid(ST_Extent(the_geom)),' || lim || ') as geom FROM ways),
+                bbox AS (SELECT ST_Envelope(ST_Extent(geom)) as box from buffer),
+                query AS (' || query_sql || ' where the_geom && (SELECT box from bbox)),
+                s_vertices AS (SELECT DISTINCT source AS vertex FROM query),
+                t_vertices AS (SELECT DISTINCT target AS vertex FROM query),
+                vertices AS ( SELECT vertex FROM (
+                    (SELECT * FROM s_vertices)
+                    UNION 
+                    (SELECT * FROM t_vertices)) AS a)
+            SELECT count(*) AS cnt FROM vertices';
+        EXECUTE sql INTO info;
+        density := density / (info.cnt * (info.cnt - 1)); 
+
+        sql = 'SELECT count(*) as cnt from ' || fn || '(
+            ''WITH  buffer AS (SELECT ST_Buffer(ST_Centroid(ST_Extent(the_geom)),' || lim || ') as geom FROM ways),
+                bbox AS (SELECT ST_Envelope(ST_Extent(geom)) as box from buffer)
+            ' || query_sql || ' where the_geom && (SELECT box from bbox)'')';
+
+        -- RAISE notice '%', sql;
+        sumt := 0;
+        avg_rows = 0;
+        FOR j in 1 .. n LOOP
+                -- notice just to inform that we are working because it takes a lot of time
+                IF (j % 5 =  0) THEN RAISE NOTICE 'Running test %, % with limit % ', seq, j, lim; END IF;
+                time1 := clock_timestamp();
+
+                BEGIN
+                    execute sql into info;
+                    EXCEPTION WHEN OTHERS THEN
+                        err = SQLERRM;
+                END;
+                time2 := clock_timestamp();
+                avg_rows := avg_rows + info.cnt;
+                deltaTime := time2 - time1;
+                sumt = sumt + extract(epoch from deltaTime);
+        END LOOP;
+        avgt := sumt/n;
+        avg_rows := avg_rows/n;
+        raise notice '% % % % % %', seq, avg_rows, cnt_edge_rows, density, lim, avgt;
+        RETURN next;
+        seq := seq + 1;
+        lim = lim + delta;
+    END LOOP;
+
+END
+$body$ language plpgsql volatile strict   cost 100 rows 100;
+
+
+
+
+/* 
+Performance for pgr_floydWarshall & pgr_Johnson
+
+Not using a bounding box
+
+create or replace function fw_j_statsQuery(low , delta , max , m , query_sql text)
+
+starts from low edges
+each change is with delta edges
+ends with max edges
+each query is executed M times
+query_sql the query
+
+RETURNS
+avg_rows average numbers of rows returned
+lim      limit used
+avgt     average seconds to perform the query
+err      error if any
+
+
+Example usage
+
+select * from fw_j_statsQuery(100 , 100, 200, 1,
+    'pgr_floydWarshall','select gid as id, source, target, cost, reverse_cost from ways order by id');
+
+select * from fw_j_statsQuery(100 , 100, 200, 1,
+    'pgr_johnson','select gid as id, source, target, cost, reverse_cost from ways order by id');
+
+     */
+
+
+
+    create or replace function fw_j_statsQuery(low integer, delta integer, max integer, n integer, fn text, query_sql text)
+    returns TABLE (
+        seq    INTEGER,
+        avg_rows float,
+        cnt_edge_rows BIGINT,
+        lim   integer,
+        avgt   float,
+        density FLOAT,
+        err text) AS
+
+    $body$
+    DECLARE
+    time1 time;
+    time2 time;
+    sumt float;
+    deltaTime time;
+    info record;
+    sql TEXT;
+    BEGIN
+        lim := low;
+        seq := 1;
+        LOOP 
+            EXIT WHEN lim > max;
+
+            sql := '
+                WITH
+                    edges AS (' || query_sql || ')
+                SELECT count(*) as cnt from edges where id <= ' || lim;
+            EXECUTE sql INTO info;
+            cnt_edge_rows := info.cnt;
+
+            sql := '
+                WITH
+                    edges AS (' || query_sql || '),
+                    query AS ( SELECT * from edges where id <= ' || lim || '),
+                    edges1 AS (SELECT count(*) AS cnt1 FROM query where cost > 0),
+                    edges2 AS (SELECT count(*) AS cnt2 FROM query where reverse_cost > 0)
+                SELECT cnt1 + cnt2 AS cnt FROM edges1 , edges2';
+            EXECUTE sql INTO info;
+            density := info.cnt;
+                    
+            sql := '
+                WITH
+                    edges AS (' || query_sql || '),
+                    query AS (SELECT * from edges where id <= ' || lim || '),
+                    s_vertices AS ( SELECT DISTINCT source AS vertex FROM edges),
+                    t_vertices AS ( SELECT DISTINCT target AS vertex FROM edges),
+                    vertices AS ( SELECT vertex FROM (
+                        (SELECT * FROM s_vertices)
+                        UNION 
+                        (SELECT * FROM t_vertices)) AS a)
+                SELECT count(*) AS cnt FROM vertices';
+            EXECUTE sql INTO info;
+            density := density / (info.cnt * (info.cnt - 1)); 
+            
+            sql := '
+                SELECT count(*) as cnt from ' || fn || '(
+                    ''WITH
+                        edges AS (' || query_sql || ')
+                    SELECT * from edges where id <= ' || lim || ' '' )';
+            -- raise notice '%', sql;
+            sumt := 0;
+            avg_rows = 0;
+            FOR j in 1 .. n
+                LOOP
+                    -- notice just to inform that we are working because it takes a lot of time
+                    if (j % 5 =  0) THEN RAISE NOTICE 'Running test %, % with limit % ', seq, j, lim; END IF;
+                        time1 := clock_timestamp();
+
+                        BEGIN
+                            execute sql into info;
+                            EXCEPTION WHEN OTHERS THEN
+                                err = SQLERRM;
+                    END;
+                    avg_rows := avg_rows + info.cnt;
+                    time2 := clock_timestamp();
+                    deltaTime := time2 - time1;
+                    sumt = sumt + extract(epoch from deltaTime);
+                    END LOOP;
+                    avgt := sumt/n;
+                    avg_rows := avg_rows/n;
+                    raise notice '% % % %', seq, avg_rows, lim, avgt;
+                    return next;
+                    seq := seq + 1;
+                    lim = lim + delta;
+                    END LOOP;
+
+                    END
+                    $body$ language plpgsql volatile strict   cost 100 rows 100;
diff --git a/tools/sigs/pgrouting--2.0.1.sig b/tools/sigs/pgrouting--2.0.1.sig
new file mode 100644
index 0000000..ec900ca
--- /dev/null
+++ b/tools/sigs/pgrouting--2.0.1.sig
@@ -0,0 +1,36 @@
+#VERSION pgrouting 2.0.1
+#TYPES
+pgr_costResult(integer,integer,integer,float8)
+pgr_costResult3(integer,integer,integer,integer,float8)
+pgr_geomResult(integer,integer,integer,geometry)
+#FUNCTIONS
+pgr_alphashape(text,out float8,out float8)
+pgr_analyzeoneway(text,text[],text[],text[],text[],boolean,text,text,text)
+pgr_analyzegraph(text,double precision,text,text,text,text,text)
+pgr_apspjohnson(text)
+pgr_apspwarshall(text,boolean,boolean)
+pgr_astar(text,integer,integer,boolean,boolean)
+pgr_bdastar(text,integer,integer,boolean,boolean)
+pgr_bddijkstra(text,integer,integer,boolean,boolean)
+pgr_createtopology(text,double precision,text,text,text,text,text)
+pgr_createverticestable(text,text,text,text,text)
+pgr_dijkstra(text,integer,integer,boolean,boolean)
+pgr_drivingdistance(text,integer,float8,boolean,boolean)
+pgr_endpoint(geometry)
+pgr_getcolumnname(text,text)
+pgr_gettablename(in text,out text,out text)
+pgr_iscolumnintable(text,text)
+pgr_kdijkstracost(text,integer,integer array,boolean,boolean)
+pgr_kdijkstrapath(text,integer,integer array,boolean,boolean)
+pgr_ksp(text,integer,integer,integer,boolean)
+pgr_makedistancematrix(text,out double precision[],out integer[])
+pgr_nodenetwork(text,double precision,text,text,text)
+pgr_pointtoid(geometry,double precision,text,integer)
+pgr_pointsaspolygon(varchar)
+pgr_quote_ident(text)
+pgr_startpoint(geometry)
+pgr_trsp(text,integer,float8,integer,float8,boolean,boolean,text)
+pgr_trsp(text,integer,integer,boolean,boolean,text)
+pgr_tsp(float8[][],integer,integer,out integer,out integer)
+pgr_tsp(text,integer,integer)
+pgr_versionless(text,text)
diff --git a/tools/sigs/pgrouting--2.1.0.sig b/tools/sigs/pgrouting--2.1.0.sig
index b33d132..a6a67bf 100644
--- a/tools/sigs/pgrouting--2.1.0.sig
+++ b/tools/sigs/pgrouting--2.1.0.sig
@@ -4,11 +4,11 @@ pgr_costResult(integer,integer,integer,float8)
 pgr_costResult3(integer,integer,integer,integer,float8)
 pgr_geomResult(integer,integer,integer,geometry)
 #FUNCTIONS
-_pgr_checkverttab(text,text[],in int,in text,out text,out text)
-_pgr_createindex(text,text,text,text,in int,in text)
-_pgr_createindex(text,text,text,text,in int,in text)
-_pgr_createindex(text,text,text,in int,in text)
-_pgr_createindex(text,text,text,in int,in text)
+_pgr_checkverttab(text,text[],in int ,in text ,out text,out text)
+_pgr_createindex(text,text,text,text,in int ,in text )
+_pgr_createindex(text,text,text,text,in int ,in text )
+_pgr_createindex(text,text,text,in int ,in text )
+_pgr_createindex(text,text,text,in int ,in text )
 _pgr_dijkstra(text,bigint,bigint,boolean,boolean,out integer,out integer,out bigint,out bigint,out float,out float)
 _pgr_dijkstra(text,bigint,anyarray,boolean,boolean,out integer,out integer,out bigint,out bigint,out bigint,out float,out float)
 _pgr_dijkstra(text,anyarray,anyarray,boolean,boolean,out integer,out integer,out bigint,out bigint,out bigint,out bigint,out float,out float)
@@ -16,39 +16,40 @@ _pgr_dijkstra(text,anyarray,bigint,boolean,boolean,out integer,out integer,out b
 _pgr_drivingdistance(text,anyarray,float8,boolean,boolean,boolean,out integer,out bigint,out bigint,out bigint,out float,out float)
 _pgr_drivingdistance(text,bigint,float8,boolean,boolean,out integer,out bigint,out bigint,out float,out float)
 _pgr_endpoint(geometry)
-_pgr_getcolumnname(text,text,text,in int,in text)
-_pgr_getcolumnname(text,text,in int,in text)
-_pgr_getcolumntype(text,text,in int,in text)
-_pgr_gettablename(in text,in int,in text,out text,out text)
+_pgr_getcolumnname(text,text,text,in int ,in text )
+_pgr_getcolumnname(text,text,in int ,in text )
+_pgr_getcolumntype(text,text,text,in int ,in text )
+_pgr_getcolumntype(text,text,in int ,in text )
+_pgr_gettablename(in text,in int ,in text ,out text,out text)
 _pgr_iscolumnintable(text,text)
-_pgr_iscolumnindexed(text,text,text,in int,in text)
-_pgr_iscolumnindexed(text,text,in int,in text)
+_pgr_iscolumnindexed(text,text,text,in int ,in text )
+_pgr_iscolumnindexed(text,text,in int ,in text )
 _pgr_ksp(text,bigint,bigint,integer,boolean,boolean,out integer,out integer,out integer,out bigint,out bigint,out float,out float)
-_pgr_msg(in int,in text,in text(sname text,text,text,in int,in text)
-_pgr_onerror(in boolean,in int,in text,in text,in text,in text)
-_pgr_parameter_check(text,text,boolean)
+_pgr_msg(in int,in text,in text )
+_pgr_onerror(in boolean,in int,in text,in text,in text ,in text )
+_pgr_parameter_check(text,text,boolean )
 _pgr_pointtoid(geometry,double precision,text,integer)
 _pgr_quote_ident(text)
 _pgr_startpoint(geometry)
 _pgr_versionless(text,text)
-pgr_alphashape(text,float8,out float8,out float8)
-pgr_analyzeoneway(text,text[],text[],text[],text[],boolean,text,text,text)
-pgr_analyzegraph(text,double precision,text,text,text,text,text)
+pgr_alphashape(text,float8 ,out float8,out float8)
+pgr_analyzeoneway(text,text[],text[],text[],text[],boolean ,text ,text ,text )
+pgr_analyzegraph(text,double precision,text ,text ,text ,text ,text )
 pgr_apspjohnson(text)
 pgr_apspwarshall(text,boolean,boolean)
 pgr_astar(text,integer,integer,boolean,boolean)
 pgr_bdastar(text,integer,integer,boolean,boolean)
 pgr_bddijkstra(text,integer,integer,boolean,boolean)
-pgr_createtopology(text,double precision,text,text,text,text,text,boolean)
-pgr_createverticestable(text,text,text,text,text)
+pgr_createtopology(text,double precision,text ,text ,text ,text ,text ,boolean )
+pgr_createverticestable(text,text ,text ,text ,text )
 pgr_dijkstra(text,bigint,bigint,out integer,out integer,out bigint,out bigint,out float,out float)
 pgr_dijkstra(text,bigint,bigint,boolean,out integer,out integer,out bigint,out bigint,out float,out float)
 pgr_dijkstra(text,bigint,bigint,boolean,boolean)
-pgr_dijkstra(text,bigint,anyarray,boolean,out integer,out integer,out bigint,out bigint,out bigint,out float,out float)
-pgr_dijkstra(text,anyarray,bigint,boolean,out integer,out integer,out bigint,out bigint,out bigint,out float,out float)
-pgr_dijkstra(text,anyarray,anyarray,boolean,out integer,out integer,out bigint,out bigint,out bigint,out bigint,out float,out float)
+pgr_dijkstra(text,bigint,anyarray,boolean ,out integer,out integer,out bigint,out bigint,out bigint,out float,out float)
+pgr_dijkstra(text,anyarray,bigint,boolean ,out integer,out integer,out bigint,out bigint,out bigint,out float,out float)
+pgr_dijkstra(text,anyarray,anyarray,boolean ,out integer,out integer,out bigint,out bigint,out bigint,out bigint,out float,out float)
 pgr_drivingdistance(text,bigint,float8,boolean,boolean)
-pgr_drivingdistance(text,anyarray,float8,boolean,boolean,out integer,out bigint,out bigint,out bigint,out float,out float)
+pgr_drivingdistance(text,anyarray,float8,boolean ,boolean ,out integer,out bigint,out bigint,out bigint,out float,out float)
 pgr_drivingdistance(text,bigint,float8,out integer,out bigint,out bigint,out float,out float)
 pgr_drivingdistance(text,bigint,float8,boolean,out integer,out bigint,out bigint,out float,out float)
 pgr_endpoint(geometry)
@@ -60,21 +61,28 @@ pgr_iscolumnintable(text,text)
 pgr_iscolumnindexed(text,text)
 pgr_kdijkstracost(text,integer,integer array,boolean,boolean)
 pgr_kdijkstrapath(text,integer,integer array,boolean,boolean)
-pgr_ksp(text,bigint,bigint,integer,boolean,boolean,out integer,out integer,out integer,out bigint,out bigint,out float,out float)
+pgr_ksp(text,bigint,bigint,integer,boolean ,boolean ,out integer,out integer,out integer,out bigint,out bigint,out float,out float)
 pgr_ksp(text,integer,integer,integer,boolean)
-pgr_labelgraph(text,text,text,text,text,text)
-pgr_nodenetwork(text,double precision,text,text,text)
-pgr_pointsaspolygon(varchar,float8)
+pgr_labelgraph(text,text ,text ,text ,text ,text )
+pgr_makedistancematrix(text,out double precision[],out integer[])
+pgr_nodenetwork(text,double precision,text ,text ,text )
+pgr_pointsaspolygon(varchar,float8 )
+pgr_pointstodmatrix(geometry[],integer )
+pgr_pointstovids(geometry[],text,float8 )
 pgr_pointtoedgenode(text,geometry,float8)
 pgr_quote_ident(text)
 pgr_startpoint(geometry)
-pgr_trsp(text,integer,float8,integer,float8,boolean,boolean,text)
-pgr_trsp(text,integer,integer,boolean,boolean,text)
-pgr_trsp(text,integer[],float8[],boolean,boolean,text)
-pgr_trsp(text,integer[],boolean,boolean,text)
-pgr_trspviaedges(text,integer[],float8[],boolean,boolean,text)
-pgr_trspviavertices(text,integer[],boolean,boolean,text)
-pgr_tsp(float8[][],integer,integer,out integer,out integer)
+pgr_texttopoints(text,integer )
+pgr_trsp(text,integer,float8,integer,float8,boolean,boolean,text )
+pgr_trsp(text,integer,integer,boolean,boolean,text )
+pgr_trsp(text,integer[],float8[],boolean,boolean,text )
+pgr_trsp(text,integer[],boolean,boolean,text )
+pgr_trspviaedges(text,integer[],float8[],boolean,boolean,text )
+pgr_trspviavertices(text,integer[],boolean,boolean,text )
+pgr_tsp(float8[][],integer,integer ,out integer,out integer)
+pgr_tsp(text,integer,integer )
+pgr_version()
 pgr_versionless(text,text)
 pgr_vidstodmatrix(text,integer[],bool,bool,bool)
+pgr_vidstodmatrix(in integer[],in geometry[],in text,float8 )
 pgr_vrponedepot(text,text,text,integer,out integer,out integer,out integer,out integer,out integer)
diff --git a/tools/template/create.sh b/tools/template/create.sh
new file mode 100644
index 0000000..92c4687
--- /dev/null
+++ b/tools/template/create.sh
@@ -0,0 +1,124 @@
+#!/bin/bash
+
+
+#dont put pgr_ on MY_FUNCTION_NAME that is done automatically
+MY_FUNCTION_NAME="funnyDijkstra"
+DEVELOPER_NAME="Celia Virginia Vergara Castillo"
+DEVELOPER_EMAIL="vicky_vergara at hotmail.com" 
+YEAR="2015"
+
+# Notice the "\n     " (change line and four spaces) after each comma
+# first line are the inputs
+# second line are the outputs
+MY_QUERY_LINE1="edges_sql TEXT,\n    start_pid BIGINT,\n    end_pids ANYARRAY,\n    directed BOOLEAN DEFAULT true,"
+MY_QUERY_LINE2="OUT seq INTEGER,\n    OUT path_seq INTEGER,\n    OUT start_vid BIGINT,\n    OUT end_vid BIGINT,\n    OUT node BIGINT,\n    OUT edge BIGINT,\n    OUT cost FLOAT,\n    OUT agg_cost FLOAT"
+
+
+MY_RETURN_VALUE_TYPE="General_path_element_t" 
+MY_FUNCTION_NAME_UPPER=$(echo $MY_FUNCTION_NAME | tr 'a-z' 'A-Z')
+
+#the above variables must be defined
+
+if test -z "$MY_FUNCTION_NAME"; then 
+	exit
+fi
+
+#if a directory named MY_FUNCTION_NAME exist we stop
+if [ -d "$MY_FUNCTION_NAME" ]; then
+        echo "directory exists please delete first"
+	exit
+fi
+if [ -d ../../src/"$MY_FUNCTION_NAME" ]; then
+        echo "directory exists please delete first"
+	exit
+fi
+
+mkdir "$MY_FUNCTION_NAME"
+
+#copy the subdirectories
+cp -r sql  "$MY_FUNCTION_NAME"
+cp -r doc  "$MY_FUNCTION_NAME"
+cp -r test  "$MY_FUNCTION_NAME"
+cp -r  src  "$MY_FUNCTION_NAME"
+cp CMakeLists.txt  "$MY_FUNCTION_NAME"
+
+
+
+#####   SQL   #########
+echo "updating the /sql/CMakeLists.txt"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/sql/CMakeLists.txt
+
+# /sql/function1.sql   
+echo "Updating the .sql in sql"
+sed -i "s/MY_QUERY_LINE1/$MY_QUERY_LINE1/" "$MY_FUNCTION_NAME"/sql/function1.sql
+sed -i "s/MY_QUERY_LINE2/$MY_QUERY_LINE2/" "$MY_FUNCTION_NAME"/sql/function1.sql
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/sql/function1.sql
+sed -i "s/DEVELOPER_NAME/$DEVELOPER_NAME/" "$MY_FUNCTION_NAME"/sql/function1.sql
+sed -i "s/DEVELOPER_EMAIL/$MY_DEVELOPER_EMAIL/" "$MY_FUNCTION_NAME"/sql/function1.sql
+sed -i "s/YEAR/$YEAR/" "$MY_FUNCTION_NAME"/sql/function1.sql
+mv "$MY_FUNCTION_NAME"/sql/function1.sql "$MY_FUNCTION_NAME"/sql/"$MY_FUNCTION_NAME".sql
+
+
+#####   SRC   #########
+echo "updating the /sql/CMakeLists.txt"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/src/CMakeLists.txt
+
+echo "updating the function1.c file in src"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/src/function1.c
+sed -i "s/DEVELOPER_NAME/$DEVELOPER_NAME/" "$MY_FUNCTION_NAME"/src/function1.c
+sed -i "s/DEVELOPER_EMAIL/$MY_DEVELOPER_EMAIL/" "$MY_FUNCTION_NAME"/src/function1.c
+sed -i "s/YEAR/$YEAR/" "$MY_FUNCTION_NAME"/src/function1.c
+sed -i "s/MY_QUERY_LINE1/$MY_QUERY_LINE1/" "$MY_FUNCTION_NAME"/src/function1.c
+sed -i "s/MY_QUERY_LINE2/$MY_QUERY_LINE2/" "$MY_FUNCTION_NAME"/src/function1.c
+sed -i "s/MY_RETURN_VALUE_TYPE/$MY_RETURN_VALUE_TYPE/" "$MY_FUNCTION_NAME"/src/function1.c
+mv "$MY_FUNCTION_NAME"/src/function1.c "$MY_FUNCTION_NAME"/src/"$MY_FUNCTION_NAME".c
+
+echo "updating the src/function1_driver.h"
+sed -i "s/MY_FUNCTION_NAME_UPPER/$MY_FUNCTION_NAME_UPPER/g" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/DEVELOPER_NAME/$DEVELOPER_NAME/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/DEVELOPER_EMAIL/$MY_DEVELOPER_EMAIL/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/YEAR/$YEAR/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/MY_QUERY_LINE1/$MY_QUERY_LINE1/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/MY_QUERY_LINE2/$MY_QUERY_LINE2/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+sed -i "s/MY_RETURN_VALUE_TYPE/$MY_RETURN_VALUE_TYPE/" "$MY_FUNCTION_NAME"/src/function1_driver.h
+mv "$MY_FUNCTION_NAME"/src/function1_driver.h "$MY_FUNCTION_NAME"/src/"$MY_FUNCTION_NAME"_driver.h
+
+echo "updating the src/function1_driver.cpp"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+sed -i "s/DEVELOPER_NAME/$DEVELOPER_NAME/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+sed -i "s/DEVELOPER_EMAIL/$MY_DEVELOPER_EMAIL/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+sed -i "s/YEAR/$YEAR/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+sed -i "s/MY_QUERY_LINE1/$MY_QUERY_LINE1/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+sed -i "s/MY_QUERY_LINE2/$MY_QUERY_LINE2/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+sed -i "s/MY_RETURN_VALUE_TYPE/$MY_RETURN_VALUE_TYPE/" "$MY_FUNCTION_NAME"/src/function1_driver.cpp
+mv "$MY_FUNCTION_NAME"/src/function1_driver.cpp "$MY_FUNCTION_NAME"/src/"$MY_FUNCTION_NAME"_driver.cpp
+
+#####   DOC   #########
+
+echo "updating the doc/pgr_function1.cpp"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/doc/pgr_function1.rst
+sed -i "s/YEAR/$YEAR/" "$MY_FUNCTION_NAME"/doc/pgr_function1.rst
+sed -i "s/MY_QUERY_LINE1/$MY_QUERY_LINE1/" "$MY_FUNCTION_NAME"/doc/pgr_function1.rst
+sed -i "s/MY_QUERY_LINE2/$MY_QUERY_LINE2/" "$MY_FUNCTION_NAME"/doc/pgr_function1.rst
+mv "$MY_FUNCTION_NAME"/doc/pgr_function1.rst "$MY_FUNCTION_NAME"/doc/pgr_"$MY_FUNCTION_NAME".rst
+
+#####   DOC   #########
+
+echo "updating test/test.conf"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/test/test.conf
+
+echo "updating test/test.conf"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/test/doc-function1.test.sql
+sed -i "s/MY_QUERY_LINE1/$MY_QUERY_LINE1/" "$MY_FUNCTION_NAME"/test/doc-function1.test.sql
+sed -i "s/MY_QUERY_LINE2/$MY_QUERY_LINE2/" "$MY_FUNCTION_NAME"/test/doc-function1.test.sql
+
+echo "updating the test/pgtap/types-check.sql"
+sed -i "s/MY_FUNCTION_NAME/$MY_FUNCTION_NAME/" "$MY_FUNCTION_NAME"/test/pgtap/types-check.sql
+
+mv "$MY_FUNCTION_NAME"/test/doc-function1.test.sql "$MY_FUNCTION_NAME"/test/doc-"$MY_FUNCTION_NAME".test.sql
+mv "$MY_FUNCTION_NAME"/test/doc-function1.result "$MY_FUNCTION_NAME"/test/doc-"$MY_FUNCTION_NAME".result
+
+#move the whole structure to its place
+mv "$MY_FUNCTION_NAME" ../../src/"$MY_FUNCTION_NAME"
+exit
diff --git a/src/kdijkstra/test/CMakeLists.txt b/tools/template/doc/CMakeLists.txt
similarity index 100%
rename from src/kdijkstra/test/CMakeLists.txt
rename to tools/template/doc/CMakeLists.txt
diff --git a/tools/template/doc/pgr_function1.rst b/tools/template/doc/pgr_function1.rst
new file mode 100644
index 0000000..5758515
--- /dev/null
+++ b/tools/template/doc/pgr_function1.rst
@@ -0,0 +1,284 @@
+..
+   ****************************************************************************
+    pgRouting Manual
+    Copyright(c) pgRouting Contributors
+
+    This documentation is licensed under a Creative Commons Attribution-Share
+    Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
+   ****************************************************************************
+
+   INSTRUCTIONS
+   - if section consists of only one value then use this file as index.rst
+   - change [...] (including the square braquets) to appropiate values
+   - one file / function,  may signatures of the same function go in the same file
+
+.. _pgr_MY_FUNCTION_NAME:
+
+pgr_MY_FUNCTION_NAME
+===============================================================================
+
+
+Name
+-------------------------------------------------------------------------------
+
+``pgr_MY_FUNCTION_NAME`` — [medium description of
+function1 it can span many
+lines]
+
+.. warning::  This is a proposed function.
+
+     - Is not officially in the current release
+
+
+..
+   keep if uses boost (this is a comment)
+
+.. figure:: ../../../doc/src/introduction/images/boost-inside.jpeg
+   :target: http://www.boost.org/libs/graph
+
+   Boost Graph Inside
+
+
+Synopsis
+-------------------------------------------------------------------------------
+
+Very long description of function
+
+..
+   SPHINX manual
+   http://www.sphinx-doc.org/en/stable/rest.html
+
+
+Characteristics:
+----------------
+
+..
+   Here is a sample of the kind of information in this section:
+
+The main Characteristics are:
+  - Process is done only on edges with positive costs.
+  - Values are returned when there is a path.
+
+    - When the starting vertex and ending vertex are the same, there is no path.
+
+      - The `agg_cost` the non included values `(v, v)` is `0`
+
+    - When the starting vertex and ending vertex are the different and there is no path:
+
+      - The `agg_cost` the non included values `(u, v)` is :math:`\infty`
+
+  - For optimization purposes, any duplicated value in the `start_vids` or `end_vids` are ignored.
+
+  - The returned values are ordered:
+
+    - `start_vid` ascending
+    - `end_vid` ascending
+
+  - Runing time: :math:`O(| start\_vids | * (V \log V + E))`
+
+Signature Summary
+-----------------
+
+..
+   If the function has more than one signature
+   Remove the unneseary parts of the signature, just leving the name of the parameters
+   Like in these examples
+
+.. code-block:: none
+
+    pgr_MY_FUNCTION_NAME(edges_sql, start_vid,  end_vids)
+    pgr_MY_FUNCTION_NAME(edges_sql, start_vids, end_vids, directed:=true)
+    RETURNS SET OF (seq, path_seq [, start_vid] [, end_vid], node, edge, cost, agg_cost)
+      OR EMPTY SET
+
+
+..
+  This is a reminder of how your query looks like
+  pgr_MY_FUNCTION_NAME(
+    MY_QUERY_LINE1
+    MY_QUERY_LINE2)
+
+
+Signatures
+===============================================================================
+
+.. index:: 
+    single: pgr_MY_FUNCTION_NAME(edges_sql, start_vid,  end_vids) - proposed
+
+Minimal signature
+-----------------
+
+
+..
+   Small description, example:
+
+The minimal signature is for a **directed** graph from one ``start_vid`` to many ``end_vids``:
+
+.. code-block:: none
+
+    pgr_MY_FUNCTION_NAME(edges_sql, start_vid,  end_vids)
+    RETURNS SET OF (seq, path_seq [, start_vid] [, end_vid], node, edge, cost, agg_cost)
+      OR EMPTY SET
+
+:Example:
+
+.. literalinclude:: doc-MY_FUNCTION_NAME.queries
+   :start-after: --q1
+   :end-before: --q2
+
+
+Complete signature
+------------------
+
+This signature performs a .....
+
+  -  on a **directed** graph when ``directed`` flag is missing or is set to ``true``.
+  -  on an **undirected** graph when ``directed`` flag is set to ``false``.
+
+.. index:: 
+    single: pgr_MY_FUNCTION_NAME(edges_sql, start_vids, end_vids, directed:=true) - proposed
+
+.. code-block:: none
+
+    pgr_MY_FUNCTION_NAME(  [parameters],
+        boolean directed:=true);
+    RETURNS SET OF ( [output] ) or EMPTY SET
+
+
+:Example:
+
+.. literalinclude:: doc-MY_FUNCTION_NAME.queries
+   :start-after: --q2
+   :end-before: --q3
+
+Description of the Signatures
+=============================
+
+..
+   DELETE / ADD DEPENDING ON YOUR REQUIREMENTS
+
+Description of the SQL query
+-------------------------------------------------------------------------------
+
+:edges_sql: an SQL query, which should return a set of rows with the following columns:
+
+================  ===================   =================================================
+Column            Type                  Description
+================  ===================   =================================================
+**id**            ``ANY-INTEGER``       Identifier of the edge.
+**source**        ``ANY-INTEGER``       Identifier of the first end point vertex of the edge.
+**target**        ``ANY-INTEGER``       Identifier of the second end point vertex of the edge.
+**cost**          ``ANY-NUMERICAL``     Weight of the edge `(source, target)`, If negative: edge `(source, target)` does not exist, therefore it's not part of the graph.
+**reverse_cost**  ``ANY-NUMERICAL``     (optional) Weight of the edge `(target, source)`, If negative: edge `(target, source)` does not exist, therefore it's not part of the graph.
+================  ===================   =================================================
+
+Description of the Points SQL query
+-------------------------------------------------------------------------------
+
+:points_sql: an SQL query, which should return a set of rows with the following columns:
+
+============ ================= =================================================
+Column            Type              Description
+============ ================= =================================================
+**pid**      ``ANY-INTEGER``   (optional) Identifier of the point. Can not be NULL. If column not present, a sequential identifier will be given automatically.
+**eid**      ``ANY-INTEGER``   Identifier of the "closest" edge to the point.
+**fraction** ``ANY-NUMERICAL`` Value in [0,1] that indicates the relative postition from the first end point of the edge.
+**side**     ``CHAR``          (optional) Value in ['b', 'r', 'l', NULL] indicating if the point is:
+                                 - In the right, left of the edge or
+                                 - If it doesn't matter with 'b' or NULL.
+                                 - If column not present 'b' is considered.
+
+                               Can be in upper or lower case.
+============ ================= =================================================
+
+
+Where:
+
+:ANY-INTEGER: SMALLINT, INTEGER, BIGINT
+:ANY-NUMERICAL: SMALLINT, INTEGER, BIGINT, REAL, FLOAT
+
+
+Description of the parameters of the signatures
+-------------------------------------------------------------------------------
+
+============== ====================== =================================================
+Column         Type                   Description
+============== ====================== =================================================
+**edges_sql**  ``TEXT``               SQL query as decribed above.
+**points_sql** ``TEXT``               Points SQL query as decribed above.
+**start_vid**  ``BIGINT``             Identifier of the starting vertex of the path.
+**start_vids** ``ARRAY[ANY-INTEGER]`` Array of identifiers of starting vertices.
+**end_vid**    ``BIGINT``             Identifier of the ending vertex of the path.
+**end_vids**   ``ARRAY[ANY-INTEGER]`` Array of identifiers of ending vertices.
+**directed**   ``BOOLEAN``            (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
+============== ====================== =================================================
+
+
+Examples
+========
+
+The examples of this section are based on the :ref:`sampledata` network.
+
+
+
+[put as many examples as needed and use the documentation data for the examples]
+
+:Example:
+
+.. literalinclude:: doc-MY_FUNCTION_NAME.queries
+   :start-after: --q2
+   :end-before: --q3
+
+..
+   If needed here are some subtitles  
+
+Examples for queries marked as ``directed`` with ``cost`` and ``reverse_cost`` columns
+--------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig1`
+
+:Example: This example is in a subtitle
+
+.. literalinclude:: doc-MY_FUNCTION_NAME.queries
+   :start-after: --q2
+   :end-before: --q3
+
+
+Examples for queries marked as ``undirected`` with ``cost`` and ``reverse_cost`` columns
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig2`
+
+
+
+Examples for queries marked as ``directed`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig3`
+
+
+Examples for queries marked as ``undirected`` with ``cost`` column
+----------------------------------------------------------------------------------------
+
+The examples in this section use the following :ref:`fig4`
+
+
+
+The queries use the :ref:`sampledata` network.
+
+.. rubric:: History
+
+* Official in version X.X
+* Proposed in version Y.Y 
+
+
+See Also
+-------------------------------------------------------------------------------
+
+* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
+
+.. rubric:: Indices and tables
+
+* :ref:`genindex`
+* :ref:`search`
+
diff --git a/tools/template/sql/CMakeLists.txt b/tools/template/sql/CMakeLists.txt
new file mode 100644
index 0000000..a2cf16f
--- /dev/null
+++ b/tools/template/sql/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Append in local scope
+LIST(APPEND PACKAGE_SQL_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/MY_FUNCTION_NAME.sql
+)
+
+# set in parent scope
+SET(PACKAGE_SQL_FILES "${PACKAGE_SQL_FILES}" PARENT_SCOPE)
diff --git a/tools/template/sql/function1.sql b/tools/template/sql/function1.sql
new file mode 100644
index 0000000..49e58e6
--- /dev/null
+++ b/tools/template/sql/function1.sql
@@ -0,0 +1,37 @@
+/*PGR-GNU*****************************************************************
+File: MY_FUNCTION_NAME.sql
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) YEAR DEVELOPER_NAME
+Mail: DEVELOPER_EMAIL
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+CREATE OR REPLACE FUNCTION pgr_MY_FUNCTION_NAME(
+    MY_QUERY_LINE1
+    MY_QUERY_LINE2)
+
+  RETURNS SETOF RECORD AS
+ '$libdir/${PGROUTING_LIBRARY_NAME}', 'MY_FUNCTION_NAME'
+    LANGUAGE c IMMUTABLE STRICT;
+
diff --git a/tools/template/src/CMakeLists.txt b/tools/template/src/CMakeLists.txt
new file mode 100644
index 0000000..be950a2
--- /dev/null
+++ b/tools/template/src/CMakeLists.txt
@@ -0,0 +1,3 @@
+ADD_LIBRARY(MY_FUNCTION_NAME OBJECT 
+                            MY_FUNCTION_NAME.c 
+                            MY_FUNCTION_NAME_driver.cpp)
diff --git a/tools/template/src/function1.c b/tools/template/src/function1.c
new file mode 100644
index 0000000..bd1dd71
--- /dev/null
+++ b/tools/template/src/function1.c
@@ -0,0 +1,224 @@
+/*PGR-GNU*****************************************************************
+File: MY_FUNCTION_NAME.c
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) YEAR DEVELOPER_NAME
+Mail: DEVELOPER_EMAIL
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#include "postgres.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "utils/array.h"
+#include "catalog/pg_type.h"
+#if PGSQL_VERSION > 92
+#include "access/htup_details.h"
+#endif
+
+/*
+  Uncomment when needed
+*/
+//#define DEBUG
+
+#include "fmgr.h"
+#include "./../../common/src/debug_macro.h"
+#include "./../../common/src/pgr_types.h"
+#include "./../../common/src/postgres_connection.h"
+#include "./../../common/src/edges_input.h"
+#include "./../../common/src/arrays_input.h"
+
+#include "./MY_FUNCTION_NAME_driver.h"
+
+PG_FUNCTION_INFO_V1(MY_FUNCTION_NAME);
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+MY_FUNCTION_NAME(PG_FUNCTION_ARGS);
+
+
+/*******************************************************************************/
+/*                          MODIFY AS NEEDED                                   */
+static
+void
+process( char* edges_sql,
+        int64_t start_vid,
+        int64_t *end_vidsArr,
+        size_t size_end_vidsArr,
+        bool directed,
+        MY_RETURN_VALUE_TYPE **result_tuples,
+        size_t *result_count) {
+    pgr_SPI_connect();
+
+    PGR_DBG("Load data");
+    pgr_edge_t *edges = NULL;
+    int64_t total_tuples = 0;
+    pgr_get_data_5_columns(edges_sql, &edges, &total_tuples);
+
+    if (total_tuples == 0) {
+        PGR_DBG("No edges found");
+        (*result_count) = 0;
+        (*result_tuples) = NULL;
+        pgr_SPI_finish();
+        return;
+    }
+    PGR_DBG("Total %ld tuples in query:", total_tuples);
+
+    PGR_DBG("Starting processing");
+    char *err_msg = (char *)"";
+    do_pgr_MY_FUNCTION_NAME(
+            edges,
+            total_tuples,
+            start_vid,
+            end_vidsArr,
+            size_end_vidsArr,
+            directed,
+            result_tuples,
+            result_count,
+            &err_msg);
+    PGR_DBG("Returning %ld tuples\n", *result_count);
+    PGR_DBG("Returned message = %s\n", err_msg);
+
+    free(err_msg);
+    pfree(edges);
+    pgr_SPI_finish();
+}
+/*                                                                            */
+/******************************************************************************/
+
+#ifndef _MSC_VER
+Datum
+#else  // _MSC_VER
+PGDLLEXPORT Datum
+#endif
+MY_FUNCTION_NAME(PG_FUNCTION_ARGS) {
+    FuncCallContext     *funcctx;
+    size_t              call_cntr;
+    size_t               max_calls;
+    TupleDesc            tuple_desc;
+
+    /**************************************************************************/
+    /*                          MODIFY AS NEEDED                              */
+    /*                                                                        */
+    MY_RETURN_VALUE_TYPE  *result_tuples = 0;
+    size_t result_count = 0;
+    /*                                                                        */
+    /**************************************************************************/
+
+    if (SRF_IS_FIRSTCALL()) {
+        MemoryContext   oldcontext;
+        funcctx = SRF_FIRSTCALL_INIT();
+        oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+
+        /**********************************************************************/
+        /*                          MODIFY AS NEEDED                          */
+        /*
+           MY_QUERY_LINE1
+         **********************************************************************/
+
+        PGR_DBG("Initializing arrays");
+        int64_t* end_vidsArr;
+        size_t size_end_vidsArr;
+        end_vidsArr = (int64_t*) pgr_get_bigIntArray(&size_end_vidsArr, PG_GETARG_ARRAYTYPE_P(2));
+        PGR_DBG("targetsArr size %ld ", size_end_vidsArr);
+
+        PGR_DBG("Calling process");
+        process(
+                pgr_text2char(PG_GETARG_TEXT_P(0)),
+                PG_GETARG_INT64(1),
+                end_vidsArr, size_end_vidsArr,
+                PG_GETARG_BOOL(3),
+                &result_tuples,
+                &result_count);
+
+        PGR_DBG("Cleaning arrays");
+        free(end_vidsArr);
+        /*                                                                             */
+        /*******************************************************************************/
+
+        funcctx->max_calls = result_count;
+        funcctx->user_fctx = result_tuples;
+        if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE)
+            ereport(ERROR,
+                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                     errmsg("function returning record called in context "
+                         "that cannot accept type record")));
+
+        funcctx->tuple_desc = tuple_desc;
+        MemoryContextSwitchTo(oldcontext);
+    }
+
+    funcctx = SRF_PERCALL_SETUP();
+    call_cntr = funcctx->call_cntr;
+    max_calls = funcctx->max_calls;
+    tuple_desc = funcctx->tuple_desc;
+    result_tuples = (MY_RETURN_VALUE_TYPE*) funcctx->user_fctx;
+
+    if (call_cntr < max_calls) {
+        HeapTuple    tuple;
+        Datum        result;
+        Datum        *values;
+        char*        nulls;
+
+        /*******************************************************************************/
+        /*                          MODIFY!!!!!                                        */
+        /*  This has to match you ouput otherwise the server crashes                   */
+        /*
+           MY_QUERY_LINE2
+        ********************************************************************************/
+
+
+        values = palloc(8 * sizeof(Datum));
+        nulls = palloc(8 * sizeof(char));
+
+        size_t i;
+        for(i = 0; i < 8; ++i) {
+            nulls[i] = ' ';
+        }
+
+
+        // postgres starts counting from 1
+        values[0] = Int32GetDatum(call_cntr + 1);
+        values[1] = Int32GetDatum(result_tuples[call_cntr].seq);
+        values[2] = Int64GetDatum(result_tuples[call_cntr].start_id);
+        values[3] = Int64GetDatum(result_tuples[call_cntr].end_id);
+        values[4] = Int64GetDatum(result_tuples[call_cntr].node);
+        values[5] = Int64GetDatum(result_tuples[call_cntr].edge);
+        values[6] = Float8GetDatum(result_tuples[call_cntr].cost);
+        values[7] = Float8GetDatum(result_tuples[call_cntr].agg_cost);
+        /*******************************************************************************/
+
+        tuple = heap_formtuple(tuple_desc, values, nulls);
+        result = HeapTupleGetDatum(tuple);
+        SRF_RETURN_NEXT(funcctx, result);
+    } else {
+        // cleanup
+        if (result_tuples) free(result_tuples);
+
+        SRF_RETURN_DONE(funcctx);
+    }
+}
+
diff --git a/tools/template/src/function1_driver.cpp b/tools/template/src/function1_driver.cpp
new file mode 100644
index 0000000..6e65bbe
--- /dev/null
+++ b/tools/template/src/function1_driver.cpp
@@ -0,0 +1,134 @@
+/*PGR-GNU*****************************************************************
+File: MY_FUNCTION_NAME_driver.cpp
+
+Generated with Template by:
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) YEAR DEVELOPER_NAME
+Mail: DEVELOPER_EMAIL
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+
+#include <sstream>
+#include <deque>
+#include <vector>
+#include "./pgr_dijkstra.hpp"
+#include "./MY_FUNCTION_NAME_driver.h"
+
+// #define DEBUG
+
+extern "C" {
+#include "./../../common/src/pgr_types.h"
+}
+
+#include "./../../common/src/memory_func.hpp"
+
+/************************************************************
+  MY_QUERY_LINE1
+ ***********************************************************/
+void
+do_pgr_MY_FUNCTION_NAME(
+        pgr_edge_t  *data_edges,
+        size_t total_tuples,
+        int64_t start_vid,
+        int64_t  *end_vidsArr,
+        int size_end_vidsArr,
+        bool directed,
+        MY_RETURN_VALUE_TYPE **return_tuples,
+        size_t *return_count,
+        char ** err_msg){
+    std::ostringstream log;
+    try {
+
+        if (total_tuples == 1) {
+            log << "Requiered: more than one tuple\n";
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            *err_msg = strdup(log.str().c_str());
+            return;
+        }
+
+        graphType gType = directed? DIRECTED: UNDIRECTED;
+        const int initial_size = total_tuples;
+
+        std::deque< Path >paths;
+        log << "Inserting vertices into a c++ vector structure\n";
+        std::set< int64_t > end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
+#ifdef DEBUG
+        for (const auto &vid : end_vertices) log << vid <<"\n";
+        log << "Destination" << start_vid;
+#endif
+        if (directed) {
+            log << "Working with directed Graph\n";
+            Pgr_base_graph< DirectedGraph > digraph(gType, initial_size);
+            digraph.graph_insert_data(data_edges, total_tuples);
+#ifdef DEBUG
+            digraph.print_graph(log);
+#endif
+            pgr_dijkstra(digraph, paths, start_vid, end_vertices, false);
+        } else {
+            log << "Working with Undirected Graph\n";
+            Pgr_base_graph< UndirectedGraph > undigraph(gType, initial_size);
+            undigraph.graph_insert_data(data_edges, total_tuples);
+#ifdef DEBUG
+            undigraph.print_graph(log);
+#endif
+            pgr_dijkstra(undigraph, paths, start_vid, end_vertices, false);
+        }
+
+        size_t count(count_tuples(paths));
+
+        if (count == 0) {
+            (*return_tuples) = NULL;
+            (*return_count) = 0;
+            log << 
+                "No paths found between Starting and any of the Ending vertices\n";
+            *err_msg = strdup(log.str().c_str());
+            return;
+        }
+
+        // get the space required to store all the paths
+        (*return_tuples) = get_memory(count, (*return_tuples));
+        log << "Converting a set of paths into the tuples\n";
+        (*return_count) = (collapse_paths(return_tuples, paths));
+
+#ifndef DEBUG
+        *err_msg = strdup("OK");
+#else
+        *err_msg = strdup(log.str().c_str());
+#endif
+    } catch ( ... ) {
+        log << "Caught unknown expection!\n";
+        *err_msg = strdup(log.str().c_str());
+    }
+}
+
+
+
+
+
diff --git a/tools/template/src/function1_driver.h b/tools/template/src/function1_driver.h
new file mode 100644
index 0000000..08661ce
--- /dev/null
+++ b/tools/template/src/function1_driver.h
@@ -0,0 +1,58 @@
+/*PGR-GNU*****************************************************************
+File: MY_FUNCTION_NAME_driver.h
+
+Copyright (c) 2015 pgRouting developers
+Mail: project at pgrouting.org
+
+Function's developer: 
+Copyright (c) YEAR DEVELOPER_NAME
+Mail: DEVELOPER_EMAIL
+
+------
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+********************************************************************PGR-GNU*/
+
+#ifndef SRC_MY_FUNCTION_NAME_UPPER_SRC_MY_FUNCTION_NAME_UPPER_DRIVER_H_
+#define SRC_MY_FUNCTION_NAME_UPPER_SRC_MY_FUNCTION_NAME_UPPER_DRIVER_H_
+
+#include "./../../common/src/pgr_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    /*********************************************************
+      MY_QUERY_LINE1
+     ********************************************************/
+    void
+        do_pgr_MY_FUNCTION_NAME(
+                pgr_edge_t  *data_edges,
+                size_t total_tuples,
+                int64_t start_vid,
+                int64_t  *end_vidsArr,
+                int size_end_vidsArr,
+                bool directed,
+                MY_RETURN_VALUE_TYPE **return_tuples,
+                size_t *return_count,
+                char ** err_msg);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  // SRC_MY_FUNCTION_NAME_UPPER_SRC_MY_FUNCTION_NAME_UPPER_DRIVER_H_
diff --git a/tools/template/test/doc-function1.result b/tools/template/test/doc-function1.result
new file mode 100644
index 0000000..798ae10
--- /dev/null
+++ b/tools/template/test/doc-function1.result
@@ -0,0 +1,19 @@
+--q1
+1|1|2|3|2|4|1|0
+2|2|2|3|5|8|1|1
+3|3|2|3|6|9|1|2
+4|4|2|3|9|16|1|3
+5|5|2|3|4|3|1|4
+6|6|2|3|3|-1|0|5
+7|1|2|5|2|4|1|0
+8|2|2|5|5|-1|0|1
+--q2
+1|1|2|3|2|4|1|0
+2|2|2|3|5|8|1|1
+3|3|2|3|6|9|1|2
+4|4|2|3|9|16|1|3
+5|5|2|3|4|3|1|4
+6|6|2|3|3|-1|0|5
+7|1|2|5|2|4|1|0
+8|2|2|5|5|-1|0|1
+--q3
diff --git a/tools/template/test/doc-function1.test.sql b/tools/template/test/doc-function1.test.sql
new file mode 100644
index 0000000..ba89b4c
--- /dev/null
+++ b/tools/template/test/doc-function1.test.sql
@@ -0,0 +1,13 @@
+
+
+\echo --q1
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table', 
+    2, ARRAY[5, 3]);
+\echo --q2
+
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table', 
+    2, ARRAY[5, 3]);
+\echo --q3
+
diff --git a/tools/template/test/pgtap/types-check.sql b/tools/template/test/pgtap/types-check.sql
new file mode 100644
index 0000000..0c371ee
--- /dev/null
+++ b/tools/template/test/pgtap/types-check.sql
@@ -0,0 +1,126 @@
+
+\i setup.sql
+
+
+SELECT plan(17);
+
+PREPARE q1 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id::BIGINT, source::SMALLINT, target::BIGINT, cost::INTEGER, reverse_cost::SMALLINT FROM edge_table',
+    2, ARRAY[5,3]);
+
+PREPARE q2 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2::BIGINT, ARRAY[5,3]);
+
+PREPARE q3 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2::SMALLINT, ARRAY[5,3]);
+
+PREPARE q4 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]::INTEGER[]);
+
+PREPARE q5 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]::SMALLINT[]);
+
+PREPARE q6 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]::BIGINT[]);
+
+SELECT lives_ok('q1', 'edges query accepts ANY-INTEGER & ANY NUMERICAL');
+SELECT lives_ok('q2', 'start_vid accepts BIGINT');
+SELECT lives_ok('q3', 'start_vid accepts SMALLINT');
+SELECT lives_ok('q4', 'end_vids accepts array of INTEGER');
+SELECT lives_ok('q4', 'end_vids accepts array of SMALLINT');
+SELECT lives_ok('q5', 'end_vids accepts array of BIGINT');
+SELECT lives_ok('q6', 'end_vids accepts array of BIGINT');
+
+
+PREPARE q10 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id::FLOAT, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]);
+
+PREPARE q11 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id::REAL, source, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]);
+
+SELECT throws_ok('q10', 'XX000', 'Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'Throws because id is FLOAT');
+SELECT throws_ok('q11', 'XX000', 'Unexpected Column ''id'' type. Expected ANY-INTEGER',
+    'Throws because id is REAL');
+
+PREPARE q12 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source::FLOAT, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]);
+
+PREPARE q13 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source::REAL, target, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]);
+
+SELECT throws_ok('q12', 'XX000', 'Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q13', 'XX000', 'Unexpected Column ''source'' type. Expected ANY-INTEGER',
+    'Throws because source is REAL');
+
+PREPARE q14 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target::FLOAT, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]);
+
+PREPARE q15 AS
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    'SELECT id, source, target::REAL, cost, reverse_cost FROM edge_table',
+    2, ARRAY[5,3]);
+
+SELECT throws_ok('q14', 'XX000', 'Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'Throws because source is FLOAT');
+SELECT throws_ok('q15', 'XX000', 'Unexpected Column ''target'' type. Expected ANY-INTEGER',
+    'Throws because source is REAL');
+
+
+SELECT throws_ok('
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'',
+    2::FLOAT, ARRAY[5,3]);',
+    '42883', 'function pgr_MY_FUNCTION_NAME(unknown, double precision, integer[]) does not exist',
+    'Throws because start_vid is FLOAT');
+
+SELECT throws_ok('
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'',
+    2::REAL, ARRAY[5,3]);',
+    '42883', 'function pgr_MY_FUNCTION_NAME(unknown, real, integer[]) does not exist',
+    'Throws because start_vid is REAL');
+
+
+SELECT throws_ok('
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'',
+    2, ARRAY[5,3]::FLOAT[]);',
+    'XX000','Expected array of ANY-INTEGER',
+    'Throws because end_vids array is of FLOAT');
+
+SELECT throws_ok('
+SELECT * FROM pgr_MY_FUNCTION_NAME(
+    ''SELECT id, source, target, cost, reverse_cost FROM edge_table'',
+    2, ARRAY[5,3]::REAL[]);',
+    'XX000','Expected array of ANY-INTEGER',
+    'Throws because end_vids array is of REAL');
+
+
+
+
+
+SELECT finish();
+ROLLBACK;
diff --git a/tools/template/test/test.conf b/tools/template/test/test.conf
new file mode 100644
index 0000000..60c3bb7
--- /dev/null
+++ b/tools/template/test/test.conf
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+
+%main::tests = (
+    'any' => {
+        'comment' => 'Function test for any versions.',
+        'data' => [],
+        'tests' => [qw(
+            doc-MY_FUNCTION_NAME
+            )],
+        'documentation' => [qw(
+            doc-MY_FUNCTION_NAME
+            )],
+
+#put here the ones that you are not testing (just a place holder)
+        'nottesting' => [qw(
+            )]
+    },
+# I dont know what this are for or how to use them.
+#  TODO ask Steve 
+#    'vpg-vpgis' => {}, # for version specific tests
+#    '8-1' => {},       # for pg 8.x and postgis 1.x
+#    '9.2-2.1' => {},   # for pg 9.2 and postgis 2.1
+);
+
+1;
diff --git a/tools/test-runner.pl b/tools/test-runner.pl
deleted file mode 100755
index 267c575..0000000
--- a/tools/test-runner.pl
+++ /dev/null
@@ -1,444 +0,0 @@
-#! /usr/bin/perl -w
-    eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
-        if 0; #$running_under_some_shell
-
-use strict;
-use File::Find ();
-use File::Basename;
-use Data::Dumper;
-use Time::HiRes qw(gettimeofday tv_interval);
-$Data::Dumper::Sortkeys = 1;
-
-# for the convenience of &wanted calls, including -eval statements:
-use vars qw/*name *dir *prune/;
-*name   = *File::Find::name;
-*dir    = *File::Find::dir;
-*prune  = *File::Find::prune;
-
-my $VERBOSE = 0;
-my $DRYRUN = 0;
-my $DEBUG = 0;
-
-my $DBNAME = "pgr_test__db__test";
-my $DBUSER;
-my $DBHOST;
-my $DBPORT;
-
-sub Usage {
-    die "Usage: test-runner.pl -pgver vpg -pgisver vpgis -psql /path/to/psql\n" .
-        "       -pgver vpg          - postgresql version\n" .
-        "       -pghost host        - postgresql host or socket directory to use\n" .
-        "       -pgport port        - postgresql port to use\n" .
-        "       -pguser username    - postgresql user role to use\n" .
-        "       -pgisver vpgis      - postgis version\n" .
-        "       -pgrver vpgr        - pgrouting version\n" .
-        "       -psql /path/to/psql - optional path to psql\n" .
-        "       -v                  - verbose messages for debuging(enter twice for more)\n" .
-        "       -clean              - dropdb pgr_test__db__test\n" .
-        "       -ignorenotice       - ignore NOTICE statements when reporting failures\n" .
-        "       -alg 'dir'          - directory to select which algorithm subdirs to test\n" .
-        "       -h                  - help\n";
-}
-
-print "RUNNING: test-runner.pl " . join(" ", @ARGV) . "\n";
-
-my ($vpg, $vpgis, $vpgr, $psql);
-my $alg = '';
-my @testpath = ("doc/", "src/");
-my $clean;
-my $ignore;
-
-while (my $a = shift @ARGV) {
-    if ( $a eq '-pgver') {
-        $vpg   = shift @ARGV || Usage();
-    }
-    elsif ($a eq '-pghost') {
-        $DBHOST = shift @ARGV || Usage();
-    }
-    elsif ($a eq '-pgport') {
-        $DBPORT = shift @ARGV || Usage();
-    }
-    elsif ($a eq '-pguser') {
-        $DBUSER = shift @ARGV || Usage();
-    }
-    elsif ($a eq '-pgisver') {
-        $vpgis = shift @ARGV || Usage();
-    }
-    elsif ($a eq '-pgrver') {
-        $vpgr = shift @ARGV || Usage();
-    }
-    elsif ($a eq '-alg') {
-        $alg = shift @ARGV || Usage();
-        if ($alg eq 'doc') {
-            @testpath = ('doc');
-        } elsif ($alg eq 'recipes') {
-            @testpath = ("doc/src/recipes");
-        } else {
-            @testpath = ("src/$alg");
-        }
-    }
-    elsif ($a eq '-psql') {
-        $psql = shift @ARGV || Usage();
-        die "'$psql' is not executable!\n"
-            unless -x $psql;
-    }
-    elsif ($a =~ /^-h/) {
-        Usage();
-    }
-    elsif ($a =~ /^-clean/) {
-        $clean = 1;;
-    }
-    elsif ($a =~ /^-ignoren/i) {
-        $ignore = 1;;
-    }
-    elsif ($a =~ /^-v/i) {
-        $VERBOSE = 1 if $DEBUG;
-        $DEBUG = 1;
-    }
-    else {
-        warn "Error: unknown option '$a'\n";
-        Usage();
-    }
-}
-
-my $connopts = "";
-$connopts .= " -U $DBUSER" if defined $DBUSER;
-$connopts .= " -h $DBHOST" if defined $DBHOST;
-$connopts .= " -p $DBPORT" if defined $DBPORT;
-
-mysystem("dropdb $connopts $DBNAME") if $clean;
-
-%main::tests = ();
-my @cfgs = ();
-my %stats = (z_pass=>0, z_fail=>0, z_crash=>0);
-my $TMP = "/tmp/pgr-test-runner-$$";
-my $TMP2 = "/tmp/pgr-test-runner-$$-2";
-my $TMP3 = "/tmp/pgr-test-runner-$$-3";
-
-if (! $psql) {
-    $psql = findPsql() || die "ERROR: can not find psql, specify it on the command line.\n";
-}
-
-my $OS = "$^O";
-if (length($psql)) {
-    if ($OS =~ /msys/
-        || $OS =~ /MSWin/) {
-        $psql = "\"$psql\"";
-    }
-}
-
-# some unit tests
-#my $server_ver = getServerVersion();
-#my $server_ver = '9.2';
-#print "PSQL=$psql\n";
-#print "SERVER_VERSION=$server_ver\n";
-#print "version_greater_eq('9.1')=" . version_greater_eq($server_ver, '9.1') . "\n";
-#print "version_greater_eq('9.2')=" . version_greater_eq($server_ver, '9.2') . "\n";
-#print "version_greater_eq('9.3')=" . version_greater_eq($server_ver, '9.3') . "\n";
-#print "version_greater_eq('8.3')=" . version_greater_eq($server_ver, '8.3') . "\n";
-#print "template_pgrouting=" . dbExists('template_pgrouting') . "\n";
-#exit;
-
-# Traverse desired filesystems
-File::Find::find({wanted => \&want_tests}, @testpath);
-
-die "Error: no test files found. Run this command from the top level pgRouting directory!\n" unless @cfgs;
-
-createTestDB();
-
-$vpg = '' if ! $vpg;
-$vpgis = '' if ! $vpgis;
-
-for my $c (@cfgs) {
-    my $found = 0;
-
-    # load the config file for the tests
-    require $c;
-
-    print "test.conf = $c\n" if $VERBOSE;
-    print Data::Dumper->Dump([\%main::tests],['test']) if $VERBOSE;
-
-    if ($main::tests{any}) {
-        push @{$stats{$c}}, run_test($c, $main::tests{any});
-        $found++;
-    }
-    if ($main::tests{"$vpg-$vpgis"}) {
-        push @{$stats{$c}}, run_test($c, $main::tests{"$vpg-$vpgis"});
-        $found++;
-    }
-    if (! $found) {
-        $stats{$c} = "No tests were found for '$vpg-$vpgis'!";
-    }
-}
-
-dropTestDB();
-
-print Data::Dumper->Dump([\%stats], ['stats']);
-
-unlink $TMP;
-unlink $TMP2;
-unlink $TMP3;
-
-if ($stats{z_crash} || $stats{z_fail}) {
-    exit 1;  # signal we had failures
-}
-
-exit 0;      # signal we passed all the tests
-
-
-sub run_test {
-    my $c = shift;
-    my $t = shift;
-    my %res = ();
-
-    my $dir = dirname($c);
-
-    $res{comment} = $t->{comment} if $t->{comment};
-    for my $x (@{$t->{data}}) {
-        mysystem("$psql $connopts -A -t -q -f '$dir/$x' $DBNAME >> $TMP2 2>\&1 ");
-    }
-
-    for my $x (@{$t->{tests}}) {
-        print "Processing test: $x\n";
-        my $t0 = [gettimeofday];
-        open(TIN, "$dir/$x.test.sql") || do {
-            $res{"$dir/$x.test.sql"} = "FAILED: could not open '$dir/$x.test.sql' : $!";
-            $stats{z_fail}++;
-            next;
-        };
-        open(PSQL, "|$psql $connopts -A -t -q $DBNAME > $TMP 2>\&1 ") || do {
-            $res{"$dir/$x.test.sql"} = "FAILED: could not open connection to db : $!";
-            $stats{z_fail}++;
-            next;
-        };
-        print PSQL "set client_min_messages to WARNING;\n" if $ignore;
-        my @d = ();
-        @d = <TIN>;
-        print PSQL @d;
-        close(PSQL);
-        close(TIN);
-
-        my $dfile;
-        my $dfile2;
-        if ($ignore) {
-            $dfile2 = $TMP2;
-            mysystem("grep -v NOTICE '$TMP' | grep -v '^CONTEXT:' | grep -v '^PL/pgSQL function' > $dfile2");
-            $dfile = $TMP3;
-            mysystem("grep -v NOTICE '$dir/$x.result' | grep -v '^CONTEXT:' | grep -v '^PL/pgSQL function' > $dfile");
-        }
-        else {
-            $dfile = "$dir/$x.result";
-            $dfile2 = $TMP;
-        }
-        # use diff -w to ignore white space differences like \r vs \r\n
-        my $r = `diff -w '$dfile' '$dfile2' `;
-        $r =~ s/^\s*|\s*$//g;
-        if ($r =~ /connection to server was lost/) {
-            $res{"$dir/$x.test.sql"} = "CRASHED SERVER: $r";
-            $stats{z_crash}++;
-            # allow the server some time to recover from the crash
-            warn "CRASHED SERVER: '$dir/$x.test.sql', sleeping 5 ...\n";
-            sleep 5;
-        }
-        elsif (length($r)) {
-            $res{"$dir/$x.test.sql"} = "FAILED: $r";
-            $stats{z_fail}++;
-        }
-# TODO missing when the result file does not exist
-        else {
-            $res{"$dir/$x.test.sql"} = "Passed";
-            $stats{z_pass}++;
-        }
-        print "    test run time: " . tv_interval($t0, [gettimeofday]) . "\n";
-    }
-
-    return \%res;
-}
-
-sub createTestDB {
-    die "ERROR: test database '$DBNAME' exists, you must drop or rename it!\n"
-        if dbExists($DBNAME);
-
-    my $template;
-
-    my $dbver = getServerVersion();
-    my $dbshare = getSharePath($dbver);
-
-    if ($DEBUG) {
-        print "-- DBVERSION: $dbver\n";
-        print "-- DBSHARE: $dbshare\n";
-    }
-
-    # first create a database with postgis installed in it
-    if (version_greater_eq($dbver, '9.1') &&
-            -f "$dbshare/extension/postgis.control") {
-        mysystem("createdb $connopts $DBNAME");
-        die "ERROR: Failed to create database '$DBNAME'!\n"
-            unless dbExists($DBNAME);
-        my $myver = '';
-        if ($vpgis) {
-            $myver = " VERSION '$vpgis'";
-        }
-        my $encoding = '';
-        if ($OS =~ /msys/
-            || $OS =~ /MSWin/) {
-            $encoding = "SET client_encoding TO 'UTF8';";
-        }
-        print "-- Trying to install postgis extension $myver\n" if $DEBUG;
-        mysystem("$psql $connopts -c \"$encoding create extension postgis $myver\" $DBNAME");
-    }
-    else {
-        if ($vpgis && dbExists("template_postgis_$vpgis")) {
-            $template = "template_postgis_$vpgis";
-        }
-        elsif (dbExists('template_postgis')) {
-            $template = "template_postgis";
-        }
-        else {
-            die "ERROR: Could not find an appropriate template_postgis database!\n";
-        }
-        print "-- Trying to install postgis from $template\n" if $DEBUG;
-        mysystem("createdb $connopts -T $template $DBNAME");
-        sleep(2);
-        die "ERROR: Failed to create database '$DBNAME'!\n"
-            if ! dbExists($DBNAME);
-    }
-
-    # next we install pgrouting into the new database
-    if (version_greater_eq($dbver, '9.1') &&
-            -f "$dbshare/extension/postgis.control") {
-        my $myver = '';
-        if ($vpgr) {
-            $myver = " PGROUTING VERSION '$vpgr'";
-        }
-        print "-- Trying to install pgrouting extension $myver\n" if $DEBUG;
-        mysystem("$psql $connopts -c \"create extension pgrouting $myver\" $DBNAME");
-    }
-    elsif ($vpgr && -f "$dbshare/extension/pgrouting--$vpgr.sql") {
-        print "-- Trying to install pgrouting from '$dbshare/extension/pgrouting--$vpgr.sql'\n" if $DEBUG;
-        mysystem("$psql $connopts -f '$dbshare/extension/pgrouting--$vpgr.sql' $DBNAME");
-    }
-    else {
-        my $find = `find "$dbshare/contrib" -name pgrouting.sql | sort -r -n `;
-        my @found = split(/\n/, $find);
-        my $file = shift @found;
-        if ($file && length($file)) {
-            print "-- Trying to install pgrouting from '$file'\n" if $DEBUG;
-            mysystem("$psql $connopts -f '$file' $DBNAME");
-        }
-        else {
-            mysystem("ls -alR $dbshare") if $DEBUG;
-            die "ERROR: failed to install pgrouting into the database!\n";
-        }
-    }
-
-    # now verify that we have pgrouting installed
-
-    my $pgrv = `$psql $connopts -c "select pgr_version()" $DBNAME`;
-    die "ERROR: failed to install pgrouting into the database!\n"
-        unless $pgrv;
-
-}
-
-sub dropTestDB {
-    mysystem("dropdb $connopts $DBNAME");
-}
-
-sub version_greater_eq {
-    my ($a, $b) = @_;
-
-    return 0 if !$a || !$b;
-
-    my @a = split(/\./, $a);
-    my @b = split(/\./, $b);
-
-    my $va = 0;
-    my $vb = 0;
-
-    while (@a || @b) {
-        $a = shift @a || 0;
-        $b = shift @b || 0;
-        $va = $va*1000+$a;
-        $vb = $vb*1000+$b;
-    }
-
-    return 0 if $va < $vb;
-    return 1;
-}
-
-
-sub getServerVersion {
-    my $v = `$psql $connopts -q -t -c "select version()" postgres`;
-    print "$psql $connopts -q -t -c \"select version()\" postgres\n    # RETURNED: $v\n" if $VERBOSE;
-    if ($v =~ m/PostgreSQL (\d+(\.\d+)?(\.\d+)?)/) {
-        print "    # Got ($1)\n" if $VERBOSE;
-        return $1;
-    }
-    return undef;
-}
-
-sub dbExists {
-    my $dbname = shift;
-
-    my $isdb = `$psql $connopts -l | grep $dbname`;
-    $isdb =~ s/^\s*|\s*$//g;
-    return length($isdb);
-}
-
-sub findPsql {
-    my $psql = `which psql`;
-    $psql =~ s/^\s*|\s*$//g;
-    print "which psql = $psql\n" if $VERBOSE;
-    return length($psql)?$psql:undef;
-}
-
-# getSharePath is complicated by the fact that on Debian we can have multiple
-# versions installed in a cluster. So we get the DB version by connectiong
-# to the port for the server we want. Then we get the share path for the
-# newest version od pg installed on the cluster. And finally we change the
-# in the path to the version of the server.
-
-sub getSharePath {
-    my $pg = shift;
-
-    my $share;
-    my $isdebian = -e "/etc/debian_version";
-    my $pg_config = `which pg_config`;
-    $pg_config =~ s/^\s*|\s*$//g;
-    print "which pg_config = $pg_config\n" if $VERBOSE;
-    if (length($pg_config)) {
-        $share = `"$pg_config" --sharedir`;
-        $share =~ s/^\s*|\s*$//g;
-        if ($isdebian) {
-            $share =~ s/(\d+(\.\d+)?)$/$pg/;
-            if (length($share) && -d $share) {
-                return $share;
-            }
-        } else {
-            return "$share"
-        }
-    }
-    die "Could not determine the postgresql version" unless $pg;
-    $pg =~ s/^(\d+(\.\d+)).*$/$1/;
-    $share = "/usr/share/postgresql/$pg";
-    return $share if -d $share;
-    $share = "/usr/local/share/postgresql/$pg";
-    return $share if -d $share;
-    die "Could not determine the postgresql share dir for ($pg)!\n";
-}
-
-sub mysystem {
-    my $cmd = shift;
-    print "$cmd\n" if $VERBOSE || $DRYRUN;
-    system($cmd) unless $DRYRUN;
-}
-
-sub want_tests {
-#    /^bd_d.*\z/s &&
-#    ($File::Find::prune = 1)
-#    ||
-    /^test\.conf\z/s &&
-    push @cfgs, $name;
-}
-
-
diff --git a/tools/testers/algorithm-tester.pl b/tools/testers/algorithm-tester.pl
new file mode 100755
index 0000000..1ac0cd3
--- /dev/null
+++ b/tools/testers/algorithm-tester.pl
@@ -0,0 +1,537 @@
+#! /usr/bin/perl -w
+    eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+        if 0; #$running_under_some_shell
+
+use strict;
+use File::Find ();
+use File::Basename;
+use Data::Dumper;
+use Time::HiRes qw(gettimeofday tv_interval);
+$Data::Dumper::Sortkeys = 1;
+
+# for the convenience of &wanted calls, including -eval statements:
+use vars qw/*name *dir *prune/;
+*name   = *File::Find::name;
+*dir    = *File::Find::dir;
+*prune  = *File::Find::prune;
+
+my $DOCUMENTATION = 0;
+my $VERBOSE = 0;
+my $DRYRUN = 0;
+my $DEBUG = 0;
+my $DEBUG1 = 0;
+
+my $DBNAME = "pgr_test__db__test";
+my $DBUSER;
+my $DBHOST;
+my $DBPORT;
+
+sub Usage {
+    die "Usage: algorithm-tester.pl -pgver vpg -pgisver vpgis -psql /path/to/psql\n" .
+        "       -pgver vpg          - postgresql version\n" .
+        "       -pghost host        - postgresql host or socket directory to use\n" .
+        "       -pgport port        - postgresql port to use\n" .
+        "       -pguser username    - postgresql user role to use\n" .
+        "       -pgisver vpgis      - postgis version\n" .
+        "       -pgrver vpgr        - pgrouting version\n" .
+        "       -psql /path/to/psql - optional path to psql\n" .
+        "       -v                  - verbose messages for small debuging\n" .
+        "       -debug              - verbose messages for debuging(enter twice for more)\n" .
+        "       -debug1             - DEBUG1 messages (for timing reports)\n" .
+        "       -clean              - dropdb pgr_test__db__test\n" .
+        "       -ignorenotice       - ignore NOTICE statements when reporting failures\n" .
+        "       -alg 'dir'          - directory to select which algorithm subdirs to test\n" .
+        "       -documentation      - ONLY generate documentation examples\n" .
+        "       -h                  - help\n";
+}
+
+print "RUNNING: algorithm-tester.pl " . join(" ", @ARGV) . "\n";
+
+my ($vpg, $postgis_ver, $vpgr, $psql);
+my $alg = '';
+my @testpath = ("doc/", "src/");
+my $clean;
+my $ignore;
+
+$postgis_ver = '';
+
+while (my $a = shift @ARGV) {
+    if ( $a eq '-pgver') {
+        $vpg   = shift @ARGV || Usage();
+    }
+    elsif ($a eq '-pghost') {
+        $DBHOST = shift @ARGV || Usage();
+    }
+    elsif ($a eq '-pgport') {
+        $DBPORT = shift @ARGV || Usage();
+    }
+    elsif ($a eq '-pguser') {
+        $DBUSER = shift @ARGV || Usage();
+    }
+    elsif ($a eq '-pgisver') {
+        $postgis_ver = shift @ARGV || Usage();
+        $postgis_ver = " VERSION '$postgis_ver'";
+    }
+    elsif ($a eq '-pgrver') {
+        $vpgr = shift @ARGV || Usage();
+    }
+    elsif ($a eq '-alg') {
+        $alg = shift @ARGV || Usage();
+        if ($alg eq 'doc') {
+            @testpath = ('doc');
+        } elsif ($alg eq 'recipes') {
+            @testpath = ("doc/src/recipes");
+        } else {
+            @testpath = ("src/$alg");
+        }
+    }
+    elsif ($a eq '-psql') {
+        $psql = shift @ARGV || Usage();
+        die "'$psql' is not executable!\n"
+            unless -x $psql;
+    }
+    elsif ($a =~ /^-h/) {
+        Usage();
+    }
+    elsif ($a =~ /^-clean/) {
+        $clean = 1;;
+    }
+    elsif ($a =~ /^-ignoren/i) {
+        $ignore = 1;;
+    }
+    elsif ($a =~ /^-debug1$/i) {
+        $DEBUG1 = 1 unless $DOCUMENTATION;
+    }
+    elsif ($a =~ /^-debug$/i) {
+        $DEBUG++;
+        $VERBOSE = 1;
+    }
+    elsif ($a =~ /^-v/i) {
+        $VERBOSE = 1;
+    }
+    elsif ($a =~ /^-doc(umentation)?/i) {
+        $DOCUMENTATION = 1;
+        $DEBUG1 = 0; # disbale timing reports during documentation generation
+    }
+    else {
+        warn "Error: unknown option '$a'\n";
+        Usage();
+    }
+}
+
+my $connopts = "";
+$connopts .= " -U $DBUSER" if defined $DBUSER;
+$connopts .= " -h $DBHOST" if defined $DBHOST;
+$connopts .= " -p $DBPORT" if defined $DBPORT;
+
+mysystem("dropdb $connopts $DBNAME") if $clean;
+
+%main::tests = ();
+my @cfgs = ();
+my %stats = (z_pass=>0, z_fail=>0, z_crash=>0);
+my $TMP = "/tmp/pgr-test-runner-$$";
+my $TMP2 = "/tmp/pgr-test-runner-$$-2";
+my $TMP3 = "/tmp/pgr-test-runner-$$-3";
+
+if (! $psql) {
+    $psql = findPsql() || die "ERROR: can not find psql, specify it on the command line.\n";
+}
+
+my $OS = "$^O";
+if (length($psql)) {
+    if ($OS =~ /msys/
+        || $OS =~ /MSWin/) {
+        $psql = "\"$psql\"";
+    }
+}
+
+# some unit tests
+#my $server_ver = getServerVersion();
+#my $server_ver = '9.2';
+#print "PSQL=$psql\n";
+#print "SERVER_VERSION=$server_ver\n";
+#print "version_greater_eq('9.1')=" . version_greater_eq($server_ver, '9.1') . "\n";
+#print "version_greater_eq('9.2')=" . version_greater_eq($server_ver, '9.2') . "\n";
+#print "version_greater_eq('9.3')=" . version_greater_eq($server_ver, '9.3') . "\n";
+#print "version_greater_eq('8.3')=" . version_greater_eq($server_ver, '8.3') . "\n";
+#print "template_pgrouting=" . dbExists('template_pgrouting') . "\n";
+#exit;
+
+# Traverse desired filesystems
+File::Find::find({wanted => \&want_tests}, @testpath);
+
+die "Error: no test files found. Run this command from the top level pgRouting directory!\n" unless @cfgs;
+
+createTestDB($DBNAME);
+
+$vpg = '' if ! $vpg;
+$postgis_ver = '' if ! $postgis_ver;
+
+# cfgs = SET of configuration file names
+# c  one file in cfgs
+for my $c (@cfgs) {
+    my $found = 0;
+
+    # load the config file for the tests
+    require $c;
+
+    print "test.conf = $c\n" if $VERBOSE;
+    print Data::Dumper->Dump([\%main::tests],['test']) if $VERBOSE;
+
+    if ($main::tests{any} && !$DOCUMENTATION) {
+        push @{$stats{$c}}, run_test($c, $main::tests{any});
+        $found++;
+    }
+    elsif ($main::tests{any}{documentation} && $DOCUMENTATION) {
+        push @{$stats{$c}}, run_test($c, $main::tests{any});
+        $found++;
+    }
+
+    if (! $found) {
+        $stats{$c} = "No tests were found for '$vpg-$postgis_ver'!";
+    }
+}
+
+dropTestDB();
+
+print Data::Dumper->Dump([\%stats], ['stats']);
+
+unlink $TMP;
+unlink $TMP2;
+unlink $TMP3;
+
+if ($stats{z_crash} > 0 || $stats{z_fail} > 0) {
+    exit 1;  # signal we had failures
+}
+
+exit 0;      # signal we passed all the tests
+
+
+# c  one file in cfgs
+# t  contents of array that has keys comment, data and test
+sub run_test {
+    my $c = shift;
+    my $t = shift;  
+    my %res = ();
+
+    my $dir = dirname($c);
+
+    $res{comment} = $t->{comment} if $t->{comment};
+    #t->{data}  referencing the key data of the data files
+
+    my $singleDB = "____pgr___single_test___";
+    for my $testName (@{$t->{singleTest}}) {
+        createTestDB($singleDB);
+        mysystem("$psql $connopts -A -t -q -f tools/testers/sampledata.sql' $singleDB >> $TMP2 2>\&1 ");
+        for my $x (@{$t->{data}}) {
+           mysystem("$psql $connopts -A -t -q -f '$dir/$x' $singleDB >> $TMP2 2>\&1 ");
+        }
+        process_single_test($testName, $dir, $singleDB,\%res);
+        mysystem("dropdb $connopts $singleDB");
+    }
+
+    mysystem("$psql $connopts -A -t -q -f tools/testers/sampledata.sql $DBNAME >> $TMP2 2>\&1 ");
+    for my $x (@{$t->{data}}) {
+       mysystem("$psql $connopts -A -t -q -f '$dir/$x' $DBNAME >> $TMP2 2>\&1 ");
+    }
+
+    if ($DOCUMENTATION) {
+        for my $x (@{$t->{documentation}}) {
+            process_single_test($x, $dir,, $DBNAME, \%res)
+        }
+    }
+    else {
+        for my $x (@{$t->{tests}}) {
+            process_single_test($x, $dir,, $DBNAME, \%res)
+        }
+    }
+
+    return \%res;
+}
+
+sub process_single_test{
+    my $x = shift;
+    my $dir = shift;
+    my $database = shift;
+    my $res = shift;
+        #each tests will use clean data
+
+        print "Processing test: $dir/$x\n";
+        my $t0 = [gettimeofday];
+        #TIN = test_input_file
+        open(TIN, "$dir/$x.test.sql") || do {
+            $res->{"$dir/$x.test.sql"} = "FAILED: could not open '$dir/$x.test.sql' : $!";
+            $stats{z_fail}++;
+            next;
+        };
+
+        #reason of opening conection is because the set client_min_messages to warning;
+        if ($DOCUMENTATION) {
+            mysystem("mkdir -p '$dir/../doc' "); # make sure the directory exists
+            open(PSQL, "|$psql $connopts --set='VERBOSITY terse' -e $database > $dir/../doc/$x.queries 2>\&1 ") || do {
+                $res->{"$dir/$x.test.sql"} = "FAILED: could not open connection to db : $!";
+                $stats{z_fail}++;
+                next;
+            };
+            print PSQL "set client_min_messages to WARNING;\n" if $ignore;
+            print PSQL "set client_min_messages to DEBUG1;\n" if $DEBUG1;
+        }
+        else {
+            open(PSQL, "|$psql $connopts --set='VERBOSITY terse' -A -t -q $database > $TMP 2>\&1 ") || do {
+                $res->{"$dir/$x.test.sql"} = "FAILED: could not open connection to db : $!";
+                $stats{z_fail}++;
+                next;
+            };
+        }
+        print PSQL "set client_min_messages to WARNING;\n" if $ignore;
+        print PSQL "set client_min_messages to DEBUG1;\n" if $DEBUG1;
+        my @d = ();
+        @d = <TIN>; #reads the whole file into the array @d 
+        print PSQL @d; #prints the whole fle stored in @d
+        close(PSQL); #executes everything
+        close(TIN); #closes the input file  /TIN = test input
+
+        return if $DOCUMENTATION;
+
+        my $dfile;
+        my $dfile2;
+        if ($ignore) { #decide how to compare results, if ignoring or not ignoring
+            $dfile2 = $TMP2;
+            mysystem("grep -v NOTICE '$TMP' | grep -v '^CONTEXT:' | grep -v '^PL/pgSQL function' > $dfile2");
+            $dfile = $TMP3;
+            mysystem("grep -v NOTICE '$dir/$x.result' | grep -v '^CONTEXT:' | grep -v '^PL/pgSQL function' > $dfile");
+        }
+        elsif ($DEBUG1) { #to delete CONTEXT lines
+            $dfile2 = $TMP2;
+            mysystem("grep -v '^CONTEXT:' '$TMP' | grep -v '^PL/pgSQL function' > $dfile2");
+            $dfile = $TMP3;
+            mysystem("grep -v '^CONTEXT:' '$dir/$x.result' | grep -v '^PL/pgSQL function' > $dfile");
+        }
+        else {
+            $dfile = "$dir/$x.result";
+            $dfile2 = $TMP;
+        }
+        if (! -f "$dir/$x.result") {
+            $res->{"$dir/$x.test.sql"} = "\nFAILED: result file missing : $!";
+            $stats{z_fail}++;            
+            next;
+        }
+
+        # use diff -w to ignore white space differences like \r vs \r\n
+        #ignore white spaces when comparing
+        #dfile is expected results
+        #dfile2 is the actual results
+        my $r = `diff -w '$dfile' '$dfile2' `;
+        #looks for removing leading blanks and trailing blanks
+        $r =~ s/^\s*|\s*$//g;
+        if ($r =~ /connection to server was lost/) {
+            $res->{"$dir/$x.test.sql"} = "CRASHED SERVER: $r";
+            $stats{z_crash}++;
+            # allow the server some time to recover from the crash
+            warn "CRASHED SERVER: '$dir/$x.test.sql', sleeping 5 ...\n";
+            sleep 20;
+        }
+        #if the diff has 0 length then everything was the same, so here we detect changes
+        elsif (length($r)) {
+            $res->{"$dir/$x.test.sql"} = "FAILED: $r";
+            $stats{z_fail}++ unless $DEBUG1;
+        }
+        else {
+            $res->{"$dir/$x.test.sql"} = "Passed";
+            $stats{z_pass}++;
+        }
+        print "    test run time: " . tv_interval($t0, [gettimeofday]) . "\n";
+}
+
+sub createTestDB {
+    my $databaseName = shift;
+    dropTestDB() if dbExists($databaseName);
+
+    my $template;
+
+    my $dbver = getServerVersion();
+    my $dbshare = getSharePath($dbver);
+
+    if ($DEBUG) {
+        print "-- DBVERSION: $dbver\n";
+        print "-- DBSHARE: $dbshare\n";
+    }
+
+    # first create a database with postgis installed in it
+    if (version_greater_eq($dbver, '9.1') &&
+            -f "$dbshare/extension/postgis.control") {
+        mysystem("createdb $connopts $databaseName");
+        die "ERROR: Failed to create database '$databaseName'!\n"
+            unless dbExists($databaseName);
+        my $encoding = '';
+        if ($OS =~ /msys/
+            || $OS =~ /MSWin/) {
+            $encoding = "SET client_encoding TO 'UTF8';";
+        }
+        print "-- Trying to install postgis extension $postgis_ver\n" if $DEBUG;
+        mysystem("$psql $connopts -c \"$encoding create extension postgis $postgis_ver \" $databaseName");
+#        print "-- Trying to install pgTap extension \n" if $DEBUG;
+#        system("$psql $connopts -c \"$encoding create extension pgtap \" $databaseName");
+#        if ($? != 0) {
+#            print "Failed: create extension pgtap\n" if $VERBOSE || $DRYRUN;
+#            die;
+#        }
+    }
+    #
+#    else {
+#        if ($vpgis && dbExists("template_postgis_$vpgis")) {
+#            $template = "template_postgis_$vpgis";
+#        }
+#        elsif (dbExists('template_postgis')) {
+#            $template = "template_postgis";
+#        }
+#        else {
+#            die "ERROR: Could not find an appropriate template_postgis database!\n";
+#        }
+#        print "-- Trying to install postgis from $template\n" if $DEBUG;
+#        mysystem("createdb $connopts -T $template $databaseName");
+#        sleep(2);
+#        die "ERROR: Failed to create database '$databaseName'!\n"
+#            if ! dbExists($databaseName);
+#    }
+
+    # next we install pgrouting into the new database
+    if (version_greater_eq($dbver, '9.1') &&
+        -f "$dbshare/extension/postgis.control") {
+        my $myver = '';
+        if ($vpgr) {
+            $myver = " PGROUTING VERSION '$vpgr'";
+        }
+        print "-- Trying to install pgrouting extension $myver\n" if $DEBUG;
+        mysystem("$psql $connopts -c \"create extension pgrouting $myver\" $databaseName");
+    }
+    elsif ($vpgr && -f "$dbshare/extension/pgrouting--$vpgr.sql") {
+        print "-- Trying to install pgrouting from '$dbshare/extension/pgrouting--$vpgr.sql'\n" if $DEBUG;
+        mysystem("$psql $connopts -f '$dbshare/extension/pgrouting--$vpgr.sql' $databaseName");
+    }
+    else {
+        my $find = `find "$dbshare/contrib" -name pgrouting.sql | sort -r -n `;
+        my @found = split(/\n/, $find);
+        my $file = shift @found;
+        if ($file && length($file)) {
+            print "-- Trying to install pgrouting from '$file'\n" if $DEBUG;
+            mysystem("$psql $connopts -f '$file' $databaseName");
+        }
+        else {
+            mysystem("ls -alR $dbshare") if $DEBUG;
+            die "ERROR: failed to install pgrouting into the database!\n";
+        }
+    }
+
+    # now verify that we have pgrouting installed
+
+    my $pgrv = `$psql $connopts -c "select pgr_version()" $databaseName`;
+    die "ERROR: failed to install pgrouting into the database!\n"
+    unless $pgrv;
+    print `$psql $connopts -c "select version();" postgres `, "\n";
+    print `$psql $connopts -c "select postgis_full_version();" $databaseName `, "\n";
+    print `$psql $connopts -c "select pgr_version();" $databaseName `, "\n";
+}
+
+sub dropTestDB {
+    mysystem("dropdb $connopts $DBNAME");
+}
+
+sub version_greater_eq {
+    my ($a, $b) = @_;
+
+    return 0 if !$a || !$b;
+
+    my @a = split(/\./, $a);
+    my @b = split(/\./, $b);
+
+    my $va = 0;
+    my $vb = 0;
+
+    while (@a || @b) {
+        $a = shift @a || 0;
+        $b = shift @b || 0;
+        $va = $va*1000+$a;
+        $vb = $vb*1000+$b;
+    }
+
+    return 0 if $va < $vb;
+    return 1;
+}
+
+
+sub getServerVersion {
+    my $v = `$psql $connopts -q -t -c "select version()" postgres`;
+    print "$psql $connopts -q -t -c \"select version()\" postgres\n    # RETURNED: $v\n" if $VERBOSE;
+    if ($v =~ m/PostgreSQL (\d+(\.\d+)?(\.\d+)?)/) {
+        print "    # Got ($1)\n" if $VERBOSE;
+        return $1;
+    }
+    return undef;
+}
+
+sub dbExists {
+    my $dbname = shift;
+
+    my $isdb = `$psql $connopts -l | grep $dbname`;
+    $isdb =~ s/^\s*|\s*$//g;
+    return length($isdb);
+}
+
+sub findPsql {
+    my $psql = `which psql`;
+    $psql =~ s/^\s*|\s*$//g;
+    print "which psql = $psql\n" if $VERBOSE;
+    return length($psql)?$psql:undef;
+}
+
+# getSharePath is complicated by the fact that on Debian we can have multiple
+# versions installed in a cluster. So we get the DB version by connectiong
+# to the port for the server we want. Then we get the share path for the
+# newest version od pg installed on the cluster. And finally we change the
+# in the path to the version of the server.
+
+sub getSharePath {
+    my $pg = shift;
+
+    my $share;
+    my $isdebian = -e "/etc/debian_version";
+    my $pg_config = `which pg_config`;
+    $pg_config =~ s/^\s*|\s*$//g;
+    print "which pg_config = $pg_config\n" if $VERBOSE;
+    if (length($pg_config)) {
+        $share = `"$pg_config" --sharedir`;
+        $share =~ s/^\s*|\s*$//g;
+        if ($isdebian) {
+            $share =~ s/(\d+(\.\d+)?)$/$pg/;
+            if (length($share) && -d $share) {
+                return $share;
+            }
+        } else {
+            return "$share"
+        }
+    }
+    die "Could not determine the postgresql version" unless $pg;
+    $pg =~ s/^(\d+(\.\d+)).*$/$1/;
+    $share = "/usr/share/postgresql/$pg";
+    return $share if -d $share;
+    $share = "/usr/local/share/postgresql/$pg";
+    return $share if -d $share;
+    die "Could not determine the postgresql share dir for ($pg)!\n";
+}
+
+sub mysystem {
+    my $cmd = shift;
+    print "$cmd\n" if $VERBOSE || $DRYRUN;
+    system($cmd) unless $DRYRUN;
+}
+
+sub want_tests {
+#    /^bd_d.*\z/s &&
+#    ($File::Find::prune = 1)
+#    ||
+    /^test\.conf\z/s &&
+    push @cfgs, $name;
+}
+
+
diff --git a/tools/testers/pg_prove_tests.sh b/tools/testers/pg_prove_tests.sh
new file mode 100755
index 0000000..af649a3
--- /dev/null
+++ b/tools/testers/pg_prove_tests.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# ------------------------------------------------------------------------------
+# Travis CI scripts 
+# Copyright(c) pgRouting Contributors
+#
+# Test pgRouting
+# ------------------------------------------------------------------------------
+
+set -e 
+
+PGUSER=$1
+PGDATABASE="___pgr___test___"
+
+# Define alias function for psql command
+run_psql () {
+    PGOPTIONS='--client-min-messages=warning' psql -U $PGUSER  -d $PGDATABASE -X -q -v ON_ERROR_STOP=1 --pset pager=off "$@"
+    if [ "$?" -ne 0 ]
+    then 
+        echo "Test query failed: $@"
+        ERROR=1
+    fi 
+}
+
+
+
+echo "cd ./tools/testers/"
+cd ./tools/testers/
+echo "psql -f setup_db.sql"
+run_psql -f setup_db.sql
+#pg_prove ../../src/funnyDijkstra/test/pgtap/* -d $PGDATABASE
+
+pg_prove ../../src/allpairs/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/apsp_johnson/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/apsp_warshall/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/ksp/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/topology/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/common/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/dijkstra/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/driving_distance/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/kdijkstra/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/withPoints/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/trsp/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+
+pg_prove ../../src/astar/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/bd_astar/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/bd_dijkstra/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+pg_prove ../../src/convinience/test/pgtap/* -d $PGDATABASE  -U $PGUSER
+
+if [ "$?" -ne 0 ]
+then
+    ERROR=1
+fi
+
+# Return success or failure
+# ------------------------------------------------------------------------------
+exit $ERROR
diff --git a/tools/testers/sampledata.sql b/tools/testers/sampledata.sql
new file mode 100644
index 0000000..ec2b5f1
--- /dev/null
+++ b/tools/testers/sampledata.sql
@@ -0,0 +1,97 @@
+\set QUIET 1
+
+SET client_min_messages = WARNING;
+
+
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+--              SAMPLE DATA                
+------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------------------
+
+    DROP TABLE IF EXISTS edge_table;
+    DROP table if exists pointsOfInterest;
+    DROP TABLE IF EXISTS restrictions;
+
+--EDGE TABLE CREATE
+CREATE TABLE edge_table (
+    id BIGSERIAL,
+    dir character varying,
+    source BIGINT,
+    target BIGINT,
+    cost FLOAT,
+    reverse_cost FLOAT,
+    x1 FLOAT,
+    y1 FLOAT,
+    x2 FLOAT,
+    y2 FLOAT,
+    the_geom geometry
+);
+--EDGE TABLE ADD DATA
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,0,   2,1);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  2,1,   3,1);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES (-1, 1,  3,1,   4,1);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,1,   2,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,1,   3,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0,2,   1,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  1,2,   2,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   3,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3,2,   4,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,2,   2,3);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,2,   3,3);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  2,3,   3,3);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1,-1,  3,3,   4,3);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  2,3,   2,4);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,2,   4,3);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  4,1,   4,2);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  0.5,3.5,  1.999999999999,3.5);
+INSERT INTO edge_table (cost,reverse_cost,x1,y1,x2,y2) VALUES ( 1, 1,  3.5,2.3,  3.5,4);
+
+UPDATE edge_table SET the_geom = st_makeline(st_point(x1,y1),st_point(x2,y2)),
+dir = CASE WHEN (cost>0 and reverse_cost>0) THEN 'B'   -- both ways
+   WHEN (cost>0 and reverse_cost<0) THEN 'FT'  -- direction of the LINESSTRING
+   WHEN (cost<0 and reverse_cost>0) THEN 'TF'  -- reverse direction of the LINESTRING
+   ELSE '' END;                                -- unknown
+--EDGE TABLE TOPOLOGY
+SELECT pgr_createTopology('edge_table',0.001);
+--POINTS CREATE
+CREATE TABLE pointsOfInterest(
+    pid BIGSERIAL,
+    x FLOAT,
+    y FLOAT,
+    edge_id BIGINT,
+    side CHAR,
+    fraction FLOAT,
+    the_geom geometry,
+    newPoint geometry
+);
+
+INSERT INTO pointsOfInterest (x,y,edge_id,side,fraction) VALUES (1.8, 0.4,1,'l',0.4);
+INSERT INTO pointsOfInterest (x,y,edge_id,side,fraction) VALUES (4.2, 2.4,15,'r',0.4);
+INSERT INTO pointsOfInterest (x,y,edge_id,side,fraction) VALUES (2.6, 3.2,12,'l',0.6);
+INSERT INTO pointsOfInterest (x,y,edge_id,side,fraction) VALUES (0.3, 1.8,6,'r',0.3);
+INSERT INTO pointsOfInterest (x,y,edge_id,side,fraction) VALUES (2.9, 1.8,5,'l',0.8);
+INSERT INTO pointsOfInterest (x,y,edge_id,side,fraction) VALUES (2.2, 1.7,4,'b',0.7);
+UPDATE pointsOfInterest SET the_geom = st_makePoint(x,y);
+
+UPDATE pointsOfInterest
+    SET newPoint = ST_LineInterpolatePoint(e.the_geom, fraction)
+    FROM edge_table AS e WHERE edge_id = id;
+--RESTRICTIONS CREATE
+CREATE TABLE restrictions (
+    rid BIGINT NOT NULL,
+    to_cost FLOAT,
+    target_id BIGINT,
+    from_edge BIGINT,
+    via_path TEXT
+);
+
+COPY restrictions (rid, to_cost, target_id, from_edge, via_path) FROM stdin WITH NULL '__NULL__' DELIMITER ',';
+1,100,7,4,__NULL__
+1,100,11,8,__NULL__
+1,100,10,7,__NULL__
+2,4,8,3,5
+3,100,9,16,__NULL__
+\.
+--RESTRICTIONS END
+
diff --git a/tools/testers/setup.sql b/tools/testers/setup.sql
new file mode 100644
index 0000000..386a686
--- /dev/null
+++ b/tools/testers/setup.sql
@@ -0,0 +1,17 @@
+\set QUIET 1
+
+--
+-- Tests for pgTAP.
+--
+--
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+
+BEGIN;
+
diff --git a/tools/testers/setup_db.sql b/tools/testers/setup_db.sql
new file mode 100644
index 0000000..3942eea
--- /dev/null
+++ b/tools/testers/setup_db.sql
@@ -0,0 +1,24 @@
+\set QUIET 1
+
+-- Tests for pgroutng.
+
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+
+SET client_min_messages = WARNING;
+
+CREATE EXTENSION postgis;
+CREATE EXTENSION pgtap;
+CREATE EXTENSION pgrouting;
+
+BEGIN;
+
+    \i sampledata.sql
+
+END;
diff --git a/tools/test-update.sh b/tools/testers/update-tester.pl
similarity index 100%
rename from tools/test-update.sh
rename to tools/testers/update-tester.pl
diff --git a/tools/travis/before_script.sh b/tools/travis/before_script.sh
new file mode 100755
index 0000000..85c197b
--- /dev/null
+++ b/tools/travis/before_script.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# ------------------------------------------------------------------------------
+# Travis CI scripts 
+# Copyright(c) pgRouting Contributors
+#
+# Build pgRouting
+# ------------------------------------------------------------------------------
+
+# exit script on error
+set -e 
+
+psql --version
+psql -U postgres -c "SELECT version();"
+
diff --git a/tools/travis/check-extensions.sh b/tools/travis/check-extensions.sh
new file mode 100755
index 0000000..7915cf8
--- /dev/null
+++ b/tools/travis/check-extensions.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+# ------------------------------------------------------------------------------
+# Travis CI scripts 
+# Copyright(c) pgRouting Contributors
+#
+# check pgtap & postgis on travis
+# ------------------------------------------------------------------------------
+
+set -e
+
+POSTGRESQL_VERSION="$1"
+DATABASE="$2"
+PGUSER=postgres
+
+sudo updatedb
+echo "locate pgtap"
+locate pgtap.control
+echo "locate postgis"
+locate postgis.control
+  
+
+
+cd ..
+# Define alias function for psql command
+run_psql () {
+    PGOPTIONS='--client-min-messages=warning' psql -U $PGUSER  -e -X -v ON_ERROR_STOP=1 --pset pager=off "$@" -d $DATABASE
+    if [ "$?" -ne 0 ]
+    then
+        echo "Test query failed: $@"
+        ERROR=1
+    fi
+}
+
+run_psql -c "SELECT version()" 
+run_psql -c "CREATE EXTENSION pgtap" 
+run_psql -c "SELECT pgtap_version()"
+run_psql -c "CREATE EXTENSION postgis" 
+run_psql -c "SELECT postgis_full_version()"
+run_psql -c "DROP EXTENSION pgtap" 
+run_psql -c "DROP EXTENSION postgis" 
+
diff --git a/tools/travis/install-postgres9.5.sh b/tools/travis/install-postgres9.5.sh
new file mode 100755
index 0000000..a09240f
--- /dev/null
+++ b/tools/travis/install-postgres9.5.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# ------------------------------------------------------------------------------
+# Travis CI scripts 
+# Copyright(c) pgRouting Contributors
+#
+# Install pgRouting prerequesits
+# ------------------------------------------------------------------------------
+
+set -e
+
+POSTGRESQL_VERSION="$1"
+PGUSER="$2"
+
+echo "Postgres $POSTGRESQL_VERSION"
+echo "User $PGUSER"
+
+if test "$POSTGRESQL_VERSION" = "9.5" ; then
+
+    echo "Installing postgresql 9.5 & postgis for 9.5 pgtap & pg_prove"
+    sudo apt-get install -y postgresql-9.5 postgresql-9.5-postgis
+    #sudo apt-get install -y pgtap libtap-parser-sourcehandler-pgtap-perl
+    sudo cp /usr/lib/postgresql/$POSTGRESQL_VERSION/bin/pg_config /usr/bin/pg_config
+    sudo /etc/init.d/postgresql stop
+    sudo /etc/init.d/postgresql stop
+    ps -fea | grep postgres
+    echo "making grep before change"
+    grep port /etc/postgresql/$POSTGRESQL_VERSION/main/postgresql.conf
+    echo "finished grep"
+    sudo sed -i -e 's/port = 5433/port = 5432/g' /etc/postgresql/$POSTGRESQL_VERSION/main/postgresql.conf
+    echo "making grep after change"
+    grep port /etc/postgresql/$POSTGRESQL_VERSION/main/postgresql.conf
+    echo "finished grep"
+    sudo cp $TRAVIS_BUILD_DIR/tools/travis/pg_hba.conf /etc/postgresql/$POSTGRESQL_VERSION/main/pg_hba.conf
+    sudo /etc/init.d/postgresql start $POSTGRESQL_VERSION
+    #sudo service postgres-$POSTGRESQL_VERSION start
+    ps -fea | grep postgres
+    #sudo -u $DBUSER psql -c "ALTER ROLE postgres WITH PASSWORD '';"
+
+#else
+
+#echo "starting server"
+#sudo /etc/init.d/postgresql start $POSTGRESQL_VERSION
+
+
+#sudo cp /usr/lib/postgresql/$POSTGRESQL_VERSION/bin/pg_config /usr/bin/pg_config
+
+#echo "Installing pgtap ... this may take some time."
+#wget https://github.com/theory/pgtap/archive/master.zip
+#unzip master.zip
+#cd pgtap-master
+#make
+#make installcheck
+#sudo make install
+#cd ..
+
+#sudo apt-get install -y libtap-parser-sourcehandler-pgtap-perl
+
+fi
diff --git a/tools/travis/install_pgtap.sh b/tools/travis/install_pgtap.sh
new file mode 100755
index 0000000..12b725d
--- /dev/null
+++ b/tools/travis/install_pgtap.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# ------------------------------------------------------------------------------
+# Travis CI scripts 
+# Copyright(c) pgRouting Contributors
+#
+# Install Pgtap
+# ------------------------------------------------------------------------------
+
+POSTGRESQL_VERSION="$1"
+
+# exit script on error
+set -e 
+
+echo "Installing pgtap ... this may take some time."
+PGUSER="postgres"
+
+sudo cp /usr/lib/postgresql/$1/bin/pg_config /usr/bin/pg_config
+
+wget https://github.com/theory/pgtap/archive/master.zip
+unzip master.zip
+cd pgtap-master
+make
+#make installcheck
+sudo make install
+
+#sh test_pgtap.sh
diff --git a/tools/travis/pgrouting_build.sh b/tools/travis/pgrouting_build.sh
index 6574075..0168e47 100755
--- a/tools/travis/pgrouting_build.sh
+++ b/tools/travis/pgrouting_build.sh
@@ -10,7 +10,10 @@
 set -e 
 
 # build pgRouting
-cmake -DWITH_DD=ON 
+cmake  -DPOSTGRESQL_VERSION=$POSTGRESQL_VERSION
 #cmake
 make
 sudo make install
+#cd ..
+
+#./tools/testers/algorithm-tester.pl -pgver $POSTGRESQL_VERSION -ignorenotice
diff --git a/tools/travis/pgrouting_prepare.sh b/tools/travis/pgrouting_prepare.sh
index 216acc1..75a3c0c 100755
--- a/tools/travis/pgrouting_prepare.sh
+++ b/tools/travis/pgrouting_prepare.sh
@@ -45,45 +45,3 @@ sudo -u $DBUSER psql -c "ALTER ROLE postgres WITH PASSWORD '';"
 
 exit $ERROR
 
-# WE ARE NOT USING TEMPLATE DATABASES SO DON'T GO BELOW HERE
-
-# ------------------------------------------------------------------------------
-# Create database templates
-# ------------------------------------------------------------------------------
-
-# PostGIS
-# ------------------------------------------------------------------------------
-#run_psql -U $DBUSER -c "CREATE DATABASE template_postgis ENCODING 'UTF8' TEMPLATE template0;"
-
-#if [ "$POSTGRESQL_VERSION" == "8.4" ] 
-#then
-#    run_psql -U $DBUSER -d template_postgis -c "CREATE LANGUAGE plpgsql;"
-#fi
-
-#run_psql -U $DBUSER -d template_postgis -f `find $POSTGRESQL_DIRECTORY/contrib -name "postgis.sql"`
-#run_psql -U $DBUSER -d template_postgis -f `find $POSTGRESQL_DIRECTORY/contrib -name "spatial_ref_sys.sql"`
-#
-#run_psql -U $DBUSER -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
-#run_psql -U $DBUSER -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
-#run_psql -U $DBUSER -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
-
-#run_psql -U $DBUSER -d template_postgis -c "VACUUM FULL;"
-#run_psql -U $DBUSER -d template_postgis -c "VACUUM FREEZE;"
-
-#run_psql -U $DBUSER -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
-#run_psql -U $DBUSER -c "UPDATE pg_database SET datallowconn='false' WHERE datname='template_postgis';"
-
-# pgRouting
-# ------------------------------------------------------------------------------
-#run_psql -U $DBUSER -c "CREATE DATABASE template_pgrouting ENCODING 'UTF8' TEMPLATE template_postgis;"
-#run_psql -U $DBUSER -d template_pgrouting -f `find $POSTGRESQL_DIRECTORY/contrib -name "pgrouting.sql"`
-
-#run_psql -U $DBUSER -d template_pgrouting -c "VACUUM FULL;"
-#run_psql -U $DBUSER -d template_pgrouting -c "VACUUM FREEZE;"
-
-#run_psql -U $DBUSER -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_pgrouting';"
-#run_psql -U $DBUSER -c "UPDATE pg_database SET datallowconn='false' WHERE datname='template_pgrouting';"
-
-# Return success or failure
-# ------------------------------------------------------------------------------
-#exit $ERROR
diff --git a/tools/travis/pgrouting_test.sh b/tools/travis/pgrouting_test.sh
index 46bec11..0fddb8b 100755
--- a/tools/travis/pgrouting_test.sh
+++ b/tools/travis/pgrouting_test.sh
@@ -6,13 +6,15 @@
 # Test pgRouting
 # ------------------------------------------------------------------------------
 
-PGUSER="postgres"
-PGDATABASE="pgrouting"
+PGDATABASE="pgr_test__db__test"
 
 POSTGRESQL_VERSION="$1"
-POSTGIS_VERSION="$2"
+PGUSER="$2"
+
+#POSTGIS_VERSION="$2"
 
 POSTGRESQL_DIRECTORY="/usr/share/postgresql/$POSTGRESQL_VERSION"
+echo "POSTGRESQL_VERSION $POSTGRESQL_VERSION"
 
 # exit script on error
 set -e 
@@ -20,7 +22,7 @@ ERROR=0
 
 # Define alias function for psql command
 run_psql () {
-    PGOPTIONS='--client-min-messages=warning' psql -X -q -v ON_ERROR_STOP=1 --pset pager=off "$@"
+    PGOPTIONS='--client-min-messages=warning' psql -U $PGUSER  -d $PGDATABASE -X -q -v ON_ERROR_STOP=1 --pset pager=off "$@"
     if [ "$?" -ne 0 ]
     then 
         echo "Test query failed: $@"
@@ -31,59 +33,42 @@ run_psql () {
 # ------------------------------------------------------------------------------
 # CREATE DATABASE
 # ------------------------------------------------------------------------------
-export PGUSER
-run_psql -l
-run_psql -c "CREATE DATABASE $PGDATABASE;"
-export PGDATABASE
+#export PGUSER
+#run_psql -l
+#run_psql -c "CREATE DATABASE ____tmp_pgdb______;"
+#export PGDATABASE
 
 # ------------------------------------------------------------------------------
 # CREATE EXTENSION
 # ------------------------------------------------------------------------------
-IGNORE=-ignorenotice
-#if [ "$POSTGRESQL_VERSION" == "8.4" ] || [ "$POSTGRESQL_VERSION" == "9.0" ]
-#then
-#    run_psql -f `find $POSTGRESQL_DIRECTORY/contrib -name "postgis.sql"`
-#    run_psql -f `find $POSTGRESQL_DIRECTORY/contrib -name "spatial_ref_sys.sql"`
-#    run_psql -f `find $POSTGRESQL_DIRECTORY/contrib -name "pgrouting.sql"`
-#    IGNORE=-ignorenotice
-#fi
-
-#if [ "$POSTGRESQL_VERSION" == "9.1" ]
-#then
-#    if [ "$POSTGIS_VERSION" == "1.5" ]
-#    then 
-#        run_psql -f `find $POSTGRESQL_DIRECTORY/contrib -name "postgis.sql"`
-#        run_psql -f `find $POSTGRESQL_DIRECTORY/contrib -name "spatial_ref_sys.sql"`
-#        run_psql -f `find $POSTGRESQL_DIRECTORY/contrib -name "pgrouting.sql"`
-#    else
-#        run_psql -c "CREATE EXTENSION postgis;"
-#        run_psql -c "CREATE EXTENSION pgrouting;"
-#    fi
-#    IGNORE=-ignorenotice
-#fi
-
-#if [ "$POSTGRESQL_VERSION" == "9.2" ] || [ "$POSTGRESQL_VERSION" == "9.3" ] || [ "$POSTGRESQL_VERSION" == "9.4" ]
-#then
-#we are allways creating extension
-    run_psql -c "CREATE EXTENSION postgis;"
-    run_psql -c "CREATE EXTENSION pgrouting;"
-#fi
+run_psql  -c "CREATE EXTENSION postgis;"
+run_psql  -c "CREATE EXTENSION pgrouting;"
 
 # ------------------------------------------------------------------------------
 # Get version information
 # ------------------------------------------------------------------------------
+run_psql -c "SELECT version();"    
 run_psql -c "SELECT postgis_full_version();"    
 run_psql -c "SELECT pgr_version();"
 
-PGROUTING_VERSION=`run_psql -A -t -c "SELECT version FROM pgr_version();"`
+#PGROUTING_VERSION=`run_psql -A -t -c "SELECT version FROM pgr_version();"`
 
 # ------------------------------------------------------------------------------
 # Test runner
 # ------------------------------------------------------------------------------
 # use -v -v for more verbose debuging output
 # ./tools/test-runner.pl -v -v -pgver $POSTGRESQL_VERSION
- ./tools/test-runner.pl -pgver $POSTGRESQL_VERSION $IGNORE 
+#./tools/test-runner.pl -pgver $POSTGRESQL_VERSION $IGNORE 
 #./tools/test-runner.pl -pgver $POSTGRESQL_VERSION $IGNORE -v -alg ksp
+
+#cd ./tools/testers/
+#psql -f setup_db.sql
+#pg_prove ../../src/trsp/test/pgtap/*
+#dropdb ___pgr___test___
+#cd ../../
+
+./tools/testers/algorithm-tester.pl -pgver $POSTGRESQL_VERSION -pguser $PGUSER -ignorenotice
+
 if [ "$?" -ne 0 ]
 then
     ERROR=1
diff --git a/tools/travis/postGIS_install.sh b/tools/travis/postGIS_install.sh
new file mode 100755
index 0000000..750fe09
--- /dev/null
+++ b/tools/travis/postGIS_install.sh
@@ -0,0 +1,93 @@
+#!/bin/bash
+# ------------------------------------------------------------------------------
+# Travis CI scripts 
+# Copyright(c) pgRouting Contributors
+#
+# Install pgRouting prerequesits
+# ------------------------------------------------------------------------------
+
+#POSTGRESQL_VERSION="$1"
+POSTGIS_VERSION="$1"
+
+# exit script on error
+set -e 
+ERROR=0
+
+# ------------------------------------------------------------------------------
+# Remove PostgreSQL and all its files
+# ------------------------------------------------------------------------------
+#sudo service postgresql stop
+#sudo apt-get remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common -qq --purge -y 
+#sudo rm -rf /var/lib/postgresql
+
+# Add PPA's'
+# ------------------------------------------------------------------------------
+#sudo apt-add-repository -y ppa:georepublic/pgrouting-travis
+
+#if [ "$POSTGIS_VERSION" == "2.0" ] || [ "$POSTGIS_VERSION" == "2.1" ]; then 
+
+# add postGIS PPA
+	sudo apt-add-repository -y ppa:ubuntugis/ppa
+#fi
+
+# Add PostgreSQL Apt repository
+# UPDATE: seems to be already available in Travis
+# ------------------------------------------------------------------------------
+# echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > pgdg.list
+# sudo mv pgdg.list /etc/apt/sources.list.d/
+# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+sudo apt-get update -qq
+
+# ------------------------------------------------------------------------------
+# Install PostgreSQL (always install from PostgreSQL Apt repository)
+# ------------------------------------------------------------------------------
+#sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install -y -qq postgresql-$POSTGRESQL_VERSION postgresql-contrib-$POSTGRESQL_VERSION postgresql-server-dev-$POSTGRESQL_VERSION
+
+# Install packages
+# ------------------------------------------------------------------------------
+echo "Installing packages ... this may take some time."
+sudo apt-get install -y -qq packaging-dev cmake checkinstall libcgal-dev libboost-graph-dev libboost-thread-dev libxml2-dev libproj-dev libjson0-dev xsltproc docbook-xsl docbook-mathml libgeos-dev libgdal1-dev 
+
+#if [ "$POSTGIS_VERSION" == "1.5" ]; then 
+#	RELEASE="1.5.8"
+#	wget --quiet -O - http://download.osgeo.org/postgis/source/postgis-${RELEASE}.tar.gz | tar xzf -
+#fi
+
+if [ "$POSTGIS_VERSION" == "2.0" ]; then 
+	RELEASE="2.0.7"
+	wget --quiet -O - http://download.osgeo.org/postgis/source/postgis-${RELEASE}.tar.gz | tar xzf -
+fi
+
+if [ "$POSTGIS_VERSION" == "2.1" ]; then 
+	sudo apt-get install -y -qq libpoppler-dev libarmadillo-dev libepsilon-dev liblzma-dev libxml2-dev
+	RELEASE="2.1.7"
+	wget --quiet -O - http://download.osgeo.org/postgis/source/postgis-${RELEASE}.tar.gz | tar xzf -
+fi
+
+if [ "$POSTGIS_VERSION" == "2.2" ]; then 
+	sudo apt-get install -y -qq libpoppler-dev libarmadillo-dev libepsilon-dev liblzma-dev libxml2-dev
+	RELEASE="2.2.1"
+	wget --quiet -O - http://download.osgeo.org/postgis/source/postgis-${RELEASE}.tar.gz | tar xzf -
+fi
+
+# Build and compile
+cd postgis-*
+./autogen.sh
+./configure 
+make
+sudo make install
+sudo ldconfig
+
+# Build extension for PostGIS > 2.0
+#if [ "$POSTGIS_VERSION" != "1.5" ]; then 
+#	cd extensions && make && sudo make install
+#fi
+
+# ------------------------------------------------------------------------------
+# Restart once
+# ------------------------------------------------------------------------------
+sudo /etc/init.d/postgresql restart
+
+# Return success or failure
+# ------------------------------------------------------------------------------
+exit $ERROR
diff --git a/tools/winnie/build_pgrouting.sh b/tools/winnie/build_pgrouting.sh
index 2728e6e..a6108b3 100644
--- a/tools/winnie/build_pgrouting.sh
+++ b/tools/winnie/build_pgrouting.sh
@@ -89,7 +89,10 @@ cp lib/*.control ${PGPATHEDB}/share/extension/
 cd ${PROJECTS}/pgrouting/branches/${PGROUTING_VER}
 
 #perl tools/test-runner.pl   -pgver ${PG_VER} -pgport "${PGPORT}"  -clean
-perl tools/test-runner.pl  -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" -ignorenotice -clean
+echo "PGVER ${PG_VER}"
+echo "PGVER ${POSTGIS_VER}"
+echo "PGVER ${PGPORT}"
+perl tools/testers/algorithm-tester.pl  -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" -ignorenotice -clean
 #perl tools/test-runner.pl  -pgver ${PG_VER} -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}" 
 #perl tools/test-runner.pl  -pgver "${PG_VER}" -pgisver "${POSTGIS_VER}" -pgport "${PGPORT}"  -clean -v -alg ksp
 
diff --git a/tools/winnie/package_pgrouting.sh b/tools/winnie/package_pgrouting.sh
index c502158..44d3dd9 100644
--- a/tools/winnie/package_pgrouting.sh
+++ b/tools/winnie/package_pgrouting.sh
@@ -7,6 +7,10 @@
 #export PGROUTING_VER=2.0
 #export PGROUTING_MICRO_VER=0dev
 #export GIT_COMMIT=whatever
+
+#This line is commented out on build file
+#strip *.dll
+
 export PGUSER=postgres
 
 #this should be setup as a mapping in msys/etc/fstab to where you keep your projects

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pgrouting.git



More information about the Pkg-grass-devel mailing list