first version of query running in what looks to be a sensible fashionb