Depth first search in graph ver 1.0