code to solve Jeek's extraneous paren removal problem