detecting closing braces.  Not tested