implemented first_search and print_path