Updated queries and test