global variables are initialized at beginning of DFS-loop