One help for you to see what the code does is for the code to be properly formatted.
Also you should always use {}s with for loops and if statements to clearly show what statements are part of the...