The class code itself should have one pair -- one (opening bracket) after the class declaration line and one (closing bracket) at the end of the class. Each method, likewise, should have one pair -- one after the declaration line and one at its end. Any and all local code blocks (for iif, for, switch, do, while, etc) should have one pair -- one at the beginning and one at its end. Any and all excess brackets must be removed (see lines 24 and 50).