Graph search algortihm nearly done.