Updated queries script