improved the query