handle nested parens; handle ternary operators