improve boolean operators in gramamr