added ability to query on AICs. not tested yet.