Implemented AND, OR, and grouping