now checks to see if parentheses are balanced