Improved the query