Basic ai depth first search