added code to interface with new queries