Modified boolean_logic