fixed parts of Dijkstra algorithm
fixed Dijkstra