An approach to smart parenthesizing

Dear Mr. Corica,

Hope this works...