Begin Dijkstra, code cleanup