(or the label stored in the temporary label slot, if higher), and the fourth is the original passage time through the edge $j$.

Step 6: Check terminal conditions
---------------------------------

In this step we take a look whether a vertex from $B$ became active or if there are no active edges. These would be the indications of the completion of the algorithm.

Step 7: Finalizing phantoms
---------------------------

In this step we go once again over the sequence of phantoms and remove each one that has its time parameter equal to $0$.

Step 8: Finalizing vertices
---------------------------

In this step of the program the sequence of active vertices is cleaned so it contains new active vertices and looses vertices that may cease to be active.

### Initial treatment of triggered vertices

For each triggered vertex $Q$ we first check whether it was inactive before. If it was inactive then its label becomes equal to the label stored at the temporary storing location in the sequence of vertices. If it was active, its label remains unchanged. The phantoms were created and their labels are keeping track of the improved water quality that has reached the vertex $Q$.

We may now clean the temporary 