query rework

this might be useful now!