Final rework of Dijkstra