Tidy up query and add comment