Hmm...
Well the error says invalid redeclaration. This means it's probably a global variable that you defined earlier, or it's a predefined variable from Maya.
I don't think gridStep is predefined ( it may, but my memory is about as good as a goats ), so you probably had defined $gridStep earlier as a global variable of a different type. probably int since redeclaring it as an int worked.
This is one of the reasons global variables should be avoided if at all possible.
Another thing you may want to consider is you naming conventions... the reason (so I've been told ) most C-like programming languages have all of their functions and keywords with the first letter lowercase and every word after uppercase is so you yourself can be sure of not using a reserved word be declaring variables using an uppercase letter at the begining.
I hope this helped, let me know if it didn't.
-Derick
([url=http://www.brainfaucet.com]BrainFaucet.com[/url])