changed isSymbol to include parentheses