find a square and valid parens in c