added code to find a reachable vertex in DAG.
minor change