added support for AND/OR results