yay, the query builder is now working - i'll have to enhance it, but this is a solid baseline