Added object and changed breadth_first_visit for depth_first_visit