Updated for multi threaded shortest path calculator