Added support for Linux and running on new x86 linux based netbook

FIXED MAJOR BUG : int i was declare in an outer scope and being
used as if it was scope local -- nested loop corrupted outer loop.
Turned all uses of i into scope local and got rid of any incorrect
nested usage (eg introduce j ;-))