add depth first search code