fixed a bug in dijkstra.py (which oddly didn't affect the result - must investigate) + some slight cleanup