styling and printing queries