Adds 2 bugs.
Bracket count only counts left brackets ('{')
Leaving the "Occurrence Count" box empty and hitting "OK" causes the program to hang.