recursion problems, main graph traverse