Hello
It is not clear from your description where the error might be. You may have missed a closing bracket, you may have an opening bracket too many, the order of brackets might be wrong [( instead of ([ or )] instead of ]). Have a look at Wakefield's Daily Tips - #5 by wakecarter to find out how to locate an error, or at least where the interpreter is going wrong.
Best wishes Jens