modification for the queries and better output