modified CPS and batch query.