using long long int for num_searches to avoid overflow