Working on the queries