add parenthesis logic