Improvements in Dijkstra algorithm and command classes