Update the implementation of the findMatchBracket