updated to fix issues with parentheses