new subroutine runQuery