implement query1