fix query, again
investigate overhaul