working on the queries