checks for balanced parens, sort of