added summary output to query