[ ] and { } and ( ) are completely different in Mathematica. Using one when Mathematica expects another will cause great confusion.
I have made a number of changes to try to get this to work. Is this now correct? Does this solve the first part of your problem?
Entering example Mathematica code on separate lines, highlighting that with the mouse and then tapping Ctrl-K will keep the forum software from doing some damage to your code.