Adding qualifying and results queries