Added count_bracket method