Thanks for the answers. Yes, it is what Hodgey says. Declaring the variables before using it helps to keep track of them, and avoid typo mistakes.
Rampage, I didn't think this before, but using types is a good way to work around the lack of strong types of simple variables. It is not perfect, but probably enclosing everything that is important in types is a good idea to avoid silly mistakes.
Thanks