I was having a look at some code a friend did and stumbled across this line which I thought was an error (simplified for example)..
for (g = 0; 10 > g; g+
The semi colon actually runs the loop without the {} code block. So your code basically has 2 parts,
variable g
g