query class abstraction
abstracted the run function up to Query and it works