gwen's edits to query integrated