working on the query