Clean up: add docstrings, translate to english, remove redundant variables, rename variables to be more self-explained. Add unit test for dijkstra algorithm.