finished pass at query structure