make runQuery working, removed unused stuff