deal with brackets at sequence beginning and end