finished count_queries script