updated framework and improved dijkstra by cutting of if the destination is reached