Working on ranking the routes still using the kdtree, but using the c implementation of the kdtree.