Valid Parentheses improved