completed containsDepthFirst and testing