terminate dijkstra when target found, fix building and printing of path list and add command line arguments