add other methods to deal with longest valid parentheses